mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-07-28 09:59:29 +03:00
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:
@@ -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")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user