LunaLua icon indicating copy to clipboard operation
LunaLua copied to clipboard

Add "Audio.MusicGetFilepath" and "Audio.MusicGetFilepathArguments"

Open SolaceEllery opened this issue 1 year ago • 0 comments

2024-06-22 15-27-54

Today, I made a pull request with new functions added: "Audio.MusicGetFilepath" and "Audio.MusicGetFilepathArguments"!

With the functions, you can now see what music is currently playing on the engine, along with getting the SDL Mixer X arguments at the end! The functions should support all of these instances:

  • Level Music (Including custom music on slot 24)
  • World Music (Including, which isn't on the official branch yet, custom music on slot 17)
  • Special Music (P-Switch, Stopwatch, Credits)
  • Music played when sections are seized (Using "Audio.SeizeStream", "Audio.MusicOpen", and "Audio.MusicPlay" in that order)
  • Music played with the Lua function "Audio.MusicChange" (Though the function is just replace the custom music ID filepath and play it)

Here's the function information below:

  • Audio.MusicGetFilepath(shouldHaveArgumentsOrBlank): Gets the current playing music on the engine. If "shouldHaveArgumentsOrBlank" is false or not specified, any SDL Mixer X arguments at the end of the filepath will be removed.
  • Audio.MusicGetFilepathArguments(): Gets the current playing music's SDL Mixer X arguments located at the end of the filepath.

Hope this pull request gets accepted!

SolaceEllery avatar Jan 29 '24 04:01 SolaceEllery