Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarGraphicsMenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/frontend/StarGraphicsMenu.cpp')
-rw-r--r--source/frontend/StarGraphicsMenu.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/frontend/StarGraphicsMenu.cpp b/source/frontend/StarGraphicsMenu.cpp
index 0a87ef6..210b318 100644
--- a/source/frontend/StarGraphicsMenu.cpp
+++ b/source/frontend/StarGraphicsMenu.cpp
@@ -86,6 +86,12 @@ GraphicsMenu::GraphicsMenu() {
Root::singleton().configuration()->set("monochromeLighting", checked);
syncGui();
});
+ reader.registerCallback("objectLightingCheckbox", [=](Widget*) {
+ bool checked = fetchChild<ButtonWidget>("objectLightingCheckbox")->isChecked();
+ m_localChanges.set("newObjectLighting", checked);
+ Root::singleton().configuration()->set("newObjectLighting", checked);
+ syncGui();
+ });
auto assets = Root::singleton().assets();
@@ -140,7 +146,8 @@ StringList const GraphicsMenu::ConfigKeys = {
"limitTextureAtlasSize",
"useMultiTexturing",
"antiAliasing",
- "monochromeLighting"
+ "monochromeLighting",
+ "newObjectLighting"
};
void GraphicsMenu::initConfig() {
@@ -196,6 +203,7 @@ void GraphicsMenu::syncGui() {
fetchChild<ButtonWidget>("multiTextureCheckbox")->setChecked(m_localChanges.get("useMultiTexturing").optBool().value(true));
fetchChild<ButtonWidget>("antiAliasingCheckbox")->setChecked(m_localChanges.get("antiAliasing").toBool());
fetchChild<ButtonWidget>("monochromeCheckbox")->setChecked(m_localChanges.get("monochromeLighting").toBool());
+ fetchChild<ButtonWidget>("objectLightingCheckbox")->setChecked(m_localChanges.get("newObjectLighting").optBool().value(true));
}
void GraphicsMenu::apply() {