mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-05 18:30:22 -08:00
Compare commits
5 commits
11a7a41648
...
5397d8426c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5397d8426c | ||
|
|
573db7d532 | ||
|
|
b393b053d0 | ||
|
|
28ba7f0bb3 | ||
|
|
3ae1d9c273 |
5 changed files with 59 additions and 2 deletions
|
|
@ -10,6 +10,7 @@ import arc.graphics.g2d.*;
|
|||
import arc.math.*;
|
||||
import arc.util.*;
|
||||
import mindustry.ai.*;
|
||||
import mindustry.audio.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.game.EventType.*;
|
||||
|
|
@ -233,6 +234,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
|||
if(assets.update(1000 / loadingFPS)){
|
||||
loader.dispose();
|
||||
loader = null;
|
||||
SoundPriority.init();
|
||||
for(ApplicationListener listener : modules){
|
||||
listener.init();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,10 @@ public class SoundControl{
|
|||
|
||||
Events.on(ResetEvent.class, e -> {
|
||||
lastPlayed = Time.millis();
|
||||
|
||||
//stop all in-game voices
|
||||
Core.audio.soundBus.stop();
|
||||
Core.audio.soundBus.play();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
51
core/src/mindustry/audio/SoundPriority.java
Normal file
51
core/src/mindustry/audio/SoundPriority.java
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
package mindustry.audio;
|
||||
|
||||
import arc.*;
|
||||
import arc.audio.*;
|
||||
import arc.struct.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
import static mindustry.gen.Sounds.*;
|
||||
|
||||
/** Sets up priorities and groups for various sounds. */
|
||||
public class SoundPriority{
|
||||
|
||||
public static void init(){
|
||||
//priority 2: long weapon loops
|
||||
set(
|
||||
2f,
|
||||
laserbig,
|
||||
beam
|
||||
);
|
||||
|
||||
//priority 1.5: big weapon sounds, not loops
|
||||
set(1.5f,
|
||||
railgun,
|
||||
largeCannon
|
||||
);
|
||||
|
||||
//priority 1: ambient noises
|
||||
set(
|
||||
1f,
|
||||
conveyor,
|
||||
smelter,
|
||||
drill,
|
||||
extractLoop,
|
||||
flux,
|
||||
hum,
|
||||
respawning
|
||||
);
|
||||
|
||||
//this is spammed a LOT
|
||||
Sounds.shootBig.setMinConcurrentInterrupt(shootBig.getLength() * 0.9f);
|
||||
|
||||
for(var sound : Core.assets.getAll(Sound.class, new Seq<>())){
|
||||
sound.setMinConcurrentInterrupt(Math.min(0.25f, sound.getLength() * 0.5f));
|
||||
sound.setMaxConcurrent(7);
|
||||
}
|
||||
}
|
||||
|
||||
static void set(float value, Sound... sounds){
|
||||
for(var s : sounds) s.setPriority(value);
|
||||
}
|
||||
}
|
||||
|
|
@ -26,4 +26,4 @@ org.gradle.caching=true
|
|||
org.gradle.internal.http.socketTimeout=100000
|
||||
org.gradle.internal.http.connectionTimeout=100000
|
||||
android.enableR8.fullMode=false
|
||||
archash=d677d2a72c
|
||||
archash=9b4648505a
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@
|
|||
</forceLinkClasses>
|
||||
<libs>
|
||||
<lib>z</lib>
|
||||
<lib>libs/libarc.a</lib>
|
||||
<lib>libs/libarc-freetype.a</lib>
|
||||
</libs>
|
||||
<frameworks>
|
||||
<framework>arc</framework>
|
||||
<framework>UIKit</framework>
|
||||
<framework>MetalANGLEKit</framework>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue