mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-10 23:28:52 +07:00
Removed sound config
This commit is contained in:
parent
e318b6a113
commit
6723479c32
@ -1,10 +1,7 @@
|
||||
package io.anuke.mindustry.core;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.audio.Sound;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.utils.ObjectMap;
|
||||
import com.badlogic.gdx.utils.TimeUtils;
|
||||
import io.anuke.mindustry.content.Mechs;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
@ -42,17 +39,13 @@ import static io.anuke.mindustry.Vars.*;
|
||||
* This class is not created in the headless server.
|
||||
*/
|
||||
public class Control extends Module{
|
||||
/** Minimum period of time between the same sound being played.*/
|
||||
private static final long minSoundPeriod = 100;
|
||||
|
||||
public final Saves saves;
|
||||
public final Unlocks unlocks;
|
||||
|
||||
private Timer timerRPC= new Timer(), timerUnlock = new Timer();
|
||||
private Timer timerRPC = new Timer(), timerUnlock = new Timer();
|
||||
private boolean hiscore = false;
|
||||
private boolean wasPaused = false;
|
||||
private InputHandler[] inputs = {};
|
||||
private ObjectMap<Sound, Long> soundMap = new ObjectMap<>();
|
||||
private Throwable error;
|
||||
|
||||
public Control(){
|
||||
@ -72,17 +65,6 @@ public class Control extends Module{
|
||||
|
||||
unlocks.load();
|
||||
|
||||
Sounds.setFalloff(9000f);
|
||||
Sounds.setPlayer((sound, volume) -> {
|
||||
long time = TimeUtils.millis();
|
||||
long value = soundMap.get(sound, 0L);
|
||||
|
||||
if(TimeUtils.timeSinceMillis(value) >= minSoundPeriod){
|
||||
threads.runGraphics(() -> sound.play(volume));
|
||||
soundMap.put(sound, time);
|
||||
}
|
||||
});
|
||||
|
||||
DefaultKeybinds.load();
|
||||
|
||||
Settings.defaultList(
|
||||
|
Loading…
Reference in New Issue
Block a user