This commit is contained in:
Mythril382
2024-05-27 03:35:37 +08:00
committed by GitHub
parent bc2be5de25
commit 7f80a1879e
3 changed files with 43 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
package mindustry.logic;
import arc.*;
import arc.audio.*;
import arc.files.*;
import arc.graphics.*;
import arc.math.*;
@@ -9,6 +10,7 @@ import arc.util.*;
import mindustry.*;
import mindustry.content.*;
import mindustry.ctype.*;
import mindustry.gen.*;
import mindustry.game.*;
import mindustry.logic.LExecutor.*;
import mindustry.type.*;
@@ -35,7 +37,9 @@ public class GlobalVars{
private IntSet privilegedIds = new IntSet();
private UnlockableContent[][] logicIdToContent;
private int[][] contentIdToLogicId;
public static final Seq<String> soundNames = new Seq<>();
public void init(){
putEntryOnly("sectionProcessor");
@@ -89,6 +93,16 @@ public class GlobalVars{
put("@ctrlProcessor", ctrlProcessor);
put("@ctrlPlayer", ctrlPlayer);
put("@ctrlCommand", ctrlCommand);
//sounds
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);
soundNames.put(name);
put("@sfx-" + name, Sounds.getSoundId(sound));
}
}
//store base content