forked from teamnwah/openmw-tes3coop
[Client] Add ScriptController w/ contextType-to-packetOrigin method
This commit is contained in:
parent
63a86f145d
commit
692ee01340
3 changed files with 30 additions and 1 deletions
|
@ -96,7 +96,7 @@ add_openmw_dir (mwbase
|
|||
)
|
||||
|
||||
add_openmw_dir (mwmp Main Networking LocalPlayer DedicatedPlayer PlayerList LocalActor DedicatedActor ActorList ObjectList
|
||||
Worldstate Cell CellController MechanicsHelper RecordHelper GUIController
|
||||
Worldstate Cell CellController GUIController MechanicsHelper RecordHelper ScriptController
|
||||
)
|
||||
|
||||
add_openmw_dir (mwmp/GUI GUIChat GUILogin PlayerMarkerCollection GUIDialogList TextInputDialog
|
||||
|
|
19
apps/openmw/mwmp/ScriptController.cpp
Normal file
19
apps/openmw/mwmp/ScriptController.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include <components/openmw-mp/Base/BaseStructs.hpp>
|
||||
|
||||
#include "../mwscript/interpretercontext.hpp"
|
||||
|
||||
#include "ScriptController.hpp"
|
||||
|
||||
unsigned short ScriptController::getPacketOriginFromContextType(unsigned short contextType)
|
||||
{
|
||||
if (contextType == Interpreter::Context::CONSOLE)
|
||||
return mwmp::CLIENT_CONSOLE;
|
||||
else if (contextType == Interpreter::Context::DIALOGUE)
|
||||
return mwmp::CLIENT_DIALOGUE;
|
||||
else if (contextType == Interpreter::Context::SCRIPT_LOCAL)
|
||||
return mwmp::CLIENT_SCRIPT_LOCAL;
|
||||
else if (contextType == Interpreter::Context::SCRIPT_GLOBAL)
|
||||
return mwmp::CLIENT_SCRIPT_GLOBAL;
|
||||
|
||||
return mwmp::CLIENT_GAMEPLAY;
|
||||
}
|
10
apps/openmw/mwmp/ScriptController.hpp
Normal file
10
apps/openmw/mwmp/ScriptController.hpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
#ifndef OPENMW_SCRIPTCONTROLLER_HPP
|
||||
#define OPENMW_SCRIPTCONTROLLER_HPP
|
||||
|
||||
namespace ScriptController
|
||||
{
|
||||
unsigned short getPacketOriginFromContextType(unsigned short contextType);
|
||||
}
|
||||
|
||||
|
||||
#endif //OPENMW_SCRIPTCONTROLLER_HPP
|
Loading…
Reference in a new issue