From 7ee68efeb588581662371422fae150206f78f719 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 00:50:20 -0400 Subject: [PATCH 01/24] Bypass CSM restrictions --- src/script/lua_api/l_client.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp index 584bd4f00..3ec775ae1 100644 --- a/src/script/lua_api/l_client.cpp +++ b/src/script/lua_api/l_client.cpp @@ -20,8 +20,7 @@ #include "util/string.h" #include "nodedef.h" -#define checkCSMRestrictionFlag(flag) \ - ( getClient(L)->checkCSMRestrictionFlag(CSMRestrictionFlags::flag) ) +#define checkCSMRestrictionFlag(flag) false // Not the same as FlagDesc, which contains an `u32 flag` struct CSMFlagDesc { From 6e2a0a56f77b45dae7825dad0a740446ee5d65b5 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 00:56:33 -0400 Subject: [PATCH 02/24] Add custom ASCII art luanti -> Erbium --- src/server.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/server.cpp b/src/server.cpp index f585e7705..f8e0b71ce 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -589,11 +589,12 @@ void Server::start() // ASCII art for the win! const char *art[] = { - R"( _ _ _ )", - R"(| |_ _ __ _ _ __ | |_(_))", - R"(| | | | |/ _` | '_ \| __| |)", - R"(| | |_| | (_| | | | | |_| |)", - R"(|_|\__,_|\__,_|_| |_|\__|_|)", + R"( ______ _ _ )", + R"(| ____| | | (_) )", + R"(| |__ _ __| |__ _ _ _ _ __ ___ )", + R"(| __| | '__| '_ \| | | | | '_ ` _ \ )", + R"(| |____| | | |_) | | |_| | | | | | |)", + R"(|______|_| |_.__/|_|\__,_|_| |_| |_|)" }; if (!m_admin_chat) { // we're not printing to rawstream to avoid it showing up in the logs. From 0c1587693c01933cea44acd657526173a45dac8f Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 00:58:37 -0400 Subject: [PATCH 03/24] Fix missing comma python habits... --- src/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.cpp b/src/server.cpp index f8e0b71ce..444460bb0 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -594,7 +594,7 @@ void Server::start() R"(| |__ _ __| |__ _ _ _ _ __ ___ )", R"(| __| | '__| '_ \| | | | | '_ ` _ \ )", R"(| |____| | | |_) | | |_| | | | | | |)", - R"(|______|_| |_.__/|_|\__,_|_| |_| |_|)" + R"(|______|_| |_.__/|_|\__,_|_| |_| |_|)", }; if (!m_admin_chat) { // we're not printing to rawstream to avoid it showing up in the logs. From fd7d4ce1971c7637f6f2cb5665aec9fa389f0539 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:02:59 -0400 Subject: [PATCH 04/24] Rename to Erbium needs more work later --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e5e7e7c4..b1e3205b9 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@
-

Luanti (formerly Minetest)

+

Erbium

Build Status Translation status License

