Auto-focus to NextRound-Button in challenge-main & fix to avoid crash.

This commit is contained in:
Florian Kuepper committed 2012-12-23 14:49:44 +01:00
1 parent c5e15aa699
commit 3992f19118
1 file changed
+15 -1
+15 -1
View File
@@ -205,6 +205,8 @@ namespace Vocaluxe.PartyModes
Buttons[htButtons(ButtonExit)].Visible = true; Buttons[htButtons(ButtonExit)].Visible = true;
} }
SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]);
ShowPopup(false); ShowPopup(false);
} }
@@ -245,6 +247,7 @@ namespace Vocaluxe.PartyModes
Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible; Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible;
Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible; Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible;
if (ExitPopupVisible)
SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]); SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]);
} }
@@ -281,6 +284,8 @@ namespace Vocaluxe.PartyModes
} }
private void UpdateNextPlayerContents() private void UpdateNextPlayerContents()
{
if (GameState.CurrentRoundNr <= GameState.Combs.Count)
{ {
SProfile[] profiles = _Base.Profiles.GetProfiles(); SProfile[] profiles = _Base.Profiles.GetProfiles();
for (int i = 0; i < GameState.NumPlayerAtOnce; i++) for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
@@ -288,7 +293,16 @@ namespace Vocaluxe.PartyModes
int pid = GameState.Combs[GameState.CurrentRoundNr - 1].Player[i]; int pid = GameState.Combs[GameState.CurrentRoundNr - 1].Player[i];
NextPlayerStatics[i].Texture = profiles[GameState.ProfileIDs[pid]].Avatar.Texture; NextPlayerStatics[i].Texture = profiles[GameState.ProfileIDs[pid]].Avatar.Texture;
NextPlayerTexts[i].Text = profiles[GameState.ProfileIDs[pid]].PlayerName; NextPlayerTexts[i].Text = profiles[GameState.ProfileIDs[pid]].PlayerName;
NextPlayerTexts[i].Color = _Base.Theme.GetPlayerColor((i+1)); 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;
}
} }
} }