]> git.lizzy.rs Git - minetest.git/commitdiff
Remove formspec_default_bg_color/opacity settings (#13419)
authorrubenwardy <rw@rubenwardy.com>
Tue, 11 Apr 2023 18:57:36 +0000 (19:57 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Apr 2023 18:57:36 +0000 (19:57 +0100)
These settings are unnecessary. They only apply when formspecs don't have a background/bgcolor set. In practice, most games do theme their GUIs. Removing low value settings simplifies code and improves UX by decluttering the settings menu

Split out from #12140

builtin/settingtypes.txt
minetest.conf.example
src/defaultsettings.cpp
src/gui/guiFormSpecMenu.cpp

index 58168fa255c2353d4cfb89a73b2d895a81335e91..cb091294f65e9b2ccff57dfaf273c693a9de6dbe 100644 (file)
@@ -2109,12 +2109,6 @@ noclip (Noclip) bool false
 #    Press the autoforward key again or the backwards movement to disable.
 continuous_forward (Continuous forward) bool false
 
-#    Formspec default background opacity (between 0 and 255).
-formspec_default_bg_opacity (Formspec Default Background Opacity) int 140 0 255
-
-#    Formspec default background color (R,G,B).
-formspec_default_bg_color (Formspec Default Background Color) string (0,0,0)
-
 #    Whether to show technical names.
 #    Affects mods and texture packs in the Content and Select Mods menus, as well as
 #    setting names in All Settings.
index 41cbdca225b1cb603401c976df342f1bad52fa7f..28b333f28ef196e04c0fce64a16c835f73682f04 100644 (file)
 #    type: bool
 # continuous_forward = false
 
-#    Formspec default background opacity (between 0 and 255).
-#    type: int min: 0 max: 255
-# formspec_default_bg_opacity = 140
-
-#    Formspec default background color (R,G,B).
-#    type: string
-# formspec_default_bg_color = (0,0,0)
-
 #    Whether to show technical names.
 #    Affects mods and texture packs in the Content and Select Mods menus, as well as
 #    setting names in All Settings.
 #    See https://github.com/minetest/irrlicht/blob/master/include/Keycodes.h
 #    type: key
 # keymap_decrease_viewing_range_min = -
-
index f7a32ee2e2a3602f8eb6e533c2f5095c1a63842e..9d883f7c1753ab059542406f0aa8ca7c93933c3f 100644 (file)
@@ -220,8 +220,6 @@ void set_default_settings()
        settings->setDefault("console_alpha", "200");
        settings->setDefault("formspec_fullscreen_bg_color", "(0,0,0)");
        settings->setDefault("formspec_fullscreen_bg_opacity", "140");
-       settings->setDefault("formspec_default_bg_color", "(0,0,0)");
-       settings->setDefault("formspec_default_bg_opacity", "140");
        settings->setDefault("selectionbox_color", "(0,0,0)");
        settings->setDefault("selectionbox_width", "2");
        settings->setDefault("node_highlighting", "box");
index aed765ed8169ca5208e8afb1e833ce99682e02ad..16183211dde6efe8347623d9955ce0e636ae55eb 100644 (file)
@@ -3090,16 +3090,7 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
        m_bgfullscreen = false;
 
        m_formspec_version = 1;
-
-       {
-               v3f formspec_bgcolor = g_settings->getV3F("formspec_default_bg_color");
-               m_bgcolor = video::SColor(
-                       (u8) clamp_u8(g_settings->getS32("formspec_default_bg_opacity")),
-                       clamp_u8(myround(formspec_bgcolor.X)),
-                       clamp_u8(myround(formspec_bgcolor.Y)),
-                       clamp_u8(myround(formspec_bgcolor.Z))
-               );
-       }
+       m_bgcolor = video::SColor(140, 0, 0, 0);
 
        {
                v3f formspec_bgcolor = g_settings->getV3F("formspec_fullscreen_bg_color");