summary refs log tree commit diff stats
path: root/src/script_system.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-27 12:05:45 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-27 12:05:45 -0500
commit1656242563d14fa564bab8d4bc40054ab8998553 (patch)
tree872589408ac7aef54b1959dc53b946fbed9dfcaa /src/script_system.cpp
parente644f5c0d769989bd3b0665312c6949d76f5e388 (diff)
downloadtanetane-1656242563d14fa564bab8d4bc40054ab8998553.tar.gz
tanetane-1656242563d14fa564bab8d4bc40054ab8998553.tar.bz2
tanetane-1656242563d14fa564bab8d4bc40054ab8998553.zip
Added background music (defined on a per-map basis)
Diffstat (limited to 'src/script_system.cpp')
-rw-r--r--src/script_system.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/script_system.cpp b/src/script_system.cpp index 1846de2..7f9f908 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp
@@ -97,7 +97,17 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) {
97 "mixer", 97 "mixer",
98 "playSound", &Mixer::playSound, 98 "playSound", &Mixer::playSound,
99 "loopSound", &Mixer::loopSound, 99 "loopSound", &Mixer::loopSound,
100 "stopChannel", &Mixer::stopChannel); 100 "stopChannel", &Mixer::stopChannel,
101 "playMusic", &Mixer::playMusic,
102 "fadeoutMusic", &Mixer::fadeoutMusic,
103 "isPlayingMusic", &Mixer::isPlayingMusic,
104 "getPlayingTrack", &Mixer::getPlayingTrack);
105
106 engine_.new_usertype<Map>(
107 "map",
108 "getWarpPoint", &Map::getWarpPoint,
109 "hasMusic", &Map::hasMusic,
110 "getMusic", &Map::getMusic);
101 111
102 engine_.set_function( 112 engine_.set_function(
103 "message", 113 "message",
@@ -190,9 +200,9 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) {
190 }); 200 });
191 201
192 engine_.set_function( 202 engine_.set_function(
193 "getWarpPoint", 203 "getMap",
194 [&] (std::string warp) { 204 [&] () -> const Map& {
195 return game_.getMap().getWarpPoint(warp); 205 return game_.getMap();
196 }); 206 });
197 207
198 engine_.set_function( 208 engine_.set_function(