From d7ba1136883de9392bb929df5772dba7f8bf49df Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 3 Jul 2023 04:29:58 +1000 Subject: Add zoom level keybinds --- source/client/StarClientApplication.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/client/StarClientApplication.cpp') 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() { -- cgit v1.2.3