merging 1.7.5 source: windows changes

This commit is contained in:
Evan Debenham
2015-02-06 01:07:22 -05:00
parent 7cc5192839
commit 68406db6fe
18 changed files with 188 additions and 134 deletions
@@ -37,7 +37,7 @@ public class WndGame extends Window {
private static final String TXT_RANKINGS = "Rankings";
private static final String TXT_START = "Start New Game";
private static final String TXT_MENU = "Main Menu";
private static final String TXT_EXIT = "Exit Pixel Dungeon";
private static final String TXT_EXIT = "Exit Game";
private static final String TXT_RETURN = "Return to Game";
private static final int WIDTH = 120;
@@ -93,28 +93,29 @@ public class WndGame extends Window {
}
} );
}
// Main menu
addButton( new RedButton( TXT_MENU ) {
@Override
protected void onClick() {
try {
Dungeon.saveAll();
} catch (IOException e) {
//
addButtons(
// Main menu
new RedButton(TXT_MENU) {
@Override
protected void onClick() {
try {
Dungeon.saveAll();
} catch (IOException e) {
// Do nothing
}
Game.switchScene(TitleScene.class);
}
},
// Quit
new RedButton( TXT_EXIT ) {
@Override
protected void onClick() {
Game.instance.finish();
}
}
Game.switchScene( TitleScene.class );
}
} );
// Exit
addButton( new RedButton( TXT_EXIT ) {
@Override
protected void onClick() {
Game.instance.finish();
}
} );
);
// Cancel
addButton( new RedButton( TXT_RETURN ) {
@Override
@@ -131,4 +132,12 @@ public class WndGame extends Window {
btn.setRect( 0, pos > 0 ? pos += GAP : 0, WIDTH, BTN_HEIGHT );
pos += BTN_HEIGHT;
}
private void addButtons( RedButton btn1, RedButton btn2 ) {
add( btn1 );
btn1.setRect( 0, pos > 0 ? pos += GAP : 0, (WIDTH - GAP) / 2, BTN_HEIGHT );
add( btn2 );
btn2.setRect( btn1.right() + GAP, btn1.top(), WIDTH - btn1.right() - GAP, BTN_HEIGHT );
pos += BTN_HEIGHT;
}
}