v0.8.1: limited sfx that play on sound slider, fixed minor slider error
This commit is contained in:
parent
a9679057b3
commit
f72b86df80
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue
Block a user