forked from teamnwah/openmw-tes3coop
added ability to close container windows with the activation key
This commit is contained in:
parent
1bc343f363
commit
d4739a451a
2 changed files with 29 additions and 7 deletions
|
@ -172,8 +172,8 @@ namespace MWInput
|
||||||
exitNow();
|
exitNow();
|
||||||
break;
|
break;
|
||||||
case A_Screenshot:
|
case A_Screenshot:
|
||||||
screenshot();
|
screenshot()
|
||||||
break;
|
; break;
|
||||||
case A_Inventory:
|
case A_Inventory:
|
||||||
toggleInventory ();
|
toggleInventory ();
|
||||||
break;
|
break;
|
||||||
|
@ -182,11 +182,14 @@ namespace MWInput
|
||||||
break;
|
break;
|
||||||
case A_Activate:
|
case A_Activate:
|
||||||
resetIdleTime();
|
resetIdleTime();
|
||||||
if( MWBase::Environment::get().getWindowManager()->isGuiMode()) {
|
|
||||||
// Pressing the activation key when a messagebox is prompting for "ok" will activate the ok button
|
if (mWindows.getMode() == MWGui::GM_Container) {
|
||||||
|
toggleContainer ();
|
||||||
|
} else if (MWBase::Environment::get().getWindowManager()->isGuiMode()) {
|
||||||
MWBase::Environment::get().getWindowManager()->enterPressed();
|
MWBase::Environment::get().getWindowManager()->enterPressed();
|
||||||
}
|
} else {
|
||||||
activate();
|
activate();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case A_Journal:
|
case A_Journal:
|
||||||
toggleJournal ();
|
toggleJournal ();
|
||||||
|
@ -674,6 +677,24 @@ namespace MWInput
|
||||||
// .. but don't touch any other mode, except container.
|
// .. but don't touch any other mode, except container.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InputManager::toggleContainer()
|
||||||
|
{
|
||||||
|
if (MyGUI::InputManager::getInstance ().isModalAny())
|
||||||
|
return;
|
||||||
|
|
||||||
|
bool gameMode = !mWindows.isGuiMode();
|
||||||
|
|
||||||
|
if(!gameMode)
|
||||||
|
{
|
||||||
|
if (mWindows.getMode() == MWGui::GM_Container)
|
||||||
|
mWindows.popGuiMode();
|
||||||
|
else
|
||||||
|
mWindows.pushGuiMode(MWGui::GM_Container);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void InputManager::toggleConsole()
|
void InputManager::toggleConsole()
|
||||||
{
|
{
|
||||||
if (MyGUI::InputManager::getInstance ().isModalAny())
|
if (MyGUI::InputManager::getInstance ().isModalAny())
|
||||||
|
|
|
@ -170,6 +170,7 @@ namespace MWInput
|
||||||
void toggleSpell();
|
void toggleSpell();
|
||||||
void toggleWeapon();
|
void toggleWeapon();
|
||||||
void toggleInventory();
|
void toggleInventory();
|
||||||
|
void toggleContainer();
|
||||||
void toggleConsole();
|
void toggleConsole();
|
||||||
void screenshot();
|
void screenshot();
|
||||||
void toggleJournal();
|
void toggleJournal();
|
||||||
|
|
Loading…
Reference in a new issue