From 86f0106d0523825549f1e74b835688c78a10cf6c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 17 May 2018 15:34:24 -0400 Subject: Added muxer access to script engine --- src/game.cpp | 6 ------ src/systems/scripting.cpp | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/game.cpp b/src/game.cpp index c76349f..eb57bc6 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1,9 +1,4 @@ #include "game.h" -#include "components/animatable.h" -#include "components/transformable.h" -#include "components/controllable.h" -#include "components/ponderable.h" -#include "components/orientable.h" #include "systems/controlling.h" #include "systems/pondering.h" #include "systems/animating.h" @@ -13,7 +8,6 @@ #include "systems/scheduling.h" #include "systems/realizing.h" #include "systems/scripting.h" -#include "animation.h" #include "consts.h" void key_callback(GLFWwindow* window, int key, int, int action, int) diff --git a/src/systems/scripting.cpp b/src/systems/scripting.cpp index c423558..504224c 100644 --- a/src/systems/scripting.cpp +++ b/src/systems/scripting.cpp @@ -9,6 +9,7 @@ #include "components/automatable.h" #include "systems/realizing.h" #include "vector.h" +#include "muxer.h" struct script_entity { using id_type = EntityManager::id_type; @@ -103,10 +104,12 @@ ScriptingSystem::ScriptingSystem(Game& game) : System(game) engine_.set_function( "realizing", - [&] () { + [&] () -> RealizingSystem& { return game_.getSystemManager().getSystem(); }); + engine_.set_function("playSound", playSound); + engine_.script_file("scripts/common.lua"); engine_.script_file("scripts/movplat.lua"); engine_.script_file("scripts/checkpoint.lua"); -- cgit 1.4.1