From 82d00c94c040904d9f76532b93c1d494a473bd70 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 08:28:34 -0700 Subject: [PATCH] refactor: use keybinding manager for quest log toggle instead of hardcoded L key The quest log screen was using a hardcoded SDL_SCANCODE_L key check instead of the keybinding manager system, preventing users from customizing the keybinding. Update to use KeybindingManager::Action::TOGGLE_QUESTS (bound to L by default), allowing users to customize the quest log toggle key through the Settings UI while maintaining the default WoW key binding. This enables consistency with other customizable window toggles that already use the keybinding system (Character Screen, Inventory, Spellbook, World Map, etc.). --- src/ui/quest_log_screen.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/quest_log_screen.cpp b/src/ui/quest_log_screen.cpp index 8a9ddd55..a5dc4945 100644 --- a/src/ui/quest_log_screen.cpp +++ b/src/ui/quest_log_screen.cpp @@ -1,4 +1,5 @@ #include "ui/quest_log_screen.hpp" +#include "ui/keybinding_manager.hpp" #include "core/application.hpp" #include "core/input.hpp" #include @@ -206,13 +207,14 @@ std::string cleanQuestTitleForUi(const std::string& raw, uint32_t questId) { } // anonymous namespace void QuestLogScreen::render(game::GameHandler& gameHandler) { - // L key toggle (edge-triggered) - ImGuiIO& io = ImGui::GetIO(); - bool lDown = !io.WantTextInput && core::Input::getInstance().isKeyPressed(SDL_SCANCODE_L); - if (lDown && !lKeyWasDown) { + // Quests toggle via keybinding (edge-triggered) + // Customizable key (default: L) from KeybindingManager + bool questsDown = KeybindingManager::getInstance().isActionPressed( + KeybindingManager::Action::TOGGLE_QUESTS, false); + if (questsDown && !lKeyWasDown) { open = !open; } - lKeyWasDown = lDown; + lKeyWasDown = questsDown; if (!open) return;