-Luanti is a free open-source voxel game engine with easy modding and game creation. +Erbium is a free and open-source fork of Luanti. Copyright (C) 2010-2025 Perttu Ahola and contributors (see source file comments and the version control log) From 16547b74f1c1843271810a32b8d84b9b9804f2f6 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:04:57 -0400 Subject: [PATCH 05/24] Bypass lower m_repeat_place_time limit (commit 1/2) --- src/client/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/game.cpp b/src/client/game.cpp index 210b17a27..0ca5ed5fd 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -3697,7 +3697,7 @@ void Game::readSettings() m_cache_enable_fog = g_settings->getBool("enable_fog"); m_cache_mouse_sensitivity = g_settings->getFloat("mouse_sensitivity", 0.001f, 10.0f); m_cache_joystick_frustum_sensitivity = std::max(g_settings->getFloat("joystick_frustum_sensitivity"), 0.001f); - m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.16f, 2.0f); + m_repeat_place_time = g_settings->getFloat("repeat_place_time", 0.001f, 2.0f); m_repeat_dig_time = g_settings->getFloat("repeat_dig_time", 0.0f, 2.0f); m_cache_enable_noclip = g_settings->getBool("noclip"); From a19300238d41d1da07bac84c5e59af3fd98d602a Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:05:47 -0400 Subject: [PATCH 06/24] Bypass lower m_repeat_place_time limit (commit 2/2) --- builtin/settingtypes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 001ef42e0..d8ba24e68 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -148,7 +148,7 @@ toggle_aux1_key (Toggle Aux1 key) bool false # the place button. # # Requires: keyboard_mouse -repeat_place_time (Place repetition interval) float 0.25 0.16 2.0 +repeat_place_time (Place repetition interval) float 0.25 0.001 2.0 # The minimum time in seconds it takes between digging nodes when holding # the dig button. From 8152bc535424a53449172cf3a864c3a904e89852 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:09:25 -0400 Subject: [PATCH 07/24] Make lighting warmer Taken from IonicCheese's warm lighting shader --- .../shaders/nodes_shader/opengl_vertex.glsl | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/client/shaders/nodes_shader/opengl_vertex.glsl b/client/shaders/nodes_shader/opengl_vertex.glsl index e53ffe47c..6fe7acd85 100644 --- a/client/shaders/nodes_shader/opengl_vertex.glsl +++ b/client/shaders/nodes_shader/opengl_vertex.glsl @@ -6,21 +6,26 @@ uniform vec3 dayLight; uniform highp vec3 cameraOffset; uniform float animationTimer; -VARYING_ vec3 vNormal; +varying vec3 vNormal; +varying vec3 vPosition; // World position in the visible world (i.e. relative to the cameraOffset.) // This can be used for many shader effects without loss of precision. // If the absolute position is required it can be calculated with // cameraOffset + worldPosition (for large coordinates the limits of float // precision must be considered). -VARYING_ vec3 worldPosition; +varying vec3 worldPosition; // The centroid keyword ensures that after interpolation the texture coordinates -// lie within the same bounds when MSAA is en- or disabled. +// lie within the same bounds when MSAA is en- and disabled. // This fixes the stripes problem with nearest-neighbor textures and MSAA. -CENTROID_ VARYING_ lowp vec4 varColor; -CENTROID_ VARYING_ mediump vec2 varTexCoord; -CENTROID_ VARYING_ float varTexLayer; // actually int -CENTROID_ VARYING_ float nightRatio; - +#ifdef GL_ES +varying lowp vec4 varColor; +varying mediump vec2 varTexCoord; +varying float nightRatio; +#else +centroid varying lowp vec4 varColor; +centroid varying vec2 varTexCoord; +centroid varying float nightRatio; +#endif #ifdef ENABLE_DYNAMIC_SHADOWS // shadow uniforms uniform vec3 v_LightDirection; @@ -31,24 +36,25 @@ CENTROID_ VARYING_ float nightRatio; uniform float f_timeofday; uniform vec4 CameraPos; - VARYING_ float cosLight; - VARYING_ float normalOffsetScale; - VARYING_ float adj_shadow_strength; - VARYING_ float f_normal_length; - VARYING_ vec3 shadow_position; - VARYING_ float perspective_factor; + varying float cosLight; + varying float normalOffsetScale; + varying float adj_shadow_strength; + varying float f_normal_length; + varying vec3 shadow_position; + varying float perspective_factor; #endif -VARYING_ highp vec3 eyeVec; +varying highp vec3 eyeVec; // Color of the light emitted by the light sources. const vec3 artificialLight = vec3(1.04, 1.04, 1.04); - -#ifdef ENABLE_DYNAMIC_SHADOWS - +const float e = 2.718281828459; +const float BS = 10.0; uniform float xyPerspectiveBias0; uniform float xyPerspectiveBias1; uniform float zPerspectiveBias; +#ifdef ENABLE_DYNAMIC_SHADOWS + vec4 getRelativePosition(in vec4 position) { vec2 l = position.xy - CameraPos.xy; @@ -75,16 +81,14 @@ vec4 applyPerspectiveDistortion(in vec4 position) return position; } -#if __VERSION__ >= 130 -#define mtsmoothstep smoothstep -#else +// custom smoothstep implementation because it's not defined in glsl1.2 +// https://docs.gl/sl4/smoothstep float mtsmoothstep(in float edge0, in float edge1, in float x) { float t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); return t * t * (3.0 - 2.0 * t); } #endif -#endif float smoothCurve(float x) @@ -145,9 +149,6 @@ float snoise(vec3 p) void main(void) { -#ifdef USE_ARRAY_TEXTURE - varTexLayer = inVertexAux; -#endif varTexCoord = inTexCoord0.st; float disp_x; @@ -180,7 +181,6 @@ void main(void) pos.y += disp_z * 0.1; pos.z += disp_z; #elif MATERIAL_TYPE == TILE_MATERIAL_WAVING_PLANTS && ENABLE_WAVING_PLANTS - // bottom of plant doesn't wave if (varTexCoord.y < 0.05) { pos.x += disp_x; pos.z += disp_z; @@ -189,6 +189,7 @@ void main(void) worldPosition = (mWorld * pos).xyz; gl_Position = mWorldViewProj * pos; + vPosition = gl_Position.xyz; eyeVec = -(mWorldView * pos).xyz; #ifdef SECONDSTAGE normalPass = normalize((inVertexNormal+1)/2); From 10d023c39276ac62682ad1d376411a63362d877f Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:20:52 -0400 Subject: [PATCH 08/24] Revert warm lighting until it can be rebased --- .../shaders/nodes_shader/opengl_vertex.glsl | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/client/shaders/nodes_shader/opengl_vertex.glsl b/client/shaders/nodes_shader/opengl_vertex.glsl index 6fe7acd85..e53ffe47c 100644 --- a/client/shaders/nodes_shader/opengl_vertex.glsl +++ b/client/shaders/nodes_shader/opengl_vertex.glsl @@ -6,26 +6,21 @@ uniform vec3 dayLight; uniform highp vec3 cameraOffset; uniform float animationTimer; -varying vec3 vNormal; -varying vec3 vPosition; +VARYING_ vec3 vNormal; // World position in the visible world (i.e. relative to the cameraOffset.) // This can be used for many shader effects without loss of precision. // If the absolute position is required it can be calculated with // cameraOffset + worldPosition (for large coordinates the limits of float // precision must be considered). -varying vec3 worldPosition; +VARYING_ vec3 worldPosition; // The centroid keyword ensures that after interpolation the texture coordinates -// lie within the same bounds when MSAA is en- and disabled. +// lie within the same bounds when MSAA is en- or disabled. // This fixes the stripes problem with nearest-neighbor textures and MSAA. -#ifdef GL_ES -varying lowp vec4 varColor; -varying mediump vec2 varTexCoord; -varying float nightRatio; -#else -centroid varying lowp vec4 varColor; -centroid varying vec2 varTexCoord; -centroid varying float nightRatio; -#endif +CENTROID_ VARYING_ lowp vec4 varColor; +CENTROID_ VARYING_ mediump vec2 varTexCoord; +CENTROID_ VARYING_ float varTexLayer; // actually int +CENTROID_ VARYING_ float nightRatio; + #ifdef ENABLE_DYNAMIC_SHADOWS // shadow uniforms uniform vec3 v_LightDirection; @@ -36,25 +31,24 @@ centroid varying float nightRatio; uniform float f_timeofday; uniform vec4 CameraPos; - varying float cosLight; - varying float normalOffsetScale; - varying float adj_shadow_strength; - varying float f_normal_length; - varying vec3 shadow_position; - varying float perspective_factor; + VARYING_ float cosLight; + VARYING_ float normalOffsetScale; + VARYING_ float adj_shadow_strength; + VARYING_ float f_normal_length; + VARYING_ vec3 shadow_position; + VARYING_ float perspective_factor; #endif -varying highp vec3 eyeVec; +VARYING_ highp vec3 eyeVec; // Color of the light emitted by the light sources. const vec3 artificialLight = vec3(1.04, 1.04, 1.04); -const float e = 2.718281828459; -const float BS = 10.0; + +#ifdef ENABLE_DYNAMIC_SHADOWS + uniform float xyPerspectiveBias0; uniform float xyPerspectiveBias1; uniform float zPerspectiveBias; -#ifdef ENABLE_DYNAMIC_SHADOWS - vec4 getRelativePosition(in vec4 position) { vec2 l = position.xy - CameraPos.xy; @@ -81,14 +75,16 @@ vec4 applyPerspectiveDistortion(in vec4 position) return position; } -// custom smoothstep implementation because it's not defined in glsl1.2 -// https://docs.gl/sl4/smoothstep +#if __VERSION__ >= 130 +#define mtsmoothstep smoothstep +#else float mtsmoothstep(in float edge0, in float edge1, in float x) { float t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); return t * t * (3.0 - 2.0 * t); } #endif +#endif float smoothCurve(float x) @@ -149,6 +145,9 @@ float snoise(vec3 p) void main(void) { +#ifdef USE_ARRAY_TEXTURE + varTexLayer = inVertexAux; +#endif varTexCoord = inTexCoord0.st; float disp_x; @@ -181,6 +180,7 @@ void main(void) pos.y += disp_z * 0.1; pos.z += disp_z; #elif MATERIAL_TYPE == TILE_MATERIAL_WAVING_PLANTS && ENABLE_WAVING_PLANTS + // bottom of plant doesn't wave if (varTexCoord.y < 0.05) { pos.x += disp_x; pos.z += disp_z; @@ -189,7 +189,6 @@ void main(void) worldPosition = (mWorld * pos).xyz; gl_Position = mWorldViewProj * pos; - vPosition = gl_Position.xyz; eyeVec = -(mWorldView * pos).xyz; #ifdef SECONDSTAGE normalPass = normalize((inVertexNormal+1)/2); From b7a7a312dc80f37eccf2c4ae85d39660d8599433 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:43:05 -0400 Subject: [PATCH 09/24] Add dark mode in the menu (commit 1) --- builtin/mainmenu/game_theme.lua | 41 +++++++++++++++------------------ 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/builtin/mainmenu/game_theme.lua b/builtin/mainmenu/game_theme.lua index b9e7e1d4b..2c371ff2b 100644 --- a/builtin/mainmenu/game_theme.lua +++ b/builtin/mainmenu/game_theme.lua @@ -29,7 +29,14 @@ function mm_game_theme.set_engine(hide_decorations) mm_game_theme.clear_single("header") mm_game_theme.clear_single("footer") - core.set_clouds(false) + + if core.settings:get_bool("menu_dark_theme") then + core.set_clouds_color("#1c2a47") + core.set_sky_color("#090b1a") + else + core.set_clouds_color("#f0f0ff") + core.set_sky_color("#8cbafa") + end if not hide_decorations then mm_game_theme.set_engine_single("header") @@ -37,10 +44,7 @@ function mm_game_theme.set_engine(hide_decorations) end if not have_bg then - if core.settings:get_bool("menu_clouds") then - core.set_clouds(true) - else - mm_game_theme.set_dirt_bg() + core.set_clouds(core.settings:get_bool("menu_clouds")) end end end @@ -71,11 +75,16 @@ function mm_game_theme.set_game(gamedetails) mm_game_theme.set_game_single("header", gamedetails) mm_game_theme.set_game_single("footer", gamedetails) + if core.settings:get_bool("menu_dark_theme") then + core.set_clouds_color("#1c2a47") + core.set_sky_color("#090b1a") + else + core.set_clouds_color("#f0f0ff") + core.set_sky_color("#8cbafa") + end + if not have_bg then - if core.settings:get_bool("menu_clouds") then - core.set_clouds(true) - else - mm_game_theme.set_dirt_bg() + core.set_clouds(core.settings:get_bool("menu_clouds")) end end end @@ -156,20 +165,6 @@ function mm_game_theme.set_game_single(identifier, gamedetails) return false end --------------------------------------------------------------------------------- -function mm_game_theme.set_dirt_bg() - if mm_game_theme.texturepack ~= nil then - local path = mm_game_theme.texturepack .. DIR_DELIM .. "default_dirt.png" - if core.set_background("background", path, true, 128) then - return true - end - end - - -- Use universal fallback texture in textures/base/pack - local minimalpath = defaulttexturedir .. "menu_bg.png" - core.set_background("background", minimalpath, true, 128) -end - -------------------------------------------------------------------------------- function mm_game_theme.stop_music() if mm_game_theme.music_handle ~= nil then From dd405d93fd46be99686ea53720c8295757531988 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:44:46 -0400 Subject: [PATCH 10/24] Add dark mode (commit 2) --- builtin/settingtypes.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index d8ba24e68..25d9d2f25 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -885,6 +885,9 @@ tooltip_append_itemname (Append item name) bool false # Use a cloud animation for the main menu background. menu_clouds (Clouds in menu) bool true +# Use dark theme for the main menu background +menu_dark_theme (Menu dark theme) bool true + [**HUD] # Modifies the size of the HUD elements. From 881ce031addfec52e3894f9527d481cf628c0710 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:46:08 -0400 Subject: [PATCH 11/24] Add dark mode (commit 3) --- src/client/clientlauncher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index e01341be8..d0a8198ae 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -127,7 +127,7 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args) g_menucloudsmgr = m_rendering_engine->get_scene_manager()->createNewSceneManager(); g_menuclouds = new Clouds(g_menucloudsmgr, ssrc.get(), -1, rand()); g_menuclouds->setHeight(100.0f); - g_menuclouds->update(v3f(0, 0, 0), video::SColor(255, 240, 240, 255)); + g_menuclouds->update(v3f(0, 0, 0), m_rendering_engine->getMenuCloudsColor()); scene::ICameraSceneNode* camera; camera = g_menucloudsmgr->addCameraSceneNode(NULL, v3f(0, 0, 0), v3f(0, 60, 100)); camera->setFarValue(10000); From 291f6e41467a7e5853356949884d76b550e605e0 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:49:43 -0400 Subject: [PATCH 12/24] Add dark mode (commit 4) --- src/client/renderingengine.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp index dac81c7ca..f44bf684c 100644 --- a/src/client/renderingengine.cpp +++ b/src/client/renderingengine.cpp @@ -26,7 +26,6 @@ #include "irr_ptr.h" RenderingEngine *RenderingEngine::s_singleton = nullptr; -const video::SColor RenderingEngine::MENU_SKY_COLOR = video::SColor(255, 140, 186, 250); /* Helper classes */ @@ -310,8 +309,9 @@ void RenderingEngine::draw_load_screen(const std::wstring &text, auto *driver = get_video_driver(); - driver->setFog(RenderingEngine::MENU_SKY_COLOR); - driver->beginScene(true, true, RenderingEngine::MENU_SKY_COLOR); + driver->setFog(getMenuSkyColor()); + driver->beginScene(true, true, getMenuSkyColor()); + if (g_settings->getBool("menu_clouds")) { g_menuclouds->step(dtime * 3); g_menucloudsmgr->drawAll(); @@ -402,6 +402,29 @@ void RenderingEngine::finalize() core.reset(); } +void RenderingEngine::setMenuSkyColor(video::SColor& color) +{ + m_menu_sky_color = video::SColor(color); +} + +void RenderingEngine::setMenuCloudsColor(video::SColor& color) +{ + m_menu_clouds_color = video::SColor(color); +} + + +const video::SColor RenderingEngine::getMenuSkyColor() +{ + return m_menu_sky_color; +} + +const video::SColor RenderingEngine::getMenuCloudsColor() +{ + return m_menu_clouds_color; +} + + + void RenderingEngine::draw_scene(video::SColor skycolor, bool show_hud, bool draw_wield_tool, bool draw_crosshair) { From e854b1c0c19f6c9906300e7e1bfde83bba203ce5 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:52:22 -0400 Subject: [PATCH 13/24] Add dark mode (commit 5) --- src/client/renderingengine.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/renderingengine.h b/src/client/renderingengine.h index f71f16e95..64317103e 100644 --- a/src/client/renderingengine.h +++ b/src/client/renderingengine.h @@ -63,8 +63,6 @@ class FogShaderUniformSetterFactory : public IShaderUniformSetterFactory class RenderingEngine { public: - static const video::SColor MENU_SKY_COLOR; - RenderingEngine(MyEventReceiver *eventReceiver); ~RenderingEngine(); @@ -136,6 +134,12 @@ class RenderingEngine { return m_device->run(); } + + void setMenuSkyColor(video::SColor &color); + void setMenuCloudsColor(video::SColor &color); + const video::SColor getMenuSkyColor(); + const video::SColor getMenuCloudsColor(); + // FIXME: this is still global when it shouldn't be static ShadowRenderer *get_shadow_renderer() @@ -157,6 +161,8 @@ class RenderingEngine } private: + video::SColor m_menu_sky_color = video::SColor(255, 140, 186, 250); + video::SColor m_menu_clouds_color = video::SColor(255, 240, 240, 255); static void settingChangedCallback(const std::string &name, void *data); v2u32 _getWindowSize() const; From 1fcae6b95e726bde0cfc33f0a242a8b4ff660eba Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:54:33 -0400 Subject: [PATCH 14/24] Add dark mode (commit 6) --- src/defaultsettings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 5d2cbb0d1..6cfca45b2 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -276,6 +276,7 @@ void set_default_settings() settings->setDefault("soft_clouds", "false"); settings->setDefault("cloud_radius", "12"); settings->setDefault("menu_clouds", "true"); + settings->setDefault("menu_dark_theme", "false"); settings->setDefault("translucent_liquids", "true"); settings->setDefault("console_height", "0.6"); settings->setDefault("console_color", "(0,0,0)"); From 0759fd16b3d2a19a86e28482082a01e89ef269ae Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:58:04 -0400 Subject: [PATCH 15/24] Add dark mode (commit 7) --- src/gui/guiEngine.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp index e1517065b..177d6a742 100644 --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -310,7 +310,7 @@ void GUIEngine::run() driver->getFog(fog_color, fog_type, fog_start, fog_end, fog_density, fog_pixelfog, fog_rangefog); - driver->setFog(RenderingEngine::MENU_SKY_COLOR, fog_type, fog_start, + driver->setFog(m_rendering_engine->getMenuSkyColor(), fog_type, fog_start, fog_end, fog_density, fog_pixelfog, fog_rangefog); } @@ -403,10 +403,25 @@ GUIEngine::~GUIEngine() /******************************************************************************/ void GUIEngine::drawClouds(float dtime) { + g_menuclouds->update(v3f(0, 0, 0), m_rendering_engine->getMenuCloudsColor()); g_menuclouds->step(dtime * 3); g_menucloudsmgr->drawAll(); } +/******************************************************************************/ +void GUIEngine::setMainMenuCloudsColor +{ +m_rendering_engine->setMenuCloudsColor(color); +} + +/******************************************************************************/ +void GUIEngine::setMainMenuSkyColor(video::SColor& color) +{ + m_rendering_engine->setMenuSkyColor(color); +} + + + /******************************************************************************/ void GUIEngine::setFormspecPrepend(const std::string &fs) { @@ -425,7 +440,7 @@ void GUIEngine::drawBackground(video::IVideoDriver *driver) /* If no texture, draw background of solid color */ if(!texture){ - video::SColor color(255,80,58,37); + video::SColor color = m_rendering_engine->getMenuSkyColor(); core::rect rect(0, 0, screensize.X, screensize.Y); driver->draw2DRectangle(color, rect, NULL); return; From 5fd65ba9823dd80620d7dd42158fd68214ad5647 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 01:59:32 -0400 Subject: [PATCH 16/24] Add dark mode (commit 8) --- src/gui/guiEngine.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/guiEngine.h b/src/gui/guiEngine.h index da0700319..b63173a41 100644 --- a/src/gui/guiEngine.h +++ b/src/gui/guiEngine.h @@ -263,5 +263,8 @@ class GUIEngine { /** is drawing of clouds enabled atm */ bool m_clouds_enabled = true; + void setMainMenuCloudsColor(video::SColor& color); + void setMainMenuSkyColor(video::SColor& color); + static void fullscreenChangedCallback(const std::string &name, void *data); }; From afe9e9be730688366e1301c1477fde01b9c85f70 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 02:01:20 -0400 Subject: [PATCH 17/24] Add dark mode (commit 9) --- src/script/lua_api/l_mainmenu.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index bde7172c6..1cc3358ba 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -218,7 +218,36 @@ int ModApiMainMenu::l_set_clouds(lua_State *L) return 0; } +/******************************************************************************/ +int ModApiMainMenu::l_set_clouds_color(lua_State* L) +{ + GUIEngine* engine = getGuiEngine(L); + sanity_check(engine != NULL); + + std::string value = readParam(L, 1); + video::SColor color = video::SColor(); + parseColorString(value, color, false); + + engine->setMainMenuCloudsColor(color); + + return 0; +} + +/******************************************************************************/ +int ModApiMainMenu::l_set_sky_color(lua_State* L) +{ + GUIEngine* engine = getGuiEngine(L); + sanity_check(engine != NULL); + + std::string value = readParam(L, 1); + video::SColor color = video::SColor(); + parseColorString(value, color, false); + + engine->setMainMenuSkyColor(color); + + return 0; +} /******************************************************************************/ int ModApiMainMenu::l_get_textlist_index(lua_State *L) { From 44a23322a33814a252d0ad17b70b8636e652bd13 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 02:02:47 -0400 Subject: [PATCH 18/24] Add dark mode (commit 9.5) --- src/script/lua_api/l_mainmenu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index 1cc3358ba..a96544ccc 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -1107,6 +1107,8 @@ void ModApiMainMenu::Initialize(lua_State *L, int top) API_FCT(update_formspec); API_FCT(set_formspec_prepend); API_FCT(set_clouds); + API_FCT(set_sky_color); + API_FCT(set_clouds_color); API_FCT(get_textlist_index); API_FCT(get_table_index); API_FCT(get_worlds); From 9c7cc382e387de8732d536bc6962b7dc4c296e42 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 02:04:08 -0400 Subject: [PATCH 19/24] Add dark mode (commit 10) yes i totally know what im doing --- textures/base/pack/menu_bg.png | Bin 83 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 textures/base/pack/menu_bg.png diff --git a/textures/base/pack/menu_bg.png b/textures/base/pack/menu_bg.png deleted file mode 100644 index 31aa937467dd8b6582a39eb01a0c0e839ce0dc1f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 83 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;bAV5XYtOD Date: Tue, 2 Dec 2025 02:06:38 -0400 Subject: [PATCH 20/24] Add dark mode (commit 11) --- src/script/lua_api/l_mainmenu.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h index 48cc619dc..fdf00cda3 100644 --- a/src/script/lua_api/l_mainmenu.h +++ b/src/script/lua_api/l_mainmenu.h @@ -72,7 +72,11 @@ class ModApiMainMenu: public ModApiBase static int l_set_topleft_text(lua_State *L); - static int l_set_clouds(lua_State *L); + static int l_set_clouds(lua_State* L); + + static int l_set_clouds_color(lua_State* L); + + static int l_set_sky_color(lua_State* L); static int l_get_textlist_index(lua_State *L); From 70b147dbb8707140f2192713de3070e2d48e20b5 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 02:11:55 -0400 Subject: [PATCH 21/24] Fix dark mode (maybe?) --- src/gui/guiEngine.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp index 177d6a742..213c3f196 100644 --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -347,9 +347,10 @@ void GUIEngine::run() m_script->handleMainMenuEvent("WindowInfoChange"); last_window_info = window_info; } - - driver->beginScene(true, true, RenderingEngine::MENU_SKY_COLOR); - + + driver->beginScene(true, true, m_rendering_engine->getMenuSkyColor()); + driver->setFog(m_rendering_engine->getMenuSkyColor()); + if (m_clouds_enabled) { drawClouds(dtime); drawOverlay(driver); From daf053e47f08d530545edb4c58b8f306b0914ed3 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 02:13:44 -0400 Subject: [PATCH 22/24] Fix dark mode again --- src/gui/guiEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp index 213c3f196..834fc2a5a 100644 --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -410,7 +410,7 @@ void GUIEngine::drawClouds(float dtime) } /******************************************************************************/ -void GUIEngine::setMainMenuCloudsColor +void GUIEngine::setMainMenuCloudsColor(video::SColor& color) { m_rendering_engine->setMenuCloudsColor(color); } From c0ccdbd0a1466b3acc35d27a9f538b638f676bf3 Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 02:20:33 -0400 Subject: [PATCH 23/24] Fix dark mode again again --- builtin/mainmenu/game_theme.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/mainmenu/game_theme.lua b/builtin/mainmenu/game_theme.lua index 2c371ff2b..dcc804818 100644 --- a/builtin/mainmenu/game_theme.lua +++ b/builtin/mainmenu/game_theme.lua @@ -44,8 +44,7 @@ function mm_game_theme.set_engine(hide_decorations) end if not have_bg then - core.set_clouds(core.settings:get_bool("menu_clouds")) - end + core.set_clouds(core.settings:get_bool("menu_clouds")) end end From 645102fab1cbd7983589cc9f9f362d6ea33dd68a Mon Sep 17 00:00:00 2001 From: a-bad-dev Date: Tue, 2 Dec 2025 02:21:27 -0400 Subject: [PATCH 24/24] Fix dark mode again again again --- builtin/mainmenu/game_theme.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/mainmenu/game_theme.lua b/builtin/mainmenu/game_theme.lua index dcc804818..a2136a2cf 100644 --- a/builtin/mainmenu/game_theme.lua +++ b/builtin/mainmenu/game_theme.lua @@ -83,8 +83,7 @@ function mm_game_theme.set_game(gamedetails) end if not have_bg then - core.set_clouds(core.settings:get_bool("menu_clouds")) - end + core.set_clouds(core.settings:get_bool("menu_clouds")) end end