mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 00:03:50 +00:00
fix(chat): disable shortcuts while typing
This commit is contained in:
parent
aed1f2ad21
commit
14e58eaa01
1 changed files with 60 additions and 54 deletions
|
|
@ -2274,10 +2274,12 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) {
|
|||
void GameScreen::processTargetInput(game::GameHandler& gameHandler) {
|
||||
auto& io = ImGui::GetIO();
|
||||
auto& input = core::Input::getInstance();
|
||||
const bool textFocus = chatInputActive || io.WantTextInput;
|
||||
|
||||
// Tab targeting (when keyboard not captured by UI)
|
||||
if (!io.WantCaptureKeyboard) {
|
||||
if (input.isKeyJustPressed(SDL_SCANCODE_TAB)) {
|
||||
// When typing in chat (or any text input), never treat keys as gameplay/UI shortcuts.
|
||||
if (!textFocus && input.isKeyJustPressed(SDL_SCANCODE_TAB)) {
|
||||
const auto& movement = gameHandler.getMovementInfo();
|
||||
gameHandler.tabTarget(movement.x, movement.y, movement.z);
|
||||
}
|
||||
|
|
@ -2300,6 +2302,7 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!textFocus) {
|
||||
// Toggle character screen (C) and inventory/bags (I)
|
||||
if (KeybindingManager::getInstance().isActionPressed(KeybindingManager::Action::TOGGLE_CHARACTER_SCREEN)) {
|
||||
inventoryScreen.toggleCharacter();
|
||||
|
|
@ -2346,7 +2349,6 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) {
|
|||
showTitlesWindow_ = !showTitlesWindow_;
|
||||
}
|
||||
|
||||
|
||||
// Action bar keys (1-9, 0, -, =)
|
||||
static const SDL_Scancode actionBarKeys[] = {
|
||||
SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4,
|
||||
|
|
@ -2366,6 +2368,7 @@ void GameScreen::processTargetInput(game::GameHandler& gameHandler) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -11224,7 +11227,9 @@ void GameScreen::renderLfgProposalPopup(game::GameHandler& gameHandler) {
|
|||
|
||||
void GameScreen::renderGuildRoster(game::GameHandler& gameHandler) {
|
||||
// Guild Roster toggle (customizable keybind)
|
||||
if (!ImGui::GetIO().WantCaptureKeyboard && KeybindingManager::getInstance().isActionPressed(KeybindingManager::Action::TOGGLE_GUILD_ROSTER)) {
|
||||
if (!chatInputActive && !ImGui::GetIO().WantTextInput &&
|
||||
!ImGui::GetIO().WantCaptureKeyboard &&
|
||||
KeybindingManager::getInstance().isActionPressed(KeybindingManager::Action::TOGGLE_GUILD_ROSTER)) {
|
||||
showGuildRoster_ = !showGuildRoster_;
|
||||
if (showGuildRoster_) {
|
||||
// Open friends tab directly if not in guild
|
||||
|
|
@ -19543,7 +19548,8 @@ void GameScreen::renderZoneText() {
|
|||
// ---------------------------------------------------------------------------
|
||||
void GameScreen::renderDungeonFinderWindow(game::GameHandler& gameHandler) {
|
||||
// Toggle Dungeon Finder (customizable keybind)
|
||||
if (!chatInputActive && KeybindingManager::getInstance().isActionPressed(KeybindingManager::Action::TOGGLE_DUNGEON_FINDER)) {
|
||||
if (!chatInputActive && !ImGui::GetIO().WantTextInput &&
|
||||
KeybindingManager::getInstance().isActionPressed(KeybindingManager::Action::TOGGLE_DUNGEON_FINDER)) {
|
||||
showDungeonFinder_ = !showDungeonFinder_;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue