1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-31 22:45:33 +00:00

Merge remote-tracking branch 'vorenon/container'

This commit is contained in:
Marc Zinnschlag 2013-07-15 09:33:16 +02:00
commit fd9cc1c282
2 changed files with 27 additions and 5 deletions

View file

@ -182,11 +182,14 @@ namespace MWInput
break;
case A_Activate:
resetIdleTime();
if( MWBase::Environment::get().getWindowManager()->isGuiMode()) {
// Pressing the activation key when a messagebox is prompting for "ok" will activate the ok button
MWBase::Environment::get().getWindowManager()->enterPressed();
}
activate();
if (mWindows.getMode() == MWGui::GM_Container) {
toggleContainer ();
} else if (MWBase::Environment::get().getWindowManager()->isGuiMode()) {
MWBase::Environment::get().getWindowManager()->enterPressed();
} else {
activate();
}
break;
case A_Journal:
toggleJournal ();
@ -674,6 +677,24 @@ namespace MWInput
// .. 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()
{
if (MyGUI::InputManager::getInstance ().isModalAny())

View file

@ -170,6 +170,7 @@ namespace MWInput
void toggleSpell();
void toggleWeapon();
void toggleInventory();
void toggleContainer();
void toggleConsole();
void screenshot();
void toggleJournal();