diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/OptionSlider.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/OptionSlider.java index 13b7dd922..e76cb6fb0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/OptionSlider.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/OptionSlider.java @@ -108,7 +108,7 @@ public abstract class OptionSlider extends Component { protected void onPointerDown( PointerEvent event ) { pressed = true; PointF p = camera().screenToCamera((int) event.current.x, (int) event.current.y); - sliderNode.x = GameMath.gate(sliderBG.x-2, p.x, sliderBG.x+sliderBG.width()-2); + sliderNode.x = GameMath.gate(sliderBG.x-2, p.x - sliderNode.width()/2, sliderBG.x+sliderBG.width()-2); sliderNode.brightness(1.5f); } @@ -116,7 +116,7 @@ public abstract class OptionSlider extends Component { protected void onPointerUp( PointerEvent event ) { if (pressed) { PointF p = camera().screenToCamera((int) event.current.x, (int) event.current.y); - sliderNode.x = GameMath.gate(sliderBG.x - 2, p.x, sliderBG.x + sliderBG.width() - 2); + sliderNode.x = GameMath.gate(sliderBG.x - 2, p.x - sliderNode.width()/2, sliderBG.x + sliderBG.width() - 2); sliderNode.resetColor(); //sets the selected value @@ -131,7 +131,7 @@ public abstract class OptionSlider extends Component { protected void onDrag( PointerEvent event ) { if (pressed) { PointF p = camera().screenToCamera((int) event.current.x, (int) event.current.y); - sliderNode.x = GameMath.gate(sliderBG.x - 2, p.x, sliderBG.x + sliderBG.width() - 2); + sliderNode.x = GameMath.gate(sliderBG.x - 2, p.x - sliderNode.width()/2, sliderBG.x + sliderBG.width() - 2); } } }; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSettings.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSettings.java index 633bd63dc..f75bc0f65 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSettings.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSettings.java @@ -352,7 +352,16 @@ public class WndSettings extends WndTabbed { @Override protected void onChange() { SPDSettings.SFXVol(getSelectedValue()); - Sample.INSTANCE.play(Random.element(Assets.Sounds.all)); + if (Random.Int(100) == 0){ + Sample.INSTANCE.play(Assets.Sounds.MIMIC); + } else { + Sample.INSTANCE.play(Random.oneOf(Assets.Sounds.GOLD, + Assets.Sounds.HIT, + Assets.Sounds.ITEM, + Assets.Sounds.SHATTER, + Assets.Sounds.EVOKE, + Assets.Sounds.TELEPORT)); + } } }; SFXVol.setSelectedValue(SPDSettings.SFXVol());