From 3992f1911849f94d4887e1201a16bf1779b8f61b Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sun, 23 Dec 2012 14:49:44 +0100 Subject: [PATCH] Auto-focus to NextRound-Button in challenge-main & fix to avoid crash. --- .../PartyScreenChallengeMain.cs | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModeChallenge/PartyScreenChallengeMain.cs index 07ad4834..a4fab9f5 100644 --- a/PartyModeChallenge/PartyScreenChallengeMain.cs +++ b/PartyModeChallenge/PartyScreenChallengeMain.cs @@ -205,6 +205,8 @@ namespace Vocaluxe.PartyModes Buttons[htButtons(ButtonExit)].Visible = true; } + SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); + ShowPopup(false); } @@ -245,7 +247,8 @@ namespace Vocaluxe.PartyModes Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible; Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible; - SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]); + if (ExitPopupVisible) + SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]); } private void Back() @@ -282,13 +285,24 @@ namespace Vocaluxe.PartyModes private void UpdateNextPlayerContents() { - SProfile[] profiles = _Base.Profiles.GetProfiles(); - for (int i = 0; i < GameState.NumPlayerAtOnce; i++) + if (GameState.CurrentRoundNr <= GameState.Combs.Count) { - 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)); + SProfile[] profiles = _Base.Profiles.GetProfiles(); + for (int i = 0; i < GameState.NumPlayerAtOnce; 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)); + } + } + else + { + for (int i = 0; i < GameState.NumPlayerAtOnce; i++) + { + NextPlayerStatics[i].Visible = false; + NextPlayerTexts[i].Visible = false; + } } }