Renaming for namesheme
This commit is contained in:
1 parent
1336a6fa36
commit
67da90427b
131 files changed
+11905
-11812
No files matched your search
@@ -9,19 +9,23 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
public enum ESongSource
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_ALLSONGS,
|
||||
TR_CATEGORY,
|
||||
TR_PLAYLIST
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public enum EPartyGameMode
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
TR_GAMEMODE_NORMAL,
|
||||
TR_GAMEMODE_SHORTSONG,
|
||||
TR_GAMEMODE_DUET
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
public class Round
|
||||
public class CRound
|
||||
{
|
||||
public int SongID;
|
||||
public int SingerTeam1;
|
||||
@@ -35,7 +39,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
#region Communication
|
||||
|
||||
#region ToScreen
|
||||
public struct DataToScreenConfig
|
||||
public struct SDataToScreenConfig
|
||||
{
|
||||
public int NumPlayerTeam1;
|
||||
public int NumPlayerTeam2;
|
||||
@@ -46,7 +50,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
public EPartyGameMode GameMode;
|
||||
}
|
||||
|
||||
public struct DataToScreenNames
|
||||
public struct SDataToScreenNames
|
||||
{
|
||||
public int NumPlayerTeam1;
|
||||
public int NumPlayerTeam2;
|
||||
@@ -54,14 +58,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
public List<int> ProfileIDsTeam2;
|
||||
}
|
||||
|
||||
public struct DataToScreenMain
|
||||
public struct SDataToScreenMain
|
||||
{
|
||||
public int CurrentRoundNr;
|
||||
public int Team;
|
||||
public int NumPlayerTeam1;
|
||||
public int NumPlayerTeam2;
|
||||
public int NumFields;
|
||||
public List<Round> Rounds;
|
||||
public List<CRound> Rounds;
|
||||
public List<int> Songs;
|
||||
public List<int> ProfileIDsTeam1;
|
||||
public List<int> ProfileIDsTeam2;
|
||||
@@ -71,14 +75,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
public int[] NumJokerRetry;
|
||||
}
|
||||
|
||||
public struct DataFromScreen
|
||||
public struct SDataFromScreen
|
||||
{
|
||||
public FromScreenConfig ScreenConfig;
|
||||
public FromScreenNames ScreenNames;
|
||||
public FromScreenMain ScreenMain;
|
||||
public SFromScreenConfig ScreenConfig;
|
||||
public SFromScreenNames ScreenNames;
|
||||
public SFromScreenMain ScreenMain;
|
||||
}
|
||||
|
||||
public struct FromScreenConfig
|
||||
public struct SFromScreenConfig
|
||||
{
|
||||
public int NumPlayerTeam1;
|
||||
public int NumPlayerTeam2;
|
||||
@@ -89,7 +93,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
public EPartyGameMode GameMode;
|
||||
}
|
||||
|
||||
public struct FromScreenNames
|
||||
public struct SFromScreenNames
|
||||
{
|
||||
public bool FadeToConfig;
|
||||
public bool FadeToMain;
|
||||
@@ -97,13 +101,13 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
public List<int> ProfileIDsTeam2;
|
||||
}
|
||||
|
||||
public struct FromScreenMain
|
||||
public struct SFromScreenMain
|
||||
{
|
||||
public bool FadeToSinging;
|
||||
public bool FadeToNameSelection;
|
||||
public List<int> PlayerTeam1;
|
||||
public List<int> PlayerTeam2;
|
||||
public List<Round> Rounds;
|
||||
public List<CRound> Rounds;
|
||||
public int SingRoundNr;
|
||||
public List<int> Songs;
|
||||
}
|
||||
@@ -111,13 +115,13 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
#endregion Communication
|
||||
|
||||
public sealed class PartyModeTicTacToe : CPartyMode
|
||||
public sealed class CPartyModeTicTacToe : CPartyMode
|
||||
{
|
||||
private const int MaxPlayer = 20;
|
||||
private const int MinPlayer = 2;
|
||||
private const int MaxTeams = 2;
|
||||
private const int MinTeams = 2;
|
||||
private const int NumFields = 9;
|
||||
private const int _MaxPlayer = 20;
|
||||
private const int _MinPlayer = 2;
|
||||
private const int _MaxTeams = 2;
|
||||
private const int _MinTeams = 2;
|
||||
private const int _NumFields = 9;
|
||||
|
||||
private enum EStage
|
||||
{
|
||||
@@ -128,7 +132,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
Singing
|
||||
}
|
||||
|
||||
private struct Data
|
||||
private struct SData
|
||||
{
|
||||
public int NumPlayerTeam1;
|
||||
public int NumPlayerTeam2;
|
||||
@@ -145,7 +149,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
public EPartyGameMode GameMode;
|
||||
|
||||
public List<Round> Rounds;
|
||||
public List<CRound> Rounds;
|
||||
public List<int> Songs;
|
||||
|
||||
public int CurrentRoundNr;
|
||||
@@ -155,14 +159,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
public int[] NumJokerRetry;
|
||||
}
|
||||
|
||||
private DataToScreenConfig ToScreenConfig;
|
||||
private DataToScreenNames ToScreenNames;
|
||||
private DataToScreenMain ToScreenMain;
|
||||
private SDataToScreenConfig _ToScreenConfig;
|
||||
private SDataToScreenNames _ToScreenNames;
|
||||
private SDataToScreenMain _ToScreenMain;
|
||||
|
||||
private Data GameData;
|
||||
private SData _GameData;
|
||||
private EStage _Stage;
|
||||
|
||||
public PartyModeTicTacToe()
|
||||
public CPartyModeTicTacToe()
|
||||
{
|
||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||
_ScreenSongOptions.Selection.PartyMode = true;
|
||||
@@ -176,28 +180,28 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
_Stage = EStage.NotStarted;
|
||||
|
||||
ToScreenConfig = new DataToScreenConfig();
|
||||
ToScreenNames = new DataToScreenNames();
|
||||
ToScreenMain = new DataToScreenMain();
|
||||
_ToScreenConfig = new SDataToScreenConfig();
|
||||
_ToScreenNames = new SDataToScreenNames();
|
||||
_ToScreenMain = new SDataToScreenMain();
|
||||
|
||||
GameData = new Data();
|
||||
GameData.NumFields = 9;
|
||||
GameData.NumPlayerTeam1 = 2;
|
||||
GameData.NumPlayerTeam2 = 2;
|
||||
GameData.ProfileIDsTeam1 = new List<int>();
|
||||
GameData.ProfileIDsTeam2 = new List<int>();
|
||||
GameData.PlayerTeam1 = new List<int>();
|
||||
GameData.PlayerTeam2 = new List<int>();
|
||||
GameData.CurrentRoundNr = 0;
|
||||
GameData.SingRoundNr = 0;
|
||||
GameData.SongSource = ESongSource.TR_ALLSONGS;
|
||||
GameData.PlaylistID = 0;
|
||||
GameData.CategoryID = 0;
|
||||
GameData.GameMode = EPartyGameMode.TR_GAMEMODE_NORMAL;
|
||||
GameData.Rounds = new List<Round>();
|
||||
GameData.Songs = new List<int>();
|
||||
GameData.NumJokerRandom = new int[2];
|
||||
GameData.NumJokerRetry = new int[2];
|
||||
_GameData = new SData();
|
||||
_GameData.NumFields = 9;
|
||||
_GameData.NumPlayerTeam1 = 2;
|
||||
_GameData.NumPlayerTeam2 = 2;
|
||||
_GameData.ProfileIDsTeam1 = new List<int>();
|
||||
_GameData.ProfileIDsTeam2 = new List<int>();
|
||||
_GameData.PlayerTeam1 = new List<int>();
|
||||
_GameData.PlayerTeam2 = new List<int>();
|
||||
_GameData.CurrentRoundNr = 0;
|
||||
_GameData.SingRoundNr = 0;
|
||||
_GameData.SongSource = ESongSource.TR_ALLSONGS;
|
||||
_GameData.PlaylistID = 0;
|
||||
_GameData.CategoryID = 0;
|
||||
_GameData.GameMode = EPartyGameMode.TR_GAMEMODE_NORMAL;
|
||||
_GameData.Rounds = new List<CRound>();
|
||||
_GameData.Songs = new List<int>();
|
||||
_GameData.NumJokerRandom = new int[2];
|
||||
_GameData.NumJokerRetry = new int[2];
|
||||
}
|
||||
|
||||
public override bool Init()
|
||||
@@ -212,58 +216,58 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
if (CBase.Config.GetTabs() == EOffOn.TR_CONFIG_ON && _ScreenSongOptions.Sorting.SongSorting != ESongSorting.TR_CONFIG_NONE)
|
||||
_ScreenSongOptions.Sorting.Tabs = EOffOn.TR_CONFIG_ON;
|
||||
|
||||
ToScreenMain.Rounds = new List<Round>();
|
||||
ToScreenMain.Songs = new List<int>();
|
||||
ToScreenMain.PlayerTeam1 = new List<int>();
|
||||
ToScreenMain.PlayerTeam2 = new List<int>();
|
||||
GameData.Songs = new List<int>();
|
||||
GameData.Rounds = new List<Round>();
|
||||
GameData.PlayerTeam1 = new List<int>();
|
||||
GameData.PlayerTeam2 = new List<int>();
|
||||
_ToScreenMain.Rounds = new List<CRound>();
|
||||
_ToScreenMain.Songs = new List<int>();
|
||||
_ToScreenMain.PlayerTeam1 = new List<int>();
|
||||
_ToScreenMain.PlayerTeam2 = new List<int>();
|
||||
_GameData.Songs = new List<int>();
|
||||
_GameData.Rounds = new List<CRound>();
|
||||
_GameData.PlayerTeam1 = new List<int>();
|
||||
_GameData.PlayerTeam2 = new List<int>();
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void DataFromScreen(string ScreenName, Object Data)
|
||||
public override void DataFromScreen(string screenName, Object data)
|
||||
{
|
||||
DataFromScreen dataFrom = new DataFromScreen();
|
||||
switch (ScreenName)
|
||||
SDataFromScreen dataFrom = new SDataFromScreen();
|
||||
switch (screenName)
|
||||
{
|
||||
case "PartyScreenTicTacToeConfig":
|
||||
|
||||
try
|
||||
{
|
||||
dataFrom = (DataFromScreen)Data;
|
||||
GameData.NumPlayerTeam1 = dataFrom.ScreenConfig.NumPlayerTeam1;
|
||||
GameData.NumPlayerTeam2 = dataFrom.ScreenConfig.NumPlayerTeam2;
|
||||
GameData.NumFields = dataFrom.ScreenConfig.NumFields;
|
||||
GameData.SongSource = dataFrom.ScreenConfig.SongSource;
|
||||
GameData.CategoryID = dataFrom.ScreenConfig.CategoryID;
|
||||
GameData.PlaylistID = dataFrom.ScreenConfig.PlaylistID;
|
||||
GameData.GameMode = dataFrom.ScreenConfig.GameMode;
|
||||
dataFrom = (SDataFromScreen)data;
|
||||
_GameData.NumPlayerTeam1 = dataFrom.ScreenConfig.NumPlayerTeam1;
|
||||
_GameData.NumPlayerTeam2 = dataFrom.ScreenConfig.NumPlayerTeam2;
|
||||
_GameData.NumFields = dataFrom.ScreenConfig.NumFields;
|
||||
_GameData.SongSource = dataFrom.ScreenConfig.SongSource;
|
||||
_GameData.CategoryID = dataFrom.ScreenConfig.CategoryID;
|
||||
_GameData.PlaylistID = dataFrom.ScreenConfig.PlaylistID;
|
||||
_GameData.GameMode = dataFrom.ScreenConfig.GameMode;
|
||||
|
||||
_Stage = EStage.Config;
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error in party mode TicTacToe. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||
CBase.Log.LogError("Error in party mode TicTacToe. Can't cast received data from screen " + screenName + ". " + e.Message);
|
||||
}
|
||||
break;
|
||||
|
||||
case "PartyScreenTicTacToeNames":
|
||||
try
|
||||
{
|
||||
dataFrom = (DataFromScreen)Data;
|
||||
dataFrom = (SDataFromScreen)data;
|
||||
if (dataFrom.ScreenNames.FadeToConfig)
|
||||
_Stage = EStage.NotStarted;
|
||||
else
|
||||
{
|
||||
if (CBase.Game.GetRandom(100) < 50)
|
||||
GameData.Team = 0;
|
||||
_GameData.Team = 0;
|
||||
else
|
||||
GameData.Team = 1;
|
||||
GameData.ProfileIDsTeam1 = dataFrom.ScreenNames.ProfileIDsTeam1;
|
||||
GameData.ProfileIDsTeam2 = dataFrom.ScreenNames.ProfileIDsTeam2;
|
||||
_GameData.Team = 1;
|
||||
_GameData.ProfileIDsTeam1 = dataFrom.ScreenNames.ProfileIDsTeam1;
|
||||
_GameData.ProfileIDsTeam2 = dataFrom.ScreenNames.ProfileIDsTeam2;
|
||||
_Stage = EStage.Names;
|
||||
}
|
||||
|
||||
@@ -271,40 +275,40 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error in party mode TicTacToe. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||
CBase.Log.LogError("Error in party mode TicTacToe. Can't cast received data from screen " + screenName + ". " + e.Message);
|
||||
}
|
||||
break;
|
||||
|
||||
case "PartyScreenTicTacToeMain":
|
||||
try
|
||||
{
|
||||
dataFrom = (DataFromScreen)Data;
|
||||
dataFrom = (SDataFromScreen)data;
|
||||
if (dataFrom.ScreenMain.FadeToSinging)
|
||||
{
|
||||
_Stage = EStage.Singing;
|
||||
GameData.Rounds = dataFrom.ScreenMain.Rounds;
|
||||
GameData.SingRoundNr = dataFrom.ScreenMain.SingRoundNr;
|
||||
GameData.Songs = dataFrom.ScreenMain.Songs;
|
||||
GameData.PlayerTeam1 = dataFrom.ScreenMain.PlayerTeam1;
|
||||
GameData.PlayerTeam2 = dataFrom.ScreenMain.PlayerTeam2;
|
||||
_GameData.Rounds = dataFrom.ScreenMain.Rounds;
|
||||
_GameData.SingRoundNr = dataFrom.ScreenMain.SingRoundNr;
|
||||
_GameData.Songs = dataFrom.ScreenMain.Songs;
|
||||
_GameData.PlayerTeam1 = dataFrom.ScreenMain.PlayerTeam1;
|
||||
_GameData.PlayerTeam2 = dataFrom.ScreenMain.PlayerTeam2;
|
||||
}
|
||||
if (dataFrom.ScreenMain.FadeToNameSelection)
|
||||
_Stage = EStage.Config;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error in party mode TicTacToe. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||
CBase.Log.LogError("Error in party mode TicTacToe. Can't cast received data from screen " + screenName + ". " + e.Message);
|
||||
}
|
||||
|
||||
|
||||
if (_Stage == EStage.Singing)
|
||||
StartRound(dataFrom.ScreenMain.SingRoundNr);
|
||||
_StartRound(dataFrom.ScreenMain.SingRoundNr);
|
||||
if (_Stage == EStage.Config)
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||
break;
|
||||
|
||||
default:
|
||||
CBase.Log.LogError("Error in party mode TicTacToe. Wrong screen is sending: " + ScreenName);
|
||||
CBase.Log.LogError("Error in party mode TicTacToe. Wrong screen is sending: " + screenName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -318,100 +322,100 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_ScreenSongOptions.Selection.RandomOnly = false;*/
|
||||
}
|
||||
|
||||
public override CMenuParty GetNextPartyScreen(out EScreens AlternativeScreen)
|
||||
public override CMenuParty GetNextPartyScreen(out EScreens alternativeScreen)
|
||||
{
|
||||
CMenuParty Screen = null;
|
||||
AlternativeScreen = EScreens.ScreenSong;
|
||||
CMenuParty screen = null;
|
||||
alternativeScreen = EScreens.ScreenSong;
|
||||
|
||||
switch (_Stage)
|
||||
{
|
||||
case EStage.NotStarted:
|
||||
_Screens.TryGetValue("PartyScreenTicTacToeConfig", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenTicTacToeConfig", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
ToScreenConfig.NumPlayerTeam1 = GameData.NumPlayerTeam1;
|
||||
ToScreenConfig.NumPlayerTeam2 = GameData.NumPlayerTeam2;
|
||||
ToScreenConfig.NumFields = GameData.NumFields;
|
||||
ToScreenConfig.SongSource = GameData.SongSource;
|
||||
ToScreenConfig.CategoryID = GameData.CategoryID;
|
||||
ToScreenConfig.PlaylistID = GameData.PlaylistID;
|
||||
ToScreenConfig.GameMode = GameData.GameMode;
|
||||
Screen.DataToScreen(ToScreenConfig);
|
||||
_ToScreenConfig.NumPlayerTeam1 = _GameData.NumPlayerTeam1;
|
||||
_ToScreenConfig.NumPlayerTeam2 = _GameData.NumPlayerTeam2;
|
||||
_ToScreenConfig.NumFields = _GameData.NumFields;
|
||||
_ToScreenConfig.SongSource = _GameData.SongSource;
|
||||
_ToScreenConfig.CategoryID = _GameData.CategoryID;
|
||||
_ToScreenConfig.PlaylistID = _GameData.PlaylistID;
|
||||
_ToScreenConfig.GameMode = _GameData.GameMode;
|
||||
screen.DataToScreen(_ToScreenConfig);
|
||||
}
|
||||
break;
|
||||
case EStage.Config:
|
||||
_Screens.TryGetValue("PartyScreenTicTacToeNames", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenTicTacToeNames", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
ToScreenNames.NumPlayerTeam1 = GameData.NumPlayerTeam1;
|
||||
ToScreenNames.NumPlayerTeam2 = GameData.NumPlayerTeam2;
|
||||
ToScreenNames.ProfileIDsTeam1 = GameData.ProfileIDsTeam1;
|
||||
ToScreenNames.ProfileIDsTeam2 = GameData.ProfileIDsTeam2;
|
||||
Screen.DataToScreen(ToScreenNames);
|
||||
_ToScreenNames.NumPlayerTeam1 = _GameData.NumPlayerTeam1;
|
||||
_ToScreenNames.NumPlayerTeam2 = _GameData.NumPlayerTeam2;
|
||||
_ToScreenNames.ProfileIDsTeam1 = _GameData.ProfileIDsTeam1;
|
||||
_ToScreenNames.ProfileIDsTeam2 = _GameData.ProfileIDsTeam2;
|
||||
screen.DataToScreen(_ToScreenNames);
|
||||
}
|
||||
break;
|
||||
case EStage.Names:
|
||||
_Screens.TryGetValue("PartyScreenTicTacToeMain", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenTicTacToeMain", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
if (GameData.Team == 1)
|
||||
GameData.Team = 0;
|
||||
if (_GameData.Team == 1)
|
||||
_GameData.Team = 0;
|
||||
else
|
||||
GameData.Team = 1;
|
||||
_GameData.Team = 1;
|
||||
CBase.Songs.ResetPartySongSung();
|
||||
GameData.CurrentRoundNr = 1;
|
||||
ToScreenMain.CurrentRoundNr = 1;
|
||||
ToScreenMain.NumPlayerTeam1 = GameData.NumPlayerTeam1;
|
||||
ToScreenMain.NumPlayerTeam2 = GameData.NumPlayerTeam2;
|
||||
ToScreenMain.NumFields = GameData.NumFields;
|
||||
ToScreenMain.ProfileIDsTeam1 = GameData.ProfileIDsTeam1;
|
||||
ToScreenMain.ProfileIDsTeam2 = GameData.ProfileIDsTeam2;
|
||||
CreateRounds();
|
||||
SetNumJokers();
|
||||
PreparePlayerList(0);
|
||||
PrepareSongList();
|
||||
ToScreenMain.Rounds = GameData.Rounds;
|
||||
ToScreenMain.Songs = GameData.Songs;
|
||||
ToScreenMain.PlayerTeam1 = GameData.PlayerTeam1;
|
||||
ToScreenMain.PlayerTeam1 = GameData.PlayerTeam2;
|
||||
ToScreenMain.NumJokerRandom = GameData.NumJokerRandom;
|
||||
ToScreenMain.NumJokerRetry = GameData.NumJokerRetry;
|
||||
ToScreenMain.Team = GameData.Team;
|
||||
Screen.DataToScreen(ToScreenMain);
|
||||
_GameData.CurrentRoundNr = 1;
|
||||
_ToScreenMain.CurrentRoundNr = 1;
|
||||
_ToScreenMain.NumPlayerTeam1 = _GameData.NumPlayerTeam1;
|
||||
_ToScreenMain.NumPlayerTeam2 = _GameData.NumPlayerTeam2;
|
||||
_ToScreenMain.NumFields = _GameData.NumFields;
|
||||
_ToScreenMain.ProfileIDsTeam1 = _GameData.ProfileIDsTeam1;
|
||||
_ToScreenMain.ProfileIDsTeam2 = _GameData.ProfileIDsTeam2;
|
||||
_CreateRounds();
|
||||
_SetNumJokers();
|
||||
_PreparePlayerList(0);
|
||||
_PrepareSongList();
|
||||
_ToScreenMain.Rounds = _GameData.Rounds;
|
||||
_ToScreenMain.Songs = _GameData.Songs;
|
||||
_ToScreenMain.PlayerTeam1 = _GameData.PlayerTeam1;
|
||||
_ToScreenMain.PlayerTeam1 = _GameData.PlayerTeam2;
|
||||
_ToScreenMain.NumJokerRandom = _GameData.NumJokerRandom;
|
||||
_ToScreenMain.NumJokerRetry = _GameData.NumJokerRetry;
|
||||
_ToScreenMain.Team = _GameData.Team;
|
||||
screen.DataToScreen(_ToScreenMain);
|
||||
}
|
||||
break;
|
||||
case EStage.Main:
|
||||
//nothing to do
|
||||
break;
|
||||
case EStage.Singing:
|
||||
_Screens.TryGetValue("PartyScreenTicTacToeMain", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenTicTacToeMain", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
if (GameData.Team == 1)
|
||||
GameData.Team = 0;
|
||||
if (_GameData.Team == 1)
|
||||
_GameData.Team = 0;
|
||||
else
|
||||
GameData.Team = 1;
|
||||
UpdateSongList();
|
||||
UpdatePlayerList();
|
||||
ToScreenMain.CurrentRoundNr = GameData.CurrentRoundNr;
|
||||
ToScreenMain.NumPlayerTeam1 = GameData.NumPlayerTeam1;
|
||||
ToScreenMain.NumPlayerTeam2 = GameData.NumPlayerTeam2;
|
||||
ToScreenMain.NumFields = GameData.NumFields;
|
||||
ToScreenMain.ProfileIDsTeam1 = GameData.ProfileIDsTeam1;
|
||||
ToScreenMain.ProfileIDsTeam2 = GameData.ProfileIDsTeam2;
|
||||
ToScreenMain.Rounds = GameData.Rounds;
|
||||
ToScreenMain.Songs = GameData.Songs;
|
||||
ToScreenMain.PlayerTeam1 = GameData.PlayerTeam1;
|
||||
ToScreenMain.PlayerTeam2 = GameData.PlayerTeam2;
|
||||
ToScreenMain.NumJokerRandom = GameData.NumJokerRandom;
|
||||
ToScreenMain.NumJokerRetry = GameData.NumJokerRetry;
|
||||
ToScreenMain.Team = GameData.Team;
|
||||
Screen.DataToScreen(ToScreenMain);
|
||||
_GameData.Team = 1;
|
||||
_UpdateSongList();
|
||||
_UpdatePlayerList();
|
||||
_ToScreenMain.CurrentRoundNr = _GameData.CurrentRoundNr;
|
||||
_ToScreenMain.NumPlayerTeam1 = _GameData.NumPlayerTeam1;
|
||||
_ToScreenMain.NumPlayerTeam2 = _GameData.NumPlayerTeam2;
|
||||
_ToScreenMain.NumFields = _GameData.NumFields;
|
||||
_ToScreenMain.ProfileIDsTeam1 = _GameData.ProfileIDsTeam1;
|
||||
_ToScreenMain.ProfileIDsTeam2 = _GameData.ProfileIDsTeam2;
|
||||
_ToScreenMain.Rounds = _GameData.Rounds;
|
||||
_ToScreenMain.Songs = _GameData.Songs;
|
||||
_ToScreenMain.PlayerTeam1 = _GameData.PlayerTeam1;
|
||||
_ToScreenMain.PlayerTeam2 = _GameData.PlayerTeam2;
|
||||
_ToScreenMain.NumJokerRandom = _GameData.NumJokerRandom;
|
||||
_ToScreenMain.NumJokerRetry = _GameData.NumJokerRetry;
|
||||
_ToScreenMain.Team = _GameData.Team;
|
||||
screen.DataToScreen(_ToScreenMain);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return Screen;
|
||||
return screen;
|
||||
}
|
||||
|
||||
public override EScreens GetStartScreen()
|
||||
@@ -424,7 +428,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return EScreens.ScreenPartyDummy;
|
||||
}
|
||||
|
||||
public override ScreenSongOptions GetScreenSongOptions()
|
||||
public override SScreenSongOptions GetScreenSongOptions()
|
||||
{
|
||||
_ScreenSongOptions.Sorting.SongSorting = CBase.Config.GetSongSorting();
|
||||
_ScreenSongOptions.Sorting.Tabs = CBase.Config.GetTabs();
|
||||
@@ -433,54 +437,54 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return _ScreenSongOptions;
|
||||
}
|
||||
|
||||
public override void OnSongChange(int SongIndex, ref ScreenSongOptions ScreenSongOptions)
|
||||
public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions)
|
||||
{
|
||||
ScreenSongOptions = _ScreenSongOptions;
|
||||
screenSongOptions = _ScreenSongOptions;
|
||||
}
|
||||
|
||||
public override void OnCategoryChange(int CategoryIndex, ref ScreenSongOptions ScreenSongOptions)
|
||||
public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions)
|
||||
{
|
||||
ScreenSongOptions = _ScreenSongOptions;
|
||||
screenSongOptions = _ScreenSongOptions;
|
||||
}
|
||||
|
||||
public override void SetSearchString(string SearchString, bool Visible)
|
||||
public override void SetSearchString(string searchString, bool visible)
|
||||
{
|
||||
_ScreenSongOptions.Sorting.SearchString = SearchString;
|
||||
_ScreenSongOptions.Sorting.SearchActive = Visible;
|
||||
_ScreenSongOptions.Sorting.SearchString = searchString;
|
||||
_ScreenSongOptions.Sorting.SearchActive = visible;
|
||||
}
|
||||
|
||||
public override int GetMaxPlayer()
|
||||
{
|
||||
return MaxPlayer;
|
||||
return _MaxPlayer;
|
||||
}
|
||||
|
||||
public override int GetMinPlayer()
|
||||
{
|
||||
return MinPlayer;
|
||||
return _MinPlayer;
|
||||
}
|
||||
|
||||
public override int GetMaxTeams()
|
||||
{
|
||||
return MaxTeams;
|
||||
return _MaxTeams;
|
||||
}
|
||||
|
||||
public override int GetMinTeams()
|
||||
{
|
||||
return MinTeams;
|
||||
return _MinTeams;
|
||||
}
|
||||
|
||||
public override int GetMaxNumRounds()
|
||||
{
|
||||
return NumFields;
|
||||
return _NumFields;
|
||||
}
|
||||
|
||||
public override void JokerUsed(int TeamNr) {}
|
||||
public override void JokerUsed(int teamNr) {}
|
||||
|
||||
public override void SongSelected(int SongID)
|
||||
public override void SongSelected(int songID)
|
||||
{
|
||||
EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
|
||||
switch (GameData.GameMode)
|
||||
switch (_GameData.GameMode)
|
||||
{
|
||||
case EPartyGameMode.TR_GAMEMODE_NORMAL:
|
||||
gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
@@ -494,131 +498,131 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
gm = EGameMode.TR_GAMEMODE_SHORTSONG;
|
||||
break;
|
||||
}
|
||||
CBase.Game.AddSong(SongID, gm);
|
||||
CBase.Game.AddSong(songID, gm);
|
||||
|
||||
CBase.Songs.AddPartySongSung(SongID);
|
||||
CBase.Songs.AddPartySongSung(songID);
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenSing);
|
||||
}
|
||||
|
||||
public override void LeavingHighscore()
|
||||
{
|
||||
UpdateScores();
|
||||
_UpdateScores();
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||
}
|
||||
|
||||
private void CreateRounds()
|
||||
private void _CreateRounds()
|
||||
{
|
||||
GameData.Rounds = new List<Round>();
|
||||
for (int i = 0; i < GameData.NumFields; i++)
|
||||
_GameData.Rounds = new List<CRound>();
|
||||
for (int i = 0; i < _GameData.NumFields; i++)
|
||||
{
|
||||
Round r = new Round();
|
||||
GameData.Rounds.Add(r);
|
||||
CRound r = new CRound();
|
||||
_GameData.Rounds.Add(r);
|
||||
}
|
||||
}
|
||||
|
||||
private void PreparePlayerList(int Team)
|
||||
private void _PreparePlayerList(int team)
|
||||
{
|
||||
if (Team == 0)
|
||||
if (team == 0)
|
||||
{
|
||||
GameData.PlayerTeam1 = new List<int>();
|
||||
GameData.PlayerTeam2 = new List<int>();
|
||||
_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>();
|
||||
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)
|
||||
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)
|
||||
if (iDs1.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < GameData.NumPlayerTeam1; i++)
|
||||
IDs1.Add(i);
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam1; i++)
|
||||
iDs1.Add(i);
|
||||
}
|
||||
if (IDs2.Count == 0)
|
||||
if (iDs2.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < GameData.NumPlayerTeam2; i++)
|
||||
IDs2.Add(i);
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam2; i++)
|
||||
iDs2.Add(i);
|
||||
}
|
||||
if (GameData.PlayerTeam1.Count < GameData.NumFields + GameData.NumJokerRetry[0])
|
||||
if (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0])
|
||||
{
|
||||
random = CBase.Game.GetRandom((IDs1.Count - 1) * 10);
|
||||
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 (num >= iDs1.Count)
|
||||
num = iDs1.Count - 1;
|
||||
_GameData.PlayerTeam1.Add(iDs1[num]);
|
||||
iDs1.RemoveAt(num);
|
||||
}
|
||||
if (GameData.PlayerTeam2.Count < GameData.NumFields + GameData.NumJokerRetry[1])
|
||||
if (_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1])
|
||||
{
|
||||
random = CBase.Game.GetRandom((IDs2.Count - 1) * 20);
|
||||
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 (num >= iDs2.Count)
|
||||
num = iDs2.Count - 1;
|
||||
_GameData.PlayerTeam2.Add(iDs2[num]);
|
||||
iDs2.RemoveAt(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Team == 1)
|
||||
else if (team == 1)
|
||||
{
|
||||
//Prepare Player-IDs
|
||||
List<int> IDs = new List<int>();
|
||||
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)
|
||||
while (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0] && iDs.Count == 0)
|
||||
{
|
||||
if (IDs.Count == 0)
|
||||
if (iDs.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < GameData.NumPlayerTeam1; i++)
|
||||
IDs.Add(i);
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam1; i++)
|
||||
iDs.Add(i);
|
||||
}
|
||||
if (GameData.PlayerTeam1.Count < GameData.NumFields + GameData.NumJokerRetry[0])
|
||||
if (_GameData.PlayerTeam1.Count < _GameData.NumFields + _GameData.NumJokerRetry[0])
|
||||
{
|
||||
random = CBase.Game.GetRandom((IDs.Count - 1) * 10);
|
||||
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);
|
||||
if (num >= iDs.Count)
|
||||
num = iDs.Count - 1;
|
||||
_GameData.PlayerTeam1.Add(iDs[num]);
|
||||
iDs.RemoveAt(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Team == 2)
|
||||
else if (team == 2)
|
||||
{
|
||||
//Prepare Player-IDs
|
||||
List<int> IDs = new List<int>();
|
||||
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)
|
||||
while (_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1] && iDs.Count == 0)
|
||||
{
|
||||
if (IDs.Count == 0)
|
||||
if (iDs.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < GameData.NumPlayerTeam2; i++)
|
||||
IDs.Add(i);
|
||||
for (int i = 0; i < _GameData.NumPlayerTeam2; i++)
|
||||
iDs.Add(i);
|
||||
}
|
||||
if (GameData.PlayerTeam2.Count < GameData.NumFields + GameData.NumJokerRetry[1])
|
||||
if (_GameData.PlayerTeam2.Count < _GameData.NumFields + _GameData.NumJokerRetry[1])
|
||||
{
|
||||
random = CBase.Game.GetRandom((IDs.Count - 1) * 20);
|
||||
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);
|
||||
if (num >= iDs.Count)
|
||||
num = iDs.Count - 1;
|
||||
_GameData.PlayerTeam2.Add(iDs[num]);
|
||||
iDs.RemoveAt(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void PrepareSongList()
|
||||
private void _PrepareSongList()
|
||||
{
|
||||
EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
|
||||
switch (GameData.GameMode)
|
||||
switch (_GameData.GameMode)
|
||||
{
|
||||
case EPartyGameMode.TR_GAMEMODE_NORMAL:
|
||||
gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
@@ -633,19 +637,19 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
break;
|
||||
}
|
||||
|
||||
while (GameData.Songs.Count < (GameData.NumFields + GameData.NumJokerRandom[0] + GameData.NumJokerRandom[1]))
|
||||
while (_GameData.Songs.Count < (_GameData.NumFields + _GameData.NumJokerRandom[0] + _GameData.NumJokerRandom[1]))
|
||||
{
|
||||
List<int> Songs = new List<int>();
|
||||
switch (GameData.SongSource)
|
||||
List<int> songs = new List<int>();
|
||||
switch (_GameData.SongSource)
|
||||
{
|
||||
case ESongSource.TR_PLAYLIST:
|
||||
for (int i = 0; i < CBase.Playlist.GetPlaylistSongCount(GameData.PlaylistID); i++)
|
||||
for (int i = 0; i < CBase.Playlist.GetPlaylistSongCount(_GameData.PlaylistID); i++)
|
||||
{
|
||||
int id = CBase.Playlist.GetPlaylistSong(GameData.PlaylistID, i).SongID;
|
||||
int id = CBase.Playlist.GetPlaylistSong(_GameData.PlaylistID, i).SongID;
|
||||
foreach (EGameMode mode in CBase.Songs.GetSongByID(id).AvailableGameModes)
|
||||
{
|
||||
if (mode == gm)
|
||||
Songs.Add(id);
|
||||
songs.Add(id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -656,47 +660,47 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
foreach (EGameMode mode in CBase.Songs.GetSongByID(i).AvailableGameModes)
|
||||
{
|
||||
if (mode == gm)
|
||||
Songs.Add(i);
|
||||
songs.Add(i);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ESongSource.TR_CATEGORY:
|
||||
CBase.Songs.SetCategory(GameData.CategoryID);
|
||||
for (int i = 0; i < CBase.Songs.NumSongsInCategory(GameData.CategoryID); i++)
|
||||
CBase.Songs.SetCategory(_GameData.CategoryID);
|
||||
for (int i = 0; i < CBase.Songs.NumSongsInCategory(_GameData.CategoryID); i++)
|
||||
{
|
||||
foreach (EGameMode mode in CBase.Songs.GetVisibleSong(i).AvailableGameModes)
|
||||
{
|
||||
if (mode == gm)
|
||||
Songs.Add(CBase.Songs.GetVisibleSong(i).ID);
|
||||
songs.Add(CBase.Songs.GetVisibleSong(i).ID);
|
||||
}
|
||||
}
|
||||
CBase.Songs.SetCategory(-1);
|
||||
break;
|
||||
}
|
||||
while (Songs.Count > 0)
|
||||
while (songs.Count > 0)
|
||||
{
|
||||
GameData.Songs.Add(Songs[CBase.Game.GetRandom(Songs.Count - 1)]);
|
||||
Songs.Remove(GameData.Songs[GameData.Songs.Count - 1]);
|
||||
_GameData.Songs.Add(songs[CBase.Game.GetRandom(songs.Count - 1)]);
|
||||
songs.Remove(_GameData.Songs[_GameData.Songs.Count - 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdatePlayerList()
|
||||
private void _UpdatePlayerList()
|
||||
{
|
||||
if (GameData.PlayerTeam1.Count == 0)
|
||||
PreparePlayerList(1);
|
||||
if (GameData.PlayerTeam2.Count == 0)
|
||||
PreparePlayerList(2);
|
||||
if (_GameData.PlayerTeam1.Count == 0)
|
||||
_PreparePlayerList(1);
|
||||
if (_GameData.PlayerTeam2.Count == 0)
|
||||
_PreparePlayerList(2);
|
||||
}
|
||||
|
||||
private void UpdateSongList()
|
||||
private void _UpdateSongList()
|
||||
{
|
||||
if (GameData.Songs.Count == 0)
|
||||
PrepareSongList();
|
||||
if (_GameData.Songs.Count == 0)
|
||||
_PrepareSongList();
|
||||
}
|
||||
|
||||
private void StartRound(int RoundNr)
|
||||
private void _StartRound(int roundNr)
|
||||
{
|
||||
CBase.Game.Reset();
|
||||
CBase.Game.ClearSongs();
|
||||
@@ -711,7 +715,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return;
|
||||
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
Round r = GameData.Rounds[RoundNr];
|
||||
CRound r = _GameData.Rounds[roundNr];
|
||||
bool isDuet = CBase.Songs.GetSongByID(r.SongID).IsDuet;
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
@@ -725,19 +729,19 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
//try to fill with the right data
|
||||
if (r != null)
|
||||
{
|
||||
if (GameData.ProfileIDsTeam1[r.SingerTeam1] < profiles.Length)
|
||||
if (_GameData.ProfileIDsTeam1[r.SingerTeam1] < profiles.Length)
|
||||
{
|
||||
player[0].Name = profiles[GameData.ProfileIDsTeam1[r.SingerTeam1]].PlayerName;
|
||||
player[0].Difficulty = profiles[GameData.ProfileIDsTeam1[r.SingerTeam1]].Difficulty;
|
||||
player[0].ProfileID = GameData.ProfileIDsTeam1[r.SingerTeam1];
|
||||
player[0].Name = profiles[_GameData.ProfileIDsTeam1[r.SingerTeam1]].PlayerName;
|
||||
player[0].Difficulty = profiles[_GameData.ProfileIDsTeam1[r.SingerTeam1]].Difficulty;
|
||||
player[0].ProfileID = _GameData.ProfileIDsTeam1[r.SingerTeam1];
|
||||
if (isDuet)
|
||||
player[0].LineNr = 0;
|
||||
}
|
||||
if (GameData.ProfileIDsTeam2[r.SingerTeam2] < profiles.Length)
|
||||
if (_GameData.ProfileIDsTeam2[r.SingerTeam2] < profiles.Length)
|
||||
{
|
||||
player[1].Name = profiles[GameData.ProfileIDsTeam2[r.SingerTeam2]].PlayerName;
|
||||
player[1].Difficulty = profiles[GameData.ProfileIDsTeam2[r.SingerTeam2]].Difficulty;
|
||||
player[1].ProfileID = GameData.ProfileIDsTeam2[r.SingerTeam2];
|
||||
player[1].Name = profiles[_GameData.ProfileIDsTeam2[r.SingerTeam2]].PlayerName;
|
||||
player[1].Difficulty = profiles[_GameData.ProfileIDsTeam2[r.SingerTeam2]].Difficulty;
|
||||
player[1].ProfileID = _GameData.ProfileIDsTeam2[r.SingerTeam2];
|
||||
if (isDuet)
|
||||
player[1].LineNr = 1;
|
||||
}
|
||||
@@ -747,37 +751,37 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return;
|
||||
}
|
||||
|
||||
private void SetNumJokers()
|
||||
private void _SetNumJokers()
|
||||
{
|
||||
switch (GameData.NumFields)
|
||||
switch (_GameData.NumFields)
|
||||
{
|
||||
case 9:
|
||||
GameData.NumJokerRandom[0] = 1;
|
||||
GameData.NumJokerRandom[1] = 1;
|
||||
GameData.NumJokerRetry[0] = 0;
|
||||
GameData.NumJokerRetry[1] = 0;
|
||||
_GameData.NumJokerRandom[0] = 1;
|
||||
_GameData.NumJokerRandom[1] = 1;
|
||||
_GameData.NumJokerRetry[0] = 0;
|
||||
_GameData.NumJokerRetry[1] = 0;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
GameData.NumJokerRandom[0] = 2;
|
||||
GameData.NumJokerRandom[1] = 2;
|
||||
GameData.NumJokerRetry[0] = 1;
|
||||
GameData.NumJokerRetry[1] = 1;
|
||||
_GameData.NumJokerRandom[0] = 2;
|
||||
_GameData.NumJokerRandom[1] = 2;
|
||||
_GameData.NumJokerRetry[0] = 1;
|
||||
_GameData.NumJokerRetry[1] = 1;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
GameData.NumJokerRandom[0] = 3;
|
||||
GameData.NumJokerRandom[1] = 3;
|
||||
GameData.NumJokerRetry[0] = 2;
|
||||
GameData.NumJokerRetry[1] = 2;
|
||||
_GameData.NumJokerRandom[0] = 3;
|
||||
_GameData.NumJokerRandom[1] = 3;
|
||||
_GameData.NumJokerRetry[0] = 2;
|
||||
_GameData.NumJokerRetry[1] = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateScores()
|
||||
private void _UpdateScores()
|
||||
{
|
||||
if (!GameData.Rounds[GameData.SingRoundNr].Finished)
|
||||
GameData.CurrentRoundNr++;
|
||||
if (!_GameData.Rounds[_GameData.SingRoundNr].Finished)
|
||||
_GameData.CurrentRoundNr++;
|
||||
|
||||
SPlayer[] results = CBase.Game.GetPlayer();
|
||||
if (results == null)
|
||||
@@ -786,17 +790,17 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
if (results.Length < 2)
|
||||
return;
|
||||
|
||||
GameData.Rounds[GameData.SingRoundNr].PointsTeam1 = (int)Math.Round(results[0].Points);
|
||||
GameData.Rounds[GameData.SingRoundNr].PointsTeam2 = (int)Math.Round(results[1].Points);
|
||||
GameData.Rounds[GameData.SingRoundNr].Finished = true;
|
||||
if (GameData.Rounds[GameData.SingRoundNr].PointsTeam1 < GameData.Rounds[GameData.SingRoundNr].PointsTeam2)
|
||||
GameData.Rounds[GameData.SingRoundNr].Winner = 2;
|
||||
else if (GameData.Rounds[GameData.SingRoundNr].PointsTeam1 > GameData.Rounds[GameData.SingRoundNr].PointsTeam2)
|
||||
GameData.Rounds[GameData.SingRoundNr].Winner = 1;
|
||||
_GameData.Rounds[_GameData.SingRoundNr].PointsTeam1 = (int)Math.Round(results[0].Points);
|
||||
_GameData.Rounds[_GameData.SingRoundNr].PointsTeam2 = (int)Math.Round(results[1].Points);
|
||||
_GameData.Rounds[_GameData.SingRoundNr].Finished = true;
|
||||
if (_GameData.Rounds[_GameData.SingRoundNr].PointsTeam1 < _GameData.Rounds[_GameData.SingRoundNr].PointsTeam2)
|
||||
_GameData.Rounds[_GameData.SingRoundNr].Winner = 2;
|
||||
else if (_GameData.Rounds[_GameData.SingRoundNr].PointsTeam1 > _GameData.Rounds[_GameData.SingRoundNr].PointsTeam2)
|
||||
_GameData.Rounds[_GameData.SingRoundNr].Winner = 1;
|
||||
else
|
||||
{
|
||||
GameData.Rounds[GameData.SingRoundNr].Finished = false;
|
||||
GameData.CurrentRoundNr--;
|
||||
_GameData.Rounds[_GameData.SingRoundNr].Finished = false;
|
||||
_GameData.CurrentRoundNr--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
public class PartyScreenTicTacToeConfig : CMenuParty
|
||||
public class CPartyScreenTicTacToeConfig : CMenuParty
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -12,30 +12,30 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
private const string SelectSlideNumPlayerTeam1 = "SelectSlideNumPlayerTeam1";
|
||||
private const string SelectSlideNumPlayerTeam2 = "SelectSlideNumPlayerTeam2";
|
||||
private const string SelectSlideNumFields = "SelectSlideNumFields";
|
||||
private const string SelectSlideSongSource = "SelectSlideSongSource";
|
||||
private const string SelectSlidePlaylist = "SelectSlidePlaylist";
|
||||
private const string SelectSlideCategory = "SelectSlideCategory";
|
||||
private const string SelectSlideGameMode = "SelectSlideGameMode";
|
||||
private const string ButtonNext = "ButtonNext";
|
||||
private const string ButtonBack = "ButtonBack";
|
||||
private const string _SelectSlideNumPlayerTeam1 = "SelectSlideNumPlayerTeam1";
|
||||
private const string _SelectSlideNumPlayerTeam2 = "SelectSlideNumPlayerTeam2";
|
||||
private const string _SelectSlideNumFields = "SelectSlideNumFields";
|
||||
private const string _SelectSlideSongSource = "SelectSlideSongSource";
|
||||
private const string _SelectSlidePlaylist = "SelectSlidePlaylist";
|
||||
private const string _SelectSlideCategory = "SelectSlideCategory";
|
||||
private const string _SelectSlideGameMode = "SelectSlideGameMode";
|
||||
private const string _ButtonNext = "ButtonNext";
|
||||
private const string _ButtonBack = "ButtonBack";
|
||||
|
||||
private bool ConfigOk = true;
|
||||
private bool _ConfigOk = true;
|
||||
|
||||
private DataFromScreen Data;
|
||||
private SDataFromScreen _Data;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
|
||||
_ThemeSelectSlides = new string[]
|
||||
{SelectSlideNumPlayerTeam1, SelectSlideNumPlayerTeam2, SelectSlideNumFields, SelectSlideSongSource, SelectSlidePlaylist, SelectSlideCategory, SelectSlideGameMode};
|
||||
_ThemeButtons = new string[] {ButtonNext, ButtonBack};
|
||||
{_SelectSlideNumPlayerTeam1, _SelectSlideNumPlayerTeam2, _SelectSlideNumFields, _SelectSlideSongSource, _SelectSlidePlaylist, _SelectSlideCategory, _SelectSlideGameMode};
|
||||
_ThemeButtons = new string[] {_ButtonNext, _ButtonBack};
|
||||
|
||||
Data = new DataFromScreen();
|
||||
FromScreenConfig config = new FromScreenConfig();
|
||||
_Data = new SDataFromScreen();
|
||||
SFromScreenConfig config = new SFromScreenConfig();
|
||||
config.PlaylistID = 0;
|
||||
config.NumFields = 9;
|
||||
config.NumPlayerTeam1 = 2;
|
||||
@@ -43,23 +43,23 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
config.GameMode = EPartyGameMode.TR_GAMEMODE_NORMAL;
|
||||
config.CategoryID = 0;
|
||||
config.SongSource = ESongSource.TR_ALLSONGS;
|
||||
Data.ScreenConfig = config;
|
||||
_Data.ScreenConfig = config;
|
||||
}
|
||||
|
||||
public override void DataToScreen(object ReceivedData)
|
||||
public override void DataToScreen(object receivedData)
|
||||
{
|
||||
DataToScreenConfig config = new DataToScreenConfig();
|
||||
SDataToScreenConfig config = new SDataToScreenConfig();
|
||||
|
||||
try
|
||||
{
|
||||
config = (DataToScreenConfig)ReceivedData;
|
||||
Data.ScreenConfig.NumFields = config.NumFields;
|
||||
Data.ScreenConfig.NumPlayerTeam1 = config.NumPlayerTeam1;
|
||||
Data.ScreenConfig.NumPlayerTeam2 = config.NumPlayerTeam2;
|
||||
Data.ScreenConfig.PlaylistID = config.PlaylistID;
|
||||
Data.ScreenConfig.CategoryID = config.CategoryID;
|
||||
Data.ScreenConfig.SongSource = config.SongSource;
|
||||
Data.ScreenConfig.GameMode = config.GameMode;
|
||||
config = (SDataToScreenConfig)receivedData;
|
||||
_Data.ScreenConfig.NumFields = config.NumFields;
|
||||
_Data.ScreenConfig.NumPlayerTeam1 = config.NumPlayerTeam1;
|
||||
_Data.ScreenConfig.NumPlayerTeam2 = config.NumPlayerTeam2;
|
||||
_Data.ScreenConfig.PlaylistID = config.PlaylistID;
|
||||
_Data.ScreenConfig.CategoryID = config.CategoryID;
|
||||
_Data.ScreenConfig.SongSource = config.SongSource;
|
||||
_Data.ScreenConfig.GameMode = config.GameMode;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -67,7 +67,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleInput(KeyEvent keyEvent)
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
base.HandleInput(keyEvent);
|
||||
|
||||
@@ -78,47 +78,47 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
case Keys.Back:
|
||||
case Keys.Escape:
|
||||
Back();
|
||||
_Back();
|
||||
break;
|
||||
|
||||
case Keys.Enter:
|
||||
UpdateSlides();
|
||||
_UpdateSlides();
|
||||
|
||||
if (Buttons[ButtonBack].Selected)
|
||||
Back();
|
||||
if (Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
|
||||
if (Buttons[ButtonNext].Selected)
|
||||
Next();
|
||||
if (Buttons[_ButtonNext].Selected)
|
||||
_Next();
|
||||
break;
|
||||
|
||||
case Keys.Left:
|
||||
UpdateSlides();
|
||||
_UpdateSlides();
|
||||
break;
|
||||
|
||||
case Keys.Right:
|
||||
UpdateSlides();
|
||||
_UpdateSlides();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool HandleMouse(MouseEvent mouseEvent)
|
||||
public override bool HandleMouse(SMouseEvent mouseEvent)
|
||||
{
|
||||
base.HandleMouse(mouseEvent);
|
||||
|
||||
if (mouseEvent.LB && IsMouseOver(mouseEvent))
|
||||
{
|
||||
UpdateSlides();
|
||||
if (Buttons[ButtonBack].Selected)
|
||||
Back();
|
||||
_UpdateSlides();
|
||||
if (Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
|
||||
if (Buttons[ButtonNext].Selected)
|
||||
Next();
|
||||
if (Buttons[_ButtonNext].Selected)
|
||||
_Next();
|
||||
}
|
||||
|
||||
if (mouseEvent.RB)
|
||||
Back();
|
||||
_Back();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -128,15 +128,15 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
base.OnShow();
|
||||
|
||||
if (CBase.Config.GetMaxNumMics() >= 2)
|
||||
ConfigOk = true;
|
||||
_ConfigOk = true;
|
||||
|
||||
FillSlides();
|
||||
UpdateSlides();
|
||||
_FillSlides();
|
||||
_UpdateSlides();
|
||||
}
|
||||
|
||||
public override bool UpdateGame()
|
||||
{
|
||||
Buttons[ButtonNext].Visible = ConfigOk;
|
||||
Buttons[_ButtonNext].Visible = _ConfigOk;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -146,79 +146,79 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return true;
|
||||
}
|
||||
|
||||
private void FillSlides()
|
||||
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");
|
||||
if (Data.ScreenConfig.NumFields == 9)
|
||||
SelectSlides[SelectSlideNumFields].Selection = 0;
|
||||
else if (Data.ScreenConfig.NumFields == 16)
|
||||
SelectSlides[SelectSlideNumFields].Selection = 1;
|
||||
else if (Data.ScreenConfig.NumFields == 25)
|
||||
SelectSlides[SelectSlideNumFields].Selection = 2;
|
||||
SelectSlides[_SelectSlideNumFields].Clear();
|
||||
SelectSlides[_SelectSlideNumFields].AddValue("9");
|
||||
SelectSlides[_SelectSlideNumFields].AddValue("16");
|
||||
SelectSlides[_SelectSlideNumFields].AddValue("25");
|
||||
if (_Data.ScreenConfig.NumFields == 9)
|
||||
SelectSlides[_SelectSlideNumFields].Selection = 0;
|
||||
else if (_Data.ScreenConfig.NumFields == 16)
|
||||
SelectSlides[_SelectSlideNumFields].Selection = 1;
|
||||
else if (_Data.ScreenConfig.NumFields == 25)
|
||||
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();
|
||||
for (int i = 0; i < _Playlists.Length; i++)
|
||||
string[] playlists = CBase.Playlist.GetPlaylistNames();
|
||||
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);
|
||||
string value = playlists[i] + " (" + CBase.Playlist.GetPlaylistSongCount(i) + " " + CBase.Language.Translate("TR_SONGS", _PartyModeID) + ")";
|
||||
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()];
|
||||
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();
|
||||
for (int i = 0; i < _Categories.Length; i++)
|
||||
categories[i] = CBase.Songs.GetCategory(i).Name;
|
||||
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);
|
||||
string value = categories[i] + " (" + CBase.Songs.NumSongsInCategory(i) + " " + CBase.Language.Translate("TR_SONGS", _PartyModeID) + ")";
|
||||
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()
|
||||
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)
|
||||
Data.ScreenConfig.NumFields = 9;
|
||||
else if (SelectSlides[SelectSlideNumFields].Selection == 1)
|
||||
Data.ScreenConfig.NumFields = 16;
|
||||
else if (SelectSlides[SelectSlideNumFields].Selection == 2)
|
||||
Data.ScreenConfig.NumFields = 25;
|
||||
if (SelectSlides[_SelectSlideNumFields].Selection == 0)
|
||||
_Data.ScreenConfig.NumFields = 9;
|
||||
else if (SelectSlides[_SelectSlideNumFields].Selection == 1)
|
||||
_Data.ScreenConfig.NumFields = 16;
|
||||
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;
|
||||
|
||||
switch (Data.ScreenConfig.GameMode)
|
||||
switch (_Data.ScreenConfig.GameMode)
|
||||
{
|
||||
case EPartyGameMode.TR_GAMEMODE_NORMAL:
|
||||
gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
@@ -233,64 +233,64 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
break;
|
||||
}
|
||||
|
||||
if (Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST)
|
||||
if (_Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST)
|
||||
{
|
||||
if (CBase.Playlist.GetNumPlaylists() > 0)
|
||||
{
|
||||
if (CBase.Playlist.GetPlaylistSongCount(Data.ScreenConfig.PlaylistID) > 0)
|
||||
if (CBase.Playlist.GetPlaylistSongCount(_Data.ScreenConfig.PlaylistID) > 0)
|
||||
{
|
||||
ConfigOk = false;
|
||||
for (int i = 0; i < CBase.Playlist.GetPlaylistSongCount(Data.ScreenConfig.PlaylistID); i++)
|
||||
_ConfigOk = false;
|
||||
for (int i = 0; i < CBase.Playlist.GetPlaylistSongCount(_Data.ScreenConfig.PlaylistID); i++)
|
||||
{
|
||||
int id = CBase.Playlist.GetPlaylistSong(Data.ScreenConfig.PlaylistID, i).SongID;
|
||||
int id = CBase.Playlist.GetPlaylistSong(_Data.ScreenConfig.PlaylistID, i).SongID;
|
||||
foreach (EGameMode mode in CBase.Songs.GetSongByID(id).AvailableGameModes)
|
||||
{
|
||||
if (mode == gm)
|
||||
{
|
||||
ConfigOk = true;
|
||||
_ConfigOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ConfigOk)
|
||||
if (_ConfigOk)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
ConfigOk = false;
|
||||
_ConfigOk = false;
|
||||
}
|
||||
else
|
||||
ConfigOk = false;
|
||||
_ConfigOk = false;
|
||||
}
|
||||
if (Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY)
|
||||
if (_Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY)
|
||||
{
|
||||
if (CBase.Songs.GetNumCategories() > 0)
|
||||
{
|
||||
if (CBase.Songs.NumSongsInCategory(Data.ScreenConfig.CategoryID) > 0)
|
||||
if (CBase.Songs.NumSongsInCategory(_Data.ScreenConfig.CategoryID) > 0)
|
||||
{
|
||||
CBase.Songs.SetCategory(Data.ScreenConfig.CategoryID);
|
||||
ConfigOk = false;
|
||||
for (int i = 0; i < CBase.Songs.NumSongsInCategory(Data.ScreenConfig.CategoryID); i++)
|
||||
CBase.Songs.SetCategory(_Data.ScreenConfig.CategoryID);
|
||||
_ConfigOk = false;
|
||||
for (int i = 0; i < CBase.Songs.NumSongsInCategory(_Data.ScreenConfig.CategoryID); i++)
|
||||
{
|
||||
foreach (EGameMode mode in CBase.Songs.GetVisibleSong(i).AvailableGameModes)
|
||||
{
|
||||
if (mode == gm)
|
||||
{
|
||||
ConfigOk = true;
|
||||
_ConfigOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ConfigOk)
|
||||
if (_ConfigOk)
|
||||
break;
|
||||
}
|
||||
CBase.Songs.SetCategory(-1);
|
||||
}
|
||||
else
|
||||
ConfigOk = false;
|
||||
_ConfigOk = false;
|
||||
}
|
||||
else
|
||||
ConfigOk = false;
|
||||
_ConfigOk = false;
|
||||
}
|
||||
if (Data.ScreenConfig.SongSource == ESongSource.TR_ALLSONGS)
|
||||
if (_Data.ScreenConfig.SongSource == ESongSource.TR_ALLSONGS)
|
||||
{
|
||||
if (CBase.Songs.GetNumSongs() > 0)
|
||||
{
|
||||
@@ -300,29 +300,29 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
if (mode == gm)
|
||||
{
|
||||
ConfigOk = true;
|
||||
_ConfigOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ConfigOk)
|
||||
if (_ConfigOk)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
ConfigOk = false;
|
||||
_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()
|
||||
private void _Back()
|
||||
{
|
||||
FadeTo(EScreens.ScreenParty);
|
||||
_FadeTo(EScreens.ScreenParty);
|
||||
}
|
||||
|
||||
private void Next()
|
||||
private void _Next()
|
||||
{
|
||||
_PartyMode.DataFromScreen(ThemeName, Data);
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,7 +5,7 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
public class PartyScreenTicTacToeNames : CMenuParty
|
||||
public class CPartyScreenTicTacToeNames : CMenuParty
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -13,43 +13,43 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
private const string ButtonNext = "ButtonNext";
|
||||
private const string ButtonBack = "ButtonBack";
|
||||
private const string ButtonPlayerDestination = "ButtonPlayerDestination";
|
||||
private const string ButtonPlayerChoose = "ButtonPlayerChoose";
|
||||
private const string ButtonPlayerChooseScrollUp = "ButtonPlayerChooseScrollUp";
|
||||
private const string ButtonPlayerChooseScrollDown = "ButtonPlayerChooseScrollDown";
|
||||
private const string _ButtonNext = "ButtonNext";
|
||||
private const string _ButtonBack = "ButtonBack";
|
||||
private const string _ButtonPlayerDestination = "ButtonPlayerDestination";
|
||||
private const string _ButtonPlayerChoose = "ButtonPlayerChoose";
|
||||
private const string _ButtonPlayerChooseScrollUp = "ButtonPlayerChooseScrollUp";
|
||||
private const string _ButtonPlayerChooseScrollDown = "ButtonPlayerChooseScrollDown";
|
||||
|
||||
private List<CPlayerChooseButton> PlayerChooseButtons;
|
||||
private List<CButton> PlayerDestinationButtons;
|
||||
private List<CPlayerChooseButton> _PlayerChooseButtons;
|
||||
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;
|
||||
private const int PlayerDestinationButtonsSpaceW = 25;
|
||||
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;
|
||||
private const int _PlayerDestinationButtonsSpaceW = 25;
|
||||
//PlayerChooseButtons-Option
|
||||
private List<int> PlayerChooseButtonsVisibleProfiles;
|
||||
private const int PlayerChooseButtonsNumH = 10;
|
||||
private const int PlayerChooseButtonsNumW = 2;
|
||||
private const int PlayerChooseButtonsFirstX = 58;
|
||||
private const int PlayerChooseButtonsFirstY = 105;
|
||||
private const int PlayerChooseButtonsSpaceH = 15;
|
||||
private const int PlayerChooseButtonsSpaceW = 25;
|
||||
private int PlayerChooseButtonsOffset;
|
||||
private List<int> _PlayerChooseButtonsVisibleProfiles;
|
||||
private const int _PlayerChooseButtonsNumH = 10;
|
||||
private const int _PlayerChooseButtonsNumW = 2;
|
||||
private const int _PlayerChooseButtonsFirstX = 58;
|
||||
private const int _PlayerChooseButtonsFirstY = 105;
|
||||
private const int _PlayerChooseButtonsSpaceH = 15;
|
||||
private const int _PlayerChooseButtonsSpaceW = 25;
|
||||
private int _PlayerChooseButtonsOffset;
|
||||
|
||||
private CStatic chooseAvatarStatic;
|
||||
private bool SelectingMouseActive;
|
||||
private int OldMouseX;
|
||||
private int OldMouseY;
|
||||
private int SelectedPlayerNr = -1;
|
||||
private bool ButtonsAdded;
|
||||
private CStatic _ChooseAvatarStatic;
|
||||
private bool _SelectingMouseActive;
|
||||
private int _OldMouseX;
|
||||
private int _OldMouseY;
|
||||
private int _SelectedPlayerNr = -1;
|
||||
private bool _ButtonsAdded;
|
||||
|
||||
private int NumPlayerTeam1 = 2;
|
||||
private int NumPlayerTeam2 = 2;
|
||||
private int _NumPlayerTeam1 = 2;
|
||||
private int _NumPlayerTeam2 = 2;
|
||||
|
||||
private DataFromScreen Data;
|
||||
private SDataFromScreen _Data;
|
||||
|
||||
private class CPlayerChooseButton
|
||||
{
|
||||
@@ -61,47 +61,47 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
base.Init();
|
||||
|
||||
chooseAvatarStatic = GetNewStatic();
|
||||
chooseAvatarStatic.Visible = false;
|
||||
_ChooseAvatarStatic = GetNewStatic();
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
|
||||
PlayerChooseButtonsVisibleProfiles = new List<int>();
|
||||
_PlayerChooseButtonsVisibleProfiles = new List<int>();
|
||||
|
||||
Data.ScreenNames.ProfileIDsTeam1 = new List<int>();
|
||||
Data.ScreenNames.ProfileIDsTeam2 = new List<int>();
|
||||
_Data.ScreenNames.ProfileIDsTeam1 = new List<int>();
|
||||
_Data.ScreenNames.ProfileIDsTeam2 = new List<int>();
|
||||
|
||||
List<string> buttons = new List<string>();
|
||||
_ThemeButtons = new string[] {ButtonBack, ButtonNext, ButtonPlayerDestination, ButtonPlayerChoose, ButtonPlayerChooseScrollUp, ButtonPlayerChooseScrollDown};
|
||||
_ThemeButtons = new string[] {_ButtonBack, _ButtonNext, _ButtonPlayerDestination, _ButtonPlayerChoose, _ButtonPlayerChooseScrollUp, _ButtonPlayerChooseScrollDown};
|
||||
|
||||
Data = new DataFromScreen();
|
||||
FromScreenNames names = new FromScreenNames();
|
||||
_Data = new SDataFromScreen();
|
||||
SFromScreenNames names = new SFromScreenNames();
|
||||
names.FadeToConfig = false;
|
||||
names.FadeToMain = false;
|
||||
names.ProfileIDsTeam1 = new List<int>();
|
||||
names.ProfileIDsTeam2 = new List<int>();
|
||||
Data.ScreenNames = names;
|
||||
_Data.ScreenNames = names;
|
||||
}
|
||||
|
||||
public override void DataToScreen(object ReceivedData)
|
||||
public override void DataToScreen(object receivedData)
|
||||
{
|
||||
DataToScreenNames config = new DataToScreenNames();
|
||||
SDataToScreenNames config = new SDataToScreenNames();
|
||||
|
||||
try
|
||||
{
|
||||
config = (DataToScreenNames)ReceivedData;
|
||||
Data.ScreenNames.ProfileIDsTeam1 = config.ProfileIDsTeam1;
|
||||
Data.ScreenNames.ProfileIDsTeam2 = config.ProfileIDsTeam2;
|
||||
if (Data.ScreenNames.ProfileIDsTeam1 == null)
|
||||
Data.ScreenNames.ProfileIDsTeam1 = new List<int>();
|
||||
if (Data.ScreenNames.ProfileIDsTeam2 == null)
|
||||
Data.ScreenNames.ProfileIDsTeam2 = new List<int>();
|
||||
config = (SDataToScreenNames)receivedData;
|
||||
_Data.ScreenNames.ProfileIDsTeam1 = config.ProfileIDsTeam1;
|
||||
_Data.ScreenNames.ProfileIDsTeam2 = config.ProfileIDsTeam2;
|
||||
if (_Data.ScreenNames.ProfileIDsTeam1 == null)
|
||||
_Data.ScreenNames.ProfileIDsTeam1 = new List<int>();
|
||||
if (_Data.ScreenNames.ProfileIDsTeam2 == null)
|
||||
_Data.ScreenNames.ProfileIDsTeam2 = new List<int>();
|
||||
|
||||
NumPlayerTeam1 = config.NumPlayerTeam1;
|
||||
NumPlayerTeam2 = config.NumPlayerTeam2;
|
||||
_NumPlayerTeam1 = config.NumPlayerTeam1;
|
||||
_NumPlayerTeam2 = config.NumPlayerTeam2;
|
||||
|
||||
while (Data.ScreenNames.ProfileIDsTeam1.Count > NumPlayerTeam1)
|
||||
Data.ScreenNames.ProfileIDsTeam1.RemoveAt(Data.ScreenNames.ProfileIDsTeam1.Count - 1);
|
||||
while (Data.ScreenNames.ProfileIDsTeam2.Count > NumPlayerTeam2)
|
||||
Data.ScreenNames.ProfileIDsTeam2.RemoveAt(Data.ScreenNames.ProfileIDsTeam2.Count - 1);
|
||||
while (_Data.ScreenNames.ProfileIDsTeam1.Count > _NumPlayerTeam1)
|
||||
_Data.ScreenNames.ProfileIDsTeam1.RemoveAt(_Data.ScreenNames.ProfileIDsTeam1.Count - 1);
|
||||
while (_Data.ScreenNames.ProfileIDsTeam2.Count > _NumPlayerTeam2)
|
||||
_Data.ScreenNames.ProfileIDsTeam2.RemoveAt(_Data.ScreenNames.ProfileIDsTeam2.Count - 1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -109,7 +109,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleInput(KeyEvent keyEvent)
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
base.HandleInput(keyEvent);
|
||||
|
||||
@@ -120,60 +120,60 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
case Keys.Back:
|
||||
case Keys.Escape:
|
||||
Back();
|
||||
_Back();
|
||||
break;
|
||||
|
||||
case Keys.Enter:
|
||||
if (Buttons[ButtonBack].Selected)
|
||||
Back();
|
||||
if (Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
|
||||
if (Buttons[ButtonNext].Selected)
|
||||
Next();
|
||||
if (Buttons[_ButtonNext].Selected)
|
||||
_Next();
|
||||
|
||||
if (Buttons[ButtonPlayerChooseScrollUp].Selected)
|
||||
Scroll(-1);
|
||||
if (Buttons[_ButtonPlayerChooseScrollUp].Selected)
|
||||
_Scroll(-1);
|
||||
|
||||
if (Buttons[ButtonPlayerChooseScrollDown].Selected)
|
||||
Scroll(1);
|
||||
if (Buttons[_ButtonPlayerChooseScrollDown].Selected)
|
||||
_Scroll(1);
|
||||
|
||||
if (!OnAdd())
|
||||
OnRemove();
|
||||
if (!_OnAdd())
|
||||
_OnRemove();
|
||||
break;
|
||||
|
||||
case Keys.Delete:
|
||||
OnRemove();
|
||||
_OnRemove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool HandleMouse(MouseEvent mouseEvent)
|
||||
public override bool HandleMouse(SMouseEvent mouseEvent)
|
||||
{
|
||||
base.HandleMouse(mouseEvent);
|
||||
|
||||
//Check if LeftButton is hold and Select-Mode inactive
|
||||
if (mouseEvent.LBH && !SelectingMouseActive)
|
||||
if (mouseEvent.LBH && !_SelectingMouseActive)
|
||||
{
|
||||
//Save mouse-coords
|
||||
OldMouseX = mouseEvent.X;
|
||||
OldMouseY = mouseEvent.Y;
|
||||
_OldMouseX = mouseEvent.X;
|
||||
_OldMouseY = mouseEvent.Y;
|
||||
//Check if mouse if over tile
|
||||
for (int i = 0; i < PlayerChooseButtons.Count; i++)
|
||||
for (int i = 0; i < _PlayerChooseButtons.Count; i++)
|
||||
{
|
||||
if (PlayerChooseButtons[i].Button.Selected)
|
||||
if (_PlayerChooseButtons[i].Button.Selected)
|
||||
{
|
||||
SelectedPlayerNr = PlayerChooseButtons[i].ProfileID;
|
||||
if (SelectedPlayerNr != -1)
|
||||
_SelectedPlayerNr = _PlayerChooseButtons[i].ProfileID;
|
||||
if (_SelectedPlayerNr != -1)
|
||||
{
|
||||
//Activate mouse-selecting
|
||||
SelectingMouseActive = true;
|
||||
_SelectingMouseActive = true;
|
||||
//Update of Drag/Drop-Texture
|
||||
chooseAvatarStatic.Visible = true;
|
||||
chooseAvatarStatic.Rect = PlayerChooseButtons[i].Button.Rect;
|
||||
chooseAvatarStatic.Rect.Z = -100;
|
||||
chooseAvatarStatic.Color = new SColorF(1, 1, 1, 1);
|
||||
chooseAvatarStatic.Texture = CBase.Profiles.GetProfiles()[SelectedPlayerNr].Avatar.Texture;
|
||||
_ChooseAvatarStatic.Visible = true;
|
||||
_ChooseAvatarStatic.Rect = _PlayerChooseButtons[i].Button.Rect;
|
||||
_ChooseAvatarStatic.Rect.Z = -100;
|
||||
_ChooseAvatarStatic.Color = new SColorF(1, 1, 1, 1);
|
||||
_ChooseAvatarStatic.Texture = CBase.Profiles.GetProfiles()[_SelectedPlayerNr].Avatar.Texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,103 +181,103 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
|
||||
//Check if LeftButton is hold and Select-Mode active
|
||||
if (mouseEvent.LBH && SelectingMouseActive)
|
||||
if (mouseEvent.LBH && _SelectingMouseActive)
|
||||
{
|
||||
//Update coords for Drag/Drop-Texture
|
||||
chooseAvatarStatic.Rect.X += mouseEvent.X - OldMouseX;
|
||||
chooseAvatarStatic.Rect.Y += mouseEvent.Y - OldMouseY;
|
||||
OldMouseX = mouseEvent.X;
|
||||
OldMouseY = mouseEvent.Y;
|
||||
_ChooseAvatarStatic.Rect.X += mouseEvent.X - _OldMouseX;
|
||||
_ChooseAvatarStatic.Rect.Y += mouseEvent.Y - _OldMouseY;
|
||||
_OldMouseX = mouseEvent.X;
|
||||
_OldMouseY = mouseEvent.Y;
|
||||
|
||||
return true;
|
||||
}
|
||||
// LeftButton isn't hold anymore, but Selec-Mode is still active -> "Drop" of Avatar
|
||||
else if (SelectingMouseActive)
|
||||
else if (_SelectingMouseActive)
|
||||
{
|
||||
//Check if really a player was selected
|
||||
if (SelectedPlayerNr != -1)
|
||||
if (_SelectedPlayerNr != -1)
|
||||
{
|
||||
//Foreach Drop-Area
|
||||
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
||||
for (int i = 0; i < _PlayerDestinationButtons.Count; i++)
|
||||
{
|
||||
//Check first, if area is "active"
|
||||
if (PlayerDestinationButtons[i].Visible)
|
||||
if (_PlayerDestinationButtons[i].Visible)
|
||||
{
|
||||
//Check if Mouse is in area
|
||||
if (CHelper.IsInBounds(PlayerDestinationButtons[i].Rect, mouseEvent))
|
||||
if (CHelper.IsInBounds(_PlayerDestinationButtons[i].Rect, mouseEvent))
|
||||
{
|
||||
int added = -1;
|
||||
//Add Player-ID to list.
|
||||
if (i - PlayerDestinationButtonsNumH < 0)
|
||||
if (i - _PlayerDestinationButtonsNumH < 0)
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDsTeam1.Count < (i + 1))
|
||||
if (_Data.ScreenNames.ProfileIDsTeam1.Count < (i + 1))
|
||||
{
|
||||
Data.ScreenNames.ProfileIDsTeam1.Add(SelectedPlayerNr);
|
||||
added = Data.ScreenNames.ProfileIDsTeam1.Count - 1;
|
||||
_Data.ScreenNames.ProfileIDsTeam1.Add(_SelectedPlayerNr);
|
||||
added = _Data.ScreenNames.ProfileIDsTeam1.Count - 1;
|
||||
}
|
||||
else if (Data.ScreenNames.ProfileIDsTeam1.Count >= (i + 1))
|
||||
else if (_Data.ScreenNames.ProfileIDsTeam1.Count >= (i + 1))
|
||||
{
|
||||
Data.ScreenNames.ProfileIDsTeam1[i] = SelectedPlayerNr;
|
||||
_Data.ScreenNames.ProfileIDsTeam1[i] = _SelectedPlayerNr;
|
||||
added = i;
|
||||
}
|
||||
}
|
||||
else if (i - PlayerDestinationButtonsNumH >= 0)
|
||||
else if (i - _PlayerDestinationButtonsNumH >= 0)
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDsTeam2.Count < ((i - PlayerDestinationButtonsNumH) + 1))
|
||||
if (_Data.ScreenNames.ProfileIDsTeam2.Count < ((i - _PlayerDestinationButtonsNumH) + 1))
|
||||
{
|
||||
Data.ScreenNames.ProfileIDsTeam2.Add(SelectedPlayerNr);
|
||||
added = Data.ScreenNames.ProfileIDsTeam2.Count - 1 + PlayerDestinationButtonsNumH;
|
||||
_Data.ScreenNames.ProfileIDsTeam2.Add(_SelectedPlayerNr);
|
||||
added = _Data.ScreenNames.ProfileIDsTeam2.Count - 1 + _PlayerDestinationButtonsNumH;
|
||||
}
|
||||
else if (Data.ScreenNames.ProfileIDsTeam2.Count >= ((i - PlayerDestinationButtonsNumH) + 1))
|
||||
else if (_Data.ScreenNames.ProfileIDsTeam2.Count >= ((i - _PlayerDestinationButtonsNumH) + 1))
|
||||
{
|
||||
Data.ScreenNames.ProfileIDsTeam2[i - PlayerDestinationButtonsNumH] = SelectedPlayerNr;
|
||||
_Data.ScreenNames.ProfileIDsTeam2[i - _PlayerDestinationButtonsNumH] = _SelectedPlayerNr;
|
||||
added = i;
|
||||
}
|
||||
}
|
||||
UpdateButtonNext();
|
||||
_UpdateButtonNext();
|
||||
//Update texture and name
|
||||
PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||
PlayerDestinationButtons[added].Texture = chooseAvatarStatic.Texture;
|
||||
PlayerDestinationButtons[added].SelTexture = chooseAvatarStatic.Texture;
|
||||
PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[SelectedPlayerNr].PlayerName;
|
||||
PlayerDestinationButtons[added].Enabled = true;
|
||||
_PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
_PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||
_PlayerDestinationButtons[added].Texture = _ChooseAvatarStatic.Texture;
|
||||
_PlayerDestinationButtons[added].SelTexture = _ChooseAvatarStatic.Texture;
|
||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[_SelectedPlayerNr].PlayerName;
|
||||
_PlayerDestinationButtons[added].Enabled = true;
|
||||
//Update Tiles-List
|
||||
UpdateButtonPlayerChoose();
|
||||
_UpdateButtonPlayerChoose();
|
||||
}
|
||||
}
|
||||
}
|
||||
SelectedPlayerNr = -1;
|
||||
_SelectedPlayerNr = -1;
|
||||
}
|
||||
//Reset variables
|
||||
SelectingMouseActive = false;
|
||||
chooseAvatarStatic.Visible = false;
|
||||
_SelectingMouseActive = false;
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mouseEvent.LB && IsMouseOver(mouseEvent))
|
||||
{
|
||||
if (Buttons[ButtonBack].Selected)
|
||||
Back();
|
||||
if (Buttons[_ButtonBack].Selected)
|
||||
_Back();
|
||||
|
||||
if (Buttons[ButtonNext].Selected)
|
||||
Next();
|
||||
if (Buttons[_ButtonNext].Selected)
|
||||
_Next();
|
||||
|
||||
if (Buttons[ButtonPlayerChooseScrollUp].Selected)
|
||||
Scroll(-1);
|
||||
if (Buttons[_ButtonPlayerChooseScrollUp].Selected)
|
||||
_Scroll(-1);
|
||||
|
||||
if (Buttons[ButtonPlayerChooseScrollDown].Selected)
|
||||
Scroll(1);
|
||||
if (Buttons[_ButtonPlayerChooseScrollDown].Selected)
|
||||
_Scroll(1);
|
||||
}
|
||||
|
||||
if (mouseEvent.LD && IsMouseOver(mouseEvent))
|
||||
{
|
||||
if (!OnAdd())
|
||||
OnRemove();
|
||||
if (!_OnAdd())
|
||||
_OnRemove();
|
||||
}
|
||||
|
||||
if (mouseEvent.RB)
|
||||
Back();
|
||||
_Back();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -286,17 +286,17 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
base.OnShow();
|
||||
|
||||
if (!ButtonsAdded)
|
||||
if (!_ButtonsAdded)
|
||||
{
|
||||
AddButtonPlayerDestination();
|
||||
AddButtonPlayerChoose();
|
||||
ButtonsAdded = true;
|
||||
_AddButtonPlayerDestination();
|
||||
_AddButtonPlayerChoose();
|
||||
_ButtonsAdded = true;
|
||||
}
|
||||
|
||||
UpdateButtonPlayerDestination();
|
||||
UpdateButtonPlayerChoose();
|
||||
_UpdateButtonPlayerDestination();
|
||||
_UpdateButtonPlayerChoose();
|
||||
|
||||
UpdateButtonNext();
|
||||
_UpdateButtonNext();
|
||||
}
|
||||
|
||||
public override bool UpdateGame()
|
||||
@@ -307,39 +307,39 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
public override bool Draw()
|
||||
{
|
||||
base.Draw();
|
||||
if (chooseAvatarStatic.Visible)
|
||||
chooseAvatarStatic.Draw();
|
||||
if (_ChooseAvatarStatic.Visible)
|
||||
_ChooseAvatarStatic.Draw();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void Scroll(int Offset)
|
||||
private void _Scroll(int offset)
|
||||
{
|
||||
if (Offset < 0 && PlayerChooseButtonsOffset > 0)
|
||||
if (offset < 0 && _PlayerChooseButtonsOffset > 0)
|
||||
{
|
||||
PlayerChooseButtonsOffset += Offset;
|
||||
UpdateButtonPlayerChoose();
|
||||
_PlayerChooseButtonsOffset += offset;
|
||||
_UpdateButtonPlayerChoose();
|
||||
}
|
||||
else if (PlayerChooseButtonsVisibleProfiles.Count < PlayerChooseButtons.Count + (PlayerChooseButtonsOffset + Offset) * PlayerChooseButtonsNumH)
|
||||
else if (_PlayerChooseButtonsVisibleProfiles.Count < _PlayerChooseButtons.Count + (_PlayerChooseButtonsOffset + offset) * _PlayerChooseButtonsNumH)
|
||||
{
|
||||
PlayerChooseButtonsOffset += Offset;
|
||||
UpdateButtonPlayerChoose();
|
||||
_PlayerChooseButtonsOffset += offset;
|
||||
_UpdateButtonPlayerChoose();
|
||||
}
|
||||
}
|
||||
|
||||
private void AddButtonPlayerDestination()
|
||||
private void _AddButtonPlayerDestination()
|
||||
{
|
||||
Buttons[ButtonPlayerDestination].Visible = false;
|
||||
PlayerDestinationButtons = new List<CButton>();
|
||||
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]);
|
||||
b.Rect.X = PlayerDestinationButtonsFirstX + column * (b.Rect.W + PlayerDestinationButtonsSpaceH);
|
||||
b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW);
|
||||
PlayerDestinationButtons.Add(b);
|
||||
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);
|
||||
column++;
|
||||
if (column >= PlayerDestinationButtonsNumH)
|
||||
if (column >= _PlayerDestinationButtonsNumH)
|
||||
{
|
||||
row++;
|
||||
column = 0;
|
||||
@@ -350,23 +350,23 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
}
|
||||
|
||||
private void AddButtonPlayerChoose()
|
||||
private void _AddButtonPlayerChoose()
|
||||
{
|
||||
Buttons[ButtonPlayerChoose].Visible = false;
|
||||
PlayerChooseButtons = new List<CPlayerChooseButton>();
|
||||
Buttons[_ButtonPlayerChoose].Visible = false;
|
||||
_PlayerChooseButtons = new List<CPlayerChooseButton>();
|
||||
int row = 0;
|
||||
int column = 0;
|
||||
for (int i = 1; i <= PlayerChooseButtonsNumH * PlayerChooseButtonsNumW; i++)
|
||||
for (int i = 1; i <= _PlayerChooseButtonsNumH * _PlayerChooseButtonsNumW; i++)
|
||||
{
|
||||
CButton b = GetNewButton(Buttons[ButtonPlayerChoose]);
|
||||
b.Rect.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH);
|
||||
b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW);
|
||||
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();
|
||||
pcb.Button = b;
|
||||
pcb.ProfileID = -1;
|
||||
PlayerChooseButtons.Add(pcb);
|
||||
_PlayerChooseButtons.Add(pcb);
|
||||
column++;
|
||||
if (column >= PlayerChooseButtonsNumH)
|
||||
if (column >= _PlayerChooseButtonsNumH)
|
||||
{
|
||||
row++;
|
||||
column = 0;
|
||||
@@ -377,56 +377,56 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateButtonPlayerChoose()
|
||||
private void _UpdateButtonPlayerChoose()
|
||||
{
|
||||
UpdateVisibleProfiles();
|
||||
if ((PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * (PlayerChooseButtonsOffset + 1) - PlayerChooseButtonsVisibleProfiles.Count >=
|
||||
(PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * PlayerChooseButtonsOffset)
|
||||
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset - 1);
|
||||
_UpdateVisibleProfiles();
|
||||
if ((_PlayerChooseButtonsNumW * _PlayerChooseButtonsNumH) * (_PlayerChooseButtonsOffset + 1) - _PlayerChooseButtonsVisibleProfiles.Count >=
|
||||
(_PlayerChooseButtonsNumW * _PlayerChooseButtonsNumH) * _PlayerChooseButtonsOffset)
|
||||
_UpdateButtonPlayerChoose(_PlayerChooseButtonsOffset - 1);
|
||||
else
|
||||
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset);
|
||||
Buttons[ButtonPlayerChooseScrollUp].Enabled = PlayerChooseButtonsOffset > 0;
|
||||
Buttons[ButtonPlayerChooseScrollDown].Enabled = PlayerChooseButtonsVisibleProfiles.Count >
|
||||
PlayerChooseButtons.Count + PlayerChooseButtonsOffset * PlayerChooseButtonsNumH;
|
||||
_UpdateButtonPlayerChoose(_PlayerChooseButtonsOffset);
|
||||
Buttons[_ButtonPlayerChooseScrollUp].Enabled = _PlayerChooseButtonsOffset > 0;
|
||||
Buttons[_ButtonPlayerChooseScrollDown].Enabled = _PlayerChooseButtonsVisibleProfiles.Count >
|
||||
_PlayerChooseButtons.Count + _PlayerChooseButtonsOffset * _PlayerChooseButtonsNumH;
|
||||
}
|
||||
|
||||
private void UpdateButtonPlayerChoose(int Offset)
|
||||
private void _UpdateButtonPlayerChoose(int offset)
|
||||
{
|
||||
int NumButtonPlayerChoose = PlayerChooseButtonsNumW * PlayerChooseButtonsNumH;
|
||||
if (Offset < 0)
|
||||
Offset = 0;
|
||||
int numButtonPlayerChoose = _PlayerChooseButtonsNumW * _PlayerChooseButtonsNumH;
|
||||
if (offset < 0)
|
||||
offset = 0;
|
||||
|
||||
if (NumButtonPlayerChoose * (Offset + 1) - PlayerChooseButtonsVisibleProfiles.Count <= NumButtonPlayerChoose)
|
||||
if (numButtonPlayerChoose * (offset + 1) - _PlayerChooseButtonsVisibleProfiles.Count <= numButtonPlayerChoose)
|
||||
{
|
||||
for (int i = 0; i < NumButtonPlayerChoose; i++)
|
||||
for (int i = 0; i < numButtonPlayerChoose; i++)
|
||||
{
|
||||
if ((i + Offset * NumButtonPlayerChoose) < PlayerChooseButtonsVisibleProfiles.Count)
|
||||
if ((i + offset * numButtonPlayerChoose) < _PlayerChooseButtonsVisibleProfiles.Count)
|
||||
{
|
||||
PlayerChooseButtons[i].ProfileID = PlayerChooseButtonsVisibleProfiles[i + Offset * NumButtonPlayerChoose];
|
||||
PlayerChooseButtons[i].Button.Text.Text = CBase.Profiles.GetProfiles()[PlayerChooseButtonsVisibleProfiles[i + Offset * NumButtonPlayerChoose]].PlayerName;
|
||||
PlayerChooseButtons[i].Button.Texture = CBase.Profiles.GetProfiles()[PlayerChooseButtonsVisibleProfiles[i + Offset * NumButtonPlayerChoose]].Avatar.Texture;
|
||||
PlayerChooseButtons[i].Button.SelTexture = CBase.Profiles.GetProfiles()[PlayerChooseButtonsVisibleProfiles[i + Offset * NumButtonPlayerChoose]].Avatar.Texture;
|
||||
PlayerChooseButtons[i].Button.Color = new SColorF(1, 1, 1, 0.6f);
|
||||
PlayerChooseButtons[i].Button.SelColor = new SColorF(1, 1, 1, 1);
|
||||
PlayerChooseButtons[i].Button.Enabled = true;
|
||||
_PlayerChooseButtons[i].ProfileID = _PlayerChooseButtonsVisibleProfiles[i + offset * numButtonPlayerChoose];
|
||||
_PlayerChooseButtons[i].Button.Text.Text = CBase.Profiles.GetProfiles()[_PlayerChooseButtonsVisibleProfiles[i + offset * numButtonPlayerChoose]].PlayerName;
|
||||
_PlayerChooseButtons[i].Button.Texture = CBase.Profiles.GetProfiles()[_PlayerChooseButtonsVisibleProfiles[i + offset * numButtonPlayerChoose]].Avatar.Texture;
|
||||
_PlayerChooseButtons[i].Button.SelTexture = CBase.Profiles.GetProfiles()[_PlayerChooseButtonsVisibleProfiles[i + offset * numButtonPlayerChoose]].Avatar.Texture;
|
||||
_PlayerChooseButtons[i].Button.Color = new SColorF(1, 1, 1, 0.6f);
|
||||
_PlayerChooseButtons[i].Button.SelColor = new SColorF(1, 1, 1, 1);
|
||||
_PlayerChooseButtons[i].Button.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
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.Enabled = false;
|
||||
_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.Enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateVisibleProfiles()
|
||||
private void _UpdateVisibleProfiles()
|
||||
{
|
||||
PlayerChooseButtonsVisibleProfiles.Clear();
|
||||
_PlayerChooseButtonsVisibleProfiles.Clear();
|
||||
for (int i = 0; i < CBase.Profiles.GetProfiles().Length; i++)
|
||||
{
|
||||
bool visible = false;
|
||||
@@ -435,20 +435,20 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
visible = true;
|
||||
|
||||
for (int p = 0; p < Data.ScreenNames.ProfileIDsTeam1.Count; p++)
|
||||
for (int p = 0; p < _Data.ScreenNames.ProfileIDsTeam1.Count; p++)
|
||||
{
|
||||
//Don't show profile if is selected
|
||||
if (Data.ScreenNames.ProfileIDsTeam1[p] == i)
|
||||
if (_Data.ScreenNames.ProfileIDsTeam1[p] == i)
|
||||
{
|
||||
visible = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int p = 0; p < Data.ScreenNames.ProfileIDsTeam2.Count; p++)
|
||||
for (int p = 0; p < _Data.ScreenNames.ProfileIDsTeam2.Count; p++)
|
||||
{
|
||||
//Don't show profile if is selected
|
||||
if (Data.ScreenNames.ProfileIDsTeam2[p] == i)
|
||||
if (_Data.ScreenNames.ProfileIDsTeam2[p] == i)
|
||||
{
|
||||
visible = false;
|
||||
break;
|
||||
@@ -456,136 +456,136 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
}
|
||||
}
|
||||
if (visible)
|
||||
PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||
_PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateButtonPlayerDestination()
|
||||
private void _UpdateButtonPlayerDestination()
|
||||
{
|
||||
for (int i = 0; i < PlayerDestinationButtons.Count / 2; i++)
|
||||
for (int i = 0; i < _PlayerDestinationButtons.Count / 2; i++)
|
||||
{
|
||||
if (NumPlayerTeam1 > i)
|
||||
if (_NumPlayerTeam1 > i)
|
||||
{
|
||||
PlayerDestinationButtons[i].Visible = true;
|
||||
PlayerDestinationButtons[i].Enabled = true;
|
||||
_PlayerDestinationButtons[i].Visible = true;
|
||||
_PlayerDestinationButtons[i].Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerDestinationButtons[i].Visible = false;
|
||||
PlayerDestinationButtons[i].Enabled = false;
|
||||
_PlayerDestinationButtons[i].Visible = false;
|
||||
_PlayerDestinationButtons[i].Enabled = false;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < PlayerDestinationButtons.Count / 2; i++)
|
||||
for (int i = 0; i < _PlayerDestinationButtons.Count / 2; i++)
|
||||
{
|
||||
if (NumPlayerTeam2 > i)
|
||||
if (_NumPlayerTeam2 > i)
|
||||
{
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Visible = true;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Enabled = true;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Visible = true;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Visible = false;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Enabled = false;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Visible = false;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Enabled = false;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < NumPlayerTeam1; i++)
|
||||
for (int i = 0; i < _NumPlayerTeam1; i++)
|
||||
{
|
||||
if (i < Data.ScreenNames.ProfileIDsTeam1.Count)
|
||||
if (i < _Data.ScreenNames.ProfileIDsTeam1.Count)
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDsTeam1[i] != -1)
|
||||
if (_Data.ScreenNames.ProfileIDsTeam1[i] != -1)
|
||||
{
|
||||
PlayerDestinationButtons[i].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
PlayerDestinationButtons[i].SelColor = new SColorF(1, 1, 1, 1);
|
||||
PlayerDestinationButtons[i].Texture = CBase.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDsTeam1[i]].Avatar.Texture;
|
||||
PlayerDestinationButtons[i].SelTexture = CBase.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDsTeam1[i]].Avatar.Texture;
|
||||
PlayerDestinationButtons[i].Text.Text = CBase.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDsTeam1[i]].PlayerName;
|
||||
PlayerDestinationButtons[i].Enabled = true;
|
||||
_PlayerDestinationButtons[i].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
_PlayerDestinationButtons[i].SelColor = new SColorF(1, 1, 1, 1);
|
||||
_PlayerDestinationButtons[i].Texture = CBase.Profiles.GetProfiles()[_Data.ScreenNames.ProfileIDsTeam1[i]].Avatar.Texture;
|
||||
_PlayerDestinationButtons[i].SelTexture = CBase.Profiles.GetProfiles()[_Data.ScreenNames.ProfileIDsTeam1[i]].Avatar.Texture;
|
||||
_PlayerDestinationButtons[i].Text.Text = CBase.Profiles.GetProfiles()[_Data.ScreenNames.ProfileIDsTeam1[i]].PlayerName;
|
||||
_PlayerDestinationButtons[i].Enabled = true;
|
||||
}
|
||||
}
|
||||
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].Text.Text = String.Empty;
|
||||
PlayerDestinationButtons[i].Enabled = false;
|
||||
_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;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < NumPlayerTeam2; i++)
|
||||
for (int i = 0; i < _NumPlayerTeam2; i++)
|
||||
{
|
||||
if (i < Data.ScreenNames.ProfileIDsTeam2.Count)
|
||||
if (i < _Data.ScreenNames.ProfileIDsTeam2.Count)
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDsTeam2[i] != -1)
|
||||
if (_Data.ScreenNames.ProfileIDsTeam2[i] != -1)
|
||||
{
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].SelColor = new SColorF(1, 1, 1, 1);
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Texture = CBase.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDsTeam2[i]].Avatar.Texture;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].SelTexture = CBase.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDsTeam2[i]].Avatar.Texture;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Text.Text = CBase.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDsTeam2[i]].PlayerName;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Enabled = true;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].SelColor = new SColorF(1, 1, 1, 1);
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Texture = CBase.Profiles.GetProfiles()[_Data.ScreenNames.ProfileIDsTeam2[i]].Avatar.Texture;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].SelTexture = CBase.Profiles.GetProfiles()[_Data.ScreenNames.ProfileIDsTeam2[i]].Avatar.Texture;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Text.Text = CBase.Profiles.GetProfiles()[_Data.ScreenNames.ProfileIDsTeam2[i]].PlayerName;
|
||||
_PlayerDestinationButtons[i + _PlayerDestinationButtonsNumH].Enabled = true;
|
||||
}
|
||||
}
|
||||
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].Text.Text = String.Empty;
|
||||
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Enabled = false;
|
||||
_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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateButtonNext()
|
||||
private void _UpdateButtonNext()
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDsTeam1.Count == NumPlayerTeam1 && Data.ScreenNames.ProfileIDsTeam2.Count == NumPlayerTeam2)
|
||||
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()
|
||||
private bool _OnAdd()
|
||||
{
|
||||
for (int i = 0; i < PlayerChooseButtons.Count; i++)
|
||||
for (int i = 0; i < _PlayerChooseButtons.Count; i++)
|
||||
{
|
||||
if (PlayerChooseButtons[i].Button.Selected && PlayerChooseButtons[i].ProfileID != -1)
|
||||
if (_PlayerChooseButtons[i].Button.Selected && _PlayerChooseButtons[i].ProfileID != -1)
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDsTeam1.Count < NumPlayerTeam1)
|
||||
if (_Data.ScreenNames.ProfileIDsTeam1.Count < _NumPlayerTeam1)
|
||||
{
|
||||
Data.ScreenNames.ProfileIDsTeam1.Add(PlayerChooseButtons[i].ProfileID);
|
||||
int added = Data.ScreenNames.ProfileIDsTeam1.Count - 1;
|
||||
UpdateButtonNext();
|
||||
_Data.ScreenNames.ProfileIDsTeam1.Add(_PlayerChooseButtons[i].ProfileID);
|
||||
int added = _Data.ScreenNames.ProfileIDsTeam1.Count - 1;
|
||||
_UpdateButtonNext();
|
||||
//Update texture and name
|
||||
PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||
PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[PlayerChooseButtons[i].ProfileID].PlayerName;
|
||||
PlayerDestinationButtons[added].Enabled = true;
|
||||
_PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
_PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].PlayerName;
|
||||
_PlayerDestinationButtons[added].Enabled = true;
|
||||
//Update Tiles-List
|
||||
UpdateButtonPlayerChoose();
|
||||
_UpdateButtonPlayerChoose();
|
||||
CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
else if (Data.ScreenNames.ProfileIDsTeam2.Count < NumPlayerTeam2)
|
||||
else if (_Data.ScreenNames.ProfileIDsTeam2.Count < _NumPlayerTeam2)
|
||||
{
|
||||
Data.ScreenNames.ProfileIDsTeam2.Add(PlayerChooseButtons[i].ProfileID);
|
||||
int added = (Data.ScreenNames.ProfileIDsTeam2.Count - 1) + PlayerDestinationButtonsNumH;
|
||||
UpdateButtonNext();
|
||||
_Data.ScreenNames.ProfileIDsTeam2.Add(_PlayerChooseButtons[i].ProfileID);
|
||||
int added = (_Data.ScreenNames.ProfileIDsTeam2.Count - 1) + _PlayerDestinationButtonsNumH;
|
||||
_UpdateButtonNext();
|
||||
//Update texture and name
|
||||
PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||
PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[PlayerChooseButtons[i].ProfileID].PlayerName;
|
||||
PlayerDestinationButtons[added].Enabled = true;
|
||||
_PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
_PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].PlayerName;
|
||||
_PlayerDestinationButtons[added].Enabled = true;
|
||||
//Update Tiles-List
|
||||
UpdateButtonPlayerChoose();
|
||||
_UpdateButtonPlayerChoose();
|
||||
CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
@@ -594,33 +594,33 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool OnRemove()
|
||||
private bool _OnRemove()
|
||||
{
|
||||
for (int i = 0; i < PlayerDestinationButtonsNumH; i++)
|
||||
for (int i = 0; i < _PlayerDestinationButtonsNumH; i++)
|
||||
{
|
||||
if (PlayerDestinationButtons[i].Selected)
|
||||
if (_PlayerDestinationButtons[i].Selected)
|
||||
{
|
||||
if ((i + 1) <= Data.ScreenNames.ProfileIDsTeam1.Count)
|
||||
if ((i + 1) <= _Data.ScreenNames.ProfileIDsTeam1.Count)
|
||||
{
|
||||
Data.ScreenNames.ProfileIDsTeam1.RemoveAt(i);
|
||||
UpdateButtonNext();
|
||||
UpdateButtonPlayerDestination();
|
||||
UpdateButtonPlayerChoose();
|
||||
_Data.ScreenNames.ProfileIDsTeam1.RemoveAt(i);
|
||||
_UpdateButtonNext();
|
||||
_UpdateButtonPlayerDestination();
|
||||
_UpdateButtonPlayerChoose();
|
||||
CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = PlayerDestinationButtonsNumH; i < PlayerDestinationButtonsNumH * 2; i++)
|
||||
for (int i = _PlayerDestinationButtonsNumH; i < _PlayerDestinationButtonsNumH * 2; i++)
|
||||
{
|
||||
if (PlayerDestinationButtons[i].Selected)
|
||||
if (_PlayerDestinationButtons[i].Selected)
|
||||
{
|
||||
if (((i - PlayerDestinationButtonsNumH) + 1) <= Data.ScreenNames.ProfileIDsTeam2.Count)
|
||||
if (((i - _PlayerDestinationButtonsNumH) + 1) <= _Data.ScreenNames.ProfileIDsTeam2.Count)
|
||||
{
|
||||
Data.ScreenNames.ProfileIDsTeam2.RemoveAt(i - PlayerDestinationButtonsNumH);
|
||||
UpdateButtonNext();
|
||||
UpdateButtonPlayerDestination();
|
||||
UpdateButtonPlayerChoose();
|
||||
_Data.ScreenNames.ProfileIDsTeam2.RemoveAt(i - _PlayerDestinationButtonsNumH);
|
||||
_UpdateButtonNext();
|
||||
_UpdateButtonPlayerDestination();
|
||||
_UpdateButtonPlayerChoose();
|
||||
CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
@@ -629,18 +629,18 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
return false;
|
||||
}
|
||||
|
||||
private void Back()
|
||||
private void _Back()
|
||||
{
|
||||
Data.ScreenNames.FadeToConfig = true;
|
||||
Data.ScreenNames.FadeToMain = false;
|
||||
_PartyMode.DataFromScreen(ThemeName, Data);
|
||||
_Data.ScreenNames.FadeToConfig = true;
|
||||
_Data.ScreenNames.FadeToMain = false;
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
}
|
||||
|
||||
private void Next()
|
||||
private void _Next()
|
||||
{
|
||||
Data.ScreenNames.FadeToConfig = false;
|
||||
Data.ScreenNames.FadeToMain = true;
|
||||
_PartyMode.DataFromScreen(ThemeName, Data);
|
||||
_Data.ScreenNames.FadeToConfig = false;
|
||||
_Data.ScreenNames.FadeToMain = true;
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user