From 227e60ca4c927ed9f6b7db5e5c53c45addd1428b Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 15 Apr 2024 08:03:26 +1000 Subject: new object lighting toggle, log non-master entity render/update exceptions --- source/frontend/StarGraphicsMenu.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/frontend/StarGraphicsMenu.cpp') 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("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("multiTextureCheckbox")->setChecked(m_localChanges.get("useMultiTexturing").optBool().value(true)); fetchChild("antiAliasingCheckbox")->setChecked(m_localChanges.get("antiAliasing").toBool()); fetchChild("monochromeCheckbox")->setChecked(m_localChanges.get("monochromeLighting").toBool()); + fetchChild("objectLightingCheckbox")->setChecked(m_localChanges.get("newObjectLighting").optBool().value(true)); } void GraphicsMenu::apply() { -- cgit v1.2.3