From 5ef9056e89855660d93c4e8d98a7dbc349c1a7eb Mon Sep 17 00:00:00 2001 From: Tre Date: Mon, 19 Feb 2018 01:25:57 -0600 Subject: [PATCH] Add a refresh button to the serverlist (#6957) * add refresh button * Make search and refresh buttons smaller * Change to image button --- LICENSE.txt | 3 +++ builtin/mainmenu/tab_online.lua | 11 +++++++++-- textures/base/pack/refresh.png | Bin 0 -> 3660 bytes 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 textures/base/pack/refresh.png diff --git a/LICENSE.txt b/LICENSE.txt index c87e74e21..92954e7eb 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -8,6 +8,9 @@ distribution. Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) http://creativecommons.org/licenses/by-sa/3.0/ +textures/base/pack/refresh.png is under the Apache 2 license +https://www.apache.org/licenses/LICENSE-2.0.html + Authors of media files ----------------------- Everything not listed in here: 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 diff --git a/textures/base/pack/refresh.png b/textures/base/pack/refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..7193677b43bea725df64fc6c84de9546787c1ffd GIT binary patch literal 3660 zcmbW4c{~%2|HrqqoOoNDK}xvM*AT5R76F^oF7VQ7`c6Nw#L_woDh_viPI_xt&HJs$7ZfA2qDuOxfh>w*v%1ONaCTHLsL^AEHB zJG|gO`$Xp%SpYx?YH`)X>EZZV-hrd@hamnIH5!>z^2MOAD((L48h zEjLG(qQXBcRLDQdeIFp?H^M=2qd%SmphVDcE?tV=#;Gh&KEMtqiQ>!UOaXcDaKokb z?(Kg5iDMPv7?Q`QD}_8iri>~1z?V3_864;6$_8&%_+Z=kr^rB_K|pLXK?cAT#9vtP zs$~@%f%DpLhSi)7NeYW8M<5Pu2v4qgA?L-l$}$gbQMU0ckk{0~J!GT7(qx|kWhV)6 z0NmAXc;N6>r)I@Fo(-vh?q>rUuG@<D-{K;5>ngLuTlCUg)SK^_S@L{TFmE||DH1wu4?uY=b{J^1%}HGs*eXG0pG6z3Tf>+r-z>#%pB0NSB4)v?KK zLFhB6Llj+>9^sd~UAwAJ_TypG!eqehAYvp-hEU_P_9#v@Gg_Il26dGI-JzXsAVS)` zoOSQoOJGTuRbV@N>ZQSwk4M^);TEhZK%geY&glLMuz=^vmsl1dtS2piyH^?4fZ~LY zMZ)DX$@m9NAzWFUcEmbM?XF35-j|OaB)a7$GBmDuS!{-Hu^=<9)?QSSejHC4FwU7P zvQ2(emmSu=4JPj+zFFlwoepCisuteTrJ~7HG_X|cY9nax8Rbq!vY&f538mmYUxu?V zZFqvWpF;{`+(Yg}Dk}u@2gbGABA9Aa!?#~M4y88|TRX*#FtzA!6oVPNnAHckNck1Oaz5TYSnOw}m7Pv1WWS}W;#KdgTq(qIHqRkq3lyy!cuubwq%Tw$%#3nq?9 zgGak6%^p=hOC~cwBeioCkrW%#ymbjJxth}4(5;Sb(9R_VoCWK!M$L`nLq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