mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-26 00:40:15 +00:00
Fix UI window hotkey toggles and silent mount sound fallback
This commit is contained in:
parent
1a9bdfb64b
commit
09de52f310
6 changed files with 14 additions and 20 deletions
|
|
@ -552,13 +552,13 @@ void InventoryScreen::closeAllBags() {
|
|||
|
||||
void InventoryScreen::render(game::Inventory& inventory, uint64_t moneyCopper) {
|
||||
// B key toggle (edge-triggered)
|
||||
bool uiWantsKeyboard = ImGui::GetIO().WantCaptureKeyboard;
|
||||
bool bDown = !uiWantsKeyboard && core::Input::getInstance().isKeyPressed(SDL_SCANCODE_B);
|
||||
bool wantsTextInput = ImGui::GetIO().WantTextInput;
|
||||
bool bDown = !wantsTextInput && core::Input::getInstance().isKeyPressed(SDL_SCANCODE_B);
|
||||
bool bToggled = bDown && !bKeyWasDown;
|
||||
bKeyWasDown = bDown;
|
||||
|
||||
// C key toggle for character screen (edge-triggered)
|
||||
bool cDown = !uiWantsKeyboard && core::Input::getInstance().isKeyPressed(SDL_SCANCODE_C);
|
||||
bool cDown = !wantsTextInput && core::Input::getInstance().isKeyPressed(SDL_SCANCODE_C);
|
||||
if (cDown && !cKeyWasDown) {
|
||||
characterOpen = !characterOpen;
|
||||
}
|
||||
|
|
@ -582,7 +582,7 @@ void InventoryScreen::render(game::Inventory& inventory, uint64_t moneyCopper) {
|
|||
}
|
||||
|
||||
// Escape cancels held item
|
||||
if (holdingItem && !uiWantsKeyboard && core::Input::getInstance().isKeyPressed(SDL_SCANCODE_ESCAPE)) {
|
||||
if (holdingItem && !wantsTextInput && core::Input::getInstance().isKeyPressed(SDL_SCANCODE_ESCAPE)) {
|
||||
cancelPickup(inventory);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue