mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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.).
This commit is contained in:
parent
9809106a84
commit
82d00c94c0
1 changed files with 7 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include "ui/quest_log_screen.hpp"
|
||||
#include "ui/keybinding_manager.hpp"
|
||||
#include "core/application.hpp"
|
||||
#include "core/input.hpp"
|
||||
#include <imgui.h>
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue