Clean up GameLogicScript.

Add some new member functions, ResetLevelTables and GetLevelFunc. The former is called in FreeLevelScripts, which is now called in control.cpp.

Remove AddTrigger, as the LevelFuncs table takes care of triggers.
This commit is contained in:
hispidence 2021-08-23 02:02:47 +01:00
parent 73eb96ee39
commit ef9a74d5e0
3 changed files with 33 additions and 42 deletions

View file

@ -65,11 +65,13 @@ private:
sol::protected_function m_onControlPhase{};
sol::protected_function m_onSave{};
sol::protected_function m_onEnd{};
void ResetLevelTables();
public:
GameScript(sol::state* lua);
void FreeLevelScripts();
void AddTrigger(LuaFunction* function);
bool AddLuaNameItem(std::string const & luaName, short itemNumber);
bool RemoveLuaNameItem(std::string const& luaName);
@ -90,6 +92,7 @@ public:
bool RemoveLuaNameAIObject(std::string const& luaName);
bool SetLevelFunc(sol::table tab, std::string const& luaName, sol::object obj);
sol::protected_function GetLevelFunc(sol::table tab, std::string const& luaName);
void AssignItemsAndLara();