fix: resolve keybinding conflicts for Q, M, and grave keys

- TOGGLE_QUEST_LOG: change default from Q to None — Q conflicts with
  strafe-left in camera_controller; quest log already accessible via
  TOGGLE_QUESTS (L, the standard WoW binding)
- Equipment Set Manager: remove hardcoded SDL_SCANCODE_GRAVE shortcut
  (~` should not be used for this)
- World map M key: remove duplicate SDL_SCANCODE_M self-handler from
  world_map.cpp::render() that was desync-ing with game_screen's
  TOGGLE_WORLD_MAP binding; game_screen now owns open/close, render()
  handles initial zone load and ESC-close signalling via isOpen()
This commit is contained in:
Kelsi 2026-03-13 01:27:30 -07:00
parent 1108aa9ae6
commit 13c096f3e9
3 changed files with 39 additions and 38 deletions

View file

@ -842,45 +842,47 @@ void WorldMap::render(const glm::vec3& playerRenderPos, int screenWidth, int scr
if (!zones.empty()) updateExploration(playerRenderPos);
if (open) {
if (input.isKeyJustPressed(SDL_SCANCODE_M) ||
input.isKeyJustPressed(SDL_SCANCODE_ESCAPE)) {
open = false;
return;
// game_screen owns the open/close toggle (via showWorldMap_ + TOGGLE_WORLD_MAP keybinding).
// render() is only called when showWorldMap_ is true, so treat each call as "should be open".
if (!open) {
// First time shown: load zones and navigate to player's location.
open = true;
if (zones.empty()) loadZonesFromDBC();
int bestContinent = findBestContinentForPlayer(playerRenderPos);
if (bestContinent >= 0 && bestContinent != continentIdx) {
continentIdx = bestContinent;
compositedIdx = -1;
}
int playerZone = findZoneForPlayer(playerRenderPos);
if (playerZone >= 0 && continentIdx >= 0 &&
zoneBelongsToContinent(playerZone, continentIdx)) {
loadZoneTextures(playerZone);
requestComposite(playerZone);
currentIdx = playerZone;
viewLevel = ViewLevel::ZONE;
} else if (continentIdx >= 0) {
loadZoneTextures(continentIdx);
requestComposite(continentIdx);
currentIdx = continentIdx;
viewLevel = ViewLevel::CONTINENT;
}
}
// ESC closes the map; game_screen will sync showWorldMap_ via wm->isOpen() next frame.
if (input.isKeyJustPressed(SDL_SCANCODE_ESCAPE)) {
open = false;
return;
}
{
auto& io = ImGui::GetIO();
float wheelDelta = io.MouseWheel;
if (std::abs(wheelDelta) < 0.001f)
wheelDelta = input.getMouseWheelDelta();
if (wheelDelta > 0.0f) zoomIn(playerRenderPos);
else if (wheelDelta < 0.0f) zoomOut();
} else {
auto& io = ImGui::GetIO();
if (!io.WantCaptureKeyboard && input.isKeyJustPressed(SDL_SCANCODE_M)) {
open = true;
if (zones.empty()) loadZonesFromDBC();
int bestContinent = findBestContinentForPlayer(playerRenderPos);
if (bestContinent >= 0 && bestContinent != continentIdx) {
continentIdx = bestContinent;
compositedIdx = -1;
}
int playerZone = findZoneForPlayer(playerRenderPos);
if (playerZone >= 0 && continentIdx >= 0 &&
zoneBelongsToContinent(playerZone, continentIdx)) {
loadZoneTextures(playerZone);
requestComposite(playerZone);
currentIdx = playerZone;
viewLevel = ViewLevel::ZONE;
} else if (continentIdx >= 0) {
loadZoneTextures(continentIdx);
requestComposite(continentIdx);
currentIdx = continentIdx;
viewLevel = ViewLevel::CONTINENT;
}
}
}
if (!open) return;