1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 07:49:56 +00:00
openmw-tes3mp/apps/openmw/mwmp/processors/player/ProcessorGameSettings.hpp

41 lines
1.3 KiB
C++

#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
{
class ProcessorGameSettings : public PlayerProcessor
{
public:
ProcessorGameSettings()
{
BPP_INIT(ID_GAME_SETTINGS)
}
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();
}
else if ((MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Rest ||
MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_RestBed) &&
(!player->restAllowed || !player->waitAllowed))
{
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
}
}
}
};
}
#endif //OPENMW_PROCESSORGAMESETTINGS_HPP