sussy bigger changes

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

View File

@ -35,6 +35,9 @@ dofile(commonpath .. "strict.lua")
dofile(commonpath .. "serialize.lua")
dofile(commonpath .. "misc_helpers.lua")
-- disable day/night cycle
minetest.settings:set("time_speed", 0)
if INIT == "game" then
dofile(gamepath .. "init.lua")
assert(not core.get_http_api)

View File

@ -165,9 +165,9 @@ local function get_formspec(tabview, name, tabdata)
y = y + yo
end
if disabled_settings["enable_server"] == nil then
--host = "checkbox[0,"..y..";cb_server;".. fgettext("Host Server") ..";" ..
-- dump(core.settings:get_bool("enable_server")) .. "]"
--y = y + yo
host = "checkbox[0,"..y..";cb_server;".. fgettext("Host Server") ..";" ..
dump(core.settings:get_bool("enable_server")) .. "]"
y = y + yo
end
retval = retval ..
@ -185,7 +185,7 @@ local function get_formspec(tabview, name, tabdata)
if core.settings:get_bool("enable_server") and disabled_settings["enable_server"] == nil then
retval = retval ..
"button[7.9,4.75;4.1,1;play;".. fgettext("Host Game") .. "]" ..
"checkbox[0,"..y..";cb_server_announce;" .. fgettext("Announce Server") .. ";" ..
--"checkbox[0,"..y..";cb_server_announce;" .. fgettext("Announce Server") .. ";" ..
dump(core.settings:get_bool("server_announce")) .. "]" ..
"field[0.3,2.85;3.8,0.5;te_playername;" .. fgettext("Name") .. ";" ..
core.formspec_escape(core.settings:get("name")) .. "]" ..
@ -260,13 +260,13 @@ local function main_button_handler(this, fields, name, tabdata)
return true
end
if fields["cb_server_announce"] then
core.settings:set("server_announce", fields["cb_server_announce"])
local selected = core.get_textlist_index("srv_worlds")
menu_worldmt(selected, "server_announce", fields["cb_server_announce"])
--if fields["cb_server_announce"] then
-- core.settings:set("server_announce", fields["cb_server_announce"])
-- local selected = core.get_textlist_index("srv_worlds")
-- menu_worldmt(selected, "server_announce", fields["cb_server_announce"])
return true
end
-- return true
--end
if fields["play"] ~= nil or world_doubleclick or fields["key_enter"] then
local selected = core.get_textlist_index("sp_worlds")

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

@ -1 +1 @@
Subproject commit 57d740cf4f40262b57cd688e57bca090ccfa8544
Subproject commit ba91a3df1b2fc18edc6035087dfd6844e317738c

View File

@ -35,7 +35,7 @@ void set_default_settings()
settings->setDefault("language", "");
settings->setDefault("name", "");
settings->setDefault("bind_address", "");
settings->setDefault("serverlist_url", "servers.cubesoftware.xyz");
settings->setDefault("serverlist_url", "servers.minetest.net");
// Client
settings->setDefault("address", "");
@ -328,7 +328,7 @@ void set_default_settings()
std::string font_size_str = std::to_string(TTF_DEFAULT_FONT_SIZE);
settings->setDefault("font_size", font_size_str);
settings->setDefault("mono_font_size", font_size_str);
settings->setDefault("chat_font_size", "0"); // Default "font_size"
settings->setDefault("chat_font_size", "16"); // Default "font_size"
// ContentDB
settings->setDefault("contentdb_url", "https://content.minetest.net");