v0.3.1: fixed some bugs relating to display scaling and very small screens

This commit is contained in:
Evan Debenham 2015-07-17 23:47:30 -04:00 committed by Evan Debenham
parent 36ccb6d48d
commit a1e9b10358
4 changed files with 6 additions and 13 deletions

View File

@ -203,7 +203,6 @@ public class ShatteredPixelDungeon extends Game {
public static void scale( int value ) {
Preferences.INSTANCE.put( Preferences.KEY_SCALE, value );
resetScene();
}
// *** IMMERSIVE MODE ****

View File

@ -63,7 +63,11 @@ public abstract class OptionSlider extends Component {
this.minVal = minVal;
this.maxVal = maxVal;
if (minVal > maxVal) throw new IllegalArgumentException();
//really shouldn't display the slider if this happens.
if (minVal > maxVal){
active = false;
visible = false;
}
sliderTicks = new ColorBlock[(maxVal - minVal) + 1];
for (int i = 0; i < sliderTicks.length; i++){

View File

@ -46,6 +46,7 @@ public class WndDisplay extends Window {
@Override
protected void onChange() {
ShatteredPixelDungeon.scale(getSelectedValue());
ShatteredPixelDungeon.resetScene();
}
};
scale.setSelectedValue(PixelScene.defaultZoom);

View File

@ -36,8 +36,6 @@ public class WndSettings extends Window {
private static final int BTN_HEIGHT = 20;
private static final int GAP = 2;
private int setScale = PixelScene.defaultZoom;
public WndSettings() {
super();
@ -77,13 +75,4 @@ public class WndSettings extends Window {
private String orientationText() {
return ShatteredPixelDungeon.landscape() ? TXT_SWITCH_PORT : TXT_SWITCH_LAND;
}
@Override
public void hide() {
super.hide();
if (setScale != PixelScene.defaultZoom) {
ShatteredPixelDungeon.scale(setScale);
ShatteredPixelDungeon.switchScene(TitleScene.class);
}
}
}