diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index faab1e9b9..85ef09e45 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -13,7 +13,16 @@ #include #include +/* + Start of tes3mp addition + + Include additional headers for multiplayer purposes +*/ #include "../mwmp/Main.hpp" +#include "../mwmp/LocalPlayer.hpp" +/* + End of tes3mp addition +*/ #include #include @@ -1026,6 +1035,17 @@ namespace MWInput void InputManager::toggleConsole() { + /* + Start of tes3mp addition + + If a player's console is disabled by the server, go no further + */ + if (!mwmp::Main::get().getLocalPlayer()->consoleAllowed) + return; + /* + End of tes3mp addition + */ + if (MyGUI::InputManager::getInstance ().isModalAny()) return; diff --git a/apps/openmw/mwmp/GUIController.cpp b/apps/openmw/mwmp/GUIController.cpp index d79236d8d..9f4678819 100644 --- a/apps/openmw/mwmp/GUIController.cpp +++ b/apps/openmw/mwmp/GUIController.cpp @@ -214,8 +214,6 @@ void mwmp::GUIController::update(float dt) Main::get().getNetworking()->getPlayerPacket(ID_GUI_MESSAGEBOX)->setPlayer(Main::get().getLocalPlayer()); Main::get().getNetworking()->getPlayerPacket(ID_GUI_MESSAGEBOX)->Send(); } - - blockConsole(); } void mwmp::GUIController::WM_UpdateVisible(MWGui::GuiMode mode) @@ -383,13 +381,3 @@ void mwmp::GUIController::updateGlobalMapMarkerTooltips(MWGui::MapWindow *mapWin setGlobalMapMarkerTooltip(mapWindow, widget.second, x, y); } } - -void mwmp::GUIController::blockConsole() -{ - if (Main::get().getLocalPlayer()->consoleAllowed) - return; - - if (MWBase::Environment::get().getWindowManager()->isGuiMode()) - if (MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Console) - MWBase::Environment::get().getWindowManager()->popGuiMode(); -} diff --git a/apps/openmw/mwmp/GUIController.hpp b/apps/openmw/mwmp/GUIController.hpp index 9cbf51ff6..8e6efba15 100644 --- a/apps/openmw/mwmp/GUIController.hpp +++ b/apps/openmw/mwmp/GUIController.hpp @@ -74,7 +74,6 @@ namespace mwmp GUIDialogList *mListBox; void onInputBoxDone(MWGui::WindowBase* parWindow); //MyGUI::Widget *oldFocusWidget, *currentFocusWidget; - void blockConsole(); }; } diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index e4bc4fda7..d4f9ffcd1 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -47,7 +47,7 @@ LocalPlayer::LocalPlayer() charGenStage.current = 0; charGenStage.end = 1; - consoleAllowed = true; + consoleAllowed = false; difficulty = 0; ignorePosPacket = false; diff --git a/apps/openmw/mwmp/processors/player/ProcessorGameSettings.hpp b/apps/openmw/mwmp/processors/player/ProcessorGameSettings.hpp index 738de5b26..a17d92f13 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorGameSettings.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorGameSettings.hpp @@ -1,6 +1,9 @@ #ifndef OPENMW_PROCESSORGAMESETTINGS_HPP #define OPENMW_PROCESSORGAMESETTINGS_HPP +#include "apps/openmw/mwbase/environment.hpp" +#include "apps/openmw/mwgui/windowmanagerimp.hpp" + #include "../PlayerProcessor.hpp" namespace mwmp @@ -15,7 +18,16 @@ namespace mwmp virtual void Do(PlayerPacket &packet, BasePlayer *player) { - + if (isLocal()) + { + if (MWBase::Environment::get().getWindowManager()->isGuiMode()) + { + if (MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Console && !player->consoleAllowed) + { + MWBase::Environment::get().getWindowManager()->popGuiMode(); + } + } + } } }; }