Removed duplicate code in CMenu
This commit is contained in:
1 parent
d1705147e0
commit
da889c9d40
31 files changed
+1595
-1964
No files matched your search
@@ -98,10 +98,10 @@ namespace Vocaluxe.PartyModes
|
||||
case Keys.Enter:
|
||||
UpdateSlides();
|
||||
|
||||
if (Buttons[htButtons(ButtonBack)].Selected)
|
||||
if (Buttons[ButtonBack].Selected)
|
||||
Back();
|
||||
|
||||
if (Buttons[htButtons(ButtonNext)].Selected)
|
||||
if (Buttons[ButtonNext].Selected)
|
||||
Next();
|
||||
break;
|
||||
|
||||
@@ -124,10 +124,10 @@ namespace Vocaluxe.PartyModes
|
||||
if (MouseEvent.LB && IsMouseOver(MouseEvent))
|
||||
{
|
||||
UpdateSlides();
|
||||
if (Buttons[htButtons(ButtonBack)].Selected)
|
||||
if (Buttons[ButtonBack].Selected)
|
||||
Back();
|
||||
|
||||
if (Buttons[htButtons(ButtonNext)].Selected)
|
||||
if (Buttons[ButtonNext].Selected)
|
||||
Next();
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace Vocaluxe.PartyModes
|
||||
|
||||
public override bool UpdateGame()
|
||||
{
|
||||
Buttons[htButtons(ButtonNext)].Visible = ConfigOk;
|
||||
Buttons[ButtonNext].Visible = ConfigOk;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -170,78 +170,78 @@ namespace Vocaluxe.PartyModes
|
||||
private void FillSlides()
|
||||
{
|
||||
// build num player slide (min player ... max player);
|
||||
SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam1)].Clear();
|
||||
SelectSlides[SelectSlideNumPlayerTeam1].Clear();
|
||||
for (int i = _PartyMode.GetMinPlayer()/2; i <= _PartyMode.GetMaxPlayer() / 2; i++)
|
||||
{
|
||||
SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam1)].AddValue(i.ToString());
|
||||
SelectSlides[SelectSlideNumPlayerTeam1].AddValue(i.ToString());
|
||||
}
|
||||
SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam1)].Selection = Data.ScreenConfig.NumPlayerTeam1 - (_PartyMode.GetMinPlayer()/2);
|
||||
SelectSlides[SelectSlideNumPlayerTeam1].Selection = Data.ScreenConfig.NumPlayerTeam1 - (_PartyMode.GetMinPlayer()/2);
|
||||
|
||||
SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam2)].Clear();
|
||||
SelectSlides[SelectSlideNumPlayerTeam2].Clear();
|
||||
for (int i = _PartyMode.GetMinPlayer()/2; i <= _PartyMode.GetMaxPlayer() / 2; i++)
|
||||
{
|
||||
SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam2)].AddValue(i.ToString());
|
||||
SelectSlides[SelectSlideNumPlayerTeam2].AddValue(i.ToString());
|
||||
}
|
||||
SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam2)].Selection = Data.ScreenConfig.NumPlayerTeam2 -( _PartyMode.GetMinPlayer()/2);
|
||||
SelectSlides[SelectSlideNumPlayerTeam2].Selection = Data.ScreenConfig.NumPlayerTeam2 -( _PartyMode.GetMinPlayer()/2);
|
||||
|
||||
SelectSlides[htSelectSlides(SelectSlideNumFields)].Clear();
|
||||
SelectSlides[htSelectSlides(SelectSlideNumFields)].AddValue("9");
|
||||
SelectSlides[htSelectSlides(SelectSlideNumFields)].AddValue("16");
|
||||
SelectSlides[htSelectSlides(SelectSlideNumFields)].AddValue("25");
|
||||
SelectSlides[SelectSlideNumFields].Clear();
|
||||
SelectSlides[SelectSlideNumFields].AddValue("9");
|
||||
SelectSlides[SelectSlideNumFields].AddValue("16");
|
||||
SelectSlides[SelectSlideNumFields].AddValue("25");
|
||||
if (Data.ScreenConfig.NumFields == 9)
|
||||
SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection = 0;
|
||||
SelectSlides[SelectSlideNumFields].Selection = 0;
|
||||
else if (Data.ScreenConfig.NumFields == 16)
|
||||
SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection = 1;
|
||||
SelectSlides[SelectSlideNumFields].Selection = 1;
|
||||
else if (Data.ScreenConfig.NumFields == 25)
|
||||
SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection = 2;
|
||||
SelectSlides[SelectSlideNumFields].Selection = 2;
|
||||
|
||||
SelectSlides[htSelectSlides(SelectSlideSongSource)].Clear();
|
||||
SelectSlides[htSelectSlides(SelectSlideSongSource)].SetValues<ESongSource>((int)Data.ScreenConfig.SongSource);
|
||||
SelectSlides[SelectSlideSongSource].Clear();
|
||||
SelectSlides[SelectSlideSongSource].SetValues<ESongSource>((int)Data.ScreenConfig.SongSource);
|
||||
|
||||
string[] _Playlists = CBase.Playlist.GetPlaylistNames();
|
||||
SelectSlides[htSelectSlides(SelectSlidePlaylist)].Clear();
|
||||
SelectSlides[SelectSlidePlaylist].Clear();
|
||||
for (int i = 0; i < _Playlists.Length; i++)
|
||||
{
|
||||
string value = _Playlists[i] + " (" + CBase.Playlist.GetPlaylistSongCount(i) + " " + CBase.Language.Translate("TR_SONGS", _PartyModeID) + ")";
|
||||
SelectSlides[htSelectSlides(SelectSlidePlaylist)].AddValue(value);
|
||||
SelectSlides[SelectSlidePlaylist].AddValue(value);
|
||||
}
|
||||
SelectSlides[htSelectSlides(SelectSlidePlaylist)].Selection = Data.ScreenConfig.PlaylistID;
|
||||
SelectSlides[htSelectSlides(SelectSlidePlaylist)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST;
|
||||
SelectSlides[SelectSlidePlaylist].Selection = Data.ScreenConfig.PlaylistID;
|
||||
SelectSlides[SelectSlidePlaylist].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST;
|
||||
|
||||
string[] _Categories = new string[CBase.Songs.GetNumCategories()];
|
||||
for (int i = 0; i < CBase.Songs.GetNumCategories(); i++ )
|
||||
{
|
||||
_Categories[i] = CBase.Songs.GetCategory(i).Name;
|
||||
}
|
||||
SelectSlides[htSelectSlides(SelectSlideCategory)].Clear();
|
||||
SelectSlides[SelectSlideCategory].Clear();
|
||||
for (int i = 0; i < _Categories.Length; i++)
|
||||
{
|
||||
string value = _Categories[i] + " (" + CBase.Songs.NumSongsInCategory(i) + " " + CBase.Language.Translate("TR_SONGS", _PartyModeID) + ")";
|
||||
SelectSlides[htSelectSlides(SelectSlideCategory)].AddValue(value);
|
||||
SelectSlides[SelectSlideCategory].AddValue(value);
|
||||
}
|
||||
SelectSlides[htSelectSlides(SelectSlideCategory)].Selection = Data.ScreenConfig.CategoryID;
|
||||
SelectSlides[htSelectSlides(SelectSlideCategory)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY;
|
||||
SelectSlides[SelectSlideCategory].Selection = Data.ScreenConfig.CategoryID;
|
||||
SelectSlides[SelectSlideCategory].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY;
|
||||
|
||||
SelectSlides[htSelectSlides(SelectSlideGameMode)].Visible = true;
|
||||
SelectSlides[htSelectSlides(SelectSlideGameMode)].SetValues<EPartyGameMode>((int)Data.ScreenConfig.GameMode);
|
||||
SelectSlides[SelectSlideGameMode].Visible = true;
|
||||
SelectSlides[SelectSlideGameMode].SetValues<EPartyGameMode>((int)Data.ScreenConfig.GameMode);
|
||||
}
|
||||
|
||||
private void UpdateSlides()
|
||||
{
|
||||
Data.ScreenConfig.NumPlayerTeam1 = SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam1)].Selection + (_PartyMode.GetMinPlayer()/2);
|
||||
Data.ScreenConfig.NumPlayerTeam2 = SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam2)].Selection + (_PartyMode.GetMinPlayer()/2);
|
||||
Data.ScreenConfig.NumPlayerTeam1 = SelectSlides[SelectSlideNumPlayerTeam1].Selection + (_PartyMode.GetMinPlayer()/2);
|
||||
Data.ScreenConfig.NumPlayerTeam2 = SelectSlides[SelectSlideNumPlayerTeam2].Selection + (_PartyMode.GetMinPlayer()/2);
|
||||
|
||||
if (SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection == 0)
|
||||
if (SelectSlides[SelectSlideNumFields].Selection == 0)
|
||||
Data.ScreenConfig.NumFields = 9;
|
||||
else if (SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection == 1)
|
||||
else if (SelectSlides[SelectSlideNumFields].Selection == 1)
|
||||
Data.ScreenConfig.NumFields = 16;
|
||||
else if (SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection == 2)
|
||||
else if (SelectSlides[SelectSlideNumFields].Selection == 2)
|
||||
Data.ScreenConfig.NumFields = 25;
|
||||
|
||||
Data.ScreenConfig.SongSource = (ESongSource)SelectSlides[htSelectSlides(SelectSlideSongSource)].Selection;
|
||||
Data.ScreenConfig.PlaylistID = SelectSlides[htSelectSlides(SelectSlidePlaylist)].Selection;
|
||||
Data.ScreenConfig.CategoryID = SelectSlides[htSelectSlides(SelectSlideCategory)].Selection;
|
||||
Data.ScreenConfig.GameMode = (EPartyGameMode)SelectSlides[htSelectSlides(SelectSlideGameMode)].Selection;
|
||||
Data.ScreenConfig.SongSource = (ESongSource)SelectSlides[SelectSlideSongSource].Selection;
|
||||
Data.ScreenConfig.PlaylistID = SelectSlides[SelectSlidePlaylist].Selection;
|
||||
Data.ScreenConfig.CategoryID = SelectSlides[SelectSlideCategory].Selection;
|
||||
Data.ScreenConfig.GameMode = (EPartyGameMode)SelectSlides[SelectSlideGameMode].Selection;
|
||||
|
||||
EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
|
||||
@@ -328,8 +328,8 @@ namespace Vocaluxe.PartyModes
|
||||
else
|
||||
ConfigOk = false;
|
||||
}
|
||||
SelectSlides[htSelectSlides(SelectSlideCategory)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY;
|
||||
SelectSlides[htSelectSlides(SelectSlidePlaylist)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST;
|
||||
SelectSlides[SelectSlideCategory].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY;
|
||||
SelectSlides[SelectSlidePlaylist].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST;
|
||||
}
|
||||
|
||||
private void Back()
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Vocaluxe.PartyModes
|
||||
base.LoadTheme(XmlPath);
|
||||
|
||||
CreateFields();
|
||||
Buttons[htButtons(ButtonField)].Visible = false;
|
||||
Buttons[ButtonField].Visible = false;
|
||||
}
|
||||
|
||||
public override void DataToScreen(object ReceivedData)
|
||||
@@ -150,11 +150,11 @@ namespace Vocaluxe.PartyModes
|
||||
case Keys.Enter:
|
||||
if (!ExitPopupVisible)
|
||||
{
|
||||
if (Buttons[htButtons(ButtonNextRound)].Selected)
|
||||
if (Buttons[ButtonNextRound].Selected)
|
||||
NextRound();
|
||||
if (Buttons[htButtons(ButtonBack)].Selected && GameData.CurrentRoundNr == 1 && Status != EStatus.FieldSelected)
|
||||
if (Buttons[ButtonBack].Selected && GameData.CurrentRoundNr == 1 && Status != EStatus.FieldSelected)
|
||||
Back();
|
||||
if (Buttons[htButtons(ButtonExit)].Selected && (GameData.CurrentRoundNr > 1 || Status == EStatus.FieldSelected) && Status != EStatus.None)
|
||||
if (Buttons[ButtonExit].Selected && (GameData.CurrentRoundNr > 1 || Status == EStatus.FieldSelected) && Status != EStatus.None)
|
||||
ShowPopup(true);
|
||||
else if (Status == EStatus.None)
|
||||
EndParty();
|
||||
@@ -181,21 +181,21 @@ namespace Vocaluxe.PartyModes
|
||||
}
|
||||
if (Status == EStatus.FieldSelected)
|
||||
{
|
||||
if (Buttons[htButtons(ButtonJokerRandomT1)].Selected)
|
||||
if (Buttons[ButtonJokerRandomT1].Selected)
|
||||
UseJoker(0, 0);
|
||||
if (Buttons[htButtons(ButtonJokerRandomT2)].Selected)
|
||||
if (Buttons[ButtonJokerRandomT2].Selected)
|
||||
UseJoker(1, 0);
|
||||
if (Buttons[htButtons(ButtonJokerRetryT1)].Selected)
|
||||
if (Buttons[ButtonJokerRetryT1].Selected)
|
||||
UseJoker(0, 1);
|
||||
if (Buttons[htButtons(ButtonJokerRetryT2)].Selected)
|
||||
if (Buttons[ButtonJokerRetryT2].Selected)
|
||||
UseJoker(1, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Buttons[htButtons(ButtonPopupYes)].Selected)
|
||||
if (Buttons[ButtonPopupYes].Selected)
|
||||
EndParty();
|
||||
if (Buttons[htButtons(ButtonPopupNo)].Selected)
|
||||
if (Buttons[ButtonPopupNo].Selected)
|
||||
ShowPopup(false);
|
||||
}
|
||||
break;
|
||||
@@ -212,11 +212,11 @@ namespace Vocaluxe.PartyModes
|
||||
{
|
||||
if (!ExitPopupVisible)
|
||||
{
|
||||
if (Buttons[htButtons(ButtonNextRound)].Selected)
|
||||
if (Buttons[ButtonNextRound].Selected)
|
||||
NextRound();
|
||||
if (Buttons[htButtons(ButtonBack)].Selected)
|
||||
if (Buttons[ButtonBack].Selected)
|
||||
Back();
|
||||
if (Buttons[htButtons(ButtonExit)].Selected)
|
||||
if (Buttons[ButtonExit].Selected)
|
||||
if (Status == EStatus.None)
|
||||
EndParty();
|
||||
else
|
||||
@@ -244,22 +244,22 @@ namespace Vocaluxe.PartyModes
|
||||
}
|
||||
if(Status == EStatus.FieldSelected)
|
||||
{
|
||||
if (Buttons[htButtons(ButtonJokerRandomT1)].Selected)
|
||||
if (Buttons[ButtonJokerRandomT1].Selected)
|
||||
UseJoker(0, 0);
|
||||
if (Buttons[htButtons(ButtonJokerRandomT2)].Selected)
|
||||
if (Buttons[ButtonJokerRandomT2].Selected)
|
||||
UseJoker(1, 0);
|
||||
if (Buttons[htButtons(ButtonJokerRetryT1)].Selected)
|
||||
if (Buttons[ButtonJokerRetryT1].Selected)
|
||||
UseJoker(0, 1);
|
||||
if (Buttons[htButtons(ButtonJokerRetryT2)].Selected)
|
||||
if (Buttons[ButtonJokerRetryT2].Selected)
|
||||
UseJoker(1, 1);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Buttons[htButtons(ButtonPopupYes)].Selected)
|
||||
if (Buttons[ButtonPopupYes].Selected)
|
||||
EndParty();
|
||||
if (Buttons[htButtons(ButtonPopupNo)].Selected)
|
||||
if (Buttons[ButtonPopupNo].Selected)
|
||||
ShowPopup(false);
|
||||
}
|
||||
}
|
||||
@@ -294,15 +294,15 @@ namespace Vocaluxe.PartyModes
|
||||
{
|
||||
BuildWinnerPossibilities();
|
||||
SelectedField = -1;
|
||||
Buttons[htButtons(ButtonBack)].Visible = true;
|
||||
Buttons[htButtons(ButtonExit)].Visible = false;
|
||||
SetInteractionToButton(Buttons[htButtons(ButtonBack)]);
|
||||
Buttons[ButtonBack].Visible = true;
|
||||
Buttons[ButtonExit].Visible = false;
|
||||
SetInteractionToButton(Buttons[ButtonBack]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Buttons[htButtons(ButtonBack)].Visible = false;
|
||||
Buttons[htButtons(ButtonExit)].Visible = true;
|
||||
SetInteractionToButton(Buttons[htButtons(ButtonExit)]);
|
||||
Buttons[ButtonBack].Visible = false;
|
||||
Buttons[ButtonExit].Visible = true;
|
||||
SetInteractionToButton(Buttons[ButtonExit]);
|
||||
}
|
||||
|
||||
Status = EStatus.FieldChoosing;
|
||||
@@ -314,36 +314,36 @@ namespace Vocaluxe.PartyModes
|
||||
if (GameData.CurrentRoundNr <= GameData.NumFields && Winner == 0)
|
||||
{
|
||||
UpdateTeamChoosingMessage();
|
||||
Texts[htTexts(TextNextPlayerT1)].Visible = false;
|
||||
Texts[htTexts(TextNextPlayerT2)].Visible = false;
|
||||
Texts[htTexts(TextNextPlayerNameT1)].Visible = false;
|
||||
Texts[htTexts(TextNextPlayerNameT2)].Visible = false;
|
||||
Statics[htStatics(StaticAvatarT1)].Visible = false;
|
||||
Statics[htStatics(StaticAvatarT2)].Visible = false;
|
||||
Buttons[htButtons(ButtonJokerRandomT1)].Visible = false;
|
||||
Buttons[htButtons(ButtonJokerRandomT2)].Visible = false;
|
||||
Buttons[htButtons(ButtonJokerRetryT1)].Visible = false;
|
||||
Buttons[htButtons(ButtonJokerRetryT2)].Visible = false;
|
||||
Buttons[htButtons(ButtonNextRound)].Visible = false;
|
||||
Texts[htTexts(TextFinishMessage)].Visible = false;
|
||||
Texts[TextNextPlayerT1].Visible = false;
|
||||
Texts[TextNextPlayerT2].Visible = false;
|
||||
Texts[TextNextPlayerNameT1].Visible = false;
|
||||
Texts[TextNextPlayerNameT2].Visible = false;
|
||||
Statics[StaticAvatarT1].Visible = false;
|
||||
Statics[StaticAvatarT2].Visible = false;
|
||||
Buttons[ButtonJokerRandomT1].Visible = false;
|
||||
Buttons[ButtonJokerRandomT2].Visible = false;
|
||||
Buttons[ButtonJokerRetryT1].Visible = false;
|
||||
Buttons[ButtonJokerRetryT2].Visible = false;
|
||||
Buttons[ButtonNextRound].Visible = false;
|
||||
Texts[TextFinishMessage].Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = EStatus.None;
|
||||
Buttons[htButtons(ButtonNextRound)].Visible = false;
|
||||
Texts[htTexts(TextFinishMessage)].Visible = true;
|
||||
Texts[htTexts(TextTeamChoosing)].Visible = false;
|
||||
Buttons[ButtonNextRound].Visible = false;
|
||||
Texts[TextFinishMessage].Visible = true;
|
||||
Texts[TextTeamChoosing].Visible = false;
|
||||
if (Winner > 0)
|
||||
{
|
||||
Texts[htTexts(TextFinishMessage)].Color = CBase.Theme.GetPlayerColor(Winner);
|
||||
Texts[htTexts(TextFinishMessage)].Text = CBase.Language.Translate("TR_SCREENMAIN_WINNER", _PartyModeID) + " " + CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + Winner;
|
||||
Texts[TextFinishMessage].Color = CBase.Theme.GetPlayerColor(Winner);
|
||||
Texts[TextFinishMessage].Text = CBase.Language.Translate("TR_SCREENMAIN_WINNER", _PartyModeID) + " " + CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + Winner;
|
||||
}
|
||||
else
|
||||
{
|
||||
Texts[htTexts(TextFinishMessage)].Color = new SColorF(1, 1, 1, 1);
|
||||
Texts[htTexts(TextFinishMessage)].Text = CBase.Language.Translate("TR_SCREENMAIN_NOWINNER", _PartyModeID);
|
||||
Texts[TextFinishMessage].Color = new SColorF(1, 1, 1, 1);
|
||||
Texts[TextFinishMessage].Text = CBase.Language.Translate("TR_SCREENMAIN_NOWINNER", _PartyModeID);
|
||||
}
|
||||
SetInteractionToButton(Buttons[htButtons(ButtonExit)]);
|
||||
SetInteractionToButton(Buttons[ButtonExit]);
|
||||
}
|
||||
|
||||
ShowPopup(false);
|
||||
@@ -372,7 +372,7 @@ namespace Vocaluxe.PartyModes
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
Field f = new Field();
|
||||
f.Button = GetNewButton(Buttons[htButtons(ButtonField)]);
|
||||
f.Button = GetNewButton(Buttons[ButtonField]);
|
||||
f.Button.Visible = false;
|
||||
f.Content = new Round();
|
||||
AddButton(f.Button);
|
||||
@@ -429,9 +429,9 @@ namespace Vocaluxe.PartyModes
|
||||
for (int i = 0; i < GameData.Rounds.Count; i++)
|
||||
{
|
||||
Fields[i].Button.Enabled = true;
|
||||
Fields[i].Button.Texture = Buttons[htButtons(ButtonField)].Texture;
|
||||
Fields[i].Button.Color = Buttons[htButtons(ButtonField)].Color;
|
||||
Fields[i].Button.SColor = Buttons[htButtons(ButtonField)].SColor;
|
||||
Fields[i].Button.Texture = Buttons[ButtonField].Texture;
|
||||
Fields[i].Button.Color = Buttons[ButtonField].Color;
|
||||
Fields[i].Button.SColor = Buttons[ButtonField].SColor;
|
||||
Fields[i].Content = GameData.Rounds[i];
|
||||
if (Fields[i].Content.Finished)
|
||||
{
|
||||
@@ -500,25 +500,25 @@ namespace Vocaluxe.PartyModes
|
||||
GameData.Rounds[SelectedField].SingerTeam2 = SingerTeam2;
|
||||
UpdateFieldContents();
|
||||
|
||||
Texts[htTexts(TextNextPlayerT1)].Visible = true;
|
||||
Texts[htTexts(TextNextPlayerT2)].Visible = true;
|
||||
Texts[htTexts(TextNextPlayerNameT1)].Visible = true;
|
||||
Texts[htTexts(TextNextPlayerNameT2)].Visible = true;
|
||||
Texts[TextNextPlayerT1].Visible = true;
|
||||
Texts[TextNextPlayerT2].Visible = true;
|
||||
Texts[TextNextPlayerNameT1].Visible = true;
|
||||
Texts[TextNextPlayerNameT2].Visible = true;
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
Texts[htTexts(TextNextPlayerNameT1)].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName;
|
||||
Texts[htTexts(TextNextPlayerNameT2)].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName;
|
||||
Statics[htStatics(StaticAvatarT1)].Visible = true;
|
||||
Statics[htStatics(StaticAvatarT2)].Visible = true;
|
||||
Statics[htStatics(StaticAvatarT1)].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture;
|
||||
Statics[htStatics(StaticAvatarT2)].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture;
|
||||
Texts[TextNextPlayerNameT1].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName;
|
||||
Texts[TextNextPlayerNameT2].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName;
|
||||
Statics[StaticAvatarT1].Visible = true;
|
||||
Statics[StaticAvatarT2].Visible = true;
|
||||
Statics[StaticAvatarT1].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture;
|
||||
Statics[StaticAvatarT2].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture;
|
||||
|
||||
UpdateJokerButtons();
|
||||
|
||||
Buttons[htButtons(ButtonNextRound)].Visible = true;
|
||||
Buttons[htButtons(ButtonExit)].Visible = true;
|
||||
Buttons[htButtons(ButtonBack)].Visible = false;
|
||||
Buttons[ButtonNextRound].Visible = true;
|
||||
Buttons[ButtonExit].Visible = true;
|
||||
Buttons[ButtonBack].Visible = false;
|
||||
|
||||
SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]);
|
||||
SetInteractionToButton(Buttons[ButtonNextRound]);
|
||||
}
|
||||
|
||||
private void FieldSelectedAgain()
|
||||
@@ -539,25 +539,25 @@ namespace Vocaluxe.PartyModes
|
||||
GameData.Rounds[SelectedField].SingerTeam2 = GameData.Rounds[OldSelectedField].SingerTeam2;
|
||||
UpdateFieldContents();
|
||||
|
||||
Texts[htTexts(TextNextPlayerT1)].Visible = true;
|
||||
Texts[htTexts(TextNextPlayerT2)].Visible = true;
|
||||
Texts[htTexts(TextNextPlayerNameT1)].Visible = true;
|
||||
Texts[htTexts(TextNextPlayerNameT2)].Visible = true;
|
||||
Texts[TextNextPlayerT1].Visible = true;
|
||||
Texts[TextNextPlayerT2].Visible = true;
|
||||
Texts[TextNextPlayerNameT1].Visible = true;
|
||||
Texts[TextNextPlayerNameT2].Visible = true;
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
Texts[htTexts(TextNextPlayerNameT1)].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName;
|
||||
Texts[htTexts(TextNextPlayerNameT2)].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName;
|
||||
Statics[htStatics(StaticAvatarT1)].Visible = true;
|
||||
Statics[htStatics(StaticAvatarT2)].Visible = true;
|
||||
Statics[htStatics(StaticAvatarT1)].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture;
|
||||
Statics[htStatics(StaticAvatarT2)].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture;
|
||||
Texts[TextNextPlayerNameT1].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName;
|
||||
Texts[TextNextPlayerNameT2].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName;
|
||||
Statics[StaticAvatarT1].Visible = true;
|
||||
Statics[StaticAvatarT2].Visible = true;
|
||||
Statics[StaticAvatarT1].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture;
|
||||
Statics[StaticAvatarT2].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture;
|
||||
|
||||
UpdateJokerButtons();
|
||||
|
||||
Buttons[htButtons(ButtonNextRound)].Visible = true;
|
||||
Buttons[htButtons(ButtonExit)].Visible = true;
|
||||
Buttons[htButtons(ButtonBack)].Visible = false;
|
||||
Buttons[ButtonNextRound].Visible = true;
|
||||
Buttons[ButtonExit].Visible = true;
|
||||
Buttons[ButtonBack].Visible = false;
|
||||
|
||||
SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]);
|
||||
SetInteractionToButton(Buttons[ButtonNextRound]);
|
||||
}
|
||||
|
||||
private void UseJoker(int TeamNr, int JokerNum)
|
||||
@@ -595,28 +595,28 @@ namespace Vocaluxe.PartyModes
|
||||
|
||||
private void UpdateTeamChoosingMessage()
|
||||
{
|
||||
Texts[htTexts(TextTeamChoosing)].Color = CBase.Theme.GetPlayerColor(GameData.Team + 1);
|
||||
Texts[htTexts(TextTeamChoosing)].Text = CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + (GameData.Team + 1) + "! " + CBase.Language.Translate("TR_SCREENMAIN_TEAM_CHOOSE", _PartyModeID);
|
||||
Texts[TextTeamChoosing].Color = CBase.Theme.GetPlayerColor(GameData.Team + 1);
|
||||
Texts[TextTeamChoosing].Text = CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + (GameData.Team + 1) + "! " + CBase.Language.Translate("TR_SCREENMAIN_TEAM_CHOOSE", _PartyModeID);
|
||||
if (Status == EStatus.JokerRetry || Status == EStatus.FieldChoosing)
|
||||
Texts[htTexts(TextTeamChoosing)].Visible = true;
|
||||
Texts[TextTeamChoosing].Visible = true;
|
||||
else
|
||||
Texts[htTexts(TextTeamChoosing)].Visible = false;
|
||||
Texts[TextTeamChoosing].Visible = false;
|
||||
}
|
||||
|
||||
private void UpdateJokerButtons()
|
||||
{
|
||||
Buttons[htButtons(ButtonJokerRandomT1)].Visible = true;
|
||||
Buttons[htButtons(ButtonJokerRandomT2)].Visible = true;
|
||||
Buttons[htButtons(ButtonJokerRandomT1)].Text.Text = GameData.NumJokerRandom[0].ToString();
|
||||
Buttons[htButtons(ButtonJokerRandomT2)].Text.Text = GameData.NumJokerRandom[1].ToString();
|
||||
Buttons[htButtons(ButtonJokerRandomT1)].Enabled = GameData.NumJokerRandom[0] > 0;
|
||||
Buttons[htButtons(ButtonJokerRandomT2)].Enabled = GameData.NumJokerRandom[1] > 0;
|
||||
Buttons[htButtons(ButtonJokerRetryT1)].Visible = true;
|
||||
Buttons[htButtons(ButtonJokerRetryT2)].Visible = true;
|
||||
Buttons[htButtons(ButtonJokerRetryT1)].Text.Text = GameData.NumJokerRetry[0].ToString();
|
||||
Buttons[htButtons(ButtonJokerRetryT2)].Text.Text = GameData.NumJokerRetry[1].ToString();
|
||||
Buttons[htButtons(ButtonJokerRetryT1)].Enabled = GameData.NumJokerRetry[0] > 0;
|
||||
Buttons[htButtons(ButtonJokerRetryT2)].Enabled = GameData.NumJokerRetry[1] > 0;
|
||||
Buttons[ButtonJokerRandomT1].Visible = true;
|
||||
Buttons[ButtonJokerRandomT2].Visible = true;
|
||||
Buttons[ButtonJokerRandomT1].Text.Text = GameData.NumJokerRandom[0].ToString();
|
||||
Buttons[ButtonJokerRandomT2].Text.Text = GameData.NumJokerRandom[1].ToString();
|
||||
Buttons[ButtonJokerRandomT1].Enabled = GameData.NumJokerRandom[0] > 0;
|
||||
Buttons[ButtonJokerRandomT2].Enabled = GameData.NumJokerRandom[1] > 0;
|
||||
Buttons[ButtonJokerRetryT1].Visible = true;
|
||||
Buttons[ButtonJokerRetryT2].Visible = true;
|
||||
Buttons[ButtonJokerRetryT1].Text.Text = GameData.NumJokerRetry[0].ToString();
|
||||
Buttons[ButtonJokerRetryT2].Text.Text = GameData.NumJokerRetry[1].ToString();
|
||||
Buttons[ButtonJokerRetryT1].Enabled = GameData.NumJokerRetry[0] > 0;
|
||||
Buttons[ButtonJokerRetryT2].Enabled = GameData.NumJokerRetry[1] > 0;
|
||||
}
|
||||
|
||||
private void NextRound()
|
||||
@@ -642,13 +642,13 @@ namespace Vocaluxe.PartyModes
|
||||
{
|
||||
ExitPopupVisible = Visible;
|
||||
|
||||
Statics[htStatics(StaticPopupBG)].Visible = ExitPopupVisible;
|
||||
Texts[htTexts(TextPopupReallyExit)].Visible = ExitPopupVisible;
|
||||
Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible;
|
||||
Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible;
|
||||
Statics[StaticPopupBG].Visible = ExitPopupVisible;
|
||||
Texts[TextPopupReallyExit].Visible = ExitPopupVisible;
|
||||
Buttons[ButtonPopupYes].Visible = ExitPopupVisible;
|
||||
Buttons[ButtonPopupNo].Visible = ExitPopupVisible;
|
||||
|
||||
if (ExitPopupVisible)
|
||||
SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]);
|
||||
SetInteractionToButton(Buttons[ButtonPopupNo]);
|
||||
}
|
||||
|
||||
private void Back()
|
||||
|
||||
@@ -144,16 +144,16 @@ namespace Vocaluxe.PartyModes
|
||||
break;
|
||||
|
||||
case Keys.Enter:
|
||||
if (Buttons[htButtons(ButtonBack)].Selected)
|
||||
if (Buttons[ButtonBack].Selected)
|
||||
Back();
|
||||
|
||||
if (Buttons[htButtons(ButtonNext)].Selected)
|
||||
if (Buttons[ButtonNext].Selected)
|
||||
Next();
|
||||
|
||||
if (Buttons[htButtons(ButtonPlayerChooseScrollUp)].Selected)
|
||||
if (Buttons[ButtonPlayerChooseScrollUp].Selected)
|
||||
Scroll(-1);
|
||||
|
||||
if (Buttons[htButtons(ButtonPlayerChooseScrollDown)].Selected)
|
||||
if (Buttons[ButtonPlayerChooseScrollDown].Selected)
|
||||
Scroll(1);
|
||||
|
||||
if (!OnAdd())
|
||||
@@ -277,16 +277,16 @@ namespace Vocaluxe.PartyModes
|
||||
|
||||
if (MouseEvent.LB && IsMouseOver(MouseEvent))
|
||||
{
|
||||
if (Buttons[htButtons(ButtonBack)].Selected)
|
||||
if (Buttons[ButtonBack].Selected)
|
||||
Back();
|
||||
|
||||
if (Buttons[htButtons(ButtonNext)].Selected)
|
||||
if (Buttons[ButtonNext].Selected)
|
||||
Next();
|
||||
|
||||
if (Buttons[htButtons(ButtonPlayerChooseScrollUp)].Selected)
|
||||
if (Buttons[ButtonPlayerChooseScrollUp].Selected)
|
||||
Scroll(-1);
|
||||
|
||||
if (Buttons[htButtons(ButtonPlayerChooseScrollDown)].Selected)
|
||||
if (Buttons[ButtonPlayerChooseScrollDown].Selected)
|
||||
Scroll(1);
|
||||
}
|
||||
|
||||
@@ -354,13 +354,13 @@ namespace Vocaluxe.PartyModes
|
||||
|
||||
private void AddButtonPlayerDestination()
|
||||
{
|
||||
Buttons[htButtons(ButtonPlayerDestination)].Visible = false;
|
||||
Buttons[ButtonPlayerDestination].Visible = false;
|
||||
PlayerDestinationButtons = new List<CButton>();
|
||||
int row = 0;
|
||||
int column = 0;
|
||||
for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++)
|
||||
{
|
||||
CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerDestination)]);
|
||||
CButton b = GetNewButton(Buttons[ButtonPlayerDestination]);
|
||||
b.Rect.X = PlayerDestinationButtonsFirstX + column * (b.Rect.W + PlayerDestinationButtonsSpaceH);
|
||||
b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW);
|
||||
PlayerDestinationButtons.Add(b);
|
||||
@@ -378,13 +378,13 @@ namespace Vocaluxe.PartyModes
|
||||
|
||||
private void AddButtonPlayerChoose()
|
||||
{
|
||||
Buttons[htButtons(ButtonPlayerChoose)].Visible = false;
|
||||
Buttons[ButtonPlayerChoose].Visible = false;
|
||||
PlayerChooseButtons = new List<CPlayerChooseButton>();
|
||||
int row = 0;
|
||||
int column = 0;
|
||||
for (int i = 1; i <= PlayerChooseButtonsNumH * PlayerChooseButtonsNumW; i++)
|
||||
{
|
||||
CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerChoose)]);
|
||||
CButton b = GetNewButton(Buttons[ButtonPlayerChoose]);
|
||||
b.Rect.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH);
|
||||
b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW);
|
||||
CPlayerChooseButton pcb = new CPlayerChooseButton();
|
||||
@@ -414,8 +414,8 @@ namespace Vocaluxe.PartyModes
|
||||
{
|
||||
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset);
|
||||
}
|
||||
Buttons[htButtons(ButtonPlayerChooseScrollUp)].Enabled = PlayerChooseButtonsOffset > 0;
|
||||
Buttons[htButtons(ButtonPlayerChooseScrollDown)].Enabled = PlayerChooseButtonsVisibleProfiles.Count > PlayerChooseButtons.Count + PlayerChooseButtonsOffset * PlayerChooseButtonsNumH;
|
||||
Buttons[ButtonPlayerChooseScrollUp].Enabled = PlayerChooseButtonsOffset > 0;
|
||||
Buttons[ButtonPlayerChooseScrollDown].Enabled = PlayerChooseButtonsVisibleProfiles.Count > PlayerChooseButtons.Count + PlayerChooseButtonsOffset * PlayerChooseButtonsNumH;
|
||||
}
|
||||
|
||||
private void UpdateButtonPlayerChoose(int Offset)
|
||||
@@ -442,10 +442,10 @@ namespace Vocaluxe.PartyModes
|
||||
{
|
||||
PlayerChooseButtons[i].ProfileID = -1;
|
||||
PlayerChooseButtons[i].Button.Text.Text = String.Empty;
|
||||
PlayerChooseButtons[i].Button.Texture = Buttons[htButtons(ButtonPlayerChoose)].Texture;
|
||||
PlayerChooseButtons[i].Button.STexture = Buttons[htButtons(ButtonPlayerChoose)].STexture;
|
||||
PlayerChooseButtons[i].Button.Color = Buttons[htButtons(ButtonPlayerChoose)].Color;
|
||||
PlayerChooseButtons[i].Button.SColor = Buttons[htButtons(ButtonPlayerChoose)].SColor;
|
||||
PlayerChooseButtons[i].Button.Texture = Buttons[ButtonPlayerChoose].Texture;
|
||||
PlayerChooseButtons[i].Button.STexture = Buttons[ButtonPlayerChoose].STexture;
|
||||
PlayerChooseButtons[i].Button.Color = Buttons[ButtonPlayerChoose].Color;
|
||||
PlayerChooseButtons[i].Button.SColor = Buttons[ButtonPlayerChoose].SColor;
|
||||
PlayerChooseButtons[i].Button.Enabled = false;
|
||||
}
|
||||
}
|
||||
@@ -534,10 +534,10 @@ namespace Vocaluxe.PartyModes
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerDestinationButtons[i].Color = Buttons[htButtons(ButtonPlayerDestination)].Color;
|
||||
PlayerDestinationButtons[i].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor;
|
||||
PlayerDestinationButtons[i].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture;
|
||||
PlayerDestinationButtons[i].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture;
|
||||
PlayerDestinationButtons[i].Color = Buttons[ButtonPlayerDestination].Color;
|
||||
PlayerDestinationButtons[i].SColor = Buttons[ButtonPlayerDestination].SColor;
|
||||
PlayerDestinationButtons[i].Texture = Buttons[ButtonPlayerDestination].Texture;
|
||||
PlayerDestinationButtons[i].STexture = Buttons[ButtonPlayerDestination].STexture;
|
||||
PlayerDestinationButtons[i].Text.Text = String.Empty;
|
||||
PlayerDestinationButtons[i].Enabled = false;
|
||||
}
|
||||
@@ -558,10 +558,10 @@ namespace Vocaluxe.PartyModes
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Color = Buttons[htButtons(ButtonPlayerDestination)].Color;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Color = Buttons[ButtonPlayerDestination].Color;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].SColor = Buttons[ButtonPlayerDestination].SColor;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Texture = Buttons[ButtonPlayerDestination].Texture;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].STexture = Buttons[ButtonPlayerDestination].STexture;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Text.Text = String.Empty;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Enabled = false;
|
||||
}
|
||||
@@ -572,11 +572,11 @@ namespace Vocaluxe.PartyModes
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDsTeam1.Count == NumPlayerTeam1 && Data.ScreenNames.ProfileIDsTeam2.Count == NumPlayerTeam2)
|
||||
{
|
||||
Buttons[htButtons(ButtonNext)].Visible = true;
|
||||
SetInteractionToButton(Buttons[htButtons(ButtonNext)]);
|
||||
Buttons[ButtonNext].Visible = true;
|
||||
SetInteractionToButton(Buttons[ButtonNext]);
|
||||
}
|
||||
else
|
||||
Buttons[htButtons(ButtonNext)].Visible = false;
|
||||
Buttons[ButtonNext].Visible = false;
|
||||
}
|
||||
|
||||
private bool OnAdd()
|
||||
|
||||
Reference in new issue
Block a user