summaryrefslogtreecommitdiff
path: root/src/guiFormSpecMenu.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-08-29 19:25:16 +0200
committerGitHub <noreply@github.com>2017-08-29 19:25:16 +0200
commit1b3e4e173624bb2523d4386aeef6987709d9b022 (patch)
tree5524dc581ac1ccc313a73d4626cea2efe5550507 /src/guiFormSpecMenu.h
parent72c09f524b1616dd75bb6e35008196b5ca6351a2 (diff)
downloadminetest-1b3e4e173624bb2523d4386aeef6987709d9b022.tar.gz
minetest-1b3e4e173624bb2523d4386aeef6987709d9b022.tar.bz2
minetest-1b3e4e173624bb2523d4386aeef6987709d9b022.zip
Formspec: Add options to set background color and opacity (fullscreen mode + default mode) (#5493)
* Formspec: Add options to set background color and opacity (fullscreen mode) * Enhance previous comment: Set formspec background when regenerate UI. * This permit to do the calcul only at regen and override it with bgcolor tag * Add a setting for default background color into formspec, separated from fullscreen * Add a little performance gain on formspecs using a const ref instead of copying formspec string
Diffstat (limited to 'src/guiFormSpecMenu.h')
-rw-r--r--src/guiFormSpecMenu.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h
index 02f367fbf..c86d596b7 100644
--- a/src/guiFormSpecMenu.h
+++ b/src/guiFormSpecMenu.h
@@ -66,7 +66,7 @@ class IFormSource
{
public:
virtual ~IFormSource() = default;
- virtual std::string getForm() = 0;
+ virtual const std::string &getForm() const = 0;
// Fill in variables in field text
virtual std::string resolveText(const std::string &str) { return str; }
};
@@ -419,6 +419,7 @@ protected:
bool m_bgfullscreen;
bool m_slotborder;
video::SColor m_bgcolor;
+ video::SColor m_fullscreen_bgcolor;
video::SColor m_slotbg_n;
video::SColor m_slotbg_h;
video::SColor m_slotbordercolor;
@@ -554,7 +555,10 @@ public:
m_formspec = FORMSPEC_VERSION_STRING + formspec;
}
- std::string getForm() { return m_formspec; }
+ const std::string &getForm() const
+ {
+ return m_formspec;
+ }
std::string m_formspec;
};