v3.0.2: blacksmith sfx now pause if music is paused in BG
This commit is contained in:
@@ -234,6 +234,10 @@ public enum Music {
|
||||
}
|
||||
|
||||
private boolean paused = false;
|
||||
|
||||
public synchronized boolean paused(){
|
||||
return paused;
|
||||
}
|
||||
|
||||
public synchronized void pause() {
|
||||
paused = true;
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.audio.Music;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.particles.Emitter;
|
||||
|
||||
@@ -77,8 +78,10 @@ public class BlacksmithSprite extends MobSprite {
|
||||
|
||||
if (visible && emitter != null && anim == idle) {
|
||||
emitter.burst( Speck.factory( Speck.FORGE ), 3 );
|
||||
float volume = 0.2f / (Dungeon.level.distance( ch.pos, Dungeon.hero.pos ));
|
||||
Sample.INSTANCE.play( Assets.Sounds.EVOKE, volume, volume, 0.8f );
|
||||
if (!Music.INSTANCE.paused()) {
|
||||
float volume = 0.2f / (Dungeon.level.distance(ch.pos, Dungeon.hero.pos));
|
||||
Sample.INSTANCE.play(Assets.Sounds.EVOKE, volume, volume, 0.8f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user