1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 12:35:46 +00:00
OpenMW/apps/openmw/mwlua/playerscripts.hpp
2021-07-09 20:48:54 +02:00

28 lines
577 B
C++

#ifndef MWLUA_PLAYERSCRIPTS_H
#define MWLUA_PLAYERSCRIPTS_H
#include <SDL_events.h>
#include "localscripts.hpp"
namespace MWLua
{
class PlayerScripts : public LocalScripts
{
public:
PlayerScripts(LuaUtil::LuaState* lua, const LObject& obj) : LocalScripts(lua, obj)
{
registerEngineHandlers({&mKeyPressHandlers});
}
void keyPress(const SDL_Keysym& key) { callEngineHandlers(mKeyPressHandlers, key); }
private:
EngineHandlerList mKeyPressHandlers{"onKeyPress"};
};
}
#endif // MWLUA_PLAYERSCRIPTS_H