From dd9ef018e7d1b33a797de9998bc2ae60cab5a459 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Mon, 24 Dec 2012 10:50:52 +0100 Subject: [PATCH] Show finish message on challenge-main. --- .../Challenge/Languages/Deutsch.xml | 1 + .../Challenge/Languages/English.xml | 1 + .../PartyModes/Challenge/Languages/French.xml | 1 + .../Challenge/Languages/Spanish.xml | 1 + .../Screens/PartyScreenChallengeMain.xml | 63 ++++++++++++++++++- .../PartyScreenChallengeMain.cs | 43 ++++++++++++- 6 files changed, 105 insertions(+), 5 deletions(-) diff --git a/Output/PartyModes/Challenge/Languages/Deutsch.xml b/Output/PartyModes/Challenge/Languages/Deutsch.xml index 27a17131..cef1250c 100644 --- a/Output/PartyModes/Challenge/Languages/Deutsch.xml +++ b/Output/PartyModes/Challenge/Languages/Deutsch.xml @@ -32,5 +32,6 @@ Punkte Challenge-Mode wirklich beenden? Spieler der nächsten Runde: + Alle Runden wurden gesungen! Und der Gewinner ist... diff --git a/Output/PartyModes/Challenge/Languages/English.xml b/Output/PartyModes/Challenge/Languages/English.xml index 6b387836..c6477146 100644 --- a/Output/PartyModes/Challenge/Languages/English.xml +++ b/Output/PartyModes/Challenge/Languages/English.xml @@ -32,5 +32,6 @@ Score Do you really want to exit? Player of next round: + All rounds were sung! And the winner is... diff --git a/Output/PartyModes/Challenge/Languages/French.xml b/Output/PartyModes/Challenge/Languages/French.xml index 3e38ada0..563d83b5 100644 --- a/Output/PartyModes/Challenge/Languages/French.xml +++ b/Output/PartyModes/Challenge/Languages/French.xml @@ -32,5 +32,6 @@ TODO: Score TODO: Do you really want to exit? TODO: Player of next round: + TODO: All rounds were sung! And the winner is... diff --git a/Output/PartyModes/Challenge/Languages/Spanish.xml b/Output/PartyModes/Challenge/Languages/Spanish.xml index 45144926..d6f7cd0d 100644 --- a/Output/PartyModes/Challenge/Languages/Spanish.xml +++ b/Output/PartyModes/Challenge/Languages/Spanish.xml @@ -31,5 +31,6 @@ TODO: Score TODO: Do you really want to exit? TODO: Player of next round: + TODO: All rounds were sung! And the winner is... diff --git a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml index cbc7ee69..34733ff1 100644 --- a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml +++ b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeMain.xml @@ -90,7 +90,7 @@ - + 640 515 @@ -118,7 +118,66 @@ - + + + + 640 + 520 + + 0,00 + + 50 + + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + TR_SCREENMAIN_FINISH + + + + + + + 640 + 575 + + 0,00 + + 35 + + 770 + + + StaticColor + + + TextSColor + + Center + + Center + + + + Outline + + + + + + 40 diff --git a/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModeChallenge/PartyScreenChallengeMain.cs index 298db4d4..717bc7de 100644 --- a/PartyModeChallenge/PartyScreenChallengeMain.cs +++ b/PartyModeChallenge/PartyScreenChallengeMain.cs @@ -41,6 +41,9 @@ namespace Vocaluxe.PartyModes const string TextRoundPlayer = "TextRoundPlayer"; const string TextRoundScore = "TextRoundScore"; const string TextRoundNumber = "TextRoundNumber"; + const string TextFinishMessage = "TextFinishMessage"; + const string TextFinishPlayerWin = "TextFinishPlayerWin"; + const string TextNextPlayerMessage = "TextNextPlayerMessage"; const string ButtonNextRound = "ButtonNextRound"; const string ButtonBack = "ButtonBack"; @@ -83,7 +86,7 @@ namespace Vocaluxe.PartyModes base.Init(); _ThemeName = "PartyScreenChallengeMain"; - _ThemeTexts = new string[] { TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextNextPlayer, TextPopupReallyExit, TextRoundNumber, TextRoundPlayer, TextRoundScore }; + _ThemeTexts = new string[] { TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextNextPlayer, TextPopupReallyExit, TextRoundNumber, TextRoundPlayer, TextRoundScore, TextFinishMessage, TextFinishPlayerWin, TextNextPlayerMessage }; _ThemeButtons = new string[] { ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo, ButtonPlayerScrollDown, ButtonPlayerScrollUp, ButtonRoundsScrollDown, ButtonRoundsScrollUp }; _ThemeStatics = new string[] { StaticPopupBG, StaticNextPlayer }; _ScreenVersion = ScreenVersion; @@ -259,7 +262,21 @@ namespace Vocaluxe.PartyModes Buttons[htButtons(ButtonExit)].Visible = true; } - SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); + if (GameState.CurrentRoundNr <= GameState.Combs.Count) + { + Buttons[htButtons(ButtonNextRound)].Visible = true; + Texts[htTexts(TextFinishMessage)].Visible = false; + Texts[htTexts(TextFinishPlayerWin)].Visible = false; + SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); + } + else + { + Buttons[htButtons(ButtonNextRound)].Visible = false; + Texts[htTexts(TextFinishMessage)].Visible = true; + Texts[htTexts(TextFinishPlayerWin)].Visible = true; + Texts[htTexts(TextFinishPlayerWin)].Text = GetPlayerWinString(); + SetInteractionToButton(Buttons[htButtons(ButtonExit)]); + } ShowPopup(false); } @@ -341,6 +358,7 @@ namespace Vocaluxe.PartyModes { if (GameState.CurrentRoundNr <= GameState.Combs.Count) { + Texts[htTexts(TextNextPlayerMessage)].Visible = true; SProfile[] profiles = _Base.Profiles.GetProfiles(); for (int i = 0; i < GameState.NumPlayerAtOnce; i++) { @@ -352,6 +370,7 @@ namespace Vocaluxe.PartyModes } else { + Texts[htTexts(TextNextPlayerMessage)].Visible = false; for (int i = 0; i < GameState.NumPlayerAtOnce; i++) { NextPlayerStatics[i].Visible = false; @@ -557,7 +576,7 @@ namespace Vocaluxe.PartyModes row.SingPoints.Visible = true; row.GamePoints.Visible = true; - row.Pos.Text = GameState.ResultTable[i + PlayerTableOffset].Position.ToString(); + row.Pos.Text = GameState.ResultTable[i + PlayerTableOffset].Position.ToString() + "."; row.Name.Text = profiles[GameState.ResultTable[i+PlayerTableOffset].PlayerID].PlayerName; row.Rounds.Text = GameState.ResultTable[i+PlayerTableOffset].NumRounds.ToString(); row.Won.Text = GameState.ResultTable[i+PlayerTableOffset].NumWon.ToString(); @@ -610,5 +629,23 @@ namespace Vocaluxe.PartyModes UpdateRoundsTable(); } + + private string GetPlayerWinString() + { + string s = ""; + SProfile[] profiles = _Base.Profiles.GetProfiles(); + + for (int i = 0; i < GameState.ResultTable.Count; i++) + { + if (i > 0) + s += ", "; + if (GameState.ResultTable[i].Position == 1) + s += profiles[GameState.ResultTable[i].PlayerID].PlayerName; + else + break; + } + + return s; + } } }