mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-11 04:56:49 +03:00
Add m_onStart, m_onEnd, m_onLoad, m_onControlPhase, and m_onSave callbacks. Add InitCallBacks, which assigns the aforementioned member functions and checks that they exist in the script, throwing an exception if not.
This commit is contained in:
parent
f22551ab32
commit
997d31af89
1 changed files with 15 additions and 4 deletions
|
@ -53,7 +53,11 @@ private:
|
||||||
std::map<int, short> m_itemsMapId;
|
std::map<int, short> m_itemsMapId;
|
||||||
std::map<std::string, short> m_itemsMapName;
|
std::map<std::string, short> m_itemsMapName;
|
||||||
std::vector<LuaFunction*> m_triggers;
|
std::vector<LuaFunction*> m_triggers;
|
||||||
|
sol::protected_function m_onStart;
|
||||||
|
sol::protected_function m_onLoad;
|
||||||
|
sol::protected_function m_onControlPhase;
|
||||||
|
sol::protected_function m_onSave;
|
||||||
|
sol::protected_function m_onEnd;
|
||||||
public:
|
public:
|
||||||
GameScript(sol::state* lua);
|
GameScript(sol::state* lua);
|
||||||
|
|
||||||
|
@ -108,4 +112,11 @@ public:
|
||||||
void AddOneSecret();
|
void AddOneSecret();
|
||||||
int CalculateDistance(GameScriptPosition pos1, GameScriptPosition pos2);
|
int CalculateDistance(GameScriptPosition pos1, GameScriptPosition pos2);
|
||||||
int CalculateHorizontalDistance(GameScriptPosition pos1, GameScriptPosition pos2);
|
int CalculateHorizontalDistance(GameScriptPosition pos1, GameScriptPosition pos2);
|
||||||
|
|
||||||
|
void InitCallbacks();
|
||||||
|
void OnStart();
|
||||||
|
void OnLoad();
|
||||||
|
void OnControlPhase();
|
||||||
|
void OnSave();
|
||||||
|
void OnEnd();
|
||||||
};
|
};
|
Loading…
Add table
Add a link
Reference in a new issue