diff options
author | Tre <ThomasMonroe@protonmail.com> | 2018-02-19 01:25:57 -0600 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2018-02-19 08:25:57 +0100 |
commit | 5ef9056e89855660d93c4e8d98a7dbc349c1a7eb (patch) | |
tree | 996d635f82846fec0548819eaffda49dc72c8718 /builtin/mainmenu | |
parent | 4bb41a19dc74fa31cb021dc3b5622814d67fbd6f (diff) | |
download | minetest-5ef9056e89855660d93c4e8d98a7dbc349c1a7eb.tar.gz minetest-5ef9056e89855660d93c4e8d98a7dbc349c1a7eb.tar.bz2 minetest-5ef9056e89855660d93c4e8d98a7dbc349c1a7eb.zip |
Add a refresh button to the serverlist (#6957)
* add refresh button
* Make search and refresh buttons smaller
* Change to image button
Diffstat (limited to 'builtin/mainmenu')
-rw-r--r-- | builtin/mainmenu/tab_online.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/builtin/mainmenu/tab_online.lua b/builtin/mainmenu/tab_online.lua index e3c583614..8e88a7743 100644 --- a/builtin/mainmenu/tab_online.lua +++ b/builtin/mainmenu/tab_online.lua @@ -33,8 +33,10 @@ local function get_formspec(tabview, name, tabdata) local retval = -- Search - "field[0.15,0.075;6.05,1;te_search;;"..core.formspec_escape(tabdata.search_for).."]".. - "button[5.8,-0.25;2,1;btn_mp_search;" .. fgettext("Search") .. "]" .. + "field[0.15,0.075;5.91,1;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" .. + "button[5.62,-0.25;1.5,1;btn_mp_search;" .. fgettext("Search") .. "]" .. + "image_button[6.97,-.165;.83,.83;" .. core.formspec_escape(defaulttexturedir .. "refresh.png") + .. ";btn_mp_refresh;" .. fgettext("") .. "]" .. -- Address / Port "label[7.75,-0.25;" .. fgettext("Address / Port") .. "]" .. @@ -300,6 +302,11 @@ local function main_button_handler(tabview, fields, name, tabdata) return true end + if fields.btn_mp_refresh then + asyncOnlineFavourites() + return true + end + if (fields.btn_mp_connect or fields.key_enter) and fields.te_address ~= "" and fields.te_port then gamedata.playername = fields.te_name |