Merge branch 'quickerkeys' into 'master'

Allow activating quick keys menu in menus (bug #6898)

Closes #6898

See merge request OpenMW/openmw!2178
This commit is contained in:
psi29a 2022-07-27 08:36:10 +00:00
commit 59f1bcc966
4 changed files with 25 additions and 14 deletions

View file

@ -132,6 +132,7 @@
Bug #6799: Game crashes if an NPC has no Class attached Bug #6799: Game crashes if an NPC has no Class attached
Bug #6849: ImageButton texture is not scaled properly Bug #6849: ImageButton texture is not scaled properly
Bug #6895: Removing a negative number of items from a script, makes the script terminate with an error Bug #6895: Removing a negative number of items from a script, makes the script terminate with an error
Bug #6898: Accessing the Quick Inventory menu does not work while in menu mode
Bug #6901: Morrowind.exe soul gem usage discrepancy Bug #6901: Morrowind.exe soul gem usage discrepancy
Feature #890: OpenMW-CS: Column filtering Feature #890: OpenMW-CS: Column filtering
Feature #1465: "Reset" argument for AI functions Feature #1465: "Reset" argument for AI functions

View file

@ -123,6 +123,18 @@ namespace MWGui
} }
} }
void QuickKeysMenu::onClose()
{
WindowBase::onClose();
if (mAssignDialog)
mAssignDialog->setVisible(false);
if (mItemSelectionDialog)
mItemSelectionDialog->setVisible(false);
if (mMagicSelectionDialog)
mMagicSelectionDialog->setVisible(false);
}
void QuickKeysMenu::unassign(keyData* key) void QuickKeysMenu::unassign(keyData* key)
{ {
key->button->clearUserStrings(); key->button->clearUserStrings();

View file

@ -33,6 +33,7 @@ namespace MWGui
void onAssignMagic (const std::string& spellId); void onAssignMagic (const std::string& spellId);
void onAssignMagicCancel (); void onAssignMagicCancel ();
void onOpen() override; void onOpen() override;
void onClose() override;
void activateQuickKey(int index); void activateQuickKey(int index);
void updateActivatedQuickKey(); void updateActivatedQuickKey();

View file

@ -477,22 +477,19 @@ namespace MWInput
void ActionManager::showQuickKeysMenu() void ActionManager::showQuickKeysMenu()
{ {
if (!MWBase::Environment::get().getWindowManager()->isGuiMode () if (MWBase::Environment::get().getWindowManager()->getMode () == MWGui::GM_QuickKeysMenu)
&& MWBase::Environment::get().getWorld()->getGlobalFloat ("chargenstate")==-1)
{ {
if (!checkAllowedToUseItems()) MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode();
return; return;
}
MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_QuickKeysMenu); if (MWBase::Environment::get().getWorld()->getGlobalFloat ("chargenstate") != -1)
} return;
else if (MWBase::Environment::get().getWindowManager()->getMode () == MWGui::GM_QuickKeysMenu)
{ if (!checkAllowedToUseItems())
while (MyGUI::InputManager::getInstance().isModalAny()) return;
{ //Handle any open Modal windows
MWBase::Environment::get().getWindowManager()->exitCurrentModal(); MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_QuickKeysMenu);
}
MWBase::Environment::get().getWindowManager()->exitCurrentGuiMode(); //And handle the actual main window
}
} }
void ActionManager::activate() void ActionManager::activate()