it's 4:14, i should sleep

anuke was right, this is a mess
This commit is contained in:
Mythril382
2024-05-27 04:13:35 +08:00
committed by GitHub
parent ce56c1df18
commit d24f031cb4

View File

@@ -98,7 +98,10 @@ public class GlobalVars{
for(Sound sound : Core.assets.getAll(Sound.class, new Seq<>(Sound.class))){
if(sound != Sounds.none && sound != Sounds.swish){
String name = sound.toString();
name = name.substring(20, name.length - 4);
int startIndex = name.indexOf("sounds/") + 7;
int endIndex = name.indexOf(".ogg");
if(endIndex == -1) endIndex = name.indexOf(".mp3");
name = name.substring(startIndex, endIndex);
soundNames.put(name);
put("@sfx-" + name, Sounds.getSoundId(sound));
}