Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
MCUmbrella committed Dec 4, 2023
1 parent 89fec21 commit 1268bd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/engine/LuaRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ void LuaRuntime::init()
UserdataMetatable<Sound>()
.addFunction("getName", &Sound::getName)
.addFunction("getPath", &Sound::getPath)
.addFunction("reassign", &Sound::reassign)
.addStaticFunction("reassign", [](Sound* instance, const string& path){
return instance->reassign(cfg.userDataPath + "/assets/sounds/" + path);
})
.addFunction("play", &Sound::play)
);

Expand All @@ -258,7 +260,9 @@ void LuaRuntime::init()
UserdataMetatable<Music>()
.addFunction("getName", &Music::getName)
.addFunction("getPath", &Music::getPath)
.addFunction("reassign", &Music::reassign)
.addStaticFunction("reassign", [](Music* instance, const string& path){
return instance->reassign(cfg.userDataPath + "/assets/sounds/" + path);
})
.addFunction("isCurrent", &Music::isCurrent)
.addFunction("play", &Music::play)
.addStaticFunction("pause", &Music::pause)
Expand Down
2 changes: 1 addition & 1 deletion the_engine/data/lua/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ end
function cleanup()
RenderManager.unloadTexture(CURSOR_TEXTURE)
Runtime.log("Placeholder level ended")
end
end

0 comments on commit 1268bd2

Please sign in to comment.