1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-25 00:23:50 +00:00
openmw-tes3mp/apps/openmw/mwmp/processors/player/ProcessorGameSettings.hpp

39 lines
1.3 KiB
C++

#ifndef OPENMW_PROCESSORGAMESETTINGS_HPP
#define OPENMW_PROCESSORGAMESETTINGS_HPP
#include "apps/openmw/mwbase/environment.hpp"
#include "apps/openmw/mwworld/worldimp.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 &&
(!player->bedRestAllowed || !player->wildernessRestAllowed || !player->waitAllowed))
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
MWBase::Environment::get().getWorld()->setPhysicsFramerate(player->physicsFramerate);
}
}
};
}
#endif //OPENMW_PROCESSORGAMESETTINGS_HPP