Commit 8607c39d authored by Matyáš Latner's avatar Matyáš Latner

#521 Victory dialog "change game" button text changed to "finish". Finished...

#521 Victory dialog "change game" button text changed to "finish". Finished game go back to game page.
parent 118161c6
......@@ -48,7 +48,7 @@ gamedifficulty_medium=Střední
gamedifficulty_hard=Těžká
victoryscreen_button_replay=Hrát znovu
victoryscreen_button_changegame=Jinou hru
victoryscreen_button_finish=Ukončit
victoryscreen_text_tutorial=Gratuluji! A teď to zkus sám…
victoryscreen_new_trophy=Získáváš trofej!
......
......@@ -48,7 +48,7 @@ gamedifficulty_medium=Mittel
gamedifficulty_hard=Schwierig
victoryscreen_button_replay=Nochmal spielen
victoryscreen_button_changegame=Anderes Spiel
victoryscreen_button_finish=Beenden
victoryscreen_text_tutorial=Gratulation! Und nun versuch es selbst…
victoryscreen_new_trophy=Du erhältst eine Trophäe!
......
......@@ -50,7 +50,7 @@ gamedifficulty_medium=Stredná
gamedifficulty_hard=Ťažká
victoryscreen_button_replay=Hrať znovu
victoryscreen_button_changegame=Inú hru
victoryscreen_button_finish=Ukončiť
victoryscreen_text_tutorial=Gratulujem! A teraz to skús sám…
victoryscreen_new_trophy=Získavaš trofej!
......
......@@ -170,6 +170,8 @@ public abstract class AbstractTablexiaGame<T> extends AbstractTablexiaScreen<T>
public static final String GAME_STATE_GAME_ID = "game_id";
private static final Class<? extends AbstractTablexiaScreen<?>> FALLBACK_RETURN_SCREEN = OfficeMenuScreen.class;
//Lower equals faster (how many seconds does it take from 0% to 100%
private static final float PROGRESS_BAR_SPEED = 1f;
......@@ -646,8 +648,16 @@ public abstract class AbstractTablexiaGame<T> extends AbstractTablexiaScreen<T>
}
}
private void goToGameMenuGamePage() {
ApplicationBus.getInstance().post(new Tablexia.ChangeScreenEvent(OfficeMenuScreen.class, TablexiaApplication.ScreenTransaction.FADE)).asynchronously();
private void goToGamePage() {
Class<? extends AbstractTablexiaScreen<?>> pageClass;
GameDefinition gameDefinition = GameDefinition.getGameDefinitionForClass(getClass());
if (gameDefinition != null) {
pageClass = gameDefinition.getPageClass();
} else {
pageClass = FALLBACK_RETURN_SCREEN;
Log.err(getClass(), "Cannot go back to game page for class: " + getClass());
}
ApplicationBus.getInstance().post(new Tablexia.ChangeScreenEvent(pageClass, TablexiaApplication.ScreenTransaction.FADE)).asynchronously();
}
public TablexiaRandom getRandom() {
......@@ -868,7 +878,7 @@ public abstract class AbstractTablexiaGame<T> extends AbstractTablexiaScreen<T>
//Buttons
adapters.add(new ResizableSpaceContentDialogComponent());
adapters.add(new TwoButtonContentDialogComponent(
ApplicationTextManager.getInstance().getText(ApplicationTextManager.ApplicationTextsAssets.VICTORYSCREEN_BUTTON_CHANGEGAME),
ApplicationTextManager.getInstance().getText(ApplicationTextManager.ApplicationTextsAssets.VICTORYSCREEN_BUTTON_FINISH),
ApplicationTextManager.getInstance().getText(ApplicationTextManager.ApplicationTextsAssets.VICTORYSCREEN_BUTTON_REPLAY),
StandardTablexiaButton.TablexiaButtonType.BLUE,
StandardTablexiaButton.TablexiaButtonType.GREEN,
......@@ -877,7 +887,7 @@ public abstract class AbstractTablexiaGame<T> extends AbstractTablexiaScreen<T>
public void clicked(InputEvent event, float x, float y) {
clearReceivedTrophyDialogs();
hideVictoryDialogAndStars();
goToGameMenuGamePage();
goToGamePage();
}
},
new ClickListener() {
......@@ -1418,7 +1428,7 @@ public abstract class AbstractTablexiaGame<T> extends AbstractTablexiaScreen<T>
else {
hideVictoryDialogAndStars();
clearReceivedTrophyDialogs();
goToGameMenuGamePage();
goToGamePage();
}
}
......
......@@ -41,7 +41,7 @@ public enum GameDefinition implements ApplicationEvent, IMenuItem {
ROBBERY (1, ApplicationTextManager.ApplicationTextsAssets.GAME_ROBBERY_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_ROBBERY_DESCRIPTION, RobberyPageScreen.class, RobberyGame.class, false, new RobberyGame.GameResultResolver(), ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
PURSUIT (2, ApplicationTextManager.ApplicationTextsAssets.GAME_PURSUIT_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_PURSUIT_DESCRIPTION, PursuitPageScreen.class, PursuitGame.class, false, new PursuitGame.GameResultResolver(), ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_DURATION, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_DURATION),
KIDNAPPING (3, ApplicationTextManager.ApplicationTextsAssets.GAME_KIDNAPPING_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_KIDNAPPING_DESCRIPTION, KidnappingPageScreen.class, KidnappingGame.class, false, new KidnappingResultResolver(), ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
NIGHT_WATCH (4, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_DESCRIPTION, NightWatchPageScreen. class, NightWatchGame.class, false, new NightWatchGame.GameResultResolver(), ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
NIGHT_WATCH (4, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_NIGHT_WATCH_DESCRIPTION, NightWatchPageScreen.class, NightWatchGame.class, false, new NightWatchGame.GameResultResolver(), ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
SHOOTING_RANGE (5, ApplicationTextManager.ApplicationTextsAssets.GAME_SHOOTING_RANGE_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_SHOOTING_RANGE_DESCRIPTION, ShootingRangePageScreen.class, ShootingRangeGame.class, false, new ShootingRangeResultResolver(), ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
IN_THE_DARKNESS (6, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_IN_THE_DARKNESS_DESCRIPTION, InTheDarknessPageScreen.class, InTheDarknessGame.class, true, new InTheDarknessGame.GameResultResolver(),ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE_ERROR, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE_ERROR),
RUNES (7, ApplicationTextManager.ApplicationTextsAssets.GAME_RUNES_TITLE, ApplicationTextManager.ApplicationTextsAssets.GAME_RUNES_DESCRIPTION, RunesPageScreen.class, RunesGame.class, false, new RunesGameResultResolver(),ApplicationTextManager.ApplicationTextsAssets.GAME_SCORE, ApplicationTextManager.ApplicationTextsAssets.GAME_AVERAGE_SCORE),
......
......@@ -21,7 +21,7 @@ public class ApplicationTextManager extends TablexiaDataManager<I18NBundle> impl
public static final class ApplicationTextsAssets {
public static final String VICTORYSCREEN_BUTTON_REPLAY = "victoryscreen_button_replay";
public static final String VICTORYSCREEN_BUTTON_CHANGEGAME = "victoryscreen_button_changegame";
public static final String VICTORYSCREEN_BUTTON_FINISH = "victoryscreen_button_finish";
public static final String VICTORYSCREEN_NEW_TROPHY = "victoryscreen_new_trophy";
public static final String USERMENU_NEWUSER = "usermenu_newuser";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment