From d5f5fb5ddf0d4a9f0b0e6ac012121926d2fcd949 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Fri, 19 Apr 2024 08:52:35 +1000 Subject: Add hardware cursor game setting --- source/frontend/StarGraphicsMenu.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/frontend/StarGraphicsMenu.cpp') diff --git a/source/frontend/StarGraphicsMenu.cpp b/source/frontend/StarGraphicsMenu.cpp index 210b318..a3d78e7 100644 --- a/source/frontend/StarGraphicsMenu.cpp +++ b/source/frontend/StarGraphicsMenu.cpp @@ -80,6 +80,12 @@ GraphicsMenu::GraphicsMenu() { Root::singleton().configuration()->set("antiAliasing", checked); syncGui(); }); + reader.registerCallback("hardwareCursorCheckbox", [=](Widget*) { + bool checked = fetchChild("hardwareCursorCheckbox")->isChecked(); + m_localChanges.set("hardwareCursor", checked); + Root::singleton().configuration()->set("hardwareCursor", checked); + GuiContext::singleton().applicationController()->setCursorHardware(checked); + }); reader.registerCallback("monochromeCheckbox", [=](Widget*) { bool checked = fetchChild("monochromeCheckbox")->isChecked(); m_localChanges.set("monochromeLighting", checked); @@ -146,6 +152,7 @@ StringList const GraphicsMenu::ConfigKeys = { "limitTextureAtlasSize", "useMultiTexturing", "antiAliasing", + "hardwareCursor", "monochromeLighting", "newObjectLighting" }; @@ -204,6 +211,7 @@ void GraphicsMenu::syncGui() { 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)); + fetchChild("hardwareCursorCheckbox")->setChecked(m_localChanges.get("hardwareCursor").toBool()); } void GraphicsMenu::apply() { -- cgit v1.2.3