v0.4.3: adjusted some elements of power saver

This commit is contained in:
Evan Debenham 2016-09-30 13:53:36 -04:00
parent debbb57066
commit 250652ac04
3 changed files with 21 additions and 17 deletions

View File

@ -340,8 +340,8 @@ public class ShatteredPixelDungeon extends Game {
int maxZoom = (int)Math.min(dispWidth/renderWidth, dispHeight/renderHeight); int maxZoom = (int)Math.min(dispWidth/renderWidth, dispHeight/renderHeight);
renderWidth *= GameMath.gate( 2, (float)Math.ceil(maxZoom/2f), 4); renderWidth *= Math.max( 2, Math.round(maxZoom/2f));
renderHeight *= GameMath.gate( 2, (float)Math.ceil(maxZoom/2f), 4); renderHeight *= Math.max( 2, Math.round(maxZoom/2f));
if (dispRatio > renderWidth / renderHeight){ if (dispRatio > renderWidth / renderHeight){
renderWidth = renderHeight * dispRatio; renderWidth = renderHeight * dispRatio;

View File

@ -158,20 +158,24 @@ public class WndSettings extends WndTabbed {
@Override @Override
protected void onClick() { protected void onClick() {
super.onClick(); super.onClick();
checked( !checked() ); if (checked()) {
checked(!checked());
ShatteredPixelDungeon.scene().add(new WndOptions( ShatteredPixelDungeon.scene().add(new WndOptions(
Messages.get(ScreenTab.class, "saver"), Messages.get(ScreenTab.class, "saver"),
Messages.get(ScreenTab.class, "saver_desc"), Messages.get(ScreenTab.class, "saver_desc"),
Messages.get(ScreenTab.class, "okay"), Messages.get(ScreenTab.class, "okay"),
Messages.get(ScreenTab.class, "cancel")){ Messages.get(ScreenTab.class, "cancel")) {
@Override @Override
protected void onSelect(int index) { protected void onSelect(int index) {
if (index == 0){ if (index == 0) {
checked( !checked() ); checked(!checked());
ShatteredPixelDungeon.powerSaver(checked()); ShatteredPixelDungeon.powerSaver(checked());
} }
} }
}); });
} else {
ShatteredPixelDungeon.powerSaver(checked());
}
} }
}; };
chkSaver.setRect( 0, chkImmersive.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT ); chkSaver.setRect( 0, chkImmersive.bottom() + GAP_TINY, WIDTH, BTN_HEIGHT );

View File

@ -88,8 +88,8 @@ windows.wndsettings$screentab.brightness=Brightness
windows.wndsettings$screentab.dark=Dark windows.wndsettings$screentab.dark=Dark
windows.wndsettings$screentab.bright=Bright windows.wndsettings$screentab.bright=Bright
windows.wndsettings$screentab.soft_keys=Hide Software Keys windows.wndsettings$screentab.soft_keys=Hide Software Keys
windows.wndsettings$screentab.saver=Power Saver Mode windows.wndsettings$screentab.saver=Power Saver
windows.wndsettings$screentab.saver_desc=Power saver mode draws the game at a reduced size and scales it up to fit your screen.\n\nThis will make the graphics less crisp, but will improve performance and battery life.\n\nYou may need to restart the game for changes to take effect. windows.wndsettings$screentab.saver_desc=Power Saver mode draws the game at a reduced size and scales it up to fit your screen.\n\nThis will make graphics less crisp and enlarge the UI slightly, but will also improve performance and battery life.\n\nYou may need to restart the game for changes to take effect.
windows.wndsettings$screentab.okay=Okay windows.wndsettings$screentab.okay=Okay
windows.wndsettings$screentab.cancel=Cancel windows.wndsettings$screentab.cancel=Cancel
windows.wndsettings$screentab.portrait=Switch to portrait windows.wndsettings$screentab.portrait=Switch to portrait