diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-24 22:19:00 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-24 22:19:00 -0500 |
| commit | e4251457fa46d22071c034e04d1f5ac53ba29593 (patch) | |
| tree | 8b61201a9a2d109041a298fa8ae43ae2f03cda3f /src/script_system.h | |
| parent | 4effe126d5b04d7e8572f8d785735a66150aa4ee (diff) | |
| download | tanetane-e4251457fa46d22071c034e04d1f5ac53ba29593.tar.gz tanetane-e4251457fa46d22071c034e04d1f5ac53ba29593.tar.bz2 tanetane-e4251457fa46d22071c034e04d1f5ac53ba29593.zip | |
Added map init scripts
Map scripts also now actually run in their own lua thread.
Diffstat (limited to 'src/script_system.h')
| -rw-r--r-- | src/script_system.h | 4 |
1 files changed, 4 insertions, 0 deletions
| diff --git a/src/script_system.h b/src/script_system.h index 18850b3..7ef2dee 100644 --- a/src/script_system.h +++ b/src/script_system.h | |||
| @@ -19,12 +19,16 @@ public: | |||
| 19 | 19 | ||
| 20 | void tick(double dt) override; | 20 | void tick(double dt) override; |
| 21 | 21 | ||
| 22 | bool mapHasScript(std::string mapName, std::string scriptName); | ||
| 23 | |||
| 22 | void runScript(std::string mapName, std::string scriptName); | 24 | void runScript(std::string mapName, std::string scriptName); |
| 23 | 25 | ||
| 24 | void runDebugScript(std::string script); | 26 | void runDebugScript(std::string script); |
| 25 | 27 | ||
| 26 | private: | 28 | private: |
| 27 | 29 | ||
| 30 | void loadMapScripts(std::string mapName); | ||
| 31 | |||
| 28 | struct Script { | 32 | struct Script { |
| 29 | std::unique_ptr<sol::thread> runner; | 33 | std::unique_ptr<sol::thread> runner; |
| 30 | std::unique_ptr<sol::coroutine> callable; | 34 | std::unique_ptr<sol::coroutine> callable; |
