sussy bigger changes

This commit is contained in:
2023-04-25 00:59:13 +02:00
parent 458dc9dc15
commit 25ecab3ad8
5 changed files with 37 additions and 33 deletions

View File

@@ -60,21 +60,21 @@ local function get_formspec(tabview, name, tabdata)
-- it may have changed after a change by the settings menu.
common_update_cached_supp_proto()
if not tabdata.search_for then
tabdata.search_for = ""
end
--if not tabdata.search_for then
-- tabdata.search_for = ""
--end
local retval =
-- Search
"field[0.25,0.25;7,0.75;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" ..
"container[7.25,0.25]" ..
"image_button[0,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "search.png") .. ";btn_mp_search;]" ..
"image_button[0.75,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "clear.png") .. ";btn_mp_clear;]" ..
"image_button[1.5,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "refresh.png") .. ";btn_mp_refresh;]" ..
"tooltip[btn_mp_clear;" .. fgettext("Clear") .. "]" ..
"tooltip[btn_mp_search;" .. fgettext("Search") .. "]" ..
"tooltip[btn_mp_refresh;" .. fgettext("Refresh") .. "]" ..
"container_end[]" ..
--"field[0.25,0.25;7,0.75;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" ..
--"container[7.25,0.25]" ..
--"image_button[0,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "search.png") .. ";btn_mp_search;]" ..
--"image_button[0.75,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "clear.png") .. ";btn_mp_clear;]" ..
--"image_button[1.5,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "refresh.png") .. ";btn_mp_refresh;]" ..
--"tooltip[btn_mp_clear;" .. fgettext("Clear") .. "]" ..
--"tooltip[btn_mp_search;" .. fgettext("Search") .. "]" ..
--"tooltip[btn_mp_refresh;" .. fgettext("Refresh") .. "]" ..
--"container_end[]" ..
"container[9.75,0]" ..
"box[0,0;5.75,7;#666666]" ..
@@ -108,7 +108,7 @@ local function get_formspec(tabview, name, tabdata)
if tabdata.selected then
if gamedata.fav then
retval = retval .. "tooltip[btn_delete_favorite;" .. fgettext("Remove favorite") .. "]"
retval = retval .. "tooltip[btn_delete_favorite;" .. fgettext("Remove recent") .. "]"
retval = retval .. "style[btn_delete_favorite;padding=6]"
retval = retval .. "image_button[5,1.3;0.5,0.5;" .. core.formspec_escape(defaulttexturedir ..
"server_favorite_delete.png") .. ";btn_delete_favorite;]"
@@ -148,13 +148,14 @@ local function get_formspec(tabview, name, tabdata)
"align=inline,padding=0.25,width=1.5;" ..
"color,align=inline,span=1;" ..
"text,align=inline,padding=1]" ..
"table[0.25,1;9.25,5.75;servers;"
"table[0.25,0.2;9.25,6.65;servers;"
local servers = get_sorted_servers()
--minetest.debug("Serverlist: " .. dump(servers))
local dividers = {
fav = "5,#ffff00," .. fgettext("Favorites") .. ",,,0,0,,",
public = "6,#4bdd42," .. fgettext("Public Servers") .. ",,,0,0,,",
fav = "5,#ffff00," .. fgettext("Recent") .. ",,,0,0,,",
public = "6,#4bdd42," .. fgettext("Main Servers") .. ",,,0,0,,",
incompatible = "7,"..mt_color_grey.."," .. fgettext("Incompatible Servers") .. ",,,0,0,,"
}
local order = {"fav", "public", "incompatible"}
@@ -341,10 +342,10 @@ local function main_button_handler(tabview, fields, name, tabdata)
return true
end
if fields.btn_mp_refresh then
serverlistmgr.sync()
return true
end
--if fields.btn_mp_refresh then
-- serverlistmgr.sync()
-- return true
--end
if (fields.btn_mp_login or fields.key_enter)
and fields.te_address ~= "" and fields.te_port then