diff options
author | clyne <clyne@bitgloo.com> | 2019-09-25 14:35:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-25 14:35:10 -0400 |
commit | 5de39474dd9c17cc7f09015f291769fbe3fd5931 (patch) | |
tree | 73de6ae8aad4418cd19d55d5b468a20b404446ec /src/script.cpp | |
parent | ec0ab456cf869f2daa6dea41158c54da745626d8 (diff) | |
parent | 1703f84121f18277c2a9bd671e204730c131c102 (diff) |
Merge pull request #2 from tcsullivan/font-support
Font support
Diffstat (limited to 'src/script.cpp')
-rw-r--r-- | src/script.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/script.cpp b/src/script.cpp index fd99228..6cda627 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -31,6 +31,9 @@ void ScriptSystem::configure([[maybe_unused]] entityx::EntityManager& entities, // Init after systems.configure() in engine.cpp //init(); + lua.open_libraries(sol::lib::base, sol::lib::math, sol::lib::string); + + scriptExport(); } #include <components/Script.hpp> @@ -54,9 +57,6 @@ void ScriptSystem::receive([[maybe_unused]] const EntitySpawnEvent &toSpawn) int ScriptSystem::init(void) { - lua.open_libraries(sol::lib::base, sol::lib::math, sol::lib::string); - - scriptExport(); doFile(); return 0; @@ -136,10 +136,9 @@ void ScriptSystem::scriptExport(void) "setSize", &World::setSize, "getSize", &World::getSize); - - auto gamespace = lua["game"].get_or_create<sol::table>(); - gamespace.set_function("spawn", entitySpawn); - gamespace.set_function("worldRegister", worldRegister); + game = lua["game"].get_or_create<sol::table>(); + game.set_function("spawn", entitySpawn); + game.set_function("worldRegister", worldRegister); } sol::table ScriptSystem::spawn(sol::object param) |