From 25ecab3ad8c36d7900ad365d20e169ee63c2802b Mon Sep 17 00:00:00 2001 From: Looki2000 Date: Tue, 25 Apr 2023 00:59:13 +0200 Subject: [PATCH] sussy bigger changes --- builtin/init.lua | 3 +++ builtin/mainmenu/tab_local.lua | 20 ++++++++-------- builtin/mainmenu/tab_online.lua | 41 +++++++++++++++++---------------- games/SussyCraft | 2 +- src/defaultsettings.cpp | 4 ++-- 5 files changed, 37 insertions(+), 33 deletions(-) diff --git a/builtin/init.lua b/builtin/init.lua index 8691360..54389db 100644 --- a/builtin/init.lua +++ b/builtin/init.lua @@ -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) diff --git a/builtin/mainmenu/tab_local.lua b/builtin/mainmenu/tab_local.lua index b8b95cb..0bd9768 100644 --- a/builtin/mainmenu/tab_local.lua +++ b/builtin/mainmenu/tab_local.lua @@ -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") diff --git a/builtin/mainmenu/tab_online.lua b/builtin/mainmenu/tab_online.lua index ad5f79e..51beacd 100644 --- a/builtin/mainmenu/tab_online.lua +++ b/builtin/mainmenu/tab_online.lua @@ -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 diff --git a/games/SussyCraft b/games/SussyCraft index 57d740c..ba91a3d 160000 --- a/games/SussyCraft +++ b/games/SussyCraft @@ -1 +1 @@ -Subproject commit 57d740cf4f40262b57cd688e57bca090ccfa8544 +Subproject commit ba91a3df1b2fc18edc6035087dfd6844e317738c diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 932dd44..474cc85 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -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");