From f26de46dc586548d14d1cd4f8033e97abb77c0e8 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 22 Dec 2012 22:56:06 +0100 Subject: [PATCH] Added back/exit button to challenge-main. --- .../Challenge/Languages/Deutsch.xml | 4 + .../Challenge/Languages/English.xml | 4 + .../PartyModes/Challenge/Languages/French.xml | 4 + .../Challenge/Languages/Spanish.xml | 4 + .../Screens/PartyScreenChallengeMain.xml | 276 +++++++++++++++++- Output/Themes/Ambient/Skin Blue.xml | 1 + Output/Themes/Ambient/Skin Green.xml | 1 + Output/Themes/Ambient/Skin Red.xml | 1 + Output/Themes/Ambient/Skin Yellow.xml | 1 + .../PartyScreenChallengeMain.cs | 96 +++++- 10 files changed, 382 insertions(+), 10 deletions(-) diff --git a/Output/PartyModes/Challenge/Languages/Deutsch.xml b/Output/PartyModes/Challenge/Languages/Deutsch.xml index e9fffed4..ce248c0b 100644 --- a/Output/PartyModes/Challenge/Languages/Deutsch.xml +++ b/Output/PartyModes/Challenge/Languages/Deutsch.xml @@ -11,6 +11,9 @@ Weiter Zurück Start + Exit + Ja + Nein Nächste Runde Challenge Modus: Einstellungen @@ -27,5 +30,6 @@ Siege Sing-Punkte Punkte + Challenge-Mode wirklich beenden? diff --git a/Output/PartyModes/Challenge/Languages/English.xml b/Output/PartyModes/Challenge/Languages/English.xml index 9663e2f6..b1cb7a0e 100644 --- a/Output/PartyModes/Challenge/Languages/English.xml +++ b/Output/PartyModes/Challenge/Languages/English.xml @@ -11,6 +11,9 @@ Next Back Start + Exit + Yes + No Next Round Challenge Mode: Configuration @@ -27,5 +30,6 @@ Wins Sing Points Score + Do you really want to exit? diff --git a/Output/PartyModes/Challenge/Languages/French.xml b/Output/PartyModes/Challenge/Languages/French.xml index f6474148..5c4c511c 100644 --- a/Output/PartyModes/Challenge/Languages/French.xml +++ b/Output/PartyModes/Challenge/Languages/French.xml @@ -11,6 +11,9 @@ TODO: Next Retour Démarrer + Quitter + Oui + Non TODO: Next Round TODO: Challenge Mode: Configuration @@ -27,5 +30,6 @@ TODO: Wins TODO: Sing Points TODO: Score + TODO: Do you really want to exit? diff --git a/Output/PartyModes/Challenge/Languages/Spanish.xml b/Output/PartyModes/Challenge/Languages/Spanish.xml index 1632f219..b7b03145 100644 --- a/Output/PartyModes/Challenge/Languages/Spanish.xml +++ b/Output/PartyModes/Challenge/Languages/Spanish.xml @@ -11,6 +11,9 @@ TODO: Next Volver Comenzar + Salir + Sí + No TODO: Next Round TODO: Challenge Mode: Configuration @@ -26,5 +29,6 @@ TODO: Wins TODO: Sing Points TODO: Score + TODO: Do you really want to exit? diff --git a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml index e5a8577f..4d26bd92 100644 --- a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml +++ b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml @@ -29,6 +29,22 @@ + + + PopupBG + + 449 + 261 + -1,00 + 382 + 198 + + + StaticColor + + + + 640 @@ -232,6 +248,36 @@ + + + 640 + 265 + + -1,01 + + 37 + + 380 + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + TR_SCREENMAIN_POPUP_REALLYEXIT + + + + Button @@ -289,5 +335,233 @@ 26 + + + Button + + Button + + 145 + 600 + 0,00 + 150 + 50 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 32 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_BUTTON_BACK + + + + + + 10 + 26 + + + + + + 10 + 26 + + + + + Button + + Button + + 145 + 600 + 0,00 + 150 + 50 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 32 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_BUTTON_EXIT + + + + + + 10 + 26 + + + + + + 10 + 26 + + + + + Button + + Button + + 665 + 360 + -1,01 + 150 + 50 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 32 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_BUTTON_YES + + + + + + 10 + 26 + + + + + + 10 + 26 + + + + + Button + + Button + + 465 + 360 + -1,01 + 150 + 50 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 32 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + TR_BUTTON_NO + + + + + + 10 + 26 + + + + + + 10 + 26 + + - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml index eb483724..f233aa88 100644 --- a/Output/Themes/Ambient/Skin Blue.xml +++ b/Output/Themes/Ambient/Skin Blue.xml @@ -336,6 +336,7 @@ Minus.png Plus.png Random.png + Popup.png [Blue]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Green.xml b/Output/Themes/Ambient/Skin Green.xml index a1865f81..86d67d2b 100644 --- a/Output/Themes/Ambient/Skin Green.xml +++ b/Output/Themes/Ambient/Skin Green.xml @@ -330,6 +330,7 @@ Minus.png Plus.png Random.png + Popup.png [Green]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Red.xml b/Output/Themes/Ambient/Skin Red.xml index cdbaebd4..a1cacc90 100644 --- a/Output/Themes/Ambient/Skin Red.xml +++ b/Output/Themes/Ambient/Skin Red.xml @@ -330,6 +330,7 @@ Minus.png Plus.png Random.png + Popup.png [Red]BG_Video.mp4 diff --git a/Output/Themes/Ambient/Skin Yellow.xml b/Output/Themes/Ambient/Skin Yellow.xml index 22bb6061..6b0dc676 100644 --- a/Output/Themes/Ambient/Skin Yellow.xml +++ b/Output/Themes/Ambient/Skin Yellow.xml @@ -330,6 +330,7 @@ Minus.png Plus.png Random.png + Popup.png [Yellow]BG_Video.mp4 diff --git a/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModeChallenge/PartyScreenChallengeMain.cs index 34d361eb..49339683 100644 --- a/PartyModeChallenge/PartyScreenChallengeMain.cs +++ b/PartyModeChallenge/PartyScreenChallengeMain.cs @@ -29,9 +29,17 @@ namespace Vocaluxe.PartyModes const string TextWon = "TextWon"; const string TextSingPoints = "TextSingPoints"; const string TextGamePoints = "TextGamePoints"; + const string TextPopupReallyExit = "TextPopupReallyExit"; const string ButtonNextRound = "ButtonNextRound"; + const string ButtonBack = "ButtonBack"; + const string ButtonExit = "ButtonExit"; + const string ButtonPopupYes = "ButtonPopupYes"; + const string ButtonPopupNo = "ButtonPopupNo"; + const string StaticPopupBG = "StaticPopupBG"; + + private bool ExitPopupVisible = false; private DataFromScreen Data; private DataToScreenMain GameState; @@ -48,8 +56,9 @@ namespace Vocaluxe.PartyModes base.Init(); _ThemeName = "PartyScreenChallengeMain"; - _ThemeTexts = new string[] { TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints }; - _ThemeButtons = new string[] { "ButtonNextRound" }; + _ThemeTexts = new string[] { TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextPopupReallyExit }; + _ThemeButtons = new string[] { ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo }; + _ThemeStatics = new string[] { StaticPopupBG }; _ScreenVersion = ScreenVersion; } @@ -91,12 +100,32 @@ namespace Vocaluxe.PartyModes { case Keys.Back: case Keys.Escape: - EndParty(); + if (!ExitPopupVisible) + if (GameState.CurrentRoundNr == 1) + Back(); + else + ShowPopup(true); + else + ShowPopup(false); break; case Keys.Enter: - if (Buttons[htButtons(ButtonNextRound)].Selected) - NextRound(); + if (!ExitPopupVisible) + { + if (Buttons[htButtons(ButtonNextRound)].Selected) + NextRound(); + if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) + ShowPopup(true); //Back(); + if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) + ShowPopup(true); + } + else + { + if (Buttons[htButtons(ButtonPopupYes)].Selected) + EndParty(); + if (Buttons[htButtons(ButtonPopupNo)].Selected) + ShowPopup(false); + } break; } } @@ -109,13 +138,33 @@ namespace Vocaluxe.PartyModes if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonNextRound)].Selected) - NextRound(); + if (!ExitPopupVisible) + { + if (Buttons[htButtons(ButtonNextRound)].Selected) + NextRound(); + if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) + Back(); + if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) + ShowPopup(true); + } + else + { + if (Buttons[htButtons(ButtonPopupYes)].Selected) + EndParty(); + if (Buttons[htButtons(ButtonPopupNo)].Selected) + ShowPopup(false); + } } if (MouseEvent.RB) { - EndParty(); + if (!ExitPopupVisible) + if (GameState.CurrentRoundNr == 1) + Back(); + else + ShowPopup(true); + else + ShowPopup(false); } return true; @@ -126,6 +175,19 @@ namespace Vocaluxe.PartyModes base.OnShow(); Updatetable(); + + if (GameState.CurrentRoundNr == 1) + { + Buttons[htButtons(ButtonBack)].Visible = true; + Buttons[htButtons(ButtonExit)].Visible = false; + } + else + { + Buttons[htButtons(ButtonBack)].Visible = false; + Buttons[htButtons(ButtonExit)].Visible = true; + } + + ShowPopup(false); } public override bool UpdateGame() @@ -152,7 +214,23 @@ namespace Vocaluxe.PartyModes private void EndParty() { - //TODO + FadeTo(EScreens.ScreenParty); + } + + private void ShowPopup(bool Visible) + { + ExitPopupVisible = Visible; + + Statics[htStatics(StaticPopupBG)].Visible = ExitPopupVisible; + Texts[htTexts(TextPopupReallyExit)].Visible = ExitPopupVisible; + Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible; + Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible; + + SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]); + } + + private void Back() + { } private void BuildTable()