From a3e0d36a722f2bd415387451f8f7de44658d6685 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 07:38:08 -0700 Subject: [PATCH] feat: add World Map visibility toggle with keybinding support Implement showWorldMap_ state variable and TOGGLE_WORLD_MAP keybinding integration to allow players to customize the W key binding for opening/ closing the World Map, consistent with other window toggles like Nameplates (V key) and Guild Roster (O key). --- include/ui/game_screen.hpp | 1 + src/ui/game_screen.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/ui/game_screen.hpp b/include/ui/game_screen.hpp index 12154c06..125dc31b 100644 --- a/include/ui/game_screen.hpp +++ b/include/ui/game_screen.hpp @@ -67,6 +67,7 @@ private: bool showPlayerInfo = false; bool showSocialFrame_ = false; // O key toggles social/friends list bool showGuildRoster_ = false; + bool showWorldMap_ = false; // W key toggles world map std::string selectedGuildMember_; bool showGuildNoteEdit_ = false; bool editingOfficerNote_ = false; diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 20e8769d..5da57eda 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -1475,6 +1475,10 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) { showNameplates_ = !showNameplates_; } + if (KeybindingManager::getInstance().isActionPressed(KeybindingManager::Action::TOGGLE_WORLD_MAP)) { + showWorldMap_ = !showWorldMap_; + } + // Action bar keys (1-9, 0, -, =) static const SDL_Scancode actionBarKeys[] = { SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4, @@ -4003,6 +4007,8 @@ void GameScreen::updateCharacterTextures(game::Inventory& inventory) { // ============================================================ void GameScreen::renderWorldMap(game::GameHandler& gameHandler) { + if (!showWorldMap_) return; + auto& app = core::Application::getInstance(); auto* renderer = app.getRenderer(); if (!renderer) return;