Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div align="center">
<img src="textures/base/pack/logo.png" width="32%">
<h1>Luanti (formerly Minetest)</h1>
<h1>Erbium</h1>
<img src="https://github.com/luanti-org/luanti/workflows/build/badge.svg" alt="Build Status">
<a href="https://hosted.weblate.org/engage/minetest/?utm_source=widget"><img src="https://hosted.weblate.org/widgets/minetest/-/svg-badge.svg" alt="Translation status"></a>
<a href="https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html"><img src="https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg" alt="License"></a>
</div>
<br>

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 <celeron55@gmail.com>
and contributors (see source file comments and the version control log)
Expand Down
43 changes: 18 additions & 25 deletions builtin/mainmenu/game_theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,22 @@ 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")
mm_game_theme.set_engine_single("footer")
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()
end
core.set_clouds(core.settings:get_bool("menu_clouds"))
end
end

Expand Down Expand Up @@ -71,12 +74,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()
end
core.set_clouds(core.settings:get_bool("menu_clouds"))
end
end

Expand Down Expand Up @@ -156,20 +163,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
Expand Down
5 changes: 4 additions & 1 deletion builtin/settingtypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/client/clientlauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/client/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
29 changes: 26 additions & 3 deletions src/client/renderingengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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)
{
Expand Down
10 changes: 8 additions & 2 deletions src/client/renderingengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ class FogShaderUniformSetterFactory : public IShaderUniformSetterFactory
class RenderingEngine
{
public:
static const video::SColor MENU_SKY_COLOR;

RenderingEngine(MyEventReceiver *eventReceiver);
~RenderingEngine();

Expand Down Expand Up @@ -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()
Expand All @@ -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;

Expand Down
1 change: 1 addition & 0 deletions src/defaultsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
Expand Down
26 changes: 21 additions & 5 deletions src/gui/guiEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -403,10 +404,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(video::SColor& color)
{
m_rendering_engine->setMenuCloudsColor(color);
}

/******************************************************************************/
void GUIEngine::setMainMenuSkyColor(video::SColor& color)
{
m_rendering_engine->setMenuSkyColor(color);
}



/******************************************************************************/
void GUIEngine::setFormspecPrepend(const std::string &fs)
{
Expand All @@ -425,7 +441,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<s32> rect(0, 0, screensize.X, screensize.Y);
driver->draw2DRectangle(color, rect, NULL);
return;
Expand Down
3 changes: 3 additions & 0 deletions src/gui/guiEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
3 changes: 1 addition & 2 deletions src/script/lua_api/l_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
31 changes: 31 additions & 0 deletions src/script/lua_api/l_mainmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>(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<std::string>(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)
{
Expand Down Expand Up @@ -1078,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);
Expand Down
6 changes: 5 additions & 1 deletion src/script/lua_api/l_mainmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
11 changes: 6 additions & 5 deletions src/server.cpp

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possibly lowercase E?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah maybe

@a-bad-dev a-bad-dev Dec 2, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you weren't supposed to track this, git...
Screenshot from 2025-12-02 01-22-55

Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Binary file removed textures/base/pack/menu_bg.png
Binary file not shown.
Loading