v3.2.2: Removed power saver, no longer useful now that we're Android 5+
This commit is contained in:
@@ -51,7 +51,6 @@ public class SPDSettings extends GameSettings {
|
||||
|
||||
public static final String KEY_FULLSCREEN = "fullscreen";
|
||||
public static final String KEY_LANDSCAPE = "landscape";
|
||||
public static final String KEY_POWER_SAVER = "power_saver";
|
||||
public static final String KEY_ZOOM = "zoom";
|
||||
public static final String KEY_BRIGHTNESS = "brightness";
|
||||
public static final String KEY_GRID = "visual_grid";
|
||||
@@ -83,15 +82,6 @@ public class SPDSettings extends GameSettings {
|
||||
}
|
||||
}
|
||||
|
||||
public static void powerSaver( boolean value ){
|
||||
put( KEY_POWER_SAVER, value );
|
||||
((ShatteredPixelDungeon)ShatteredPixelDungeon.instance).updateDisplaySize();
|
||||
}
|
||||
|
||||
public static boolean powerSaver(){
|
||||
return getBoolean( KEY_POWER_SAVER, false );
|
||||
}
|
||||
|
||||
public static void zoom( int value ) {
|
||||
put( KEY_ZOOM, value );
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ public class PixelScene extends Scene {
|
||||
|
||||
public static int defaultZoom = 0;
|
||||
public static int maxDefaultZoom = 0;
|
||||
public static int maxScreenZoom = 0;
|
||||
public static float minZoom;
|
||||
public static float maxZoom;
|
||||
|
||||
@@ -122,7 +121,7 @@ public class PixelScene extends Scene {
|
||||
}
|
||||
|
||||
maxDefaultZoom = (int)Math.min(Game.width/minWidth, Game.height/minHeight);
|
||||
maxScreenZoom = (int)Math.min(Game.dispWidth/minWidth, Game.dispHeight/minHeight);
|
||||
maxDefaultZoom = Math.max(2, maxDefaultZoom);
|
||||
defaultZoom = SPDSettings.scale();
|
||||
|
||||
if (defaultZoom < Math.ceil( Game.density * 2 ) || defaultZoom > maxDefaultZoom){
|
||||
|
||||
@@ -221,7 +221,6 @@ public class WndSettings extends WndTabbed {
|
||||
ColorBlock sep1;
|
||||
CheckBox chkFullscreen;
|
||||
OptionSlider optScale;
|
||||
CheckBox chkSaver;
|
||||
RedButton btnOrientation;
|
||||
ColorBlock sep2;
|
||||
OptionSlider optBrightness;
|
||||
@@ -253,39 +252,7 @@ public class WndSettings extends WndTabbed {
|
||||
}
|
||||
add(chkFullscreen);
|
||||
|
||||
//power saver is being slowly phased out, only show it on old (4.3-) android devices
|
||||
// this is being phased out as the setting is useless on all but very old devices anyway
|
||||
// and support is going to be dropped for 4.3- in the forseeable future
|
||||
if (DeviceCompat.isAndroid() && PixelScene.maxScreenZoom >= 2
|
||||
&& (SPDSettings.powerSaver() || !DeviceCompat.supportsFullScreen())) {
|
||||
chkSaver = new CheckBox(Messages.get(this, "saver")) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
if (checked()) {
|
||||
checked(!checked());
|
||||
ShatteredPixelDungeon.scene().add(new WndOptions(Icons.get(Icons.DISPLAY),
|
||||
Messages.get(DisplayTab.class, "saver"),
|
||||
Messages.get(DisplayTab.class, "saver_desc"),
|
||||
Messages.get(DisplayTab.class, "okay"),
|
||||
Messages.get(DisplayTab.class, "cancel")) {
|
||||
@Override
|
||||
protected void onSelect(int index) {
|
||||
if (index == 0) {
|
||||
checked(!checked());
|
||||
SPDSettings.powerSaver(checked());
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
SPDSettings.powerSaver(checked());
|
||||
}
|
||||
}
|
||||
};
|
||||
chkSaver.checked( SPDSettings.powerSaver() );
|
||||
add( chkSaver );
|
||||
}
|
||||
|
||||
//TODO change to respect auto-rotation when updating Android SDK?
|
||||
if (DeviceCompat.isAndroid()) {
|
||||
Boolean landscape = SPDSettings.landscape();
|
||||
if (landscape == null){
|
||||
@@ -359,19 +326,8 @@ public class WndSettings extends WndTabbed {
|
||||
|
||||
bottom = sep1.y + 1;
|
||||
|
||||
if (width > 200 && chkSaver != null) {
|
||||
chkFullscreen.setRect(0, bottom + GAP, width/2-1, BTN_HEIGHT);
|
||||
chkSaver.setRect(chkFullscreen.right()+ GAP, bottom + GAP, width/2-1, BTN_HEIGHT);
|
||||
bottom = chkFullscreen.bottom();
|
||||
} else {
|
||||
chkFullscreen.setRect(0, bottom + GAP, width, BTN_HEIGHT);
|
||||
bottom = chkFullscreen.bottom();
|
||||
|
||||
if (chkSaver != null) {
|
||||
chkSaver.setRect(0, bottom + GAP, width, BTN_HEIGHT);
|
||||
bottom = chkSaver.bottom();
|
||||
}
|
||||
}
|
||||
chkFullscreen.setRect(0, bottom + GAP, width, BTN_HEIGHT);
|
||||
bottom = chkFullscreen.bottom();
|
||||
|
||||
if (btnOrientation != null) {
|
||||
btnOrientation.setRect(0, bottom + GAP, width, BTN_HEIGHT);
|
||||
|
||||
Reference in New Issue
Block a user