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

summaryrefslogtreecommitdiff
path: root/source/client/StarClientApplication.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-03 04:29:58 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-03 04:29:58 +1000
commitd7ba1136883de9392bb929df5772dba7f8bf49df (patch)
treee6e3cbcd2711755c6bb0b461218b5506164f66d6 /source/client/StarClientApplication.cpp
parent7d86194cae75da21cee8b5aff51445391893b045 (diff)
Add zoom level keybinds
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() {