Added next players to challenge-main. Please check with > 2 mics.

This commit is contained in:
Florian Kuepper committed 2012-12-23 00:01:03 +01:00
1 parent cec33be07a
commit 07b0878bb3
6 files changed
+141 -7

No files matched your search

+57 -2
View File
@@ -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<TableRow> Table;
private List<CText> NextPlayerTexts;
private List<CStatic> 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<CText>();
NextPlayerStatics = new List<CStatic>();
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<TableRow>();