Many cleanups according to ReSharper suggestions (Mostly redundant code)
Minor Bug fixes
This commit is contained in:
1 parent
9aa81b7ba2
commit
dcbbc5caf3
96 files changed
+2702
-3322
No files matched your search
@@ -52,7 +52,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
public int PointsTeam1;
|
||||
public int PointsTeam2;
|
||||
public int Winner;
|
||||
public bool Finished = false;
|
||||
public bool Finished;
|
||||
}
|
||||
|
||||
#region Communication
|
||||
@@ -456,12 +456,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return _ScreenSongOptions;
|
||||
}
|
||||
|
||||
// ReSharper disable RedundantAssignment
|
||||
public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions)
|
||||
// ReSharper restore RedundantAssignment
|
||||
{
|
||||
screenSongOptions = _ScreenSongOptions;
|
||||
}
|
||||
|
||||
// ReSharper disable RedundantAssignment
|
||||
public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions)
|
||||
// ReSharper restore RedundantAssignment
|
||||
{
|
||||
screenSongOptions = _ScreenSongOptions;
|
||||
}
|
||||
@@ -541,99 +545,101 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
private void _PreparePlayerList(int team)
|
||||
{
|
||||
if (team == 0)
|
||||
switch (team)
|
||||
{
|
||||
_GameData.PlayerTeam1 = new List<int>();
|
||||
_GameData.PlayerTeam2 = new List<int>();
|
||||
case 0:
|
||||
{
|
||||
_GameData.PlayerTeam1 = new List<int>();
|
||||
_GameData.PlayerTeam2 = new List<int>();
|
||||
|
||||
//Prepare Player-IDs
|
||||
List<int> iDs1 = new List<int>();
|
||||
List<int> iDs2 = new List<int>();
|
||||
int num = 0;
|
||||
int random = 0;
|
||||
//Add IDs to team-list
|
||||
while (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0] && iDs1.Count == 0 &&
|
||||
_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1] && iDs2.Count == 0)
|
||||
{
|
||||
if (iDs1.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam1; i++)
|
||||
iDs1.Add(i);
|
||||
//Prepare Player-IDs
|
||||
List<int> ids1 = new List<int>();
|
||||
List<int> ids2 = new List<int>();
|
||||
//Add IDs to team-list
|
||||
while (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0] && ids1.Count == 0 &&
|
||||
_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1] && ids2.Count == 0)
|
||||
{
|
||||
if (ids1.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam1; i++)
|
||||
ids1.Add(i);
|
||||
}
|
||||
if (ids2.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam2; i++)
|
||||
ids2.Add(i);
|
||||
}
|
||||
int num;
|
||||
int random;
|
||||
if (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0])
|
||||
{
|
||||
random = CBase.Game.GetRandom((ids1.Count - 1) * 10);
|
||||
num = (int)Math.Round((double)random / 10);
|
||||
if (num >= ids1.Count)
|
||||
num = ids1.Count - 1;
|
||||
_GameData.PlayerTeam1.Add(ids1[num]);
|
||||
ids1.RemoveAt(num);
|
||||
}
|
||||
if (_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1])
|
||||
{
|
||||
random = CBase.Game.GetRandom((ids2.Count - 1) * 20);
|
||||
num = (int)Math.Round((double)random / 20);
|
||||
if (num >= ids2.Count)
|
||||
num = ids2.Count - 1;
|
||||
_GameData.PlayerTeam2.Add(ids2[num]);
|
||||
ids2.RemoveAt(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (iDs2.Count == 0)
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam2; i++)
|
||||
iDs2.Add(i);
|
||||
//Prepare Player-IDs
|
||||
List<int> iDs = new List<int>();
|
||||
//Add IDs to team-list
|
||||
while (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0] && iDs.Count == 0)
|
||||
{
|
||||
if (iDs.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam1; i++)
|
||||
iDs.Add(i);
|
||||
}
|
||||
if (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0])
|
||||
{
|
||||
int random = CBase.Game.GetRandom((iDs.Count - 1) * 10);
|
||||
int num = (int)Math.Round((double)random / 10);
|
||||
if (num >= iDs.Count)
|
||||
num = iDs.Count - 1;
|
||||
_GameData.PlayerTeam1.Add(iDs[num]);
|
||||
iDs.RemoveAt(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0])
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
random = CBase.Game.GetRandom((iDs1.Count - 1) * 10);
|
||||
num = (int)Math.Round((double)random / 10);
|
||||
if (num >= iDs1.Count)
|
||||
num = iDs1.Count - 1;
|
||||
_GameData.PlayerTeam1.Add(iDs1[num]);
|
||||
iDs1.RemoveAt(num);
|
||||
//Prepare Player-IDs
|
||||
List<int> ids = new List<int>();
|
||||
//Add IDs to team-list
|
||||
while (_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1] && ids.Count == 0)
|
||||
{
|
||||
if (ids.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam2; i++)
|
||||
ids.Add(i);
|
||||
}
|
||||
if (_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1])
|
||||
{
|
||||
int random = CBase.Game.GetRandom((ids.Count - 1) * 20);
|
||||
int num = (int)Math.Round((double)random / 20);
|
||||
if (num >= ids.Count)
|
||||
num = ids.Count - 1;
|
||||
_GameData.PlayerTeam2.Add(ids[num]);
|
||||
ids.RemoveAt(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1])
|
||||
{
|
||||
random = CBase.Game.GetRandom((iDs2.Count - 1) * 20);
|
||||
num = (int)Math.Round((double)random / 20);
|
||||
if (num >= iDs2.Count)
|
||||
num = iDs2.Count - 1;
|
||||
_GameData.PlayerTeam2.Add(iDs2[num]);
|
||||
iDs2.RemoveAt(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (team == 1)
|
||||
{
|
||||
//Prepare Player-IDs
|
||||
List<int> iDs = new List<int>();
|
||||
int num = 0;
|
||||
int random = 0;
|
||||
//Add IDs to team-list
|
||||
while (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0] && iDs.Count == 0)
|
||||
{
|
||||
if (iDs.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam1; i++)
|
||||
iDs.Add(i);
|
||||
}
|
||||
if (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0])
|
||||
{
|
||||
random = CBase.Game.GetRandom((iDs.Count - 1) * 10);
|
||||
num = (int)Math.Round((double)random / 10);
|
||||
if (num >= iDs.Count)
|
||||
num = iDs.Count - 1;
|
||||
_GameData.PlayerTeam1.Add(iDs[num]);
|
||||
iDs.RemoveAt(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (team == 2)
|
||||
{
|
||||
//Prepare Player-IDs
|
||||
List<int> iDs = new List<int>();
|
||||
int num = 0;
|
||||
int random = 0;
|
||||
//Add IDs to team-list
|
||||
while (_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1] && iDs.Count == 0)
|
||||
{
|
||||
if (iDs.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam2; i++)
|
||||
iDs.Add(i);
|
||||
}
|
||||
if (_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1])
|
||||
{
|
||||
random = CBase.Game.GetRandom((iDs.Count - 1) * 20);
|
||||
num = (int)Math.Round((double)random / 20);
|
||||
if (num >= iDs.Count)
|
||||
num = iDs.Count - 1;
|
||||
_GameData.PlayerTeam2.Add(iDs[num]);
|
||||
iDs.RemoveAt(num);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -766,8 +772,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
SongSelected(r.SongID);
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
private void _SetNumJokers()
|
||||
|
||||
@@ -70,11 +70,9 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
public override void DataToScreen(object receivedData)
|
||||
{
|
||||
SDataToScreenConfig config = new SDataToScreenConfig();
|
||||
|
||||
try
|
||||
{
|
||||
config = (SDataToScreenConfig)receivedData;
|
||||
SDataToScreenConfig config = (SDataToScreenConfig)receivedData;
|
||||
_Data.ScreenConfig.NumFields = config.NumFields;
|
||||
_Data.ScreenConfig.NumPlayerTeam1 = config.NumPlayerTeam1;
|
||||
_Data.ScreenConfig.NumPlayerTeam2 = config.NumPlayerTeam2;
|
||||
@@ -106,10 +104,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
case Keys.Enter:
|
||||
_UpdateSlides();
|
||||
|
||||
if (Buttons[_ButtonBack].Selected)
|
||||
if (_Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
|
||||
if (Buttons[_ButtonNext].Selected)
|
||||
if (_Buttons[_ButtonNext].Selected)
|
||||
_Next();
|
||||
break;
|
||||
|
||||
@@ -129,13 +127,13 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
base.HandleMouse(mouseEvent);
|
||||
|
||||
if (mouseEvent.LB && IsMouseOver(mouseEvent))
|
||||
if (mouseEvent.LB && _IsMouseOver(mouseEvent))
|
||||
{
|
||||
_UpdateSlides();
|
||||
if (Buttons[_ButtonBack].Selected)
|
||||
if (_Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
|
||||
if (Buttons[_ButtonNext].Selected)
|
||||
if (_Buttons[_ButtonNext].Selected)
|
||||
_Next();
|
||||
}
|
||||
|
||||
@@ -158,7 +156,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
public override bool UpdateGame()
|
||||
{
|
||||
Buttons[_ButtonNext].Visible = _ConfigOk;
|
||||
_Buttons[_ButtonNext].Visible = _ConfigOk;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -171,72 +169,72 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
private void _FillSlides()
|
||||
{
|
||||
// build num player slide (min player ... max player);
|
||||
SelectSlides[_SelectSlideNumPlayerTeam1].Clear();
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam1].Clear();
|
||||
for (int i = _PartyMode.GetMinPlayer() / 2; i <= _PartyMode.GetMaxPlayer() / 2; i++)
|
||||
SelectSlides[_SelectSlideNumPlayerTeam1].AddValue(i.ToString());
|
||||
SelectSlides[_SelectSlideNumPlayerTeam1].Selection = _Data.ScreenConfig.NumPlayerTeam1 - (_PartyMode.GetMinPlayer() / 2);
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam1].AddValue(i.ToString());
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam1].Selection = _Data.ScreenConfig.NumPlayerTeam1 - (_PartyMode.GetMinPlayer() / 2);
|
||||
|
||||
SelectSlides[_SelectSlideNumPlayerTeam2].Clear();
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam2].Clear();
|
||||
for (int i = _PartyMode.GetMinPlayer() / 2; i <= _PartyMode.GetMaxPlayer() / 2; i++)
|
||||
SelectSlides[_SelectSlideNumPlayerTeam2].AddValue(i.ToString());
|
||||
SelectSlides[_SelectSlideNumPlayerTeam2].Selection = _Data.ScreenConfig.NumPlayerTeam2 - (_PartyMode.GetMinPlayer() / 2);
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam2].AddValue(i.ToString());
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam2].Selection = _Data.ScreenConfig.NumPlayerTeam2 - (_PartyMode.GetMinPlayer() / 2);
|
||||
|
||||
SelectSlides[_SelectSlideNumFields].Clear();
|
||||
SelectSlides[_SelectSlideNumFields].AddValue("9");
|
||||
SelectSlides[_SelectSlideNumFields].AddValue("16");
|
||||
SelectSlides[_SelectSlideNumFields].AddValue("25");
|
||||
_SelectSlides[_SelectSlideNumFields].Clear();
|
||||
_SelectSlides[_SelectSlideNumFields].AddValue("9");
|
||||
_SelectSlides[_SelectSlideNumFields].AddValue("16");
|
||||
_SelectSlides[_SelectSlideNumFields].AddValue("25");
|
||||
if (_Data.ScreenConfig.NumFields == 9)
|
||||
SelectSlides[_SelectSlideNumFields].Selection = 0;
|
||||
_SelectSlides[_SelectSlideNumFields].Selection = 0;
|
||||
else if (_Data.ScreenConfig.NumFields == 16)
|
||||
SelectSlides[_SelectSlideNumFields].Selection = 1;
|
||||
_SelectSlides[_SelectSlideNumFields].Selection = 1;
|
||||
else if (_Data.ScreenConfig.NumFields == 25)
|
||||
SelectSlides[_SelectSlideNumFields].Selection = 2;
|
||||
_SelectSlides[_SelectSlideNumFields].Selection = 2;
|
||||
|
||||
SelectSlides[_SelectSlideSongSource].Clear();
|
||||
SelectSlides[_SelectSlideSongSource].SetValues<ESongSource>((int)_Data.ScreenConfig.SongSource);
|
||||
_SelectSlides[_SelectSlideSongSource].Clear();
|
||||
_SelectSlides[_SelectSlideSongSource].SetValues<ESongSource>((int)_Data.ScreenConfig.SongSource);
|
||||
|
||||
string[] playlists = CBase.Playlist.GetPlaylistNames();
|
||||
SelectSlides[_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[_SelectSlidePlaylist].AddValue(value);
|
||||
_SelectSlides[_SelectSlidePlaylist].AddValue(value);
|
||||
}
|
||||
SelectSlides[_SelectSlidePlaylist].Selection = _Data.ScreenConfig.PlaylistID;
|
||||
SelectSlides[_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[_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[_SelectSlideCategory].AddValue(value);
|
||||
_SelectSlides[_SelectSlideCategory].AddValue(value);
|
||||
}
|
||||
SelectSlides[_SelectSlideCategory].Selection = _Data.ScreenConfig.CategoryID;
|
||||
SelectSlides[_SelectSlideCategory].Visible = _Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY;
|
||||
_SelectSlides[_SelectSlideCategory].Selection = _Data.ScreenConfig.CategoryID;
|
||||
_SelectSlides[_SelectSlideCategory].Visible = _Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY;
|
||||
|
||||
SelectSlides[_SelectSlideGameMode].Visible = true;
|
||||
SelectSlides[_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[_SelectSlideNumPlayerTeam1].Selection + (_PartyMode.GetMinPlayer() / 2);
|
||||
_Data.ScreenConfig.NumPlayerTeam2 = SelectSlides[_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[_SelectSlideNumFields].Selection == 0)
|
||||
if (_SelectSlides[_SelectSlideNumFields].Selection == 0)
|
||||
_Data.ScreenConfig.NumFields = 9;
|
||||
else if (SelectSlides[_SelectSlideNumFields].Selection == 1)
|
||||
else if (_SelectSlides[_SelectSlideNumFields].Selection == 1)
|
||||
_Data.ScreenConfig.NumFields = 16;
|
||||
else if (SelectSlides[_SelectSlideNumFields].Selection == 2)
|
||||
else if (_SelectSlides[_SelectSlideNumFields].Selection == 2)
|
||||
_Data.ScreenConfig.NumFields = 25;
|
||||
|
||||
_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;
|
||||
_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;
|
||||
|
||||
@@ -333,8 +331,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
else
|
||||
_ConfigOk = false;
|
||||
}
|
||||
SelectSlides[_SelectSlideCategory].Visible = _Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY;
|
||||
SelectSlides[_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()
|
||||
|
||||
@@ -122,16 +122,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
base.LoadTheme(xmlPath);
|
||||
|
||||
_CreateFields();
|
||||
Buttons[_ButtonField].Visible = false;
|
||||
_Buttons[_ButtonField].Visible = false;
|
||||
}
|
||||
|
||||
public override void DataToScreen(object receivedData)
|
||||
{
|
||||
SDataToScreenMain config = new SDataToScreenMain();
|
||||
|
||||
try
|
||||
{
|
||||
config = (SDataToScreenMain)receivedData;
|
||||
SDataToScreenMain config = (SDataToScreenMain)receivedData;
|
||||
_GameData = config;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -167,11 +165,11 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
case Keys.Enter:
|
||||
if (!_ExitPopupVisible)
|
||||
{
|
||||
if (Buttons[_ButtonNextRound].Selected)
|
||||
if (_Buttons[_ButtonNextRound].Selected)
|
||||
_NextRound();
|
||||
if (Buttons[_ButtonBack].Selected && _GameData.CurrentRoundNr == 1 && _Status != EStatus.FieldSelected)
|
||||
if (_Buttons[_ButtonBack].Selected && _GameData.CurrentRoundNr == 1 && _Status != EStatus.FieldSelected)
|
||||
_Back();
|
||||
if (Buttons[_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();
|
||||
@@ -198,21 +196,21 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
if (_Status == EStatus.FieldSelected)
|
||||
{
|
||||
if (Buttons[_ButtonJokerRandomT1].Selected)
|
||||
if (_Buttons[_ButtonJokerRandomT1].Selected)
|
||||
_UseJoker(0, 0);
|
||||
if (Buttons[_ButtonJokerRandomT2].Selected)
|
||||
if (_Buttons[_ButtonJokerRandomT2].Selected)
|
||||
_UseJoker(1, 0);
|
||||
if (Buttons[_ButtonJokerRetryT1].Selected)
|
||||
if (_Buttons[_ButtonJokerRetryT1].Selected)
|
||||
_UseJoker(0, 1);
|
||||
if (Buttons[_ButtonJokerRetryT2].Selected)
|
||||
if (_Buttons[_ButtonJokerRetryT2].Selected)
|
||||
_UseJoker(1, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Buttons[_ButtonPopupYes].Selected)
|
||||
if (_Buttons[_ButtonPopupYes].Selected)
|
||||
_EndParty();
|
||||
if (Buttons[_ButtonPopupNo].Selected)
|
||||
if (_Buttons[_ButtonPopupNo].Selected)
|
||||
_ShowPopup(false);
|
||||
}
|
||||
break;
|
||||
@@ -225,15 +223,15 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
base.HandleMouse(mouseEvent);
|
||||
|
||||
if (mouseEvent.LB && IsMouseOver(mouseEvent))
|
||||
if (mouseEvent.LB && _IsMouseOver(mouseEvent))
|
||||
{
|
||||
if (!_ExitPopupVisible)
|
||||
{
|
||||
if (Buttons[_ButtonNextRound].Selected)
|
||||
if (_Buttons[_ButtonNextRound].Selected)
|
||||
_NextRound();
|
||||
if (Buttons[_ButtonBack].Selected)
|
||||
if (_Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
if (Buttons[_ButtonExit].Selected)
|
||||
if (_Buttons[_ButtonExit].Selected)
|
||||
{
|
||||
if (_Status == EStatus.None)
|
||||
_EndParty();
|
||||
@@ -263,21 +261,21 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
if (_Status == EStatus.FieldSelected)
|
||||
{
|
||||
if (Buttons[_ButtonJokerRandomT1].Selected)
|
||||
if (_Buttons[_ButtonJokerRandomT1].Selected)
|
||||
_UseJoker(0, 0);
|
||||
if (Buttons[_ButtonJokerRandomT2].Selected)
|
||||
if (_Buttons[_ButtonJokerRandomT2].Selected)
|
||||
_UseJoker(1, 0);
|
||||
if (Buttons[_ButtonJokerRetryT1].Selected)
|
||||
if (_Buttons[_ButtonJokerRetryT1].Selected)
|
||||
_UseJoker(0, 1);
|
||||
if (Buttons[_ButtonJokerRetryT2].Selected)
|
||||
if (_Buttons[_ButtonJokerRetryT2].Selected)
|
||||
_UseJoker(1, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Buttons[_ButtonPopupYes].Selected)
|
||||
if (_Buttons[_ButtonPopupYes].Selected)
|
||||
_EndParty();
|
||||
if (Buttons[_ButtonPopupNo].Selected)
|
||||
if (_Buttons[_ButtonPopupNo].Selected)
|
||||
_ShowPopup(false);
|
||||
}
|
||||
}
|
||||
@@ -312,15 +310,15 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
_BuildWinnerPossibilities();
|
||||
_SelectedField = -1;
|
||||
Buttons[_ButtonBack].Visible = true;
|
||||
Buttons[_ButtonExit].Visible = false;
|
||||
SetInteractionToButton(Buttons[_ButtonBack]);
|
||||
_Buttons[_ButtonBack].Visible = true;
|
||||
_Buttons[_ButtonExit].Visible = false;
|
||||
_SetInteractionToButton(_Buttons[_ButtonBack]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Buttons[_ButtonBack].Visible = false;
|
||||
Buttons[_ButtonExit].Visible = true;
|
||||
SetInteractionToButton(Buttons[_ButtonExit]);
|
||||
_Buttons[_ButtonBack].Visible = false;
|
||||
_Buttons[_ButtonExit].Visible = true;
|
||||
_SetInteractionToButton(_Buttons[_ButtonExit]);
|
||||
}
|
||||
|
||||
_Status = EStatus.FieldChoosing;
|
||||
@@ -332,37 +330,37 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
if (_GameData.CurrentRoundNr <= _GameData.NumFields && winner == 0)
|
||||
{
|
||||
_UpdateTeamChoosingMessage();
|
||||
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;
|
||||
_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[_ButtonNextRound].Visible = false;
|
||||
Texts[_TextFinishMessage].Visible = true;
|
||||
Texts[_TextTeamChoosing].Visible = false;
|
||||
_Buttons[_ButtonNextRound].Visible = false;
|
||||
_Texts[_TextFinishMessage].Visible = true;
|
||||
_Texts[_TextTeamChoosing].Visible = false;
|
||||
if (winner > 0)
|
||||
{
|
||||
Texts[_TextFinishMessage].Color = CBase.Theme.GetPlayerColor(winner);
|
||||
Texts[_TextFinishMessage].Text = CBase.Language.Translate("TR_SCREENMAIN_WINNER", _PartyModeID) + " " + CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " +
|
||||
_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[_TextFinishMessage].Color = new SColorF(1, 1, 1, 1);
|
||||
Texts[_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[_ButtonExit]);
|
||||
_SetInteractionToButton(_Buttons[_ButtonExit]);
|
||||
}
|
||||
|
||||
_ShowPopup(false);
|
||||
@@ -391,10 +389,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
CField f = new CField();
|
||||
f.Button = GetNewButton(Buttons[_ButtonField]);
|
||||
f.Button = GetNewButton(_Buttons[_ButtonField]);
|
||||
f.Button.Visible = false;
|
||||
f.Content = new CRound();
|
||||
AddButton(f.Button);
|
||||
_AddButton(f.Button);
|
||||
_Fields.Add(f);
|
||||
}
|
||||
}
|
||||
@@ -448,9 +446,9 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
for (int i = 0; i < _GameData.Rounds.Count; i++)
|
||||
{
|
||||
_Fields[i].Button.Enabled = true;
|
||||
_Fields[i].Button.Texture = Buttons[_ButtonField].Texture;
|
||||
_Fields[i].Button.Color = Buttons[_ButtonField].Color;
|
||||
_Fields[i].Button.SelColor = Buttons[_ButtonField].SelColor;
|
||||
_Fields[i].Button.Texture = _Buttons[_ButtonField].Texture;
|
||||
_Fields[i].Button.Color = _Buttons[_ButtonField].Color;
|
||||
_Fields[i].Button.SelColor = _Buttons[_ButtonField].SelColor;
|
||||
_Fields[i].Content = _GameData.Rounds[i];
|
||||
if (_Fields[i].Content.Finished)
|
||||
{
|
||||
@@ -515,25 +513,25 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_GameData.Rounds[_SelectedField].SingerTeam2 = singerTeam2;
|
||||
_UpdateFieldContents();
|
||||
|
||||
Texts[_TextNextPlayerT1].Visible = true;
|
||||
Texts[_TextNextPlayerT2].Visible = true;
|
||||
Texts[_TextNextPlayerNameT1].Visible = true;
|
||||
Texts[_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[_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;
|
||||
_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[_ButtonNextRound].Visible = true;
|
||||
Buttons[_ButtonExit].Visible = true;
|
||||
Buttons[_ButtonBack].Visible = false;
|
||||
_Buttons[_ButtonNextRound].Visible = true;
|
||||
_Buttons[_ButtonExit].Visible = true;
|
||||
_Buttons[_ButtonBack].Visible = false;
|
||||
|
||||
SetInteractionToButton(Buttons[_ButtonNextRound]);
|
||||
_SetInteractionToButton(_Buttons[_ButtonNextRound]);
|
||||
}
|
||||
|
||||
private void _FieldSelectedAgain()
|
||||
@@ -554,25 +552,25 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_GameData.Rounds[_SelectedField].SingerTeam2 = _GameData.Rounds[_OldSelectedField].SingerTeam2;
|
||||
_UpdateFieldContents();
|
||||
|
||||
Texts[_TextNextPlayerT1].Visible = true;
|
||||
Texts[_TextNextPlayerT2].Visible = true;
|
||||
Texts[_TextNextPlayerNameT1].Visible = true;
|
||||
Texts[_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[_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;
|
||||
_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[_ButtonNextRound].Visible = true;
|
||||
Buttons[_ButtonExit].Visible = true;
|
||||
Buttons[_ButtonBack].Visible = false;
|
||||
_Buttons[_ButtonNextRound].Visible = true;
|
||||
_Buttons[_ButtonExit].Visible = true;
|
||||
_Buttons[_ButtonBack].Visible = false;
|
||||
|
||||
SetInteractionToButton(Buttons[_ButtonNextRound]);
|
||||
_SetInteractionToButton(_Buttons[_ButtonNextRound]);
|
||||
}
|
||||
|
||||
private void _UseJoker(int teamNr, int jokerNum)
|
||||
@@ -610,29 +608,29 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
private void _UpdateTeamChoosingMessage()
|
||||
{
|
||||
Texts[_TextTeamChoosing].Color = CBase.Theme.GetPlayerColor(_GameData.Team + 1);
|
||||
Texts[_TextTeamChoosing].Text = CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + (_GameData.Team + 1) + "! " +
|
||||
_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[_TextTeamChoosing].Visible = true;
|
||||
_Texts[_TextTeamChoosing].Visible = true;
|
||||
else
|
||||
Texts[_TextTeamChoosing].Visible = false;
|
||||
_Texts[_TextTeamChoosing].Visible = false;
|
||||
}
|
||||
|
||||
private void _UpdateJokerButtons()
|
||||
{
|
||||
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;
|
||||
_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()
|
||||
@@ -658,13 +656,13 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
_ExitPopupVisible = visible;
|
||||
|
||||
Statics[_StaticPopupBG].Visible = _ExitPopupVisible;
|
||||
Texts[_TextPopupReallyExit].Visible = _ExitPopupVisible;
|
||||
Buttons[_ButtonPopupYes].Visible = _ExitPopupVisible;
|
||||
Buttons[_ButtonPopupNo].Visible = _ExitPopupVisible;
|
||||
_Statics[_StaticPopupBG].Visible = _ExitPopupVisible;
|
||||
_Texts[_TextPopupReallyExit].Visible = _ExitPopupVisible;
|
||||
_Buttons[_ButtonPopupYes].Visible = _ExitPopupVisible;
|
||||
_Buttons[_ButtonPopupNo].Visible = _ExitPopupVisible;
|
||||
|
||||
if (_ExitPopupVisible)
|
||||
SetInteractionToButton(Buttons[_ButtonPopupNo]);
|
||||
_SetInteractionToButton(_Buttons[_ButtonPopupNo]);
|
||||
}
|
||||
|
||||
private void _Back()
|
||||
|
||||
@@ -43,7 +43,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
private List<CButton> _PlayerDestinationButtons;
|
||||
//PlayerDestinationButtons-Option
|
||||
private const int _PlayerDestinationButtonsNumH = 10;
|
||||
private const int _PlayerDestinationButtonsNumW = 2;
|
||||
private const int _PlayerDestinationButtonsFirstX = 58;
|
||||
private const int _PlayerDestinationButtonsFirstY = 380;
|
||||
private const int _PlayerDestinationButtonsSpaceH = 15;
|
||||
@@ -102,11 +101,9 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
public override void DataToScreen(object receivedData)
|
||||
{
|
||||
SDataToScreenNames config = new SDataToScreenNames();
|
||||
|
||||
try
|
||||
{
|
||||
config = (SDataToScreenNames)receivedData;
|
||||
SDataToScreenNames config = (SDataToScreenNames)receivedData;
|
||||
_Data.ScreenNames.ProfileIDsTeam1 = config.ProfileIDsTeam1;
|
||||
_Data.ScreenNames.ProfileIDsTeam2 = config.ProfileIDsTeam2;
|
||||
if (_Data.ScreenNames.ProfileIDsTeam1 == null)
|
||||
@@ -143,16 +140,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
break;
|
||||
|
||||
case Keys.Enter:
|
||||
if (Buttons[_ButtonBack].Selected)
|
||||
if (_Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
|
||||
if (Buttons[_ButtonNext].Selected)
|
||||
if (_Buttons[_ButtonNext].Selected)
|
||||
_Next();
|
||||
|
||||
if (Buttons[_ButtonPlayerChooseScrollUp].Selected)
|
||||
if (_Buttons[_ButtonPlayerChooseScrollUp].Selected)
|
||||
_Scroll(-1);
|
||||
|
||||
if (Buttons[_ButtonPlayerChooseScrollDown].Selected)
|
||||
if (_Buttons[_ButtonPlayerChooseScrollDown].Selected)
|
||||
_Scroll(1);
|
||||
|
||||
if (!_OnAdd())
|
||||
@@ -274,22 +271,22 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mouseEvent.LB && IsMouseOver(mouseEvent))
|
||||
if (mouseEvent.LB && _IsMouseOver(mouseEvent))
|
||||
{
|
||||
if (Buttons[_ButtonBack].Selected)
|
||||
if (_Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
|
||||
if (Buttons[_ButtonNext].Selected)
|
||||
if (_Buttons[_ButtonNext].Selected)
|
||||
_Next();
|
||||
|
||||
if (Buttons[_ButtonPlayerChooseScrollUp].Selected)
|
||||
if (_Buttons[_ButtonPlayerChooseScrollUp].Selected)
|
||||
_Scroll(-1);
|
||||
|
||||
if (Buttons[_ButtonPlayerChooseScrollDown].Selected)
|
||||
if (_Buttons[_ButtonPlayerChooseScrollDown].Selected)
|
||||
_Scroll(1);
|
||||
}
|
||||
|
||||
if (mouseEvent.LD && IsMouseOver(mouseEvent))
|
||||
if (mouseEvent.LD && _IsMouseOver(mouseEvent))
|
||||
{
|
||||
if (!_OnAdd())
|
||||
_OnRemove();
|
||||
@@ -347,13 +344,13 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
private void _AddButtonPlayerDestination()
|
||||
{
|
||||
Buttons[_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[_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);
|
||||
@@ -365,19 +362,19 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
b.Visible = true;
|
||||
b.Enabled = false;
|
||||
AddButton(b);
|
||||
_AddButton(b);
|
||||
}
|
||||
}
|
||||
|
||||
private void _AddButtonPlayerChoose()
|
||||
{
|
||||
Buttons[_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[_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();
|
||||
@@ -392,7 +389,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
b.Visible = true;
|
||||
b.Enabled = false;
|
||||
AddButton(b);
|
||||
_AddButton(b);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,8 +401,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_UpdateButtonPlayerChoose(_PlayerChooseButtonsOffset - 1);
|
||||
else
|
||||
_UpdateButtonPlayerChoose(_PlayerChooseButtonsOffset);
|
||||
Buttons[_ButtonPlayerChooseScrollUp].Enabled = _PlayerChooseButtonsOffset > 0;
|
||||
Buttons[_ButtonPlayerChooseScrollDown].Enabled = _PlayerChooseButtonsVisibleProfiles.Count >
|
||||
_Buttons[_ButtonPlayerChooseScrollUp].Enabled = _PlayerChooseButtonsOffset > 0;
|
||||
_Buttons[_ButtonPlayerChooseScrollDown].Enabled = _PlayerChooseButtonsVisibleProfiles.Count >
|
||||
_PlayerChooseButtons.Count + _PlayerChooseButtonsOffset * _PlayerChooseButtonsNumH;
|
||||
}
|
||||
|
||||
@@ -435,10 +432,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
_PlayerChooseButtons[i].ProfileID = -1;
|
||||
_PlayerChooseButtons[i].Button.Text.Text = String.Empty;
|
||||
_PlayerChooseButtons[i].Button.Texture = Buttons[_ButtonPlayerChoose].Texture;
|
||||
_PlayerChooseButtons[i].Button.SelTexture = Buttons[_ButtonPlayerChoose].SelTexture;
|
||||
_PlayerChooseButtons[i].Button.Color = Buttons[_ButtonPlayerChoose].Color;
|
||||
_PlayerChooseButtons[i].Button.SelColor = Buttons[_ButtonPlayerChoose].SelColor;
|
||||
_PlayerChooseButtons[i].Button.Texture = _Buttons[_ButtonPlayerChoose].Texture;
|
||||
_PlayerChooseButtons[i].Button.SelTexture = _Buttons[_ButtonPlayerChoose].SelTexture;
|
||||
_PlayerChooseButtons[i].Button.Color = _Buttons[_ButtonPlayerChoose].Color;
|
||||
_PlayerChooseButtons[i].Button.SelColor = _Buttons[_ButtonPlayerChoose].SelColor;
|
||||
_PlayerChooseButtons[i].Button.Enabled = false;
|
||||
}
|
||||
}
|
||||
@@ -525,10 +522,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
else
|
||||
{
|
||||
_PlayerDestinationButtons[i].Color = Buttons[_ButtonPlayerDestination].Color;
|
||||
_PlayerDestinationButtons[i].SelColor = Buttons[_ButtonPlayerDestination].SelColor;
|
||||
_PlayerDestinationButtons[i].Texture = Buttons[_ButtonPlayerDestination].Texture;
|
||||
_PlayerDestinationButtons[i].SelTexture = Buttons[_ButtonPlayerDestination].SelTexture;
|
||||
_PlayerDestinationButtons[i].Color = _Buttons[_ButtonPlayerDestination].Color;
|
||||
_PlayerDestinationButtons[i].SelColor = _Buttons[_ButtonPlayerDestination].SelColor;
|
||||
_PlayerDestinationButtons[i].Texture = _Buttons[_ButtonPlayerDestination].Texture;
|
||||
_PlayerDestinationButtons[i].SelTexture = _Buttons[_ButtonPlayerDestination].SelTexture;
|
||||
_PlayerDestinationButtons[i].Text.Text = String.Empty;
|
||||
_PlayerDestinationButtons[i].Enabled = false;
|
||||
}
|
||||
@@ -549,10 +546,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
else
|
||||
{
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Color = Buttons[_ButtonPlayerDestination].Color;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].SelColor = Buttons[_ButtonPlayerDestination].SelColor;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Texture = Buttons[_ButtonPlayerDestination].Texture;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].SelTexture = Buttons[_ButtonPlayerDestination].SelTexture;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Color = _Buttons[_ButtonPlayerDestination].Color;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].SelColor = _Buttons[_ButtonPlayerDestination].SelColor;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Texture = _Buttons[_ButtonPlayerDestination].Texture;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].SelTexture = _Buttons[_ButtonPlayerDestination].SelTexture;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Text.Text = String.Empty;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Enabled = false;
|
||||
}
|
||||
@@ -563,11 +560,11 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
if (_Data.ScreenNames.ProfileIDsTeam1.Count == _NumPlayerTeam1 && _Data.ScreenNames.ProfileIDsTeam2.Count == _NumPlayerTeam2)
|
||||
{
|
||||
Buttons[_ButtonNext].Visible = true;
|
||||
SetInteractionToButton(Buttons[_ButtonNext]);
|
||||
_Buttons[_ButtonNext].Visible = true;
|
||||
_SetInteractionToButton(_Buttons[_ButtonNext]);
|
||||
}
|
||||
else
|
||||
Buttons[_ButtonNext].Visible = false;
|
||||
_Buttons[_ButtonNext].Visible = false;
|
||||
}
|
||||
|
||||
private bool _OnAdd()
|
||||
@@ -590,7 +587,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_PlayerDestinationButtons[added].Enabled = true;
|
||||
//Update Tiles-List
|
||||
_UpdateButtonPlayerChoose();
|
||||
CheckInteraction();
|
||||
_CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
else if (_Data.ScreenNames.ProfileIDsTeam2.Count < _NumPlayerTeam2)
|
||||
@@ -607,7 +604,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_PlayerDestinationButtons[added].Enabled = true;
|
||||
//Update Tiles-List
|
||||
_UpdateButtonPlayerChoose();
|
||||
CheckInteraction();
|
||||
_CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -627,7 +624,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_UpdateButtonNext();
|
||||
_UpdateButtonPlayerDestination();
|
||||
_UpdateButtonPlayerChoose();
|
||||
CheckInteraction();
|
||||
_CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -642,7 +639,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_UpdateButtonNext();
|
||||
_UpdateButtonPlayerDestination();
|
||||
_UpdateButtonPlayerChoose();
|
||||
CheckInteraction();
|
||||
_CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user