Merging Source v1.7.2: window changes

This commit is contained in:
Evan Debenham
2014-10-20 03:24:59 -04:00
parent 735af276c8
commit 33db534e25
8 changed files with 363 additions and 49 deletions
@@ -21,6 +21,7 @@ import java.io.IOException;
import com.watabou.noosa.Game;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.RankingsScene;
@@ -32,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
public class WndGame extends Window {
private static final String TXT_SETTINGS = "Settings";
private static final String TXT_CHALLEGES = "Challenges";
private static final String TXT_RANKINGS = "Rankings";
private static final String TXT_START = "Start New Game";
private static final String TXT_MENU = "Main Menu";
@@ -55,15 +57,27 @@ public class WndGame extends Window {
GameScene.show( new WndSettings( true ) );
}
} );
// Restart
if (!Dungeon.hero.isAlive()) {
// Challenges window
if (Dungeon.challenges > 0) {
addButton( new RedButton( TXT_CHALLEGES ) {
@Override
protected void onClick() {
hide();
GameScene.show( new WndChallenges( Dungeon.challenges, false ) );
}
} );
}
// Restart
if (!Dungeon.hero.isAlive()) {
RedButton btnStart;
addButton( btnStart = new RedButton( TXT_START ) {
@Override
protected void onClick() {
Dungeon.hero = null;
ShatteredPixelDungeon.challenges( Dungeon.challenges );
InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
InterlevelScene.noStory = true;
Game.switchScene( InterlevelScene.class );