v0.3.1: added fine-grained brightness controls

This commit is contained in:
Evan Debenham
2015-06-26 16:23:56 -04:00
parent 906fe27ea8
commit 8947eabaf0
3 changed files with 14 additions and 17 deletions
@@ -44,7 +44,7 @@ public class WndSettings extends Window {
private static final String TXT_SOUND = "Sound FX";
private static final String TXT_BRIGHTNESS = "Brightness";
private static final String TXT_BRIGHTNESS = "Brightness: %s";
private static final String TXT_QUICKSLOT = "QuickSlots: %s";
@@ -156,16 +156,18 @@ public class WndSettings extends Window {
resize( WIDTH, (int)btnOrientation.bottom() );
} else {
CheckBox btnBrightness = new CheckBox( TXT_BRIGHTNESS ) {
RedButton btnBrightness = new RedButton( Utils.format(TXT_BRIGHTNESS, ShatteredPixelDungeon.brightness()) ) {
@Override
protected void onClick() {
super.onClick();
ShatteredPixelDungeon.brightness(checked());
int brightness = ShatteredPixelDungeon.brightness()+1;
if (brightness == 5) brightness = -2;
ShatteredPixelDungeon.brightness(brightness);
this.text(Utils.format(TXT_BRIGHTNESS, brightness));
}
};
btnBrightness.setRect(0, btnSound.bottom() + GAP, WIDTH, BTN_HEIGHT);
btnBrightness.checked(ShatteredPixelDungeon.brightness());
add(btnBrightness);
RedButton btnQuickSlot = new RedButton( Utils.format(TXT_QUICKSLOT, ShatteredPixelDungeon.quickSlots()) ) {