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

summaryrefslogtreecommitdiff
path: root/source/client/StarClientApplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/client/StarClientApplication.cpp')
-rw-r--r--source/client/StarClientApplication.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp
index 33a4552..b4c9b1a 100644
--- a/source/client/StarClientApplication.cpp
+++ b/source/client/StarClientApplication.cpp
@@ -315,6 +315,18 @@ void ClientApplication::processInput(InputEvent const& event) {
}
m_input->handleInput(event, processed);
+ WorldCamera& camera = m_worldPainter->camera();
+
+ auto config = m_root->configuration();
+ int zoomOffset = 0;
+
+ if (auto presses = m_input->bindDown("opensb", "zoomIn"))
+ zoomOffset += *presses;
+ if (auto presses = m_input->bindDown("opensb", "zoomOut"))
+ zoomOffset -= *presses;
+
+ if (zoomOffset != 0)
+ config->set("zoomLevel", max(1.0f, round(config->get("zoomLevel").toFloat() + zoomOffset)));
}
void ClientApplication::update() {