Add a refresh button to the serverlist (#6957)

* add refresh button

* Make search and refresh buttons smaller

* Change to image button
This commit is contained in:
Tre 2018-02-19 01:25:57 -06:00 committed by Nils Dagsson Moskopp
parent c23bdb0be1
commit d08af64363
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 9 additions and 2 deletions

View File

@ -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