Load an unlimited amount of sounds

This commit allows the usage of new "extra" sounds in levels for use in
custom level scripting. Including `squid.ogg` inside of your sounds
folder will now allow for the usage of the command `playef(squid)`.
Additionally, you can play built-in sounds by name this way too,
instead of having to memorize the id (`playef(rescue)`).

However, you CANNOT play extra sounds through using their numerical
IDs, since those can shift around depending on the filesystem (or if
someone adds a new sound). Playing an extra sound by ID will NOT play
the sound.

This is another attempt at #902, being loosely based off of that PR.

Co-authored-by: Fussmatte <doormattion@gmail.com>
This commit is contained in:
NyakoFox
2025-04-11 17:16:01 -03:00
committed by Ethan Lee
parent 512a9b7150
commit f73fddea72
3 changed files with 125 additions and 30 deletions
+8 -1
View File
@@ -447,7 +447,14 @@ void scriptclass::run(void)
}
if (words[0] == "playef")
{
music.playef(ss_toi(words[1]));
if (music.soundidexists(words[1].c_str()))
{
music.playefid(words[1].c_str());
}
else if (!music.soundisextra(ss_toi(words[1])))
{
music.playef(ss_toi(words[1]));
}
}
if (words[0] == "play")
{