Fix focus for InputDialog

Created a special pipe for future GUI modes.
This commit is contained in:
Koncord 2016-08-27 13:40:11 +08:00
parent e81bf7318c
commit 4c2415e9db
4 changed files with 21 additions and 1 deletions

View File

@ -48,7 +48,8 @@ namespace MWGui
GM_LoadingWallpaper, GM_LoadingWallpaper,
GM_Jail, GM_Jail,
GM_QuickKeysMenu GM_QuickKeysMenu,
GM_TES3MPPipe
}; };
// Windows shown in inventory mode // Windows shown in inventory mode

View File

@ -45,6 +45,7 @@
#include <components/sdlutil/sdlcursormanager.hpp> #include <components/sdlutil/sdlcursormanager.hpp>
#include <components/misc/resourcehelpers.hpp> #include <components/misc/resourcehelpers.hpp>
#include <apps/openmw/mwmp/Main.hpp>
#include "../mwbase/inputmanager.hpp" #include "../mwbase/inputmanager.hpp"
#include "../mwbase/statemanager.hpp" #include "../mwbase/statemanager.hpp"
@ -676,6 +677,9 @@ namespace MWGui
mToolTips->setVisible(false); mToolTips->setVisible(false);
setCursorVisible(mMessageBoxManager && mMessageBoxManager->isInteractiveMessageBox()); setCursorVisible(mMessageBoxManager && mMessageBoxManager->isInteractiveMessageBox());
break; break;
case GM_TES3MPPipe:
mwmp::Main::get().getGUIController()->WM_UpdateVisible(mode);
break;
default: default:
// Unsupported mode, switch back to game // Unsupported mode, switch back to game
break; break;

View File

@ -90,6 +90,7 @@ void mwmp::GUIController::ShowInputBox(const BasePlayer::GUIMessageBox &guiMessa
MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager(); MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager();
windowManager->removeDialog(mInputBox); windowManager->removeDialog(mInputBox);
windowManager->pushGuiMode(MWGui::GM_TES3MPPipe);
mInputBox = 0; mInputBox = 0;
mInputBox = new MWGui::TextInputDialog(); mInputBox = new MWGui::TextInputDialog();
mInputBox->setTextLabel(guiMessageBox.label); mInputBox->setTextLabel(guiMessageBox.label);
@ -108,6 +109,7 @@ void mwmp::GUIController::OnInputBoxDone(MWGui::WindowBase *parWindow)
MWBase::Environment::get().getWindowManager()->removeDialog(mInputBox); MWBase::Environment::get().getWindowManager()->removeDialog(mInputBox);
mInputBox = 0; mInputBox = 0;
MWBase::Environment::get().getWindowManager()->popGuiMode();
} }
bool mwmp::GUIController::pressedKey(int key) bool mwmp::GUIController::pressedKey(int key)
@ -154,4 +156,15 @@ void mwmp::GUIController::update(float dt)
} }
void mwmp::GUIController::WM_UpdateVisible(MWGui::GuiMode mode)
{
switch(mode)
{
case MWGui::GM_TES3MPPipe:
break;
default:
break;
}
}

View File

@ -7,6 +7,7 @@
#include <components/settings/settings.hpp> #include <components/settings/settings.hpp>
#include <apps/openmw/mwgui/textinput.hpp> #include <apps/openmw/mwgui/textinput.hpp>
#include <apps/openmw/mwgui/mode.hpp>
#include <components/openmw-mp/Base/BasePlayer.hpp> #include <components/openmw-mp/Base/BasePlayer.hpp>
#include "GUIChat.hpp" #include "GUIChat.hpp"
@ -33,6 +34,7 @@ namespace mwmp
void update(float dt); void update(float dt);
void WM_UpdateVisible(MWGui::GuiMode mode);
private: private:
GUIChat *mChat; GUIChat *mChat;
int keySay; int keySay;