From f26de46dc586548d14d1cd4f8033e97abb77c0e8 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 22 Dec 2012 22:56:06 +0100 Subject: [PATCH 1/4] 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() From cec33be07ab25a1a04eda62d552bc94c786d6b97 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 22 Dec 2012 23:02:41 +0100 Subject: [PATCH 2/4] Added function to back-button. --- PartyModeChallenge/PartyScreenChallengeMain.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModeChallenge/PartyScreenChallengeMain.cs index 49339683..9cf2e2c0 100644 --- a/PartyModeChallenge/PartyScreenChallengeMain.cs +++ b/PartyModeChallenge/PartyScreenChallengeMain.cs @@ -115,7 +115,7 @@ namespace Vocaluxe.PartyModes if (Buttons[htButtons(ButtonNextRound)].Selected) NextRound(); if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) - ShowPopup(true); //Back(); + Back(); if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) ShowPopup(true); } @@ -231,6 +231,9 @@ namespace Vocaluxe.PartyModes private void Back() { + Data.ScreenMain.FadeToNameSelection = true; + Data.ScreenMain.FadeToSongSelection = false; + _PartyMode.DataFromScreen(_ThemeName, Data); } private void BuildTable() From 07b0878bb367fbbafb4d8689882c1d395639aeb0 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 23 Dec 2012 00:01:03 +0100 Subject: [PATCH 3/4] Added next players to challenge-main. Please check with > 2 mics. --- .../Challenge/Languages/Deutsch.xml | 1 + .../Challenge/Languages/English.xml | 3 +- .../PartyModes/Challenge/Languages/French.xml | 1 + .../Challenge/Languages/Spanish.xml | 1 + .../Screens/PartyScreenChallengeMain.xml | 83 ++++++++++++++++++- .../PartyScreenChallengeMain.cs | 59 ++++++++++++- 6 files changed, 141 insertions(+), 7 deletions(-) diff --git a/Output/PartyModes/Challenge/Languages/Deutsch.xml b/Output/PartyModes/Challenge/Languages/Deutsch.xml index ce248c0b..27a17131 100644 --- a/Output/PartyModes/Challenge/Languages/Deutsch.xml +++ b/Output/PartyModes/Challenge/Languages/Deutsch.xml @@ -31,5 +31,6 @@ Sing-Punkte Punkte Challenge-Mode wirklich beenden? + Spieler der nächsten Runde: diff --git a/Output/PartyModes/Challenge/Languages/English.xml b/Output/PartyModes/Challenge/Languages/English.xml index b1cb7a0e..6b387836 100644 --- a/Output/PartyModes/Challenge/Languages/English.xml +++ b/Output/PartyModes/Challenge/Languages/English.xml @@ -30,6 +30,7 @@ Wins Sing Points Score - Do you really want to exit? + Do you really want to exit? + Player of next round: diff --git a/Output/PartyModes/Challenge/Languages/French.xml b/Output/PartyModes/Challenge/Languages/French.xml index 5c4c511c..3e38ada0 100644 --- a/Output/PartyModes/Challenge/Languages/French.xml +++ b/Output/PartyModes/Challenge/Languages/French.xml @@ -31,5 +31,6 @@ TODO: Sing Points TODO: Score TODO: Do you really want to exit? + TODO: Player of next round: diff --git a/Output/PartyModes/Challenge/Languages/Spanish.xml b/Output/PartyModes/Challenge/Languages/Spanish.xml index b7b03145..45144926 100644 --- a/Output/PartyModes/Challenge/Languages/Spanish.xml +++ b/Output/PartyModes/Challenge/Languages/Spanish.xml @@ -30,5 +30,6 @@ TODO: Sing Points TODO: Score TODO: Do you really want to exit? + TODO: Player of next round: diff --git a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml index 4d26bd92..946b68dc 100644 --- a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml +++ b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml @@ -45,6 +45,22 @@ + + + Invisible + + 0 + 0 + 0,00 + 100 + 100 + + + StaticColor + + + + 640 @@ -74,6 +90,35 @@ + + + 640 + 515 + + 0,00 + + 32 + + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + TR_SCREENMAIN_NEXT_PLAYER + + + + 100 @@ -248,6 +293,36 @@ + + + 0 + 0 + + 0,00 + + 32 + + 100 + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + + + + + 640 @@ -255,7 +330,7 @@ -1,01 - 37 + 32 380 @@ -284,7 +359,7 @@ Button - 985 + 1030 600 0,00 150 @@ -341,7 +416,7 @@ Button - 145 + 100 600 0,00 150 @@ -398,7 +473,7 @@ Button - 145 + 100 600 0,00 150 diff --git a/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModeChallenge/PartyScreenChallengeMain.cs index 9cf2e2c0..3d4be412 100644 --- a/PartyModeChallenge/PartyScreenChallengeMain.cs +++ b/PartyModeChallenge/PartyScreenChallengeMain.cs @@ -29,6 +29,7 @@ namespace Vocaluxe.PartyModes const string TextWon = "TextWon"; const string TextSingPoints = "TextSingPoints"; const string TextGamePoints = "TextGamePoints"; + const string TextNextPlayer = "TextNextPlayer"; const string TextPopupReallyExit = "TextPopupReallyExit"; const string ButtonNextRound = "ButtonNextRound"; @@ -38,6 +39,7 @@ namespace Vocaluxe.PartyModes const string ButtonPopupNo = "ButtonPopupNo"; const string StaticPopupBG = "StaticPopupBG"; + const string StaticNextPlayer = "StaticNextPlayer"; private bool ExitPopupVisible = false; @@ -45,6 +47,9 @@ namespace Vocaluxe.PartyModes private DataToScreenMain GameState; private List Table; + private List NextPlayerTexts; + private List NextPlayerStatics; + public PartyScreenChallengeMain() { Data = new DataFromScreen(); @@ -56,9 +61,9 @@ namespace Vocaluxe.PartyModes base.Init(); _ThemeName = "PartyScreenChallengeMain"; - _ThemeTexts = new string[] { TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextPopupReallyExit }; + _ThemeTexts = new string[] { TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextNextPlayer, TextPopupReallyExit }; _ThemeButtons = new string[] { ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo }; - _ThemeStatics = new string[] { StaticPopupBG }; + _ThemeStatics = new string[] { StaticPopupBG, StaticNextPlayer }; _ScreenVersion = ScreenVersion; } @@ -68,6 +73,17 @@ namespace Vocaluxe.PartyModes GameState = new DataToScreenMain(); BuildTable(); + + NextPlayerTexts = new List(); + NextPlayerStatics = new List(); + + for (int i = 0; i < _PartyMode.GetMaxPlayer(); i++) + { + NextPlayerTexts.Add(GetNewText(Texts[htTexts(TextNextPlayer)])); + AddText(NextPlayerTexts[NextPlayerTexts.Count - 1]); + NextPlayerStatics.Add(GetNewStatic(Statics[htStatics(StaticNextPlayer)])); + AddStatic(NextPlayerStatics[NextPlayerStatics.Count - 1]); + } } public override void DataToScreen(object ReceivedData) @@ -175,6 +191,8 @@ namespace Vocaluxe.PartyModes base.OnShow(); Updatetable(); + UpdateNextPlayerPositions(); + UpdateNextPlayerContents(); if (GameState.CurrentRoundNr == 1) { @@ -236,6 +254,43 @@ namespace Vocaluxe.PartyModes _PartyMode.DataFromScreen(_ThemeName, Data); } + private void UpdateNextPlayerPositions() + { + float x = _Base.Settings.GetRenderW()/2 - ((GameState.NumPlayerAtOnce * Statics[htStatics(StaticNextPlayer)].Rect.W) + ((GameState.NumPlayerAtOnce-1) * 15))/2; + float static_y = 590; + float text_y = 550; + for (int i = 0; i < GameState.NumPlayerAtOnce; i++) + { + //static + NextPlayerStatics[i].Rect.X = x; + NextPlayerStatics[i].Rect.Y = static_y; + NextPlayerStatics[i].Visible = true; + //text + NextPlayerTexts[i].X = x + Statics[htStatics(StaticNextPlayer)].Rect.W / 2; + NextPlayerTexts[i].Y = text_y; + NextPlayerTexts[i].Visible = true; + + x += Statics[htStatics(StaticNextPlayer)].Rect.W + 15; + } + for (int i = GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++) + { + NextPlayerStatics[i].Visible = false; + NextPlayerTexts[i].Visible = false; + } + } + + private void UpdateNextPlayerContents() + { + SProfile[] profiles = _Base.Profiles.GetProfiles(); + for (int i = 0; i < GameState.NumPlayerAtOnce; i++) + { + int pid = GameState.Combs[GameState.CurrentRoundNr].Player[i]; + NextPlayerStatics[i].Texture = profiles[GameState.ProfileIDs[pid]].Avatar.Texture; + NextPlayerTexts[i].Text = profiles[GameState.ProfileIDs[pid]].PlayerName; + NextPlayerTexts[i].Color = _Base.Theme.GetPlayerColor((i+1)); + } + } + private void BuildTable() { Table = new List(); From 9008e7094d927202a823f538376f2b2031c85bdf Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 23 Dec 2012 00:04:40 +0100 Subject: [PATCH 4/4] Fix for last commit. --- PartyModeChallenge/PartyScreenChallengeMain.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModeChallenge/PartyScreenChallengeMain.cs index 3d4be412..911519c0 100644 --- a/PartyModeChallenge/PartyScreenChallengeMain.cs +++ b/PartyModeChallenge/PartyScreenChallengeMain.cs @@ -284,7 +284,7 @@ namespace Vocaluxe.PartyModes SProfile[] profiles = _Base.Profiles.GetProfiles(); for (int i = 0; i < GameState.NumPlayerAtOnce; i++) { - int pid = GameState.Combs[GameState.CurrentRoundNr].Player[i]; + int pid = GameState.Combs[GameState.CurrentRoundNr - 1].Player[i]; NextPlayerStatics[i].Texture = profiles[GameState.ProfileIDs[pid]].Avatar.Texture; NextPlayerTexts[i].Text = profiles[GameState.ProfileIDs[pid]].PlayerName; NextPlayerTexts[i].Color = _Base.Theme.GetPlayerColor((i+1));