Renaming for namesheme
This commit is contained in:
1 parent
1336a6fa36
commit
67da90427b
131 files changed
+11905
-11812
No files matched your search
@@ -3,58 +3,58 @@ using System.Collections.Generic;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
public class ChallengeRounds
|
||||
public class CChallengeRounds
|
||||
{
|
||||
private readonly Random _Rand;
|
||||
private readonly int _NumPlayer;
|
||||
|
||||
public List<Combination> Rounds;
|
||||
public List<CCombination> Rounds;
|
||||
|
||||
public ChallengeRounds(int NumRounds, int NumPlayer, int NumPlayerAtOnce)
|
||||
public CChallengeRounds(int numRounds, int numPlayer, int numPlayerAtOnce)
|
||||
{
|
||||
Rounds = new List<Combination>();
|
||||
Rounds = new List<CCombination>();
|
||||
_Rand = new Random(DateTime.Now.Millisecond);
|
||||
|
||||
if (NumPlayerAtOnce < 1 || NumRounds < 1 || NumPlayer == 0)
|
||||
if (numPlayerAtOnce < 1 || numRounds < 1 || numPlayer == 0)
|
||||
_NumPlayer = 0;
|
||||
else
|
||||
{
|
||||
_NumPlayer = NumPlayer;
|
||||
BuildRounds(NumRounds, NumPlayerAtOnce, _Rand);
|
||||
_NumPlayer = numPlayer;
|
||||
_BuildRounds(numRounds, numPlayerAtOnce, _Rand);
|
||||
}
|
||||
}
|
||||
|
||||
public Combination GetRound(int RoundNr)
|
||||
public CCombination GetRound(int roundNr)
|
||||
{
|
||||
if (RoundNr >= Rounds.Count || _NumPlayer == 0 || Rounds.Count == 0)
|
||||
if (roundNr >= Rounds.Count || _NumPlayer == 0 || Rounds.Count == 0)
|
||||
return null;
|
||||
|
||||
return Rounds[RoundNr];
|
||||
return Rounds[roundNr];
|
||||
}
|
||||
|
||||
private void BuildRounds(int NumRounds, int NumPlayerAtOnce, Random Rand)
|
||||
private void _BuildRounds(int numRounds, int numPlayerAtOnce, Random rand)
|
||||
{
|
||||
Combinations Combinations = new Combinations(_NumPlayer, NumPlayerAtOnce, Rand);
|
||||
Rounds.Add(Combinations.GetNextCombination(null));
|
||||
CCombinations combinations = new CCombinations(_NumPlayer, numPlayerAtOnce, rand);
|
||||
Rounds.Add(combinations.GetNextCombination(null));
|
||||
|
||||
for (int i = 1; i < NumRounds; i++)
|
||||
Rounds.Add(Combinations.GetNextCombination(GetPlayerDemand(i)));
|
||||
for (int i = 1; i < numRounds; i++)
|
||||
Rounds.Add(combinations.GetNextCombination(_GetPlayerDemand(i)));
|
||||
}
|
||||
|
||||
private List<int> GetPlayerDemand(int RoundIndex)
|
||||
private List<int> _GetPlayerDemand(int roundIndex)
|
||||
{
|
||||
List<int> NumPlayed = new List<int>(_NumPlayer);
|
||||
List<int> numPlayed = new List<int>(_NumPlayer);
|
||||
for (int i = 0; i < _NumPlayer; i++)
|
||||
NumPlayed.Add(0);
|
||||
numPlayed.Add(0);
|
||||
|
||||
for (int i = 0; i < RoundIndex; i++)
|
||||
for (int i = 0; i < roundIndex; i++)
|
||||
{
|
||||
foreach (int PlayerIndex in Rounds[i].Player)
|
||||
NumPlayed[PlayerIndex]++;
|
||||
foreach (int playerIndex in Rounds[i].Player)
|
||||
numPlayed[playerIndex]++;
|
||||
}
|
||||
|
||||
int max = 0;
|
||||
foreach (int p in NumPlayed)
|
||||
foreach (int p in numPlayed)
|
||||
{
|
||||
if (p > max)
|
||||
max = p;
|
||||
@@ -65,20 +65,20 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
List<int> other = new List<int>();
|
||||
List<int> last = new List<int>();
|
||||
|
||||
for (int i = 0; i < NumPlayed.Count; i++)
|
||||
for (int i = 0; i < numPlayed.Count; i++)
|
||||
{
|
||||
if (RoundIndex == 0 || NumPlayed[i] < max)
|
||||
if (roundIndex == 0 || numPlayed[i] < max)
|
||||
{
|
||||
if (RoundIndex == 0 || RoundIndex > 0 && NumPlayed[i] < max && !Rounds[RoundIndex - 1].IsAvailable(i))
|
||||
if (roundIndex == 0 || roundIndex > 0 && numPlayed[i] < max && !Rounds[roundIndex - 1].IsAvailable(i))
|
||||
result.Add(i);
|
||||
else if (NumPlayed[i] < max)
|
||||
else if (numPlayed[i] < max)
|
||||
other.Add(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (RoundIndex > 0)
|
||||
if (roundIndex > 0)
|
||||
{
|
||||
if (!Rounds[RoundIndex - 1].IsAvailable(i))
|
||||
if (!Rounds[roundIndex - 1].IsAvailable(i))
|
||||
other.Add(i);
|
||||
else
|
||||
last.Add(i);
|
||||
@@ -116,48 +116,48 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
|
||||
class Combinations
|
||||
class CCombinations
|
||||
{
|
||||
private readonly List<Combination> _Combs;
|
||||
private readonly List<CCombination> _Combs;
|
||||
private readonly Random _Rand;
|
||||
private readonly int _NumPlayer;
|
||||
private readonly int _NumMics;
|
||||
|
||||
public Combinations(int NumPlayer, int NumMics, Random Rand)
|
||||
public CCombinations(int numPlayer, int numMics, Random rand)
|
||||
{
|
||||
_Combs = new List<Combination>();
|
||||
_NumMics = NumMics;
|
||||
_NumPlayer = NumPlayer;
|
||||
_Rand = Rand;
|
||||
_Combs = new List<CCombination>();
|
||||
_NumMics = numMics;
|
||||
_NumPlayer = numPlayer;
|
||||
_Rand = rand;
|
||||
}
|
||||
|
||||
public Combination GetNextCombination(List<int> PlayerNrDemand)
|
||||
public CCombination GetNextCombination(List<int> playerNrDemand)
|
||||
{
|
||||
if (_Combs.Count == 0)
|
||||
Create();
|
||||
_Create();
|
||||
|
||||
Combination combs = new Combination();
|
||||
CCombination combs = new CCombination();
|
||||
|
||||
if (_NumPlayer == _NumMics)
|
||||
return _Combs[0];
|
||||
|
||||
//filter against PlayerNrDemand
|
||||
List<Combination> combsFiltered = new List<Combination>();
|
||||
if (PlayerNrDemand != null)
|
||||
List<CCombination> combsFiltered = new List<CCombination>();
|
||||
if (playerNrDemand != null)
|
||||
{
|
||||
for (int i = 0; i < _Combs.Count; i++)
|
||||
{
|
||||
if (_Combs[i].IsAvailableAll(PlayerNrDemand))
|
||||
if (_Combs[i].IsAvailableAll(playerNrDemand))
|
||||
combsFiltered.Add(_Combs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//1st fallback
|
||||
if (PlayerNrDemand != null && combsFiltered.Count == 0)
|
||||
if (playerNrDemand != null && combsFiltered.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < _Combs.Count; i++)
|
||||
{
|
||||
if (_Combs[i].IsAvailableSomeone(PlayerNrDemand))
|
||||
if (_Combs[i].IsAvailableSomeone(playerNrDemand))
|
||||
combsFiltered.Add(_Combs[i]);
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
int num = combsFiltered.Count;
|
||||
int rand = _Rand.Next(num);
|
||||
Combination c = new Combination();
|
||||
CCombination c = new CCombination();
|
||||
for (int i = 0; i < combsFiltered[rand].Player.Count; i++)
|
||||
c.Player.Add(combsFiltered[rand].Player[i]);
|
||||
_Combs.Remove(combsFiltered[rand]);
|
||||
@@ -179,7 +179,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
return combsFiltered[rand];
|
||||
}
|
||||
|
||||
private void Create()
|
||||
private void _Create()
|
||||
{
|
||||
_Combs.Clear();
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
for (int i = 1; i <= num; i++)
|
||||
{
|
||||
Combination c = new Combination();
|
||||
CCombination c = new CCombination();
|
||||
|
||||
for (int j = 0; j < _NumPlayer; j++)
|
||||
{
|
||||
@@ -201,37 +201,37 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
|
||||
public class Combination
|
||||
public class CCombination
|
||||
{
|
||||
public List<int> Player;
|
||||
|
||||
public Combination()
|
||||
public CCombination()
|
||||
{
|
||||
Player = new List<int>();
|
||||
}
|
||||
|
||||
public bool IsAvailable(int PlayerIndex)
|
||||
public bool IsAvailable(int playerIndex)
|
||||
{
|
||||
foreach (int p in Player)
|
||||
{
|
||||
if (p == PlayerIndex)
|
||||
if (p == playerIndex)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsAvailableAll(List<int> PlayerIndices)
|
||||
public bool IsAvailableAll(List<int> playerIndices)
|
||||
{
|
||||
bool result = true;
|
||||
foreach (int p in PlayerIndices)
|
||||
foreach (int p in playerIndices)
|
||||
result &= IsAvailable(p);
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool IsAvailableSomeone(List<int> PlayerIndices)
|
||||
public bool IsAvailableSomeone(List<int> playerIndices)
|
||||
{
|
||||
bool result = false;
|
||||
foreach (int p in PlayerIndices)
|
||||
foreach (int p in playerIndices)
|
||||
result |= IsAvailable(p);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -11,30 +11,30 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
#region Communication
|
||||
|
||||
#region ToScreen
|
||||
public struct DataToScreenConfig
|
||||
public struct SDataToScreenConfig
|
||||
{
|
||||
public int NumPlayer;
|
||||
public int NumPlayerAtOnce;
|
||||
public int NumRounds;
|
||||
}
|
||||
|
||||
public struct DataToScreenNames
|
||||
public struct SDataToScreenNames
|
||||
{
|
||||
public int NumPlayer;
|
||||
public List<int> ProfileIDs;
|
||||
}
|
||||
|
||||
public struct DataToScreenMain
|
||||
public struct SDataToScreenMain
|
||||
{
|
||||
public int CurrentRoundNr;
|
||||
public int NumPlayerAtOnce;
|
||||
public List<Combination> Combs;
|
||||
public List<CCombination> Combs;
|
||||
public int[,] Results;
|
||||
public List<ResultTableRow> ResultTable;
|
||||
public List<CResultTableRow> ResultTable;
|
||||
public List<int> ProfileIDs;
|
||||
}
|
||||
|
||||
public class ResultTableRow : IComparable
|
||||
public class CResultTableRow : IComparable
|
||||
{
|
||||
public int Position;
|
||||
public int PlayerID;
|
||||
@@ -46,9 +46,9 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
public int CompareTo(object obj)
|
||||
{
|
||||
if (obj is ResultTableRow)
|
||||
if (obj is CResultTableRow)
|
||||
{
|
||||
ResultTableRow row = (ResultTableRow)obj;
|
||||
CResultTableRow row = (CResultTableRow)obj;
|
||||
|
||||
int res = row.NumGamePoints.CompareTo(NumGamePoints);
|
||||
if (res == 0)
|
||||
@@ -66,28 +66,28 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
#endregion ToScreen
|
||||
|
||||
#region FromScreen
|
||||
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 NumPlayer;
|
||||
public int NumPlayerAtOnce;
|
||||
public int NumRounds;
|
||||
}
|
||||
|
||||
public struct FromScreenNames
|
||||
public struct SFromScreenNames
|
||||
{
|
||||
public bool FadeToConfig;
|
||||
public bool FadeToMain;
|
||||
public List<int> ProfileIDs;
|
||||
}
|
||||
|
||||
public struct FromScreenMain
|
||||
public struct SFromScreenMain
|
||||
{
|
||||
public bool FadeToSongSelection;
|
||||
public bool FadeToNameSelection;
|
||||
@@ -96,13 +96,13 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
#endregion Communication
|
||||
|
||||
public sealed class PartyModeChallenge : CPartyMode
|
||||
public sealed class CPartyModeChallenge : CPartyMode
|
||||
{
|
||||
private const int MaxPlayer = 12;
|
||||
private const int MinPlayer = 1;
|
||||
private const int MaxTeams = 0;
|
||||
private const int MinTeams = 0;
|
||||
private const int MaxNumRounds = 100;
|
||||
private const int _MaxPlayer = 12;
|
||||
private const int _MinPlayer = 1;
|
||||
private const int _MaxTeams = 0;
|
||||
private const int _MinTeams = 0;
|
||||
private const int _MaxNumRounds = 100;
|
||||
|
||||
private enum EStage
|
||||
{
|
||||
@@ -113,15 +113,15 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
Singing
|
||||
}
|
||||
|
||||
private struct Data
|
||||
private struct SData
|
||||
{
|
||||
public int NumPlayer;
|
||||
public int NumPlayerAtOnce;
|
||||
public int NumRounds;
|
||||
public List<int> ProfileIDs;
|
||||
|
||||
public ChallengeRounds Rounds;
|
||||
public List<ResultTableRow> ResultTable;
|
||||
public CChallengeRounds Rounds;
|
||||
public List<CResultTableRow> ResultTable;
|
||||
public int[,] Results;
|
||||
|
||||
public int CurrentRoundNr;
|
||||
@@ -129,7 +129,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
public int[] CatSongIndices;
|
||||
}
|
||||
|
||||
private struct Stats
|
||||
private struct SStats
|
||||
{
|
||||
public int ProfileID;
|
||||
public int SingPoints;
|
||||
@@ -137,14 +137,14 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
public int Won;
|
||||
}
|
||||
|
||||
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 PartyModeChallenge()
|
||||
public CPartyModeChallenge()
|
||||
{
|
||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||
_ScreenSongOptions.Selection.PartyMode = true;
|
||||
@@ -158,18 +158,18 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
_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.NumPlayer = 4;
|
||||
GameData.NumPlayerAtOnce = 2;
|
||||
GameData.NumRounds = 2;
|
||||
GameData.CurrentRoundNr = 1;
|
||||
GameData.ProfileIDs = new List<int>();
|
||||
GameData.CatSongIndices = null;
|
||||
GameData.Results = null;
|
||||
_GameData = new SData();
|
||||
_GameData.NumPlayer = 4;
|
||||
_GameData.NumPlayerAtOnce = 2;
|
||||
_GameData.NumRounds = 2;
|
||||
_GameData.CurrentRoundNr = 1;
|
||||
_GameData.ProfileIDs = new List<int>();
|
||||
_GameData.CatSongIndices = null;
|
||||
_GameData.Results = null;
|
||||
}
|
||||
|
||||
public override bool Init()
|
||||
@@ -184,44 +184,44 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
if (CBase.Config.GetTabs() == EOffOn.TR_CONFIG_ON && _ScreenSongOptions.Sorting.SongSorting != ESongSorting.TR_CONFIG_NONE)
|
||||
_ScreenSongOptions.Sorting.Tabs = EOffOn.TR_CONFIG_ON;
|
||||
|
||||
ToScreenMain.ResultTable = new List<ResultTableRow>();
|
||||
GameData.ResultTable = new List<ResultTableRow>();
|
||||
_ToScreenMain.ResultTable = new List<CResultTableRow>();
|
||||
_GameData.ResultTable = new List<CResultTableRow>();
|
||||
|
||||
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 "PartyScreenChallengeConfig":
|
||||
|
||||
try
|
||||
{
|
||||
dataFrom = (DataFromScreen)Data;
|
||||
GameData.NumPlayer = dataFrom.ScreenConfig.NumPlayer;
|
||||
GameData.NumPlayerAtOnce = dataFrom.ScreenConfig.NumPlayerAtOnce;
|
||||
GameData.NumRounds = dataFrom.ScreenConfig.NumRounds;
|
||||
dataFrom = (SDataFromScreen)data;
|
||||
_GameData.NumPlayer = dataFrom.ScreenConfig.NumPlayer;
|
||||
_GameData.NumPlayerAtOnce = dataFrom.ScreenConfig.NumPlayerAtOnce;
|
||||
_GameData.NumRounds = dataFrom.ScreenConfig.NumRounds;
|
||||
|
||||
_Stage = EStage.Config;
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + screenName + ". " + e.Message);
|
||||
}
|
||||
break;
|
||||
|
||||
case "PartyScreenChallengeNames":
|
||||
try
|
||||
{
|
||||
dataFrom = (DataFromScreen)Data;
|
||||
dataFrom = (SDataFromScreen)data;
|
||||
if (dataFrom.ScreenNames.FadeToConfig)
|
||||
_Stage = EStage.NotStarted;
|
||||
else
|
||||
{
|
||||
GameData.ProfileIDs = dataFrom.ScreenNames.ProfileIDs;
|
||||
_GameData.ProfileIDs = dataFrom.ScreenNames.ProfileIDs;
|
||||
_Stage = EStage.Names;
|
||||
}
|
||||
|
||||
@@ -229,14 +229,14 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + screenName + ". " + e.Message);
|
||||
}
|
||||
break;
|
||||
|
||||
case "PartyScreenChallengeMain":
|
||||
try
|
||||
{
|
||||
dataFrom = (DataFromScreen)Data;
|
||||
dataFrom = (SDataFromScreen)data;
|
||||
if (dataFrom.ScreenMain.FadeToSongSelection)
|
||||
_Stage = EStage.Singing;
|
||||
if (dataFrom.ScreenMain.FadeToNameSelection)
|
||||
@@ -244,18 +244,18 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + screenName + ". " + e.Message);
|
||||
}
|
||||
|
||||
|
||||
if (_Stage == EStage.Singing)
|
||||
StartNextRound();
|
||||
_StartNextRound();
|
||||
if (_Stage == EStage.Config)
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||
break;
|
||||
|
||||
default:
|
||||
CBase.Log.LogError("Error in party mode challenge. Wrong screen is sending: " + ScreenName);
|
||||
CBase.Log.LogError("Error in party mode challenge. Wrong screen is sending: " + screenName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -269,68 +269,68 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
_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("PartyScreenChallengeConfig", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenChallengeConfig", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
ToScreenConfig.NumPlayer = GameData.NumPlayer;
|
||||
ToScreenConfig.NumPlayerAtOnce = GameData.NumPlayerAtOnce;
|
||||
ToScreenConfig.NumRounds = GameData.NumRounds;
|
||||
Screen.DataToScreen(ToScreenConfig);
|
||||
_ToScreenConfig.NumPlayer = _GameData.NumPlayer;
|
||||
_ToScreenConfig.NumPlayerAtOnce = _GameData.NumPlayerAtOnce;
|
||||
_ToScreenConfig.NumRounds = _GameData.NumRounds;
|
||||
screen.DataToScreen(_ToScreenConfig);
|
||||
}
|
||||
break;
|
||||
case EStage.Config:
|
||||
_Screens.TryGetValue("PartyScreenChallengeNames", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenChallengeNames", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
ToScreenNames.NumPlayer = GameData.NumPlayer;
|
||||
ToScreenNames.ProfileIDs = GameData.ProfileIDs;
|
||||
Screen.DataToScreen(ToScreenNames);
|
||||
_ToScreenNames.NumPlayer = _GameData.NumPlayer;
|
||||
_ToScreenNames.ProfileIDs = _GameData.ProfileIDs;
|
||||
screen.DataToScreen(_ToScreenNames);
|
||||
}
|
||||
break;
|
||||
case EStage.Names:
|
||||
_Screens.TryGetValue("PartyScreenChallengeMain", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenChallengeMain", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
CBase.Songs.ResetPartySongSung();
|
||||
ToScreenMain.ResultTable = new List<ResultTableRow>();
|
||||
GameData.ResultTable = new List<ResultTableRow>();
|
||||
GameData.Rounds = new ChallengeRounds(GameData.NumRounds, GameData.NumPlayer, GameData.NumPlayerAtOnce);
|
||||
GameData.CurrentRoundNr = 1;
|
||||
ToScreenMain.CurrentRoundNr = 1;
|
||||
ToScreenMain.NumPlayerAtOnce = GameData.NumPlayerAtOnce;
|
||||
ToScreenMain.Combs = GameData.Rounds.Rounds;
|
||||
ToScreenMain.ProfileIDs = GameData.ProfileIDs;
|
||||
UpdateScores();
|
||||
ToScreenMain.ResultTable = GameData.ResultTable;
|
||||
ToScreenMain.Results = GameData.Results;
|
||||
Screen.DataToScreen(ToScreenMain);
|
||||
_ToScreenMain.ResultTable = new List<CResultTableRow>();
|
||||
_GameData.ResultTable = new List<CResultTableRow>();
|
||||
_GameData.Rounds = new CChallengeRounds(_GameData.NumRounds, _GameData.NumPlayer, _GameData.NumPlayerAtOnce);
|
||||
_GameData.CurrentRoundNr = 1;
|
||||
_ToScreenMain.CurrentRoundNr = 1;
|
||||
_ToScreenMain.NumPlayerAtOnce = _GameData.NumPlayerAtOnce;
|
||||
_ToScreenMain.Combs = _GameData.Rounds.Rounds;
|
||||
_ToScreenMain.ProfileIDs = _GameData.ProfileIDs;
|
||||
_UpdateScores();
|
||||
_ToScreenMain.ResultTable = _GameData.ResultTable;
|
||||
_ToScreenMain.Results = _GameData.Results;
|
||||
screen.DataToScreen(_ToScreenMain);
|
||||
}
|
||||
break;
|
||||
case EStage.Main:
|
||||
//nothing to do
|
||||
break;
|
||||
case EStage.Singing:
|
||||
_Screens.TryGetValue("PartyScreenChallengeMain", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenChallengeMain", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
UpdateScores();
|
||||
ToScreenMain.CurrentRoundNr = GameData.CurrentRoundNr;
|
||||
ToScreenMain.Combs = GameData.Rounds.Rounds;
|
||||
ToScreenMain.Results = GameData.Results;
|
||||
Screen.DataToScreen(ToScreenMain);
|
||||
_UpdateScores();
|
||||
_ToScreenMain.CurrentRoundNr = _GameData.CurrentRoundNr;
|
||||
_ToScreenMain.Combs = _GameData.Rounds.Rounds;
|
||||
_ToScreenMain.Results = _GameData.Results;
|
||||
screen.DataToScreen(_ToScreenMain);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return Screen;
|
||||
return screen;
|
||||
}
|
||||
|
||||
public override EScreens GetStartScreen()
|
||||
@@ -343,7 +343,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
return EScreens.ScreenPartyDummy;
|
||||
}
|
||||
|
||||
public override ScreenSongOptions GetScreenSongOptions()
|
||||
public override SScreenSongOptions GetScreenSongOptions()
|
||||
{
|
||||
_ScreenSongOptions.Sorting.SongSorting = CBase.Config.GetSongSorting();
|
||||
_ScreenSongOptions.Sorting.Tabs = CBase.Config.GetTabs();
|
||||
@@ -352,112 +352,112 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
return _ScreenSongOptions;
|
||||
}
|
||||
|
||||
public override void OnSongChange(int SongIndex, ref ScreenSongOptions ScreenSongOptions)
|
||||
public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions)
|
||||
{
|
||||
if (_ScreenSongOptions.Selection.SongIndex != -1)
|
||||
_ScreenSongOptions.Selection.SongIndex = -1;
|
||||
|
||||
if (_ScreenSongOptions.Selection.SelectNextRandomSong && SongIndex != -1)
|
||||
if (_ScreenSongOptions.Selection.SelectNextRandomSong && songIndex != -1)
|
||||
{
|
||||
_ScreenSongOptions.Selection.SelectNextRandomSong = false;
|
||||
CreateCatSongIndices();
|
||||
_CreateCatSongIndices();
|
||||
|
||||
if (GameData.CatSongIndices != null)
|
||||
if (_GameData.CatSongIndices != null)
|
||||
{
|
||||
if (GameData.CatSongIndices[CBase.Songs.GetCurrentCategoryIndex()] == -1)
|
||||
GameData.CatSongIndices[CBase.Songs.GetCurrentCategoryIndex()] = SongIndex;
|
||||
if (_GameData.CatSongIndices[CBase.Songs.GetCurrentCategoryIndex()] == -1)
|
||||
_GameData.CatSongIndices[CBase.Songs.GetCurrentCategoryIndex()] = songIndex;
|
||||
}
|
||||
}
|
||||
|
||||
ScreenSongOptions = _ScreenSongOptions;
|
||||
screenSongOptions = _ScreenSongOptions;
|
||||
}
|
||||
|
||||
public override void OnCategoryChange(int CategoryIndex, ref ScreenSongOptions ScreenSongOptions)
|
||||
public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions)
|
||||
{
|
||||
if (GameData.CatSongIndices != null && CategoryIndex != -1)
|
||||
if (_GameData.CatSongIndices != null && categoryIndex != -1)
|
||||
{
|
||||
if (GameData.CatSongIndices[CategoryIndex] == -1)
|
||||
if (_GameData.CatSongIndices[categoryIndex] == -1)
|
||||
_ScreenSongOptions.Selection.SelectNextRandomSong = true;
|
||||
else
|
||||
_ScreenSongOptions.Selection.SongIndex = GameData.CatSongIndices[CategoryIndex];
|
||||
_ScreenSongOptions.Selection.SongIndex = _GameData.CatSongIndices[categoryIndex];
|
||||
}
|
||||
|
||||
if (GameData.CatSongIndices == null && CategoryIndex != -1)
|
||||
if (_GameData.CatSongIndices == null && categoryIndex != -1)
|
||||
_ScreenSongOptions.Selection.SelectNextRandomSong = true;
|
||||
|
||||
if (CategoryIndex == -1)
|
||||
if (categoryIndex == -1)
|
||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||
|
||||
if (_ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF || CategoryIndex != -1)
|
||||
if (_ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF || categoryIndex != -1)
|
||||
_ScreenSongOptions.Selection.RandomOnly = true;
|
||||
|
||||
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 MaxNumRounds;
|
||||
return _MaxNumRounds;
|
||||
}
|
||||
|
||||
public override void JokerUsed(int TeamNr)
|
||||
public override void JokerUsed(int teamNr)
|
||||
{
|
||||
if (_ScreenSongOptions.Selection.NumJokers == null)
|
||||
return;
|
||||
|
||||
if (TeamNr >= _ScreenSongOptions.Selection.NumJokers.Length)
|
||||
if (teamNr >= _ScreenSongOptions.Selection.NumJokers.Length)
|
||||
return;
|
||||
|
||||
_ScreenSongOptions.Selection.NumJokers[TeamNr]--;
|
||||
_ScreenSongOptions.Selection.NumJokers[teamNr]--;
|
||||
_ScreenSongOptions.Selection.RandomOnly = true;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = false;
|
||||
}
|
||||
|
||||
public override void SongSelected(int SongID)
|
||||
public override void SongSelected(int songID)
|
||||
{
|
||||
EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
|
||||
CBase.Game.Reset();
|
||||
CBase.Game.ClearSongs();
|
||||
CBase.Game.AddSong(SongID, gm);
|
||||
CBase.Game.SetNumPlayer(GameData.NumPlayerAtOnce);
|
||||
CBase.Game.AddSong(songID, gm);
|
||||
CBase.Game.SetNumPlayer(_GameData.NumPlayerAtOnce);
|
||||
|
||||
SPlayer[] player = CBase.Game.GetPlayer();
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (player.Length < GameData.NumPlayerAtOnce)
|
||||
if (player.Length < _GameData.NumPlayerAtOnce)
|
||||
return;
|
||||
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
Combination c = GameData.Rounds.GetRound(GameData.CurrentRoundNr - 1);
|
||||
CCombination c = _GameData.Rounds.GetRound(_GameData.CurrentRoundNr - 1);
|
||||
|
||||
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||
for (int i = 0; i < _GameData.NumPlayerAtOnce; i++)
|
||||
{
|
||||
//default values
|
||||
player[i].Name = "foobar";
|
||||
@@ -467,38 +467,38 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
//try to fill with the right data
|
||||
if (c != null)
|
||||
{
|
||||
if (GameData.ProfileIDs[c.Player[i]] < profiles.Length)
|
||||
if (_GameData.ProfileIDs[c.Player[i]] < profiles.Length)
|
||||
{
|
||||
player[i].Name = profiles[GameData.ProfileIDs[c.Player[i]]].PlayerName;
|
||||
player[i].Difficulty = profiles[GameData.ProfileIDs[c.Player[i]]].Difficulty;
|
||||
player[i].ProfileID = GameData.ProfileIDs[c.Player[i]];
|
||||
player[i].Name = profiles[_GameData.ProfileIDs[c.Player[i]]].PlayerName;
|
||||
player[i].Difficulty = profiles[_GameData.ProfileIDs[c.Player[i]]].Difficulty;
|
||||
player[i].ProfileID = _GameData.ProfileIDs[c.Player[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CBase.Songs.AddPartySongSung(SongID);
|
||||
CBase.Songs.AddPartySongSung(songID);
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenSing);
|
||||
}
|
||||
|
||||
public override void LeavingHighscore()
|
||||
{
|
||||
GameData.CurrentRoundNr++;
|
||||
_GameData.CurrentRoundNr++;
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||
}
|
||||
|
||||
private void StartNextRound()
|
||||
private void _StartNextRound()
|
||||
{
|
||||
_ScreenSongOptions.Selection.RandomOnly = _ScreenSongOptions.Sorting.Tabs != EOffOn.TR_CONFIG_ON;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_ON;
|
||||
SetNumJokers();
|
||||
SetTeamNames();
|
||||
GameData.CatSongIndices = null;
|
||||
_SetNumJokers();
|
||||
_SetTeamNames();
|
||||
_GameData.CatSongIndices = null;
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenSong);
|
||||
}
|
||||
|
||||
private void SetNumJokers()
|
||||
private void _SetNumJokers()
|
||||
{
|
||||
switch (GameData.NumPlayerAtOnce)
|
||||
switch (_GameData.NumPlayerAtOnce)
|
||||
{
|
||||
case 1:
|
||||
_ScreenSongOptions.Selection.NumJokers = new int[] {10};
|
||||
@@ -529,7 +529,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
|
||||
private void SetTeamNames()
|
||||
private void _SetTeamNames()
|
||||
{
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
|
||||
@@ -539,21 +539,21 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
return;
|
||||
}
|
||||
|
||||
if (GameData.NumPlayerAtOnce < 1 || GameData.ProfileIDs.Count < GameData.NumPlayerAtOnce || profiles.Length < GameData.NumPlayerAtOnce)
|
||||
if (_GameData.NumPlayerAtOnce < 1 || _GameData.ProfileIDs.Count < _GameData.NumPlayerAtOnce || profiles.Length < _GameData.NumPlayerAtOnce)
|
||||
{
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"};
|
||||
return;
|
||||
}
|
||||
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[GameData.NumPlayerAtOnce];
|
||||
Combination c = GameData.Rounds.GetRound(GameData.CurrentRoundNr - 1);
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[_GameData.NumPlayerAtOnce];
|
||||
CCombination c = _GameData.Rounds.GetRound(_GameData.CurrentRoundNr - 1);
|
||||
|
||||
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||
for (int i = 0; i < _GameData.NumPlayerAtOnce; i++)
|
||||
{
|
||||
if (c != null)
|
||||
{
|
||||
if (GameData.ProfileIDs[c.Player[i]] < profiles.Length)
|
||||
_ScreenSongOptions.Selection.TeamNames[i] = profiles[GameData.ProfileIDs[c.Player[i]]].PlayerName;
|
||||
if (_GameData.ProfileIDs[c.Player[i]] < profiles.Length)
|
||||
_ScreenSongOptions.Selection.TeamNames[i] = profiles[_GameData.ProfileIDs[c.Player[i]]].PlayerName;
|
||||
else
|
||||
_ScreenSongOptions.Selection.TeamNames[i] = "foobar";
|
||||
}
|
||||
@@ -562,27 +562,27 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateScores()
|
||||
private void _UpdateScores()
|
||||
{
|
||||
if (GameData.ResultTable.Count == 0)
|
||||
if (_GameData.ResultTable.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < GameData.NumPlayer; i++)
|
||||
for (int i = 0; i < _GameData.NumPlayer; i++)
|
||||
{
|
||||
ResultTableRow row = new ResultTableRow();
|
||||
row.PlayerID = GameData.ProfileIDs[i];
|
||||
CResultTableRow row = new CResultTableRow();
|
||||
row.PlayerID = _GameData.ProfileIDs[i];
|
||||
row.NumPlayed = 0;
|
||||
row.NumRounds = 0;
|
||||
row.NumWon = 0;
|
||||
row.NumSingPoints = 0;
|
||||
row.NumGamePoints = 0;
|
||||
GameData.ResultTable.Add(row);
|
||||
_GameData.ResultTable.Add(row);
|
||||
}
|
||||
|
||||
GameData.Results = new int[GameData.NumRounds,GameData.NumPlayerAtOnce];
|
||||
for (int i = 0; i < GameData.NumRounds; i++)
|
||||
_GameData.Results = new int[_GameData.NumRounds,_GameData.NumPlayerAtOnce];
|
||||
for (int i = 0; i < _GameData.NumRounds; i++)
|
||||
{
|
||||
for (int j = 0; j < GameData.NumPlayerAtOnce; j++)
|
||||
GameData.Results[i, j] = 0;
|
||||
for (int j = 0; j < _GameData.NumPlayerAtOnce; j++)
|
||||
_GameData.Results[i, j] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -591,20 +591,20 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
if (results == null)
|
||||
return;
|
||||
|
||||
if (results.Length < GameData.NumPlayerAtOnce)
|
||||
if (results.Length < _GameData.NumPlayerAtOnce)
|
||||
return;
|
||||
|
||||
for (int j = 0; j < GameData.NumPlayerAtOnce; j++)
|
||||
GameData.Results[GameData.CurrentRoundNr - 2, j] = (int)Math.Round(results[j].Points);
|
||||
for (int j = 0; j < _GameData.NumPlayerAtOnce; j++)
|
||||
_GameData.Results[_GameData.CurrentRoundNr - 2, j] = (int)Math.Round(results[j].Points);
|
||||
|
||||
List<Stats> points = GetPointsForPlayer(results);
|
||||
List<SStats> points = _GetPointsForPlayer(results);
|
||||
|
||||
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||
for (int i = 0; i < _GameData.NumPlayerAtOnce; i++)
|
||||
{
|
||||
int index = -1;
|
||||
for (int j = 0; j < GameData.ResultTable.Count; j++)
|
||||
for (int j = 0; j < _GameData.ResultTable.Count; j++)
|
||||
{
|
||||
if (points[i].ProfileID == GameData.ResultTable[j].PlayerID)
|
||||
if (points[i].ProfileID == _GameData.ResultTable[j].PlayerID)
|
||||
{
|
||||
index = j;
|
||||
break;
|
||||
@@ -613,7 +613,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
ResultTableRow row = GameData.ResultTable[index];
|
||||
CResultTableRow row = _GameData.ResultTable[index];
|
||||
|
||||
row.NumPlayed++;
|
||||
row.NumWon += points[i].Won;
|
||||
@@ -621,41 +621,41 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
row.NumSingPoints += points[i].SingPoints;
|
||||
row.NumGamePoints += points[i].GamePoints;
|
||||
|
||||
GameData.ResultTable[index] = row;
|
||||
_GameData.ResultTable[index] = row;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GameData.ResultTable.Sort();
|
||||
_GameData.ResultTable.Sort();
|
||||
|
||||
//Update position-number
|
||||
int pos = 1;
|
||||
int lastPoints = 0;
|
||||
int lastSingPoints = 0;
|
||||
for (int i = 0; i < GameData.ResultTable.Count; i++)
|
||||
for (int i = 0; i < _GameData.ResultTable.Count; i++)
|
||||
{
|
||||
if (lastPoints > GameData.ResultTable[i].NumGamePoints || lastSingPoints > GameData.ResultTable[i].NumSingPoints)
|
||||
if (lastPoints > _GameData.ResultTable[i].NumGamePoints || lastSingPoints > _GameData.ResultTable[i].NumSingPoints)
|
||||
pos++;
|
||||
GameData.ResultTable[i].Position = pos;
|
||||
lastPoints = GameData.ResultTable[i].NumGamePoints;
|
||||
lastSingPoints = GameData.ResultTable[i].NumSingPoints;
|
||||
_GameData.ResultTable[i].Position = pos;
|
||||
lastPoints = _GameData.ResultTable[i].NumGamePoints;
|
||||
lastSingPoints = _GameData.ResultTable[i].NumSingPoints;
|
||||
}
|
||||
}
|
||||
|
||||
private List<Stats> GetPointsForPlayer(SPlayer[] Results)
|
||||
private List<SStats> _GetPointsForPlayer(SPlayer[] results)
|
||||
{
|
||||
List<Stats> result = new List<Stats>();
|
||||
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||
List<SStats> result = new List<SStats>();
|
||||
for (int i = 0; i < _GameData.NumPlayerAtOnce; i++)
|
||||
{
|
||||
Stats stat = new Stats();
|
||||
stat.ProfileID = Results[i].ProfileID;
|
||||
stat.SingPoints = (int)Math.Round(Results[i].Points);
|
||||
SStats stat = new SStats();
|
||||
stat.ProfileID = results[i].ProfileID;
|
||||
stat.SingPoints = (int)Math.Round(results[i].Points);
|
||||
stat.Won = 0;
|
||||
stat.GamePoints = 0;
|
||||
result.Add(stat);
|
||||
}
|
||||
|
||||
result.Sort(delegate(Stats s1, Stats s2) { return s1.SingPoints.CompareTo(s2.SingPoints); });
|
||||
result.Sort(delegate(SStats s1, SStats s2) { return s1.SingPoints.CompareTo(s2.SingPoints); });
|
||||
|
||||
int current = result[result.Count - 1].SingPoints;
|
||||
int points = result.Count;
|
||||
@@ -663,7 +663,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
for (int i = result.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Stats res = result[i];
|
||||
SStats res = result[i];
|
||||
|
||||
if (i < result.Count - 1)
|
||||
{
|
||||
@@ -695,17 +695,17 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
return result;
|
||||
}
|
||||
|
||||
private void CreateCatSongIndices()
|
||||
private void _CreateCatSongIndices()
|
||||
{
|
||||
if (GameData.CatSongIndices == null && CBase.Songs.GetNumCategories() > 0 && _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_ON)
|
||||
if (_GameData.CatSongIndices == null && CBase.Songs.GetNumCategories() > 0 && _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
GameData.CatSongIndices = new int[CBase.Songs.GetNumCategories()];
|
||||
for (int i = 0; i < GameData.CatSongIndices.Length; i++)
|
||||
GameData.CatSongIndices[i] = -1;
|
||||
_GameData.CatSongIndices = new int[CBase.Songs.GetNumCategories()];
|
||||
for (int i = 0; i < _GameData.CatSongIndices.Length; i++)
|
||||
_GameData.CatSongIndices[i] = -1;
|
||||
}
|
||||
|
||||
if (CBase.Songs.GetNumCategories() == 0 || _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF)
|
||||
GameData.CatSongIndices = null;
|
||||
_GameData.CatSongIndices = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
public class PartyScreenChallengeConfig : CMenuParty
|
||||
public class CPartyScreenChallengeConfig : CMenuParty
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -12,43 +12,43 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
private const string SelectSlideNumPlayers = "SelectSlideNumPlayers";
|
||||
private const string SelectSlideNumMics = "SelectSlideNumMics";
|
||||
private const string SelectSlideNumRounds = "SelectSlideNumRounds";
|
||||
private const string ButtonNext = "ButtonNext";
|
||||
private const string ButtonBack = "ButtonBack";
|
||||
private const string _SelectSlideNumPlayers = "SelectSlideNumPlayers";
|
||||
private const string _SelectSlideNumMics = "SelectSlideNumMics";
|
||||
private const string _SelectSlideNumRounds = "SelectSlideNumRounds";
|
||||
private const string _ButtonNext = "ButtonNext";
|
||||
private const string _ButtonBack = "ButtonBack";
|
||||
|
||||
private int _MaxNumMics = 2;
|
||||
private int _MaxNumRounds = 100;
|
||||
private int _RoundSteps = 1;
|
||||
|
||||
private DataFromScreen Data;
|
||||
private SDataFromScreen _Data;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
|
||||
_ThemeSelectSlides = new string[] {SelectSlideNumPlayers, SelectSlideNumMics, SelectSlideNumRounds};
|
||||
_ThemeButtons = new string[] {ButtonNext, ButtonBack};
|
||||
_ThemeSelectSlides = new string[] {_SelectSlideNumPlayers, _SelectSlideNumMics, _SelectSlideNumRounds};
|
||||
_ThemeButtons = new string[] {_ButtonNext, _ButtonBack};
|
||||
|
||||
Data = new DataFromScreen();
|
||||
FromScreenConfig config = new FromScreenConfig();
|
||||
_Data = new SDataFromScreen();
|
||||
SFromScreenConfig config = new SFromScreenConfig();
|
||||
config.NumPlayer = 4;
|
||||
config.NumPlayerAtOnce = 2;
|
||||
config.NumRounds = 12;
|
||||
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.NumPlayer = config.NumPlayer;
|
||||
Data.ScreenConfig.NumPlayerAtOnce = config.NumPlayerAtOnce;
|
||||
Data.ScreenConfig.NumRounds = config.NumRounds;
|
||||
config = (SDataToScreenConfig)receivedData;
|
||||
_Data.ScreenConfig.NumPlayer = config.NumPlayer;
|
||||
_Data.ScreenConfig.NumPlayerAtOnce = config.NumPlayerAtOnce;
|
||||
_Data.ScreenConfig.NumRounds = config.NumRounds;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleInput(KeyEvent keyEvent)
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
base.HandleInput(keyEvent);
|
||||
|
||||
@@ -67,47 +67,47 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
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;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
_MaxNumRounds = _PartyMode.GetMaxNumRounds();
|
||||
|
||||
RebuildSlides();
|
||||
_RebuildSlides();
|
||||
}
|
||||
|
||||
public override bool UpdateGame()
|
||||
@@ -136,92 +136,92 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
return true;
|
||||
}
|
||||
|
||||
private void RebuildSlides()
|
||||
private void _RebuildSlides()
|
||||
{
|
||||
// build num player slide (min player ... max player);
|
||||
SelectSlides[SelectSlideNumPlayers].Clear();
|
||||
SelectSlides[_SelectSlideNumPlayers].Clear();
|
||||
for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++)
|
||||
SelectSlides[SelectSlideNumPlayers].AddValue(i.ToString());
|
||||
SelectSlides[SelectSlideNumPlayers].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
|
||||
SelectSlides[_SelectSlideNumPlayers].AddValue(i.ToString());
|
||||
SelectSlides[_SelectSlideNumPlayers].Selection = _Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
|
||||
|
||||
UpdateMicsAtOnce();
|
||||
SetRoundSteps();
|
||||
UpdateSlideRounds();
|
||||
_UpdateMicsAtOnce();
|
||||
_SetRoundSteps();
|
||||
_UpdateSlideRounds();
|
||||
}
|
||||
|
||||
private void UpdateSlides()
|
||||
private void _UpdateSlides()
|
||||
{
|
||||
int player = Data.ScreenConfig.NumPlayer;
|
||||
int mics = Data.ScreenConfig.NumPlayerAtOnce;
|
||||
Data.ScreenConfig.NumPlayer = SelectSlides[SelectSlideNumPlayers].Selection + _PartyMode.GetMinPlayer();
|
||||
Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[SelectSlideNumMics].Selection + _PartyMode.GetMinPlayer();
|
||||
Data.ScreenConfig.NumRounds = (SelectSlides[SelectSlideNumRounds].Selection + 1) * _RoundSteps;
|
||||
int player = _Data.ScreenConfig.NumPlayer;
|
||||
int mics = _Data.ScreenConfig.NumPlayerAtOnce;
|
||||
_Data.ScreenConfig.NumPlayer = SelectSlides[_SelectSlideNumPlayers].Selection + _PartyMode.GetMinPlayer();
|
||||
_Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[_SelectSlideNumMics].Selection + _PartyMode.GetMinPlayer();
|
||||
_Data.ScreenConfig.NumRounds = (SelectSlides[_SelectSlideNumRounds].Selection + 1) * _RoundSteps;
|
||||
|
||||
UpdateMicsAtOnce();
|
||||
SetRoundSteps();
|
||||
_UpdateMicsAtOnce();
|
||||
_SetRoundSteps();
|
||||
|
||||
if (player != Data.ScreenConfig.NumPlayer || mics != Data.ScreenConfig.NumPlayerAtOnce)
|
||||
if (player != _Data.ScreenConfig.NumPlayer || mics != _Data.ScreenConfig.NumPlayerAtOnce)
|
||||
{
|
||||
int num = CHelper.CombinationCount(Data.ScreenConfig.NumPlayer, Data.ScreenConfig.NumPlayerAtOnce);
|
||||
int num = CHelper.CombinationCount(_Data.ScreenConfig.NumPlayer, _Data.ScreenConfig.NumPlayerAtOnce);
|
||||
while (num > _MaxNumRounds)
|
||||
num -= _RoundSteps;
|
||||
Data.ScreenConfig.NumRounds = num;
|
||||
_Data.ScreenConfig.NumRounds = num;
|
||||
}
|
||||
|
||||
UpdateSlideRounds();
|
||||
_UpdateSlideRounds();
|
||||
}
|
||||
|
||||
private void UpdateMicsAtOnce()
|
||||
private void _UpdateMicsAtOnce()
|
||||
{
|
||||
//Data.ScreenConfig.NumPlayerAtOnce
|
||||
int MaxNum = _MaxNumMics;
|
||||
if (Data.ScreenConfig.NumPlayer < _MaxNumMics)
|
||||
MaxNum = Data.ScreenConfig.NumPlayer;
|
||||
int maxNum = _MaxNumMics;
|
||||
if (_Data.ScreenConfig.NumPlayer < _MaxNumMics)
|
||||
maxNum = _Data.ScreenConfig.NumPlayer;
|
||||
|
||||
if (Data.ScreenConfig.NumPlayerAtOnce > MaxNum)
|
||||
Data.ScreenConfig.NumPlayerAtOnce = MaxNum;
|
||||
if (_Data.ScreenConfig.NumPlayerAtOnce > maxNum)
|
||||
_Data.ScreenConfig.NumPlayerAtOnce = maxNum;
|
||||
|
||||
// build mics at once slide
|
||||
SelectSlides[SelectSlideNumMics].Clear();
|
||||
for (int i = 1; i <= MaxNum; i++)
|
||||
SelectSlides[SelectSlideNumMics].AddValue(i.ToString());
|
||||
SelectSlides[SelectSlideNumMics].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
|
||||
SelectSlides[_SelectSlideNumMics].Clear();
|
||||
for (int i = 1; i <= maxNum; i++)
|
||||
SelectSlides[_SelectSlideNumMics].AddValue(i.ToString());
|
||||
SelectSlides[_SelectSlideNumMics].Selection = _Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
|
||||
}
|
||||
|
||||
private void UpdateSlideRounds()
|
||||
private void _UpdateSlideRounds()
|
||||
{
|
||||
// build num rounds slide
|
||||
SelectSlides[SelectSlideNumRounds].Clear();
|
||||
SelectSlides[_SelectSlideNumRounds].Clear();
|
||||
for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps)
|
||||
SelectSlides[SelectSlideNumRounds].AddValue(i.ToString());
|
||||
SelectSlides[SelectSlideNumRounds].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1;
|
||||
SelectSlides[_SelectSlideNumRounds].AddValue(i.ToString());
|
||||
SelectSlides[_SelectSlideNumRounds].Selection = _Data.ScreenConfig.NumRounds / _RoundSteps - 1;
|
||||
}
|
||||
|
||||
private void SetRoundSteps()
|
||||
private void _SetRoundSteps()
|
||||
{
|
||||
if (Data.ScreenConfig.NumPlayerAtOnce < 1 || Data.ScreenConfig.NumPlayer < 1 || Data.ScreenConfig.NumPlayerAtOnce > Data.ScreenConfig.NumPlayer)
|
||||
if (_Data.ScreenConfig.NumPlayerAtOnce < 1 || _Data.ScreenConfig.NumPlayer < 1 || _Data.ScreenConfig.NumPlayerAtOnce > _Data.ScreenConfig.NumPlayer)
|
||||
{
|
||||
_RoundSteps = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
int res = Data.ScreenConfig.NumPlayer / Data.ScreenConfig.NumPlayerAtOnce;
|
||||
int mod = Data.ScreenConfig.NumPlayer % Data.ScreenConfig.NumPlayerAtOnce;
|
||||
int res = _Data.ScreenConfig.NumPlayer / _Data.ScreenConfig.NumPlayerAtOnce;
|
||||
int mod = _Data.ScreenConfig.NumPlayer % _Data.ScreenConfig.NumPlayerAtOnce;
|
||||
|
||||
if (mod == 0)
|
||||
_RoundSteps = res;
|
||||
else
|
||||
_RoundSteps = Data.ScreenConfig.NumPlayer;
|
||||
_RoundSteps = _Data.ScreenConfig.NumPlayer;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
struct TableRow
|
||||
struct STableRow
|
||||
{
|
||||
public CText Pos;
|
||||
public CText Name;
|
||||
@@ -15,14 +15,14 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
public CText GamePoints;
|
||||
}
|
||||
|
||||
class RoundsTableRow
|
||||
class CRoundsTableRow
|
||||
{
|
||||
public CText Number;
|
||||
public List<CText> TextPlayer;
|
||||
public List<CText> TextScores;
|
||||
}
|
||||
|
||||
public class PartyScreenChallengeMain : CMenuParty
|
||||
public class CPartyScreenChallengeMain : CMenuParty
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -30,55 +30,55 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
private const string TextPosition = "TextPosition";
|
||||
private const string TextPlayerName = "TextPlayerName";
|
||||
private const string TextNumPlayed = "TextNumPlayed";
|
||||
private const string TextWon = "TextWon";
|
||||
private const string TextSingPoints = "TextSingPoints";
|
||||
private const string TextGamePoints = "TextGamePoints";
|
||||
private const string TextNextPlayer = "TextNextPlayer";
|
||||
private const string TextPopupReallyExit = "TextPopupReallyExit";
|
||||
private const string TextRoundPlayer = "TextRoundPlayer";
|
||||
private const string TextRoundScore = "TextRoundScore";
|
||||
private const string TextRoundNumber = "TextRoundNumber";
|
||||
private const string TextFinishMessage = "TextFinishMessage";
|
||||
private const string TextFinishPlayerWin = "TextFinishPlayerWin";
|
||||
private const string TextNextPlayerMessage = "TextNextPlayerMessage";
|
||||
private const string _TextPosition = "TextPosition";
|
||||
private const string _TextPlayerName = "TextPlayerName";
|
||||
private const string _TextNumPlayed = "TextNumPlayed";
|
||||
private const string _TextWon = "TextWon";
|
||||
private const string _TextSingPoints = "TextSingPoints";
|
||||
private const string _TextGamePoints = "TextGamePoints";
|
||||
private const string _TextNextPlayer = "TextNextPlayer";
|
||||
private const string _TextPopupReallyExit = "TextPopupReallyExit";
|
||||
private const string _TextRoundPlayer = "TextRoundPlayer";
|
||||
private const string _TextRoundScore = "TextRoundScore";
|
||||
private const string _TextRoundNumber = "TextRoundNumber";
|
||||
private const string _TextFinishMessage = "TextFinishMessage";
|
||||
private const string _TextFinishPlayerWin = "TextFinishPlayerWin";
|
||||
private const string _TextNextPlayerMessage = "TextNextPlayerMessage";
|
||||
|
||||
private const string ButtonNextRound = "ButtonNextRound";
|
||||
private const string ButtonBack = "ButtonBack";
|
||||
private const string ButtonExit = "ButtonExit";
|
||||
private const string ButtonPopupYes = "ButtonPopupYes";
|
||||
private const string ButtonPopupNo = "ButtonPopupNo";
|
||||
private const string ButtonPlayerScrollUp = "ButtonPlayerScrollUp";
|
||||
private const string ButtonPlayerScrollDown = "ButtonPlayerScrollDown";
|
||||
private const string ButtonRoundsScrollUp = "ButtonRoundsScrollUp";
|
||||
private const string ButtonRoundsScrollDown = "ButtonRoundsScrollDown";
|
||||
private const string _ButtonNextRound = "ButtonNextRound";
|
||||
private const string _ButtonBack = "ButtonBack";
|
||||
private const string _ButtonExit = "ButtonExit";
|
||||
private const string _ButtonPopupYes = "ButtonPopupYes";
|
||||
private const string _ButtonPopupNo = "ButtonPopupNo";
|
||||
private const string _ButtonPlayerScrollUp = "ButtonPlayerScrollUp";
|
||||
private const string _ButtonPlayerScrollDown = "ButtonPlayerScrollDown";
|
||||
private const string _ButtonRoundsScrollUp = "ButtonRoundsScrollUp";
|
||||
private const string _ButtonRoundsScrollDown = "ButtonRoundsScrollDown";
|
||||
|
||||
private const string StaticPopupBG = "StaticPopupBG";
|
||||
private const string StaticNextPlayer = "StaticNextPlayer";
|
||||
private const string _StaticPopupBG = "StaticPopupBG";
|
||||
private const string _StaticNextPlayer = "StaticNextPlayer";
|
||||
|
||||
private bool ExitPopupVisible;
|
||||
private bool _ExitPopupVisible;
|
||||
|
||||
private DataFromScreen Data;
|
||||
private DataToScreenMain GameState;
|
||||
private List<TableRow> PlayerTable;
|
||||
private List<RoundsTableRow> RoundsTable;
|
||||
private SDataFromScreen _Data;
|
||||
private SDataToScreenMain _GameState;
|
||||
private List<STableRow> _PlayerTable;
|
||||
private List<CRoundsTableRow> _RoundsTable;
|
||||
|
||||
private List<CText> NextPlayerTexts;
|
||||
private List<CStatic> NextPlayerStatics;
|
||||
private List<CText> _NextPlayerTexts;
|
||||
private List<CStatic> _NextPlayerStatics;
|
||||
|
||||
private SRectF RoundsTableScrollArea;
|
||||
private SRectF PlayerTableScrollArea;
|
||||
private int RoundsTableOffset;
|
||||
private int PlayerTableOffset;
|
||||
private int NumPlayerVisible = 10;
|
||||
private int NumRoundsVisible = 3;
|
||||
private SRectF _RoundsTableScrollArea;
|
||||
private SRectF _PlayerTableScrollArea;
|
||||
private int _RoundsTableOffset;
|
||||
private int _PlayerTableOffset;
|
||||
private int _NumPlayerVisible = 10;
|
||||
private int _NumRoundsVisible = 3;
|
||||
|
||||
public PartyScreenChallengeMain()
|
||||
public CPartyScreenChallengeMain()
|
||||
{
|
||||
Data = new DataFromScreen();
|
||||
Data.ScreenMain = new FromScreenMain();
|
||||
_Data = new SDataFromScreen();
|
||||
_Data.ScreenMain = new SFromScreenMain();
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
@@ -87,41 +87,41 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
_ThemeTexts = new string[]
|
||||
{
|
||||
TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextNextPlayer, TextPopupReallyExit, TextRoundNumber, TextRoundPlayer,
|
||||
TextRoundScore, TextFinishMessage, TextFinishPlayerWin, TextNextPlayerMessage
|
||||
_TextPosition, _TextPlayerName, _TextNumPlayed, _TextWon, _TextSingPoints, _TextGamePoints, _TextNextPlayer, _TextPopupReallyExit, _TextRoundNumber, _TextRoundPlayer,
|
||||
_TextRoundScore, _TextFinishMessage, _TextFinishPlayerWin, _TextNextPlayerMessage
|
||||
};
|
||||
_ThemeButtons = new string[]
|
||||
{ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo, ButtonPlayerScrollDown, ButtonPlayerScrollUp, ButtonRoundsScrollDown, ButtonRoundsScrollUp};
|
||||
_ThemeStatics = new string[] {StaticPopupBG, StaticNextPlayer};
|
||||
{_ButtonNextRound, _ButtonBack, _ButtonExit, _ButtonPopupYes, _ButtonPopupNo, _ButtonPlayerScrollDown, _ButtonPlayerScrollUp, _ButtonRoundsScrollDown, _ButtonRoundsScrollUp};
|
||||
_ThemeStatics = new string[] {_StaticPopupBG, _StaticNextPlayer};
|
||||
}
|
||||
|
||||
public override void LoadTheme(string XmlPath)
|
||||
public override void LoadTheme(string xmlPath)
|
||||
{
|
||||
base.LoadTheme(XmlPath);
|
||||
base.LoadTheme(xmlPath);
|
||||
|
||||
GameState = new DataToScreenMain();
|
||||
BuildPlayerTable();
|
||||
CreateRoundsTable();
|
||||
NextPlayerTexts = new List<CText>();
|
||||
NextPlayerStatics = new List<CStatic>();
|
||||
_GameState = new SDataToScreenMain();
|
||||
_BuildPlayerTable();
|
||||
_CreateRoundsTable();
|
||||
_NextPlayerTexts = new List<CText>();
|
||||
_NextPlayerStatics = new List<CStatic>();
|
||||
|
||||
for (int i = 0; i < _PartyMode.GetMaxPlayer(); i++)
|
||||
{
|
||||
NextPlayerTexts.Add(GetNewText(Texts[TextNextPlayer]));
|
||||
AddText(NextPlayerTexts[NextPlayerTexts.Count - 1]);
|
||||
NextPlayerStatics.Add(GetNewStatic(Statics[StaticNextPlayer]));
|
||||
AddStatic(NextPlayerStatics[NextPlayerStatics.Count - 1]);
|
||||
_NextPlayerTexts.Add(GetNewText(Texts[_TextNextPlayer]));
|
||||
AddText(_NextPlayerTexts[_NextPlayerTexts.Count - 1]);
|
||||
_NextPlayerStatics.Add(GetNewStatic(Statics[_StaticNextPlayer]));
|
||||
AddStatic(_NextPlayerStatics[_NextPlayerStatics.Count - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
public override void DataToScreen(object ReceivedData)
|
||||
public override void DataToScreen(object receivedData)
|
||||
{
|
||||
DataToScreenMain data = new DataToScreenMain();
|
||||
SDataToScreenMain data = new SDataToScreenMain();
|
||||
|
||||
try
|
||||
{
|
||||
data = (DataToScreenMain)ReceivedData;
|
||||
GameState = data;
|
||||
data = (SDataToScreenMain)receivedData;
|
||||
_GameState = data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -129,7 +129,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleInput(KeyEvent keyEvent)
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
base.HandleInput(keyEvent);
|
||||
|
||||
@@ -140,41 +140,41 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
case Keys.Back:
|
||||
case Keys.Escape:
|
||||
if (!ExitPopupVisible)
|
||||
if (!_ExitPopupVisible)
|
||||
{
|
||||
if (GameState.CurrentRoundNr == 1)
|
||||
Back();
|
||||
if (_GameState.CurrentRoundNr == 1)
|
||||
_Back();
|
||||
else
|
||||
ShowPopup(true);
|
||||
_ShowPopup(true);
|
||||
}
|
||||
else
|
||||
ShowPopup(false);
|
||||
_ShowPopup(false);
|
||||
break;
|
||||
|
||||
case Keys.Enter:
|
||||
if (!ExitPopupVisible)
|
||||
if (!_ExitPopupVisible)
|
||||
{
|
||||
if (Buttons[ButtonNextRound].Selected)
|
||||
NextRound();
|
||||
if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1)
|
||||
Back();
|
||||
if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1)
|
||||
ShowPopup(true);
|
||||
if (Buttons[ButtonPlayerScrollUp].Selected)
|
||||
ScrollPlayerTable(-1);
|
||||
if (Buttons[ButtonPlayerScrollDown].Selected)
|
||||
ScrollPlayerTable(1);
|
||||
if (Buttons[ButtonRoundsScrollUp].Selected)
|
||||
ScrollRoundsTable(-1);
|
||||
if (Buttons[ButtonRoundsScrollDown].Selected)
|
||||
ScrollRoundsTable(1);
|
||||
if (Buttons[_ButtonNextRound].Selected)
|
||||
_NextRound();
|
||||
if (Buttons[_ButtonBack].Selected && _GameState.CurrentRoundNr == 1)
|
||||
_Back();
|
||||
if (Buttons[_ButtonExit].Selected && _GameState.CurrentRoundNr > 1)
|
||||
_ShowPopup(true);
|
||||
if (Buttons[_ButtonPlayerScrollUp].Selected)
|
||||
_ScrollPlayerTable(-1);
|
||||
if (Buttons[_ButtonPlayerScrollDown].Selected)
|
||||
_ScrollPlayerTable(1);
|
||||
if (Buttons[_ButtonRoundsScrollUp].Selected)
|
||||
_ScrollRoundsTable(-1);
|
||||
if (Buttons[_ButtonRoundsScrollDown].Selected)
|
||||
_ScrollRoundsTable(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Buttons[ButtonPopupYes].Selected)
|
||||
EndParty();
|
||||
if (Buttons[ButtonPopupNo].Selected)
|
||||
ShowPopup(false);
|
||||
if (Buttons[_ButtonPopupYes].Selected)
|
||||
_EndParty();
|
||||
if (Buttons[_ButtonPopupNo].Selected)
|
||||
_ShowPopup(false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -182,57 +182,57 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool HandleMouse(MouseEvent mouseEvent)
|
||||
public override bool HandleMouse(SMouseEvent mouseEvent)
|
||||
{
|
||||
base.HandleMouse(mouseEvent);
|
||||
|
||||
if (mouseEvent.LB && IsMouseOver(mouseEvent))
|
||||
{
|
||||
if (!ExitPopupVisible)
|
||||
if (!_ExitPopupVisible)
|
||||
{
|
||||
if (Buttons[ButtonNextRound].Selected)
|
||||
NextRound();
|
||||
if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1)
|
||||
Back();
|
||||
if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1)
|
||||
ShowPopup(true);
|
||||
if (Buttons[ButtonPlayerScrollUp].Selected)
|
||||
ScrollPlayerTable(-1);
|
||||
if (Buttons[ButtonPlayerScrollDown].Selected)
|
||||
ScrollPlayerTable(1);
|
||||
if (Buttons[ButtonRoundsScrollUp].Selected)
|
||||
ScrollRoundsTable(-1);
|
||||
if (Buttons[ButtonRoundsScrollDown].Selected)
|
||||
ScrollRoundsTable(1);
|
||||
if (Buttons[_ButtonNextRound].Selected)
|
||||
_NextRound();
|
||||
if (Buttons[_ButtonBack].Selected && _GameState.CurrentRoundNr == 1)
|
||||
_Back();
|
||||
if (Buttons[_ButtonExit].Selected && _GameState.CurrentRoundNr > 1)
|
||||
_ShowPopup(true);
|
||||
if (Buttons[_ButtonPlayerScrollUp].Selected)
|
||||
_ScrollPlayerTable(-1);
|
||||
if (Buttons[_ButtonPlayerScrollDown].Selected)
|
||||
_ScrollPlayerTable(1);
|
||||
if (Buttons[_ButtonRoundsScrollUp].Selected)
|
||||
_ScrollRoundsTable(-1);
|
||||
if (Buttons[_ButtonRoundsScrollDown].Selected)
|
||||
_ScrollRoundsTable(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Buttons[ButtonPopupYes].Selected)
|
||||
EndParty();
|
||||
if (Buttons[ButtonPopupNo].Selected)
|
||||
ShowPopup(false);
|
||||
if (Buttons[_ButtonPopupYes].Selected)
|
||||
_EndParty();
|
||||
if (Buttons[_ButtonPopupNo].Selected)
|
||||
_ShowPopup(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (mouseEvent.RB)
|
||||
{
|
||||
if (!ExitPopupVisible)
|
||||
if (!_ExitPopupVisible)
|
||||
{
|
||||
if (GameState.CurrentRoundNr == 1)
|
||||
Back();
|
||||
if (_GameState.CurrentRoundNr == 1)
|
||||
_Back();
|
||||
else
|
||||
ShowPopup(true);
|
||||
_ShowPopup(true);
|
||||
}
|
||||
else
|
||||
ShowPopup(false);
|
||||
_ShowPopup(false);
|
||||
}
|
||||
|
||||
if (mouseEvent.Wheel != 0)
|
||||
{
|
||||
if (CHelper.IsInBounds(RoundsTableScrollArea, mouseEvent))
|
||||
ScrollRoundsTable(mouseEvent.Wheel);
|
||||
if (CHelper.IsInBounds(PlayerTableScrollArea, mouseEvent))
|
||||
ScrollPlayerTable(mouseEvent.Wheel);
|
||||
if (CHelper.IsInBounds(_RoundsTableScrollArea, mouseEvent))
|
||||
_ScrollRoundsTable(mouseEvent.Wheel);
|
||||
if (CHelper.IsInBounds(_PlayerTableScrollArea, mouseEvent))
|
||||
_ScrollPlayerTable(mouseEvent.Wheel);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -242,46 +242,46 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
base.OnShow();
|
||||
|
||||
PlayerTableOffset = 0;
|
||||
RoundsTableOffset = 0;
|
||||
_PlayerTableOffset = 0;
|
||||
_RoundsTableOffset = 0;
|
||||
|
||||
UpdatePlayerTable();
|
||||
UpdateNextPlayerPositions();
|
||||
UpdateNextPlayerContents();
|
||||
if (GameState.CurrentRoundNr == 1)
|
||||
BuildRoundsTable();
|
||||
_UpdatePlayerTable();
|
||||
_UpdateNextPlayerPositions();
|
||||
_UpdateNextPlayerContents();
|
||||
if (_GameState.CurrentRoundNr == 1)
|
||||
_BuildRoundsTable();
|
||||
else
|
||||
ScrollRoundsTable(GameState.CurrentRoundNr - 2);
|
||||
UpdateRoundsTable();
|
||||
_ScrollRoundsTable(_GameState.CurrentRoundNr - 2);
|
||||
_UpdateRoundsTable();
|
||||
|
||||
if (GameState.CurrentRoundNr == 1)
|
||||
if (_GameState.CurrentRoundNr == 1)
|
||||
{
|
||||
Buttons[ButtonBack].Visible = true;
|
||||
Buttons[ButtonExit].Visible = false;
|
||||
Buttons[_ButtonBack].Visible = true;
|
||||
Buttons[_ButtonExit].Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Buttons[ButtonBack].Visible = false;
|
||||
Buttons[ButtonExit].Visible = true;
|
||||
Buttons[_ButtonBack].Visible = false;
|
||||
Buttons[_ButtonExit].Visible = true;
|
||||
}
|
||||
|
||||
if (GameState.CurrentRoundNr <= GameState.Combs.Count)
|
||||
if (_GameState.CurrentRoundNr <= _GameState.Combs.Count)
|
||||
{
|
||||
Buttons[ButtonNextRound].Visible = true;
|
||||
Texts[TextFinishMessage].Visible = false;
|
||||
Texts[TextFinishPlayerWin].Visible = false;
|
||||
SetInteractionToButton(Buttons[ButtonNextRound]);
|
||||
Buttons[_ButtonNextRound].Visible = true;
|
||||
Texts[_TextFinishMessage].Visible = false;
|
||||
Texts[_TextFinishPlayerWin].Visible = false;
|
||||
SetInteractionToButton(Buttons[_ButtonNextRound]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Buttons[ButtonNextRound].Visible = false;
|
||||
Texts[TextFinishMessage].Visible = true;
|
||||
Texts[TextFinishPlayerWin].Visible = true;
|
||||
Texts[TextFinishPlayerWin].Text = GetPlayerWinString();
|
||||
SetInteractionToButton(Buttons[ButtonExit]);
|
||||
Buttons[_ButtonNextRound].Visible = false;
|
||||
Texts[_TextFinishMessage].Visible = true;
|
||||
Texts[_TextFinishPlayerWin].Visible = true;
|
||||
Texts[_TextFinishPlayerWin].Text = _GetPlayerWinString();
|
||||
SetInteractionToButton(Buttons[_ButtonExit]);
|
||||
}
|
||||
|
||||
ShowPopup(false);
|
||||
_ShowPopup(false);
|
||||
}
|
||||
|
||||
public override bool UpdateGame()
|
||||
@@ -295,246 +295,246 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
return true;
|
||||
}
|
||||
|
||||
private void NextRound()
|
||||
private void _NextRound()
|
||||
{
|
||||
Data.ScreenMain.FadeToNameSelection = false;
|
||||
Data.ScreenMain.FadeToSongSelection = true;
|
||||
_PartyMode.DataFromScreen(ThemeName, Data);
|
||||
_Data.ScreenMain.FadeToNameSelection = false;
|
||||
_Data.ScreenMain.FadeToSongSelection = true;
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
}
|
||||
|
||||
private void EndParty()
|
||||
private void _EndParty()
|
||||
{
|
||||
FadeTo(EScreens.ScreenParty);
|
||||
_FadeTo(EScreens.ScreenParty);
|
||||
}
|
||||
|
||||
private void ShowPopup(bool Visible)
|
||||
private void _ShowPopup(bool visible)
|
||||
{
|
||||
ExitPopupVisible = Visible;
|
||||
_ExitPopupVisible = visible;
|
||||
|
||||
Statics[StaticPopupBG].Visible = ExitPopupVisible;
|
||||
Texts[TextPopupReallyExit].Visible = ExitPopupVisible;
|
||||
Buttons[ButtonPopupYes].Visible = ExitPopupVisible;
|
||||
Buttons[ButtonPopupNo].Visible = ExitPopupVisible;
|
||||
Statics[_StaticPopupBG].Visible = _ExitPopupVisible;
|
||||
Texts[_TextPopupReallyExit].Visible = _ExitPopupVisible;
|
||||
Buttons[_ButtonPopupYes].Visible = _ExitPopupVisible;
|
||||
Buttons[_ButtonPopupNo].Visible = _ExitPopupVisible;
|
||||
|
||||
if (ExitPopupVisible)
|
||||
SetInteractionToButton(Buttons[ButtonPopupNo]);
|
||||
if (_ExitPopupVisible)
|
||||
SetInteractionToButton(Buttons[_ButtonPopupNo]);
|
||||
}
|
||||
|
||||
private void Back()
|
||||
private void _Back()
|
||||
{
|
||||
Data.ScreenMain.FadeToNameSelection = true;
|
||||
Data.ScreenMain.FadeToSongSelection = false;
|
||||
_PartyMode.DataFromScreen(ThemeName, Data);
|
||||
_Data.ScreenMain.FadeToNameSelection = true;
|
||||
_Data.ScreenMain.FadeToSongSelection = false;
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
}
|
||||
|
||||
private void UpdateNextPlayerPositions()
|
||||
private void _UpdateNextPlayerPositions()
|
||||
{
|
||||
float x = CBase.Settings.GetRenderW() / 2 - ((GameState.NumPlayerAtOnce * Statics[StaticNextPlayer].Rect.W) + ((GameState.NumPlayerAtOnce - 1) * 15)) / 2;
|
||||
float static_y = 590;
|
||||
float text_y = 550;
|
||||
for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
|
||||
float x = CBase.Settings.GetRenderW() / 2 - ((_GameState.NumPlayerAtOnce * Statics[_StaticNextPlayer].Rect.W) + ((_GameState.NumPlayerAtOnce - 1) * 15)) / 2;
|
||||
float staticY = 590;
|
||||
float textY = 550;
|
||||
for (int i = 0; i < _GameState.NumPlayerAtOnce; i++)
|
||||
{
|
||||
//static
|
||||
NextPlayerStatics[i].Rect.X = x;
|
||||
NextPlayerStatics[i].Rect.Y = static_y;
|
||||
NextPlayerStatics[i].Visible = true;
|
||||
_NextPlayerStatics[i].Rect.X = x;
|
||||
_NextPlayerStatics[i].Rect.Y = staticY;
|
||||
_NextPlayerStatics[i].Visible = true;
|
||||
//text
|
||||
NextPlayerTexts[i].X = x + Statics[StaticNextPlayer].Rect.W / 2;
|
||||
NextPlayerTexts[i].Y = text_y;
|
||||
NextPlayerTexts[i].Visible = true;
|
||||
_NextPlayerTexts[i].X = x + Statics[_StaticNextPlayer].Rect.W / 2;
|
||||
_NextPlayerTexts[i].Y = textY;
|
||||
_NextPlayerTexts[i].Visible = true;
|
||||
|
||||
x += Statics[StaticNextPlayer].Rect.W + 15;
|
||||
x += Statics[_StaticNextPlayer].Rect.W + 15;
|
||||
}
|
||||
for (int i = GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++)
|
||||
for (int i = _GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++)
|
||||
{
|
||||
NextPlayerStatics[i].Visible = false;
|
||||
NextPlayerTexts[i].Visible = false;
|
||||
_NextPlayerStatics[i].Visible = false;
|
||||
_NextPlayerTexts[i].Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateNextPlayerContents()
|
||||
private void _UpdateNextPlayerContents()
|
||||
{
|
||||
if (GameState.CurrentRoundNr <= GameState.Combs.Count)
|
||||
if (_GameState.CurrentRoundNr <= _GameState.Combs.Count)
|
||||
{
|
||||
Texts[TextNextPlayerMessage].Visible = true;
|
||||
Texts[_TextNextPlayerMessage].Visible = true;
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
|
||||
for (int i = 0; i < _GameState.NumPlayerAtOnce; i++)
|
||||
{
|
||||
int pid = GameState.Combs[GameState.CurrentRoundNr - 1].Player[i];
|
||||
NextPlayerStatics[i].Texture = profiles[GameState.ProfileIDs[pid]].Avatar.Texture;
|
||||
NextPlayerTexts[i].Text = profiles[GameState.ProfileIDs[pid]].PlayerName;
|
||||
NextPlayerTexts[i].Color = CBase.Theme.GetPlayerColor(i + 1);
|
||||
int pid = _GameState.Combs[_GameState.CurrentRoundNr - 1].Player[i];
|
||||
_NextPlayerStatics[i].Texture = profiles[_GameState.ProfileIDs[pid]].Avatar.Texture;
|
||||
_NextPlayerTexts[i].Text = profiles[_GameState.ProfileIDs[pid]].PlayerName;
|
||||
_NextPlayerTexts[i].Color = CBase.Theme.GetPlayerColor(i + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Texts[TextNextPlayerMessage].Visible = false;
|
||||
for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
|
||||
Texts[_TextNextPlayerMessage].Visible = false;
|
||||
for (int i = 0; i < _GameState.NumPlayerAtOnce; i++)
|
||||
{
|
||||
NextPlayerStatics[i].Visible = false;
|
||||
NextPlayerTexts[i].Visible = false;
|
||||
_NextPlayerStatics[i].Visible = false;
|
||||
_NextPlayerTexts[i].Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateRoundsTable()
|
||||
private void _CreateRoundsTable()
|
||||
{
|
||||
//Create lists
|
||||
RoundsTable = new List<RoundsTableRow>();
|
||||
_RoundsTable = new List<CRoundsTableRow>();
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
RoundsTableRow rtr = new RoundsTableRow();
|
||||
CRoundsTableRow rtr = new CRoundsTableRow();
|
||||
rtr.TextPlayer = new List<CText>();
|
||||
rtr.TextScores = new List<CText>();
|
||||
RoundsTable.Add(rtr);
|
||||
_RoundsTable.Add(rtr);
|
||||
}
|
||||
//Create statics and texts for rounds
|
||||
for (int round = 0; round < RoundsTable.Count; round++)
|
||||
for (int round = 0; round < _RoundsTable.Count; round++)
|
||||
{
|
||||
//Round-number
|
||||
CText text = GetNewText(Texts[TextRoundNumber]);
|
||||
CText text = GetNewText(Texts[_TextRoundNumber]);
|
||||
AddText(text);
|
||||
RoundsTable[round].Number = text;
|
||||
_RoundsTable[round].Number = text;
|
||||
for (int row = 0; row < 2; row++)
|
||||
{
|
||||
for (int column = 0; column < 3; column++)
|
||||
{
|
||||
//Player
|
||||
text = GetNewText(Texts[TextRoundPlayer]);
|
||||
text = GetNewText(Texts[_TextRoundPlayer]);
|
||||
AddText(text);
|
||||
RoundsTable[round].TextPlayer.Add(text);
|
||||
_RoundsTable[round].TextPlayer.Add(text);
|
||||
//Score
|
||||
text = GetNewText(Texts[TextRoundScore]);
|
||||
text = GetNewText(Texts[_TextRoundScore]);
|
||||
AddText(text);
|
||||
RoundsTable[round].TextScores.Add(text);
|
||||
_RoundsTable[round].TextScores.Add(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BuildRoundsTable()
|
||||
private void _BuildRoundsTable()
|
||||
{
|
||||
RoundsTableScrollArea = new SRectF();
|
||||
_RoundsTableScrollArea = new SRectF();
|
||||
|
||||
int NumPlayerInOneRow = 3;
|
||||
if (GameState.NumPlayerAtOnce <= NumPlayerInOneRow)
|
||||
NumRoundsVisible = 5;
|
||||
int numPlayerInOneRow = 3;
|
||||
if (_GameState.NumPlayerAtOnce <= numPlayerInOneRow)
|
||||
_NumRoundsVisible = 5;
|
||||
else
|
||||
NumRoundsVisible = 3;
|
||||
_NumRoundsVisible = 3;
|
||||
|
||||
if (NumRoundsVisible > GameState.Combs.Count)
|
||||
NumRoundsVisible = GameState.Combs.Count;
|
||||
if (_NumRoundsVisible > _GameState.Combs.Count)
|
||||
_NumRoundsVisible = _GameState.Combs.Count;
|
||||
|
||||
float numberX = Texts[TextRoundNumber].X;
|
||||
float numberY = Texts[TextRoundNumber].Y;
|
||||
float numberX = Texts[_TextRoundNumber].X;
|
||||
float numberY = Texts[_TextRoundNumber].Y;
|
||||
|
||||
RoundsTableScrollArea.X = numberX;
|
||||
RoundsTableScrollArea.Y = numberY;
|
||||
RoundsTableScrollArea.W = CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20;
|
||||
_RoundsTableScrollArea.X = numberX;
|
||||
_RoundsTableScrollArea.Y = numberY;
|
||||
_RoundsTableScrollArea.W = CBase.Settings.GetRenderW() - Texts[_TextRoundNumber].X - 20;
|
||||
|
||||
float delta = Texts[TextRoundNumber].Height;
|
||||
float delta = Texts[_TextRoundNumber].Height;
|
||||
|
||||
//Update statics and texts for rounds
|
||||
for (int round = 0; round < RoundsTable.Count; round++)
|
||||
for (int round = 0; round < _RoundsTable.Count; round++)
|
||||
{
|
||||
//Round-number
|
||||
RoundsTable[round].Number.X = numberX;
|
||||
RoundsTable[round].Number.Y = numberY;
|
||||
int NumInnerRows = (int)Math.Ceiling(GameState.NumPlayerAtOnce / ((double)NumPlayerInOneRow));
|
||||
for (int row = 0; row < NumInnerRows; row++)
|
||||
_RoundsTable[round].Number.X = numberX;
|
||||
_RoundsTable[round].Number.Y = numberY;
|
||||
int numInnerRows = (int)Math.Ceiling(_GameState.NumPlayerAtOnce / ((double)numPlayerInOneRow));
|
||||
for (int row = 0; row < numInnerRows; row++)
|
||||
{
|
||||
int num = (row + 1) * NumPlayerInOneRow;
|
||||
int NumPlayerInThisRow = NumPlayerInOneRow;
|
||||
if (num > GameState.NumPlayerAtOnce)
|
||||
int num = (row + 1) * numPlayerInOneRow;
|
||||
int numPlayerInThisRow = numPlayerInOneRow;
|
||||
if (num > _GameState.NumPlayerAtOnce)
|
||||
{
|
||||
num = GameState.NumPlayerAtOnce;
|
||||
NumPlayerInThisRow = GameState.NumPlayerAtOnce - (row * NumPlayerInOneRow);
|
||||
num = _GameState.NumPlayerAtOnce;
|
||||
numPlayerInThisRow = _GameState.NumPlayerAtOnce - (row * numPlayerInOneRow);
|
||||
}
|
||||
for (int column = row * NumPlayerInOneRow; column < num; column++)
|
||||
for (int column = row * numPlayerInOneRow; column < num; column++)
|
||||
{
|
||||
//Player
|
||||
float _x = numberX + 15 + (CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) +
|
||||
((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2;
|
||||
float maxw = ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2 - 5;
|
||||
RoundsTable[round].TextPlayer[column].X = _x;
|
||||
RoundsTable[round].TextPlayer[column].Y = numberY;
|
||||
RoundsTable[round].TextPlayer[column].MaxWidth = maxw;
|
||||
float x = numberX + 15 + (CBase.Settings.GetRenderW() - Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow * (column - row * numPlayerInOneRow) +
|
||||
((CBase.Settings.GetRenderW() - Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow) / 2;
|
||||
float maxw = ((CBase.Settings.GetRenderW() - Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow) / 2 - 5;
|
||||
_RoundsTable[round].TextPlayer[column].X = x;
|
||||
_RoundsTable[round].TextPlayer[column].Y = numberY;
|
||||
_RoundsTable[round].TextPlayer[column].MaxWidth = maxw;
|
||||
//Score
|
||||
RoundsTable[round].TextScores[column] = RoundsTable[round].TextScores[column];
|
||||
RoundsTable[round].TextScores[column].X = _x;
|
||||
RoundsTable[round].TextScores[column].Y = numberY + delta;
|
||||
RoundsTable[round].TextScores[column].MaxWidth = maxw;
|
||||
_RoundsTable[round].TextScores[column] = _RoundsTable[round].TextScores[column];
|
||||
_RoundsTable[round].TextScores[column].X = x;
|
||||
_RoundsTable[round].TextScores[column].Y = numberY + delta;
|
||||
_RoundsTable[round].TextScores[column].MaxWidth = maxw;
|
||||
}
|
||||
numberY = numberY + delta + delta;
|
||||
}
|
||||
numberY = numberY + delta / 2;
|
||||
}
|
||||
RoundsTableScrollArea.H = numberY - RoundsTableScrollArea.Y;
|
||||
_RoundsTableScrollArea.H = numberY - _RoundsTableScrollArea.Y;
|
||||
}
|
||||
|
||||
private void UpdateRoundsTable()
|
||||
private void _UpdateRoundsTable()
|
||||
{
|
||||
SProfile[] profile = CBase.Profiles.GetProfiles();
|
||||
for (int i = 0; i < RoundsTable.Count; i++)
|
||||
for (int i = 0; i < _RoundsTable.Count; i++)
|
||||
{
|
||||
for (int p = 0; p < RoundsTable[i].TextPlayer.Count; p++)
|
||||
for (int p = 0; p < _RoundsTable[i].TextPlayer.Count; p++)
|
||||
{
|
||||
if (GameState.Combs.Count > i + RoundsTableOffset && GameState.Combs[i + RoundsTableOffset].Player.Count > p)
|
||||
if (_GameState.Combs.Count > i + _RoundsTableOffset && _GameState.Combs[i + _RoundsTableOffset].Player.Count > p)
|
||||
{
|
||||
RoundsTable[i].Number.Visible = true;
|
||||
RoundsTable[i].TextPlayer[p].Visible = true;
|
||||
RoundsTable[i].TextScores[p].Visible = true;
|
||||
RoundsTable[i].Number.Text = (i + 1 + RoundsTableOffset).ToString() + ")";
|
||||
int pID = GameState.ProfileIDs[GameState.Combs[i + RoundsTableOffset].Player[p]];
|
||||
RoundsTable[i].TextPlayer[p].Text = profile[pID].PlayerName;
|
||||
if ((GameState.CurrentRoundNr - 1) > i + RoundsTableOffset)
|
||||
RoundsTable[i].TextScores[p].Text = GameState.Results[i + RoundsTableOffset, p].ToString();
|
||||
_RoundsTable[i].Number.Visible = true;
|
||||
_RoundsTable[i].TextPlayer[p].Visible = true;
|
||||
_RoundsTable[i].TextScores[p].Visible = true;
|
||||
_RoundsTable[i].Number.Text = (i + 1 + _RoundsTableOffset).ToString() + ")";
|
||||
int pID = _GameState.ProfileIDs[_GameState.Combs[i + _RoundsTableOffset].Player[p]];
|
||||
_RoundsTable[i].TextPlayer[p].Text = profile[pID].PlayerName;
|
||||
if ((_GameState.CurrentRoundNr - 1) > i + _RoundsTableOffset)
|
||||
_RoundsTable[i].TextScores[p].Text = _GameState.Results[i + _RoundsTableOffset, p].ToString();
|
||||
else
|
||||
RoundsTable[i].TextScores[p].Text = "";
|
||||
_RoundsTable[i].TextScores[p].Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
RoundsTable[i].TextPlayer[p].Visible = false;
|
||||
RoundsTable[i].TextScores[p].Visible = false;
|
||||
_RoundsTable[i].TextPlayer[p].Visible = false;
|
||||
_RoundsTable[i].TextScores[p].Visible = false;
|
||||
}
|
||||
}
|
||||
if (GameState.Combs.Count < i + RoundsTableOffset || i + 1 > NumRoundsVisible)
|
||||
if (_GameState.Combs.Count < i + _RoundsTableOffset || i + 1 > _NumRoundsVisible)
|
||||
{
|
||||
RoundsTable[i].Number.Visible = false;
|
||||
for (int p = 0; p < RoundsTable[i].TextPlayer.Count; p++)
|
||||
_RoundsTable[i].Number.Visible = false;
|
||||
for (int p = 0; p < _RoundsTable[i].TextPlayer.Count; p++)
|
||||
{
|
||||
RoundsTable[i].TextPlayer[p].Visible = false;
|
||||
RoundsTable[i].TextScores[p].Visible = false;
|
||||
_RoundsTable[i].TextPlayer[p].Visible = false;
|
||||
_RoundsTable[i].TextScores[p].Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Buttons[ButtonRoundsScrollUp].Visible = RoundsTableOffset > 0;
|
||||
Buttons[ButtonRoundsScrollDown].Visible = GameState.Combs.Count - NumRoundsVisible - RoundsTableOffset > 0;
|
||||
Buttons[_ButtonRoundsScrollUp].Visible = _RoundsTableOffset > 0;
|
||||
Buttons[_ButtonRoundsScrollDown].Visible = _GameState.Combs.Count - _NumRoundsVisible - _RoundsTableOffset > 0;
|
||||
}
|
||||
|
||||
private void BuildPlayerTable()
|
||||
private void _BuildPlayerTable()
|
||||
{
|
||||
PlayerTableScrollArea = new SRectF();
|
||||
PlayerTableScrollArea.X = Texts[TextPosition].X;
|
||||
PlayerTableScrollArea.Y = Texts[TextPosition].Y;
|
||||
PlayerTableScrollArea.W = Texts[TextGamePoints].X - Texts[TextPosition].X;
|
||||
_PlayerTableScrollArea = new SRectF();
|
||||
_PlayerTableScrollArea.X = Texts[_TextPosition].X;
|
||||
_PlayerTableScrollArea.Y = Texts[_TextPosition].Y;
|
||||
_PlayerTableScrollArea.W = Texts[_TextGamePoints].X - Texts[_TextPosition].X;
|
||||
|
||||
PlayerTable = new List<TableRow>();
|
||||
float delta = Texts[TextPosition].Height * 1.2f;
|
||||
_PlayerTable = new List<STableRow>();
|
||||
float delta = Texts[_TextPosition].Height * 1.2f;
|
||||
|
||||
float h = 0;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
TableRow row = new TableRow();
|
||||
STableRow row = new STableRow();
|
||||
|
||||
row.Pos = GetNewText(Texts[TextPosition]);
|
||||
row.Name = GetNewText(Texts[TextPlayerName]);
|
||||
row.Rounds = GetNewText(Texts[TextNumPlayed]);
|
||||
row.Won = GetNewText(Texts[TextWon]);
|
||||
row.SingPoints = GetNewText(Texts[TextSingPoints]);
|
||||
row.GamePoints = GetNewText(Texts[TextGamePoints]);
|
||||
row.Pos = GetNewText(Texts[_TextPosition]);
|
||||
row.Name = GetNewText(Texts[_TextPlayerName]);
|
||||
row.Rounds = GetNewText(Texts[_TextNumPlayed]);
|
||||
row.Won = GetNewText(Texts[_TextWon]);
|
||||
row.SingPoints = GetNewText(Texts[_TextSingPoints]);
|
||||
row.GamePoints = GetNewText(Texts[_TextGamePoints]);
|
||||
|
||||
row.Pos.Y += delta * (i + 1);
|
||||
row.Name.Y += delta * (i + 1);
|
||||
@@ -559,22 +559,22 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
AddText(row.SingPoints);
|
||||
AddText(row.GamePoints);
|
||||
|
||||
PlayerTable.Add(row);
|
||||
_PlayerTable.Add(row);
|
||||
|
||||
h = delta * (i + 1);
|
||||
}
|
||||
PlayerTableScrollArea.H = h + delta;
|
||||
_PlayerTableScrollArea.H = h + delta;
|
||||
}
|
||||
|
||||
private void UpdatePlayerTable()
|
||||
private void _UpdatePlayerTable()
|
||||
{
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
|
||||
for (int i = 0; i < PlayerTable.Count; i++)
|
||||
for (int i = 0; i < _PlayerTable.Count; i++)
|
||||
{
|
||||
TableRow row = PlayerTable[i];
|
||||
STableRow row = _PlayerTable[i];
|
||||
|
||||
if (i + PlayerTableOffset < GameState.ResultTable.Count)
|
||||
if (i + _PlayerTableOffset < _GameState.ResultTable.Count)
|
||||
{
|
||||
row.Pos.Visible = true;
|
||||
row.Name.Visible = true;
|
||||
@@ -583,12 +583,12 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
row.SingPoints.Visible = true;
|
||||
row.GamePoints.Visible = true;
|
||||
|
||||
row.Pos.Text = GameState.ResultTable[i + PlayerTableOffset].Position.ToString() + ".";
|
||||
row.Name.Text = profiles[GameState.ResultTable[i + PlayerTableOffset].PlayerID].PlayerName;
|
||||
row.Rounds.Text = GameState.ResultTable[i + PlayerTableOffset].NumRounds.ToString();
|
||||
row.Won.Text = GameState.ResultTable[i + PlayerTableOffset].NumWon.ToString();
|
||||
row.SingPoints.Text = GameState.ResultTable[i + PlayerTableOffset].NumSingPoints.ToString();
|
||||
row.GamePoints.Text = GameState.ResultTable[i + PlayerTableOffset].NumGamePoints.ToString();
|
||||
row.Pos.Text = _GameState.ResultTable[i + _PlayerTableOffset].Position.ToString() + ".";
|
||||
row.Name.Text = profiles[_GameState.ResultTable[i + _PlayerTableOffset].PlayerID].PlayerName;
|
||||
row.Rounds.Text = _GameState.ResultTable[i + _PlayerTableOffset].NumRounds.ToString();
|
||||
row.Won.Text = _GameState.ResultTable[i + _PlayerTableOffset].NumWon.ToString();
|
||||
row.SingPoints.Text = _GameState.ResultTable[i + _PlayerTableOffset].NumSingPoints.ToString();
|
||||
row.GamePoints.Text = _GameState.ResultTable[i + _PlayerTableOffset].NumGamePoints.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -601,54 +601,54 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
|
||||
Buttons[ButtonPlayerScrollUp].Visible = PlayerTableOffset > 0;
|
||||
Buttons[ButtonPlayerScrollDown].Visible = GameState.ProfileIDs.Count - NumPlayerVisible - PlayerTableOffset > 0;
|
||||
Buttons[_ButtonPlayerScrollUp].Visible = _PlayerTableOffset > 0;
|
||||
Buttons[_ButtonPlayerScrollDown].Visible = _GameState.ProfileIDs.Count - _NumPlayerVisible - _PlayerTableOffset > 0;
|
||||
}
|
||||
|
||||
private void ScrollPlayerTable(int Offset)
|
||||
private void _ScrollPlayerTable(int offset)
|
||||
{
|
||||
if (GameState.ProfileIDs.Count <= NumPlayerVisible)
|
||||
PlayerTableOffset = 0;
|
||||
else if (Offset < 0 && PlayerTableOffset + Offset >= 0)
|
||||
PlayerTableOffset += Offset;
|
||||
else if (Offset < 0 && PlayerTableOffset + Offset < 0)
|
||||
PlayerTableOffset = 0;
|
||||
else if (Offset > 0 && PlayerTableOffset + Offset <= GameState.ProfileIDs.Count - NumPlayerVisible)
|
||||
PlayerTableOffset += Offset;
|
||||
else if (Offset > 0 && PlayerTableOffset + Offset > GameState.ProfileIDs.Count - NumPlayerVisible)
|
||||
PlayerTableOffset = GameState.ProfileIDs.Count - NumPlayerVisible;
|
||||
if (_GameState.ProfileIDs.Count <= _NumPlayerVisible)
|
||||
_PlayerTableOffset = 0;
|
||||
else if (offset < 0 && _PlayerTableOffset + offset >= 0)
|
||||
_PlayerTableOffset += offset;
|
||||
else if (offset < 0 && _PlayerTableOffset + offset < 0)
|
||||
_PlayerTableOffset = 0;
|
||||
else if (offset > 0 && _PlayerTableOffset + offset <= _GameState.ProfileIDs.Count - _NumPlayerVisible)
|
||||
_PlayerTableOffset += offset;
|
||||
else if (offset > 0 && _PlayerTableOffset + offset > _GameState.ProfileIDs.Count - _NumPlayerVisible)
|
||||
_PlayerTableOffset = _GameState.ProfileIDs.Count - _NumPlayerVisible;
|
||||
|
||||
UpdatePlayerTable();
|
||||
_UpdatePlayerTable();
|
||||
}
|
||||
|
||||
private void ScrollRoundsTable(int Offset)
|
||||
private void _ScrollRoundsTable(int offset)
|
||||
{
|
||||
if (GameState.Combs.Count <= NumRoundsVisible)
|
||||
RoundsTableOffset = 0;
|
||||
else if (Offset < 0 && RoundsTableOffset + Offset >= 0)
|
||||
RoundsTableOffset += Offset;
|
||||
else if (Offset < 0 && RoundsTableOffset + Offset < 0)
|
||||
RoundsTableOffset = 0;
|
||||
else if (Offset > 0 && RoundsTableOffset + Offset <= GameState.Combs.Count - NumRoundsVisible)
|
||||
RoundsTableOffset += Offset;
|
||||
else if (Offset > 0 && RoundsTableOffset + Offset > GameState.Combs.Count - NumRoundsVisible)
|
||||
RoundsTableOffset = GameState.Combs.Count - NumRoundsVisible;
|
||||
if (_GameState.Combs.Count <= _NumRoundsVisible)
|
||||
_RoundsTableOffset = 0;
|
||||
else if (offset < 0 && _RoundsTableOffset + offset >= 0)
|
||||
_RoundsTableOffset += offset;
|
||||
else if (offset < 0 && _RoundsTableOffset + offset < 0)
|
||||
_RoundsTableOffset = 0;
|
||||
else if (offset > 0 && _RoundsTableOffset + offset <= _GameState.Combs.Count - _NumRoundsVisible)
|
||||
_RoundsTableOffset += offset;
|
||||
else if (offset > 0 && _RoundsTableOffset + offset > _GameState.Combs.Count - _NumRoundsVisible)
|
||||
_RoundsTableOffset = _GameState.Combs.Count - _NumRoundsVisible;
|
||||
|
||||
UpdateRoundsTable();
|
||||
_UpdateRoundsTable();
|
||||
}
|
||||
|
||||
private string GetPlayerWinString()
|
||||
private string _GetPlayerWinString()
|
||||
{
|
||||
string s = "";
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
|
||||
for (int i = 0; i < GameState.ResultTable.Count; i++)
|
||||
for (int i = 0; i < _GameState.ResultTable.Count; i++)
|
||||
{
|
||||
if (GameState.ResultTable[i].Position == 1)
|
||||
if (_GameState.ResultTable[i].Position == 1)
|
||||
{
|
||||
if (i > 0)
|
||||
s += ", ";
|
||||
s += profiles[GameState.ResultTable[i].PlayerID].PlayerName;
|
||||
s += profiles[_GameState.ResultTable[i].PlayerID].PlayerName;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
@@ -5,7 +5,7 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
public class PartyScreenChallengeNames : CMenuParty
|
||||
public class CPartyScreenChallengeNames : CMenuParty
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -13,40 +13,40 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
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 _ButtonNext = "ButtonNext";
|
||||
private const string _ButtonBack = "ButtonBack";
|
||||
private const string _ButtonPlayerDestination = "ButtonPlayerDestination";
|
||||
private const string _ButtonPlayerChoose = "ButtonPlayerChoose";
|
||||
|
||||
private List<CPlayerChooseButton> PlayerChooseButtons;
|
||||
private List<CButton> PlayerDestinationButtons;
|
||||
private List<CPlayerChooseButton> _PlayerChooseButtons;
|
||||
private List<CButton> _PlayerDestinationButtons;
|
||||
//PlayerDestinationButtons-Option
|
||||
private const int PlayerDestinationButtonsNumH = 3;
|
||||
private const int PlayerDestinationButtonsNumW = 4;
|
||||
private const int PlayerDestinationButtonsFirstX = 900;
|
||||
private const int PlayerDestinationButtonsFirstY = 105;
|
||||
private const int PlayerDestinationButtonsSpaceH = 15;
|
||||
private const int PlayerDestinationButtonsSpaceW = 25;
|
||||
private const int _PlayerDestinationButtonsNumH = 3;
|
||||
private const int _PlayerDestinationButtonsNumW = 4;
|
||||
private const int _PlayerDestinationButtonsFirstX = 900;
|
||||
private const int _PlayerDestinationButtonsFirstY = 105;
|
||||
private const int _PlayerDestinationButtonsSpaceH = 15;
|
||||
private const int _PlayerDestinationButtonsSpaceW = 25;
|
||||
//PlayerChooseButtons-Option
|
||||
private List<int> PlayerChooseButtonsVisibleProfiles;
|
||||
private const int PlayerChooseButtonsNumH = 7;
|
||||
private const int PlayerChooseButtonsNumW = 4;
|
||||
private const int PlayerChooseButtonsFirstX = 52;
|
||||
private const int PlayerChooseButtonsFirstY = 105;
|
||||
private const int PlayerChooseButtonsSpaceH = 15;
|
||||
private const int PlayerChooseButtonsSpaceW = 25;
|
||||
private int PlayerChooseButtonsOffset = 0;
|
||||
private List<int> _PlayerChooseButtonsVisibleProfiles;
|
||||
private const int _PlayerChooseButtonsNumH = 7;
|
||||
private const int _PlayerChooseButtonsNumW = 4;
|
||||
private const int _PlayerChooseButtonsFirstX = 52;
|
||||
private const int _PlayerChooseButtonsFirstY = 105;
|
||||
private const int _PlayerChooseButtonsSpaceH = 15;
|
||||
private const int _PlayerChooseButtonsSpaceW = 25;
|
||||
private int _PlayerChooseButtonsOffset = 0;
|
||||
|
||||
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 NumPlayer = 4;
|
||||
private int _NumPlayer = 4;
|
||||
|
||||
private DataFromScreen Data;
|
||||
private SDataFromScreen _Data;
|
||||
|
||||
private class CPlayerChooseButton
|
||||
{
|
||||
@@ -58,39 +58,39 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
base.Init();
|
||||
|
||||
chooseAvatarStatic = GetNewStatic();
|
||||
chooseAvatarStatic.Visible = false;
|
||||
_ChooseAvatarStatic = GetNewStatic();
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
|
||||
PlayerChooseButtonsVisibleProfiles = new List<int>();
|
||||
_PlayerChooseButtonsVisibleProfiles = new List<int>();
|
||||
|
||||
Data.ScreenNames.ProfileIDs = new List<int>();
|
||||
_Data.ScreenNames.ProfileIDs = new List<int>();
|
||||
|
||||
List<string> buttons = new List<string>();
|
||||
_ThemeButtons = new string[] {ButtonBack, ButtonNext, ButtonPlayerDestination, ButtonPlayerChoose};
|
||||
_ThemeButtons = new string[] {_ButtonBack, _ButtonNext, _ButtonPlayerDestination, _ButtonPlayerChoose};
|
||||
|
||||
Data = new DataFromScreen();
|
||||
FromScreenNames names = new FromScreenNames();
|
||||
_Data = new SDataFromScreen();
|
||||
SFromScreenNames names = new SFromScreenNames();
|
||||
names.FadeToConfig = false;
|
||||
names.FadeToMain = false;
|
||||
names.ProfileIDs = 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.ProfileIDs = config.ProfileIDs;
|
||||
if (Data.ScreenNames.ProfileIDs == null)
|
||||
Data.ScreenNames.ProfileIDs = new List<int>();
|
||||
config = (SDataToScreenNames)receivedData;
|
||||
_Data.ScreenNames.ProfileIDs = config.ProfileIDs;
|
||||
if (_Data.ScreenNames.ProfileIDs == null)
|
||||
_Data.ScreenNames.ProfileIDs = new List<int>();
|
||||
|
||||
NumPlayer = config.NumPlayer;
|
||||
_NumPlayer = config.NumPlayer;
|
||||
|
||||
while (Data.ScreenNames.ProfileIDs.Count > NumPlayer)
|
||||
Data.ScreenNames.ProfileIDs.RemoveAt(Data.ScreenNames.ProfileIDs.Count - 1);
|
||||
while (_Data.ScreenNames.ProfileIDs.Count > _NumPlayer)
|
||||
_Data.ScreenNames.ProfileIDs.RemoveAt(_Data.ScreenNames.ProfileIDs.Count - 1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleInput(KeyEvent keyEvent)
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
base.HandleInput(keyEvent);
|
||||
|
||||
@@ -109,29 +109,29 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
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 (!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);
|
||||
|
||||
@@ -164,74 +164,74 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}*/
|
||||
|
||||
//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;
|
||||
}
|
||||
// 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 (Data.ScreenNames.ProfileIDs.Count < (i + 1))
|
||||
if (_Data.ScreenNames.ProfileIDs.Count < (i + 1))
|
||||
{
|
||||
Data.ScreenNames.ProfileIDs.Add(SelectedPlayerNr);
|
||||
added = Data.ScreenNames.ProfileIDs.Count - 1;
|
||||
_Data.ScreenNames.ProfileIDs.Add(_SelectedPlayerNr);
|
||||
added = _Data.ScreenNames.ProfileIDs.Count - 1;
|
||||
}
|
||||
else if (Data.ScreenNames.ProfileIDs.Count >= (i + 1))
|
||||
else if (_Data.ScreenNames.ProfileIDs.Count >= (i + 1))
|
||||
{
|
||||
Data.ScreenNames.ProfileIDs[i] = SelectedPlayerNr;
|
||||
_Data.ScreenNames.ProfileIDs[i] = _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].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;
|
||||
//Update Tiles-List
|
||||
UpdateButtonPlayerChoose();
|
||||
_UpdateButtonPlayerChoose();
|
||||
}
|
||||
}
|
||||
}
|
||||
SelectedPlayerNr = -1;
|
||||
_SelectedPlayerNr = -1;
|
||||
}
|
||||
//Reset variables
|
||||
SelectingMouseActive = false;
|
||||
chooseAvatarStatic.Visible = false;
|
||||
_SelectingMouseActive = false;
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
}
|
||||
|
||||
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 (!OnAdd())
|
||||
OnRemove();
|
||||
if (!_OnAdd())
|
||||
_OnRemove();
|
||||
}
|
||||
|
||||
if (mouseEvent.RB)
|
||||
Back();
|
||||
_Back();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -240,17 +240,17 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
base.OnShow();
|
||||
|
||||
if (!ButtonsAdded)
|
||||
if (!_ButtonsAdded)
|
||||
{
|
||||
AddButtonPlayerDestination();
|
||||
AddButtonPlayerChoose();
|
||||
ButtonsAdded = true;
|
||||
_AddButtonPlayerDestination();
|
||||
_AddButtonPlayerChoose();
|
||||
_ButtonsAdded = true;
|
||||
}
|
||||
|
||||
UpdateButtonPlayerDestination();
|
||||
UpdateButtonPlayerChoose();
|
||||
_UpdateButtonPlayerDestination();
|
||||
_UpdateButtonPlayerChoose();
|
||||
|
||||
UpdateButtonNext();
|
||||
_UpdateButtonNext();
|
||||
}
|
||||
|
||||
public override bool UpdateGame()
|
||||
@@ -261,25 +261,25 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
public override bool Draw()
|
||||
{
|
||||
base.Draw();
|
||||
if (chooseAvatarStatic.Visible)
|
||||
chooseAvatarStatic.Draw();
|
||||
if (_ChooseAvatarStatic.Visible)
|
||||
_ChooseAvatarStatic.Draw();
|
||||
return true;
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -290,23 +290,23 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -317,53 +317,53 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
_UpdateButtonPlayerChoose(_PlayerChooseButtonsOffset);
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -372,10 +372,10 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
{
|
||||
visible = true;
|
||||
|
||||
for (int p = 0; p < Data.ScreenNames.ProfileIDs.Count; p++)
|
||||
for (int p = 0; p < _Data.ScreenNames.ProfileIDs.Count; p++)
|
||||
{
|
||||
//Don't show profile if is selected
|
||||
if (Data.ScreenNames.ProfileIDs[p] == i)
|
||||
if (_Data.ScreenNames.ProfileIDs[p] == i)
|
||||
{
|
||||
visible = false;
|
||||
break;
|
||||
@@ -383,82 +383,82 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
}
|
||||
}
|
||||
if (visible)
|
||||
PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||
_PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateButtonPlayerDestination()
|
||||
private void _UpdateButtonPlayerDestination()
|
||||
{
|
||||
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
||||
for (int i = 0; i < _PlayerDestinationButtons.Count; i++)
|
||||
{
|
||||
if (NumPlayer > i)
|
||||
if (_NumPlayer > 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 < NumPlayer; i++)
|
||||
for (int i = 0; i < _NumPlayer; i++)
|
||||
{
|
||||
if (i < Data.ScreenNames.ProfileIDs.Count)
|
||||
if (i < _Data.ScreenNames.ProfileIDs.Count)
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDs[i] != -1)
|
||||
if (_Data.ScreenNames.ProfileIDs[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.ProfileIDs[i]].Avatar.Texture;
|
||||
PlayerDestinationButtons[i].SelTexture = CBase.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDs[i]].Avatar.Texture;
|
||||
PlayerDestinationButtons[i].Text.Text = CBase.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDs[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.ProfileIDs[i]].Avatar.Texture;
|
||||
_PlayerDestinationButtons[i].SelTexture = CBase.Profiles.GetProfiles()[_Data.ScreenNames.ProfileIDs[i]].Avatar.Texture;
|
||||
_PlayerDestinationButtons[i].Text.Text = CBase.Profiles.GetProfiles()[_Data.ScreenNames.ProfileIDs[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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateButtonNext()
|
||||
private void _UpdateButtonNext()
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDs.Count == NumPlayer)
|
||||
if (_Data.ScreenNames.ProfileIDs.Count == _NumPlayer)
|
||||
{
|
||||
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.ProfileIDs.Count < NumPlayer)
|
||||
if (_Data.ScreenNames.ProfileIDs.Count < _NumPlayer)
|
||||
{
|
||||
Data.ScreenNames.ProfileIDs.Add(PlayerChooseButtons[i].ProfileID);
|
||||
int added = Data.ScreenNames.ProfileIDs.Count - 1;
|
||||
UpdateButtonNext();
|
||||
_Data.ScreenNames.ProfileIDs.Add(_PlayerChooseButtons[i].ProfileID);
|
||||
int added = _Data.ScreenNames.ProfileIDs.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;
|
||||
}
|
||||
@@ -467,18 +467,18 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool OnRemove()
|
||||
private bool _OnRemove()
|
||||
{
|
||||
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
||||
for (int i = 0; i < _PlayerDestinationButtons.Count; i++)
|
||||
{
|
||||
if (PlayerDestinationButtons[i].Selected)
|
||||
if (_PlayerDestinationButtons[i].Selected)
|
||||
{
|
||||
if ((i + 1) <= Data.ScreenNames.ProfileIDs.Count)
|
||||
if ((i + 1) <= _Data.ScreenNames.ProfileIDs.Count)
|
||||
{
|
||||
Data.ScreenNames.ProfileIDs.RemoveAt(i);
|
||||
UpdateButtonNext();
|
||||
UpdateButtonPlayerDestination();
|
||||
UpdateButtonPlayerChoose();
|
||||
_Data.ScreenNames.ProfileIDs.RemoveAt(i);
|
||||
_UpdateButtonNext();
|
||||
_UpdateButtonPlayerDestination();
|
||||
_UpdateButtonPlayerChoose();
|
||||
CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
@@ -487,18 +487,18 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,58 +3,58 @@ using System.Collections.Generic;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
public class ChallengeRounds
|
||||
public class CChallengeRounds
|
||||
{
|
||||
private readonly Random _Rand;
|
||||
private readonly int _NumPlayer;
|
||||
|
||||
public List<Combination> Rounds;
|
||||
public List<CCombination> Rounds;
|
||||
|
||||
public ChallengeRounds(int NumRounds, int NumPlayer, int NumPlayerAtOnce)
|
||||
public CChallengeRounds(int numRounds, int numPlayer, int numPlayerAtOnce)
|
||||
{
|
||||
Rounds = new List<Combination>();
|
||||
Rounds = new List<CCombination>();
|
||||
_Rand = new Random(DateTime.Now.Millisecond);
|
||||
|
||||
if (NumPlayerAtOnce < 1 || NumRounds < 1 || NumPlayer == 0)
|
||||
if (numPlayerAtOnce < 1 || numRounds < 1 || numPlayer == 0)
|
||||
_NumPlayer = 0;
|
||||
else
|
||||
{
|
||||
_NumPlayer = NumPlayer;
|
||||
BuildRounds(NumRounds, NumPlayerAtOnce, _Rand);
|
||||
_NumPlayer = numPlayer;
|
||||
_BuildRounds(numRounds, numPlayerAtOnce, _Rand);
|
||||
}
|
||||
}
|
||||
|
||||
public Combination GetRound(int RoundNr)
|
||||
public CCombination GetRound(int roundNr)
|
||||
{
|
||||
if (RoundNr >= Rounds.Count || _NumPlayer == 0 || Rounds.Count == 0)
|
||||
if (roundNr >= Rounds.Count || _NumPlayer == 0 || Rounds.Count == 0)
|
||||
return null;
|
||||
|
||||
return Rounds[RoundNr];
|
||||
return Rounds[roundNr];
|
||||
}
|
||||
|
||||
private void BuildRounds(int NumRounds, int NumPlayerAtOnce, Random Rand)
|
||||
private void _BuildRounds(int numRounds, int numPlayerAtOnce, Random rand)
|
||||
{
|
||||
Combinations Combinations = new Combinations(_NumPlayer, NumPlayerAtOnce, Rand);
|
||||
Rounds.Add(Combinations.GetNextCombination(null));
|
||||
CCombinations combinations = new CCombinations(_NumPlayer, numPlayerAtOnce, rand);
|
||||
Rounds.Add(combinations.GetNextCombination(null));
|
||||
|
||||
for (int i = 1; i < NumRounds; i++)
|
||||
Rounds.Add(Combinations.GetNextCombination(GetPlayerDemand(i)));
|
||||
for (int i = 1; i < numRounds; i++)
|
||||
Rounds.Add(combinations.GetNextCombination(_GetPlayerDemand(i)));
|
||||
}
|
||||
|
||||
private List<int> GetPlayerDemand(int RoundIndex)
|
||||
private List<int> _GetPlayerDemand(int roundIndex)
|
||||
{
|
||||
List<int> NumPlayed = new List<int>(_NumPlayer);
|
||||
List<int> numPlayed = new List<int>(_NumPlayer);
|
||||
for (int i = 0; i < _NumPlayer; i++)
|
||||
NumPlayed.Add(0);
|
||||
numPlayed.Add(0);
|
||||
|
||||
for (int i = 0; i < RoundIndex; i++)
|
||||
for (int i = 0; i < roundIndex; i++)
|
||||
{
|
||||
foreach (int PlayerIndex in Rounds[i].Player)
|
||||
NumPlayed[PlayerIndex]++;
|
||||
foreach (int playerIndex in Rounds[i].Player)
|
||||
numPlayed[playerIndex]++;
|
||||
}
|
||||
|
||||
int max = 0;
|
||||
foreach (int p in NumPlayed)
|
||||
foreach (int p in numPlayed)
|
||||
{
|
||||
if (p > max)
|
||||
max = p;
|
||||
@@ -65,20 +65,20 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
List<int> other = new List<int>();
|
||||
List<int> last = new List<int>();
|
||||
|
||||
for (int i = 0; i < NumPlayed.Count; i++)
|
||||
for (int i = 0; i < numPlayed.Count; i++)
|
||||
{
|
||||
if (RoundIndex == 0 || NumPlayed[i] < max)
|
||||
if (roundIndex == 0 || numPlayed[i] < max)
|
||||
{
|
||||
if (RoundIndex == 0 || RoundIndex > 0 && NumPlayed[i] < max && !Rounds[RoundIndex - 1].IsAvailable(i))
|
||||
if (roundIndex == 0 || roundIndex > 0 && numPlayed[i] < max && !Rounds[roundIndex - 1].IsAvailable(i))
|
||||
result.Add(i);
|
||||
else if (NumPlayed[i] < max)
|
||||
else if (numPlayed[i] < max)
|
||||
other.Add(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (RoundIndex > 0)
|
||||
if (roundIndex > 0)
|
||||
{
|
||||
if (!Rounds[RoundIndex - 1].IsAvailable(i))
|
||||
if (!Rounds[roundIndex - 1].IsAvailable(i))
|
||||
other.Add(i);
|
||||
else
|
||||
last.Add(i);
|
||||
@@ -116,48 +116,48 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
|
||||
class Combinations
|
||||
class CCombinations
|
||||
{
|
||||
private readonly List<Combination> _Combs;
|
||||
private readonly List<CCombination> _Combs;
|
||||
private readonly Random _Rand;
|
||||
private readonly int _NumPlayer;
|
||||
private readonly int _NumMics;
|
||||
|
||||
public Combinations(int NumPlayer, int NumMics, Random Rand)
|
||||
public CCombinations(int numPlayer, int numMics, Random rand)
|
||||
{
|
||||
_Combs = new List<Combination>();
|
||||
_NumMics = NumMics;
|
||||
_NumPlayer = NumPlayer;
|
||||
_Rand = Rand;
|
||||
_Combs = new List<CCombination>();
|
||||
_NumMics = numMics;
|
||||
_NumPlayer = numPlayer;
|
||||
_Rand = rand;
|
||||
}
|
||||
|
||||
public Combination GetNextCombination(List<int> PlayerNrDemand)
|
||||
public CCombination GetNextCombination(List<int> playerNrDemand)
|
||||
{
|
||||
if (_Combs.Count == 0)
|
||||
Create();
|
||||
_Create();
|
||||
|
||||
Combination combs = new Combination();
|
||||
CCombination combs = new CCombination();
|
||||
|
||||
if (_NumPlayer == _NumMics)
|
||||
return _Combs[0];
|
||||
|
||||
//filter against PlayerNrDemand
|
||||
List<Combination> combsFiltered = new List<Combination>();
|
||||
if (PlayerNrDemand != null)
|
||||
List<CCombination> combsFiltered = new List<CCombination>();
|
||||
if (playerNrDemand != null)
|
||||
{
|
||||
for (int i = 0; i < _Combs.Count; i++)
|
||||
{
|
||||
if (_Combs[i].IsAvailableAll(PlayerNrDemand))
|
||||
if (_Combs[i].IsAvailableAll(playerNrDemand))
|
||||
combsFiltered.Add(_Combs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//1st fallback
|
||||
if (PlayerNrDemand != null && combsFiltered.Count == 0)
|
||||
if (playerNrDemand != null && combsFiltered.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < _Combs.Count; i++)
|
||||
{
|
||||
if (_Combs[i].IsAvailableSomeone(PlayerNrDemand))
|
||||
if (_Combs[i].IsAvailableSomeone(playerNrDemand))
|
||||
combsFiltered.Add(_Combs[i]);
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
int num = combsFiltered.Count;
|
||||
int rand = _Rand.Next(num);
|
||||
Combination c = new Combination();
|
||||
CCombination c = new CCombination();
|
||||
for (int i = 0; i < combsFiltered[rand].Player.Count; i++)
|
||||
c.Player.Add(combsFiltered[rand].Player[i]);
|
||||
_Combs.Remove(combsFiltered[rand]);
|
||||
@@ -179,7 +179,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return combsFiltered[rand];
|
||||
}
|
||||
|
||||
private void Create()
|
||||
private void _Create()
|
||||
{
|
||||
_Combs.Clear();
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
for (int i = 1; i <= num; i++)
|
||||
{
|
||||
Combination c = new Combination();
|
||||
CCombination c = new CCombination();
|
||||
|
||||
for (int j = 0; j < _NumPlayer; j++)
|
||||
{
|
||||
@@ -201,37 +201,37 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
|
||||
public class Combination
|
||||
public class CCombination
|
||||
{
|
||||
public List<int> Player;
|
||||
|
||||
public Combination()
|
||||
public CCombination()
|
||||
{
|
||||
Player = new List<int>();
|
||||
}
|
||||
|
||||
public bool IsAvailable(int PlayerIndex)
|
||||
public bool IsAvailable(int playerIndex)
|
||||
{
|
||||
foreach (int p in Player)
|
||||
{
|
||||
if (p == PlayerIndex)
|
||||
if (p == playerIndex)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsAvailableAll(List<int> PlayerIndices)
|
||||
public bool IsAvailableAll(List<int> playerIndices)
|
||||
{
|
||||
bool result = true;
|
||||
foreach (int p in PlayerIndices)
|
||||
foreach (int p in playerIndices)
|
||||
result &= IsAvailable(p);
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool IsAvailableSomeone(List<int> PlayerIndices)
|
||||
public bool IsAvailableSomeone(List<int> playerIndices)
|
||||
{
|
||||
bool result = false;
|
||||
foreach (int p in PlayerIndices)
|
||||
foreach (int p in playerIndices)
|
||||
result |= IsAvailable(p);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -12,30 +12,30 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
#region Communication
|
||||
|
||||
#region ToScreen
|
||||
public struct DataToScreenConfig
|
||||
public struct SDataToScreenConfig
|
||||
{
|
||||
public int NumPlayer;
|
||||
public int NumPlayerAtOnce;
|
||||
public int NumRounds;
|
||||
}
|
||||
|
||||
public struct DataToScreenNames
|
||||
public struct SDataToScreenNames
|
||||
{
|
||||
public int NumPlayer;
|
||||
public List<int> ProfileIDs;
|
||||
}
|
||||
|
||||
public struct DataToScreenMain
|
||||
public struct SDataToScreenMain
|
||||
{
|
||||
public int CurrentRoundNr;
|
||||
public int NumPlayerAtOnce;
|
||||
public List<Combination> Combs;
|
||||
public List<CCombination> Combs;
|
||||
public int[,] Results;
|
||||
public List<ResultTableRow> ResultTable;
|
||||
public List<CResultTableRow> ResultTable;
|
||||
public List<int> ProfileIDs;
|
||||
}
|
||||
|
||||
public class ResultTableRow : IComparable
|
||||
public class CResultTableRow : IComparable
|
||||
{
|
||||
public int Position;
|
||||
public int PlayerID;
|
||||
@@ -47,9 +47,9 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
public int CompareTo(object obj)
|
||||
{
|
||||
if (obj is ResultTableRow)
|
||||
if (obj is CResultTableRow)
|
||||
{
|
||||
ResultTableRow row = (ResultTableRow)obj;
|
||||
CResultTableRow row = (CResultTableRow)obj;
|
||||
|
||||
int res = row.NumGamePoints.CompareTo(NumGamePoints);
|
||||
if (res == 0)
|
||||
@@ -67,28 +67,28 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
#endregion ToScreen
|
||||
|
||||
#region FromScreen
|
||||
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 NumPlayer;
|
||||
public int NumPlayerAtOnce;
|
||||
public int NumRounds;
|
||||
}
|
||||
|
||||
public struct FromScreenNames
|
||||
public struct SFromScreenNames
|
||||
{
|
||||
public bool FadeToConfig;
|
||||
public bool FadeToMain;
|
||||
public List<int> ProfileIDs;
|
||||
}
|
||||
|
||||
public struct FromScreenMain
|
||||
public struct SFromScreenMain
|
||||
{
|
||||
public bool FadeToSongSelection;
|
||||
public bool FadeToNameSelection;
|
||||
@@ -97,14 +97,14 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
#endregion Communication
|
||||
|
||||
public sealed class PartyModeChallengeMedley : CPartyMode
|
||||
public sealed class CPartyModeChallengeMedley : CPartyMode
|
||||
{
|
||||
private const int MaxPlayer = 12;
|
||||
private const int MinPlayer = 1;
|
||||
private const int MaxTeams = 0;
|
||||
private const int MinTeams = 0;
|
||||
private const int MaxNumRounds = 100;
|
||||
private const int NumSongs = 5;
|
||||
private const int _MaxPlayer = 12;
|
||||
private const int _MinPlayer = 1;
|
||||
private const int _MaxTeams = 0;
|
||||
private const int _MinTeams = 0;
|
||||
private const int _MaxNumRounds = 100;
|
||||
private const int _NumSongs = 5;
|
||||
|
||||
private enum EStage
|
||||
{
|
||||
@@ -115,15 +115,15 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
Singing
|
||||
}
|
||||
|
||||
private struct Data
|
||||
private struct SData
|
||||
{
|
||||
public int NumPlayer;
|
||||
public int NumPlayerAtOnce;
|
||||
public int NumRounds;
|
||||
public List<int> ProfileIDs;
|
||||
|
||||
public ChallengeRounds Rounds;
|
||||
public List<ResultTableRow> ResultTable;
|
||||
public CChallengeRounds Rounds;
|
||||
public List<CResultTableRow> ResultTable;
|
||||
public int[,] Results;
|
||||
|
||||
public int CurrentRoundNr;
|
||||
@@ -131,7 +131,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
public int[] CatSongIndices;
|
||||
}
|
||||
|
||||
private struct Stats
|
||||
private struct SStats
|
||||
{
|
||||
public int ProfileID;
|
||||
public int SingPoints;
|
||||
@@ -139,14 +139,14 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
public int Won;
|
||||
}
|
||||
|
||||
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 PartyModeChallengeMedley()
|
||||
public CPartyModeChallengeMedley()
|
||||
{
|
||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||
_ScreenSongOptions.Selection.PartyMode = true;
|
||||
@@ -160,18 +160,18 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
_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.NumPlayer = 4;
|
||||
GameData.NumPlayerAtOnce = 2;
|
||||
GameData.NumRounds = 2;
|
||||
GameData.CurrentRoundNr = 1;
|
||||
GameData.ProfileIDs = new List<int>();
|
||||
GameData.CatSongIndices = null;
|
||||
GameData.Results = null;
|
||||
_GameData = new SData();
|
||||
_GameData.NumPlayer = 4;
|
||||
_GameData.NumPlayerAtOnce = 2;
|
||||
_GameData.NumRounds = 2;
|
||||
_GameData.CurrentRoundNr = 1;
|
||||
_GameData.ProfileIDs = new List<int>();
|
||||
_GameData.CatSongIndices = null;
|
||||
_GameData.Results = null;
|
||||
}
|
||||
|
||||
public override bool Init()
|
||||
@@ -186,8 +186,8 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
if (CBase.Config.GetTabs() == EOffOn.TR_CONFIG_ON && _ScreenSongOptions.Sorting.SongSorting != ESongSorting.TR_CONFIG_NONE)
|
||||
_ScreenSongOptions.Sorting.Tabs = EOffOn.TR_CONFIG_ON;
|
||||
|
||||
ToScreenMain.ResultTable = new List<ResultTableRow>();
|
||||
GameData.ResultTable = new List<ResultTableRow>();
|
||||
_ToScreenMain.ResultTable = new List<CResultTableRow>();
|
||||
_GameData.ResultTable = new List<CResultTableRow>();
|
||||
|
||||
CBase.Songs.SortSongs(ESongSorting.TR_CONFIG_NONE, EOffOn.TR_CONFIG_OFF, EOffOn.TR_CONFIG_OFF, String.Empty, EDuetOptions.NoDuets);
|
||||
CBase.Songs.SetCategory(0);
|
||||
@@ -195,38 +195,38 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
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 "PartyScreenChallengeMedleyConfig":
|
||||
|
||||
try
|
||||
{
|
||||
dataFrom = (DataFromScreen)Data;
|
||||
GameData.NumPlayer = dataFrom.ScreenConfig.NumPlayer;
|
||||
GameData.NumPlayerAtOnce = dataFrom.ScreenConfig.NumPlayerAtOnce;
|
||||
GameData.NumRounds = dataFrom.ScreenConfig.NumRounds;
|
||||
dataFrom = (SDataFromScreen)data;
|
||||
_GameData.NumPlayer = dataFrom.ScreenConfig.NumPlayer;
|
||||
_GameData.NumPlayerAtOnce = dataFrom.ScreenConfig.NumPlayerAtOnce;
|
||||
_GameData.NumRounds = dataFrom.ScreenConfig.NumRounds;
|
||||
|
||||
_Stage = EStage.Config;
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + screenName + ". " + e.Message);
|
||||
}
|
||||
break;
|
||||
|
||||
case "PartyScreenChallengeMedleyNames":
|
||||
try
|
||||
{
|
||||
dataFrom = (DataFromScreen)Data;
|
||||
dataFrom = (SDataFromScreen)data;
|
||||
if (dataFrom.ScreenNames.FadeToConfig)
|
||||
_Stage = EStage.NotStarted;
|
||||
else
|
||||
{
|
||||
GameData.ProfileIDs = dataFrom.ScreenNames.ProfileIDs;
|
||||
_GameData.ProfileIDs = dataFrom.ScreenNames.ProfileIDs;
|
||||
_Stage = EStage.Names;
|
||||
}
|
||||
|
||||
@@ -234,14 +234,14 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + screenName + ". " + e.Message);
|
||||
}
|
||||
break;
|
||||
|
||||
case "PartyScreenChallengeMedleyMain":
|
||||
try
|
||||
{
|
||||
dataFrom = (DataFromScreen)Data;
|
||||
dataFrom = (SDataFromScreen)data;
|
||||
if (dataFrom.ScreenMain.FadeToSongSelection)
|
||||
_Stage = EStage.Singing;
|
||||
if (dataFrom.ScreenMain.FadeToNameSelection)
|
||||
@@ -249,18 +249,18 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + ScreenName + ". " + e.Message);
|
||||
CBase.Log.LogError("Error in party mode challenge. Can't cast received data from screen " + screenName + ". " + e.Message);
|
||||
}
|
||||
|
||||
|
||||
if (_Stage == EStage.Singing)
|
||||
StartNextRound();
|
||||
_StartNextRound();
|
||||
if (_Stage == EStage.Config)
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||
break;
|
||||
|
||||
default:
|
||||
CBase.Log.LogError("Error in party mode challenge. Wrong screen is sending: " + ScreenName);
|
||||
CBase.Log.LogError("Error in party mode challenge. Wrong screen is sending: " + screenName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -274,68 +274,68 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
_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("PartyScreenChallengeMedleyConfig", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenChallengeMedleyConfig", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
ToScreenConfig.NumPlayer = GameData.NumPlayer;
|
||||
ToScreenConfig.NumPlayerAtOnce = GameData.NumPlayerAtOnce;
|
||||
ToScreenConfig.NumRounds = GameData.NumRounds;
|
||||
Screen.DataToScreen(ToScreenConfig);
|
||||
_ToScreenConfig.NumPlayer = _GameData.NumPlayer;
|
||||
_ToScreenConfig.NumPlayerAtOnce = _GameData.NumPlayerAtOnce;
|
||||
_ToScreenConfig.NumRounds = _GameData.NumRounds;
|
||||
screen.DataToScreen(_ToScreenConfig);
|
||||
}
|
||||
break;
|
||||
case EStage.Config:
|
||||
_Screens.TryGetValue("PartyScreenChallengeMedleyNames", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenChallengeMedleyNames", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
ToScreenNames.NumPlayer = GameData.NumPlayer;
|
||||
ToScreenNames.ProfileIDs = GameData.ProfileIDs;
|
||||
Screen.DataToScreen(ToScreenNames);
|
||||
_ToScreenNames.NumPlayer = _GameData.NumPlayer;
|
||||
_ToScreenNames.ProfileIDs = _GameData.ProfileIDs;
|
||||
screen.DataToScreen(_ToScreenNames);
|
||||
}
|
||||
break;
|
||||
case EStage.Names:
|
||||
_Screens.TryGetValue("PartyScreenChallengeMedleyMain", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenChallengeMedleyMain", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
CBase.Songs.ResetPartySongSung();
|
||||
ToScreenMain.ResultTable = new List<ResultTableRow>();
|
||||
GameData.ResultTable = new List<ResultTableRow>();
|
||||
GameData.Rounds = new ChallengeRounds(GameData.NumRounds, GameData.NumPlayer, GameData.NumPlayerAtOnce);
|
||||
GameData.CurrentRoundNr = 1;
|
||||
ToScreenMain.CurrentRoundNr = 1;
|
||||
ToScreenMain.NumPlayerAtOnce = GameData.NumPlayerAtOnce;
|
||||
ToScreenMain.Combs = GameData.Rounds.Rounds;
|
||||
ToScreenMain.ProfileIDs = GameData.ProfileIDs;
|
||||
UpdateScores();
|
||||
ToScreenMain.ResultTable = GameData.ResultTable;
|
||||
ToScreenMain.Results = GameData.Results;
|
||||
Screen.DataToScreen(ToScreenMain);
|
||||
_ToScreenMain.ResultTable = new List<CResultTableRow>();
|
||||
_GameData.ResultTable = new List<CResultTableRow>();
|
||||
_GameData.Rounds = new CChallengeRounds(_GameData.NumRounds, _GameData.NumPlayer, _GameData.NumPlayerAtOnce);
|
||||
_GameData.CurrentRoundNr = 1;
|
||||
_ToScreenMain.CurrentRoundNr = 1;
|
||||
_ToScreenMain.NumPlayerAtOnce = _GameData.NumPlayerAtOnce;
|
||||
_ToScreenMain.Combs = _GameData.Rounds.Rounds;
|
||||
_ToScreenMain.ProfileIDs = _GameData.ProfileIDs;
|
||||
_UpdateScores();
|
||||
_ToScreenMain.ResultTable = _GameData.ResultTable;
|
||||
_ToScreenMain.Results = _GameData.Results;
|
||||
screen.DataToScreen(_ToScreenMain);
|
||||
}
|
||||
break;
|
||||
case EStage.Main:
|
||||
//nothing to do
|
||||
break;
|
||||
case EStage.Singing:
|
||||
_Screens.TryGetValue("PartyScreenChallengeMedleyMain", out Screen);
|
||||
_Screens.TryGetValue("PartyScreenChallengeMedleyMain", out screen);
|
||||
if (_Screens != null)
|
||||
{
|
||||
UpdateScores();
|
||||
ToScreenMain.CurrentRoundNr = GameData.CurrentRoundNr;
|
||||
ToScreenMain.Combs = GameData.Rounds.Rounds;
|
||||
ToScreenMain.Results = GameData.Results;
|
||||
Screen.DataToScreen(ToScreenMain);
|
||||
_UpdateScores();
|
||||
_ToScreenMain.CurrentRoundNr = _GameData.CurrentRoundNr;
|
||||
_ToScreenMain.Combs = _GameData.Rounds.Rounds;
|
||||
_ToScreenMain.Results = _GameData.Results;
|
||||
screen.DataToScreen(_ToScreenMain);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return Screen;
|
||||
return screen;
|
||||
}
|
||||
|
||||
public override EScreens GetStartScreen()
|
||||
@@ -348,7 +348,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return EScreens.ScreenPartyDummy;
|
||||
}
|
||||
|
||||
public override ScreenSongOptions GetScreenSongOptions()
|
||||
public override SScreenSongOptions GetScreenSongOptions()
|
||||
{
|
||||
_ScreenSongOptions.Sorting.SongSorting = CBase.Config.GetSongSorting();
|
||||
_ScreenSongOptions.Sorting.Tabs = CBase.Config.GetTabs();
|
||||
@@ -357,130 +357,130 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return _ScreenSongOptions;
|
||||
}
|
||||
|
||||
public override void OnSongChange(int SongIndex, ref ScreenSongOptions ScreenSongOptions)
|
||||
public override void OnSongChange(int songIndex, ref SScreenSongOptions screenSongOptions)
|
||||
{
|
||||
if (_ScreenSongOptions.Selection.SongIndex != -1)
|
||||
_ScreenSongOptions.Selection.SongIndex = -1;
|
||||
|
||||
if (_ScreenSongOptions.Selection.SelectNextRandomSong && SongIndex != -1)
|
||||
if (_ScreenSongOptions.Selection.SelectNextRandomSong && songIndex != -1)
|
||||
{
|
||||
_ScreenSongOptions.Selection.SelectNextRandomSong = false;
|
||||
CreateCatSongIndices();
|
||||
_CreateCatSongIndices();
|
||||
|
||||
if (GameData.CatSongIndices != null)
|
||||
if (_GameData.CatSongIndices != null)
|
||||
{
|
||||
if (GameData.CatSongIndices[CBase.Songs.GetCurrentCategoryIndex()] == -1)
|
||||
GameData.CatSongIndices[CBase.Songs.GetCurrentCategoryIndex()] = SongIndex;
|
||||
if (_GameData.CatSongIndices[CBase.Songs.GetCurrentCategoryIndex()] == -1)
|
||||
_GameData.CatSongIndices[CBase.Songs.GetCurrentCategoryIndex()] = songIndex;
|
||||
}
|
||||
}
|
||||
|
||||
ScreenSongOptions = _ScreenSongOptions;
|
||||
screenSongOptions = _ScreenSongOptions;
|
||||
}
|
||||
|
||||
public override void OnCategoryChange(int CategoryIndex, ref ScreenSongOptions ScreenSongOptions)
|
||||
public override void OnCategoryChange(int categoryIndex, ref SScreenSongOptions screenSongOptions)
|
||||
{
|
||||
if (GameData.CatSongIndices != null && CategoryIndex != -1)
|
||||
if (_GameData.CatSongIndices != null && categoryIndex != -1)
|
||||
{
|
||||
if (GameData.CatSongIndices[CategoryIndex] == -1)
|
||||
if (_GameData.CatSongIndices[categoryIndex] == -1)
|
||||
_ScreenSongOptions.Selection.SelectNextRandomSong = true;
|
||||
else
|
||||
_ScreenSongOptions.Selection.SongIndex = GameData.CatSongIndices[CategoryIndex];
|
||||
_ScreenSongOptions.Selection.SongIndex = _GameData.CatSongIndices[categoryIndex];
|
||||
}
|
||||
|
||||
if (GameData.CatSongIndices == null && CategoryIndex != -1)
|
||||
if (_GameData.CatSongIndices == null && categoryIndex != -1)
|
||||
_ScreenSongOptions.Selection.SelectNextRandomSong = true;
|
||||
|
||||
if (CategoryIndex == -1)
|
||||
if (categoryIndex == -1)
|
||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||
|
||||
if (_ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF || CategoryIndex != -1)
|
||||
if (_ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF || categoryIndex != -1)
|
||||
_ScreenSongOptions.Selection.RandomOnly = true;
|
||||
|
||||
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 MaxNumRounds;
|
||||
return _MaxNumRounds;
|
||||
}
|
||||
|
||||
public override void JokerUsed(int TeamNr)
|
||||
public override void JokerUsed(int teamNr)
|
||||
{
|
||||
if (_ScreenSongOptions.Selection.NumJokers == null)
|
||||
return;
|
||||
|
||||
if (TeamNr >= _ScreenSongOptions.Selection.NumJokers.Length)
|
||||
if (teamNr >= _ScreenSongOptions.Selection.NumJokers.Length)
|
||||
return;
|
||||
|
||||
_ScreenSongOptions.Selection.NumJokers[TeamNr]--;
|
||||
_ScreenSongOptions.Selection.NumJokers[teamNr]--;
|
||||
_ScreenSongOptions.Selection.RandomOnly = true;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = false;
|
||||
}
|
||||
|
||||
public override void SongSelected(int SongID) {}
|
||||
public override void SongSelected(int songID) {}
|
||||
|
||||
public override void LeavingHighscore()
|
||||
{
|
||||
GameData.CurrentRoundNr++;
|
||||
_GameData.CurrentRoundNr++;
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||
}
|
||||
|
||||
private void StartNextRound()
|
||||
private void _StartNextRound()
|
||||
{
|
||||
_ScreenSongOptions.Selection.RandomOnly = _ScreenSongOptions.Sorting.Tabs != EOffOn.TR_CONFIG_ON;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_ON;
|
||||
SetNumJokers();
|
||||
SetTeamNames();
|
||||
GameData.CatSongIndices = null;
|
||||
_SetNumJokers();
|
||||
_SetTeamNames();
|
||||
_GameData.CatSongIndices = null;
|
||||
|
||||
if (RandomizeSongs())
|
||||
if (_RandomizeSongs())
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenSing);
|
||||
}
|
||||
|
||||
private bool RandomizeSongs()
|
||||
private bool _RandomizeSongs()
|
||||
{
|
||||
CBase.Game.Reset();
|
||||
CBase.Game.ClearSongs();
|
||||
|
||||
#region PlayerNames
|
||||
CBase.Game.SetNumPlayer(GameData.NumPlayerAtOnce);
|
||||
CBase.Game.SetNumPlayer(_GameData.NumPlayerAtOnce);
|
||||
SPlayer[] player = CBase.Game.GetPlayer();
|
||||
if (player == null)
|
||||
return false;
|
||||
|
||||
if (player.Length < GameData.NumPlayerAtOnce)
|
||||
if (player.Length < _GameData.NumPlayerAtOnce)
|
||||
return false;
|
||||
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
Combination c = GameData.Rounds.GetRound(GameData.CurrentRoundNr - 1);
|
||||
CCombination c = _GameData.Rounds.GetRound(_GameData.CurrentRoundNr - 1);
|
||||
|
||||
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||
for (int i = 0; i < _GameData.NumPlayerAtOnce; i++)
|
||||
{
|
||||
//default values
|
||||
player[i].Name = "foobar";
|
||||
@@ -490,41 +490,41 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
//try to fill with the right data
|
||||
if (c != null)
|
||||
{
|
||||
if (GameData.ProfileIDs[c.Player[i]] < profiles.Length)
|
||||
if (_GameData.ProfileIDs[c.Player[i]] < profiles.Length)
|
||||
{
|
||||
player[i].Name = profiles[GameData.ProfileIDs[c.Player[i]]].PlayerName;
|
||||
player[i].Difficulty = profiles[GameData.ProfileIDs[c.Player[i]]].Difficulty;
|
||||
player[i].ProfileID = GameData.ProfileIDs[c.Player[i]];
|
||||
player[i].Name = profiles[_GameData.ProfileIDs[c.Player[i]]].PlayerName;
|
||||
player[i].Difficulty = profiles[_GameData.ProfileIDs[c.Player[i]]].Difficulty;
|
||||
player[i].ProfileID = _GameData.ProfileIDs[c.Player[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion PlayerNames
|
||||
|
||||
#region SongQueque
|
||||
if (CBase.Songs.GetNumVisibleSongs() < NumSongs)
|
||||
if (CBase.Songs.GetNumVisibleSongs() < _NumSongs)
|
||||
CBase.Songs.ResetPartySongSung();
|
||||
|
||||
EGameMode gm = EGameMode.TR_GAMEMODE_MEDLEY;
|
||||
List<int> IDs = new List<int>();
|
||||
List<int> iDs = new List<int>();
|
||||
|
||||
CSong[] VisSongs = CBase.Songs.GetSongsNotSung();
|
||||
if (VisSongs == null)
|
||||
CSong[] visSongs = CBase.Songs.GetSongsNotSung();
|
||||
if (visSongs == null)
|
||||
{
|
||||
CBase.Log.LogError("PartyChallengeMedleyMode Error: There are no songs!");
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenParty);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < VisSongs.Length; i++)
|
||||
for (int i = 0; i < visSongs.Length; i++)
|
||||
{
|
||||
foreach (EGameMode mode in VisSongs[i].AvailableGameModes)
|
||||
foreach (EGameMode mode in visSongs[i].AvailableGameModes)
|
||||
{
|
||||
if (mode == EGameMode.TR_GAMEMODE_MEDLEY)
|
||||
IDs.Add(VisSongs[i].ID);
|
||||
iDs.Add(visSongs[i].ID);
|
||||
}
|
||||
}
|
||||
|
||||
if (IDs.Count == 0)
|
||||
if (iDs.Count == 0)
|
||||
{
|
||||
CBase.Log.LogError("PartyChallengeMedleyMode Error: There are no medley songs!");
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenParty);
|
||||
@@ -532,21 +532,21 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
|
||||
int s = 0;
|
||||
while (s < NumSongs && IDs.Count > 0)
|
||||
while (s < _NumSongs && iDs.Count > 0)
|
||||
{
|
||||
int SongID = IDs[CBase.Game.GetRandom(IDs.Count)];
|
||||
CBase.Game.AddSong(SongID, gm);
|
||||
CBase.Songs.AddPartySongSung(SongID);
|
||||
IDs.Remove(SongID);
|
||||
int songID = iDs[CBase.Game.GetRandom(iDs.Count)];
|
||||
CBase.Game.AddSong(songID, gm);
|
||||
CBase.Songs.AddPartySongSung(songID);
|
||||
iDs.Remove(songID);
|
||||
s++;
|
||||
}
|
||||
return true;
|
||||
#endregion SongQueque
|
||||
}
|
||||
|
||||
private void SetNumJokers()
|
||||
private void _SetNumJokers()
|
||||
{
|
||||
switch (GameData.NumPlayerAtOnce)
|
||||
switch (_GameData.NumPlayerAtOnce)
|
||||
{
|
||||
case 1:
|
||||
_ScreenSongOptions.Selection.NumJokers = new int[] {10};
|
||||
@@ -577,7 +577,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
|
||||
private void SetTeamNames()
|
||||
private void _SetTeamNames()
|
||||
{
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
|
||||
@@ -587,21 +587,21 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return;
|
||||
}
|
||||
|
||||
if (GameData.NumPlayerAtOnce < 1 || GameData.ProfileIDs.Count < GameData.NumPlayerAtOnce || profiles.Length < GameData.NumPlayerAtOnce)
|
||||
if (_GameData.NumPlayerAtOnce < 1 || _GameData.ProfileIDs.Count < _GameData.NumPlayerAtOnce || profiles.Length < _GameData.NumPlayerAtOnce)
|
||||
{
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"};
|
||||
return;
|
||||
}
|
||||
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[GameData.NumPlayerAtOnce];
|
||||
Combination c = GameData.Rounds.GetRound(GameData.CurrentRoundNr - 1);
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[_GameData.NumPlayerAtOnce];
|
||||
CCombination c = _GameData.Rounds.GetRound(_GameData.CurrentRoundNr - 1);
|
||||
|
||||
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||
for (int i = 0; i < _GameData.NumPlayerAtOnce; i++)
|
||||
{
|
||||
if (c != null)
|
||||
{
|
||||
if (GameData.ProfileIDs[c.Player[i]] < profiles.Length)
|
||||
_ScreenSongOptions.Selection.TeamNames[i] = profiles[GameData.ProfileIDs[c.Player[i]]].PlayerName;
|
||||
if (_GameData.ProfileIDs[c.Player[i]] < profiles.Length)
|
||||
_ScreenSongOptions.Selection.TeamNames[i] = profiles[_GameData.ProfileIDs[c.Player[i]]].PlayerName;
|
||||
else
|
||||
_ScreenSongOptions.Selection.TeamNames[i] = "foobar";
|
||||
}
|
||||
@@ -610,66 +610,66 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateScores()
|
||||
private void _UpdateScores()
|
||||
{
|
||||
if (GameData.ResultTable.Count == 0)
|
||||
if (_GameData.ResultTable.Count == 0)
|
||||
{
|
||||
for (int i = 0; i < GameData.NumPlayer; i++)
|
||||
for (int i = 0; i < _GameData.NumPlayer; i++)
|
||||
{
|
||||
ResultTableRow row = new ResultTableRow();
|
||||
row.PlayerID = GameData.ProfileIDs[i];
|
||||
CResultTableRow row = new CResultTableRow();
|
||||
row.PlayerID = _GameData.ProfileIDs[i];
|
||||
row.NumPlayed = 0;
|
||||
row.NumRounds = 0;
|
||||
row.NumWon = 0;
|
||||
row.NumSingPoints = 0;
|
||||
row.NumGamePoints = 0;
|
||||
GameData.ResultTable.Add(row);
|
||||
_GameData.ResultTable.Add(row);
|
||||
}
|
||||
|
||||
GameData.Results = new int[GameData.NumRounds,GameData.NumPlayerAtOnce];
|
||||
for (int i = 0; i < GameData.NumRounds; i++)
|
||||
_GameData.Results = new int[_GameData.NumRounds,_GameData.NumPlayerAtOnce];
|
||||
for (int i = 0; i < _GameData.NumRounds; i++)
|
||||
{
|
||||
for (int j = 0; j < GameData.NumPlayerAtOnce; j++)
|
||||
GameData.Results[i, j] = 0;
|
||||
for (int j = 0; j < _GameData.NumPlayerAtOnce; j++)
|
||||
_GameData.Results[i, j] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CPoints GamePoints = CBase.Game.GetPoints();
|
||||
if (GamePoints == null || GamePoints.NumPlayer < GameData.NumPlayerAtOnce)
|
||||
CPoints gamePoints = CBase.Game.GetPoints();
|
||||
if (gamePoints == null || gamePoints.NumPlayer < _GameData.NumPlayerAtOnce)
|
||||
return;
|
||||
|
||||
SPlayer[] results = GamePoints.GetPlayer(0, GameData.NumPlayerAtOnce);
|
||||
SPlayer[] results = gamePoints.GetPlayer(0, _GameData.NumPlayerAtOnce);
|
||||
if (results == null)
|
||||
return;
|
||||
|
||||
if (results.Length < GameData.NumPlayerAtOnce)
|
||||
if (results.Length < _GameData.NumPlayerAtOnce)
|
||||
return;
|
||||
|
||||
if (GamePoints.NumRounds == 0)
|
||||
if (gamePoints.NumRounds == 0)
|
||||
return;
|
||||
|
||||
for (int i = 1; i < GamePoints.NumRounds; i++)
|
||||
for (int i = 1; i < gamePoints.NumRounds; i++)
|
||||
{
|
||||
SPlayer[] temp = GamePoints.GetPlayer(i, GameData.NumPlayerAtOnce);
|
||||
for (int p = 0; p < GameData.NumPlayerAtOnce; p++)
|
||||
SPlayer[] temp = gamePoints.GetPlayer(i, _GameData.NumPlayerAtOnce);
|
||||
for (int p = 0; p < _GameData.NumPlayerAtOnce; p++)
|
||||
results[p].Points += temp[p].Points;
|
||||
}
|
||||
|
||||
for (int j = 0; j < GameData.NumPlayerAtOnce; j++)
|
||||
for (int j = 0; j < _GameData.NumPlayerAtOnce; j++)
|
||||
{
|
||||
results[j].Points = results[j].Points / GamePoints.NumRounds;
|
||||
GameData.Results[GameData.CurrentRoundNr - 2, j] = (int)Math.Round(results[j].Points);
|
||||
results[j].Points = results[j].Points / gamePoints.NumRounds;
|
||||
_GameData.Results[_GameData.CurrentRoundNr - 2, j] = (int)Math.Round(results[j].Points);
|
||||
}
|
||||
|
||||
List<Stats> points = GetPointsForPlayer(results);
|
||||
List<SStats> points = _GetPointsForPlayer(results);
|
||||
|
||||
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||
for (int i = 0; i < _GameData.NumPlayerAtOnce; i++)
|
||||
{
|
||||
int index = -1;
|
||||
for (int j = 0; j < GameData.ResultTable.Count; j++)
|
||||
for (int j = 0; j < _GameData.ResultTable.Count; j++)
|
||||
{
|
||||
if (points[i].ProfileID == GameData.ResultTable[j].PlayerID)
|
||||
if (points[i].ProfileID == _GameData.ResultTable[j].PlayerID)
|
||||
{
|
||||
index = j;
|
||||
break;
|
||||
@@ -678,7 +678,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
ResultTableRow row = GameData.ResultTable[index];
|
||||
CResultTableRow row = _GameData.ResultTable[index];
|
||||
|
||||
row.NumPlayed++;
|
||||
row.NumWon += points[i].Won;
|
||||
@@ -686,41 +686,41 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
row.NumSingPoints += points[i].SingPoints;
|
||||
row.NumGamePoints += points[i].GamePoints;
|
||||
|
||||
GameData.ResultTable[index] = row;
|
||||
_GameData.ResultTable[index] = row;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GameData.ResultTable.Sort();
|
||||
_GameData.ResultTable.Sort();
|
||||
|
||||
//Update position-number
|
||||
int pos = 1;
|
||||
int lastPoints = 0;
|
||||
int lastSingPoints = 0;
|
||||
for (int i = 0; i < GameData.ResultTable.Count; i++)
|
||||
for (int i = 0; i < _GameData.ResultTable.Count; i++)
|
||||
{
|
||||
if (lastPoints > GameData.ResultTable[i].NumGamePoints || lastSingPoints > GameData.ResultTable[i].NumSingPoints)
|
||||
if (lastPoints > _GameData.ResultTable[i].NumGamePoints || lastSingPoints > _GameData.ResultTable[i].NumSingPoints)
|
||||
pos++;
|
||||
GameData.ResultTable[i].Position = pos;
|
||||
lastPoints = GameData.ResultTable[i].NumGamePoints;
|
||||
lastSingPoints = GameData.ResultTable[i].NumSingPoints;
|
||||
_GameData.ResultTable[i].Position = pos;
|
||||
lastPoints = _GameData.ResultTable[i].NumGamePoints;
|
||||
lastSingPoints = _GameData.ResultTable[i].NumSingPoints;
|
||||
}
|
||||
}
|
||||
|
||||
private List<Stats> GetPointsForPlayer(SPlayer[] Results)
|
||||
private List<SStats> _GetPointsForPlayer(SPlayer[] results)
|
||||
{
|
||||
List<Stats> result = new List<Stats>();
|
||||
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||
List<SStats> result = new List<SStats>();
|
||||
for (int i = 0; i < _GameData.NumPlayerAtOnce; i++)
|
||||
{
|
||||
Stats stat = new Stats();
|
||||
stat.ProfileID = Results[i].ProfileID;
|
||||
stat.SingPoints = (int)Math.Round(Results[i].Points);
|
||||
SStats stat = new SStats();
|
||||
stat.ProfileID = results[i].ProfileID;
|
||||
stat.SingPoints = (int)Math.Round(results[i].Points);
|
||||
stat.Won = 0;
|
||||
stat.GamePoints = 0;
|
||||
result.Add(stat);
|
||||
}
|
||||
|
||||
result.Sort(delegate(Stats s1, Stats s2) { return s1.SingPoints.CompareTo(s2.SingPoints); });
|
||||
result.Sort(delegate(SStats s1, SStats s2) { return s1.SingPoints.CompareTo(s2.SingPoints); });
|
||||
|
||||
int current = result[result.Count - 1].SingPoints;
|
||||
int points = result.Count;
|
||||
@@ -728,7 +728,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
for (int i = result.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Stats res = result[i];
|
||||
SStats res = result[i];
|
||||
|
||||
if (i < result.Count - 1)
|
||||
{
|
||||
@@ -760,17 +760,17 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return result;
|
||||
}
|
||||
|
||||
private void CreateCatSongIndices()
|
||||
private void _CreateCatSongIndices()
|
||||
{
|
||||
if (GameData.CatSongIndices == null && CBase.Songs.GetNumCategories() > 0 && _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_ON)
|
||||
if (_GameData.CatSongIndices == null && CBase.Songs.GetNumCategories() > 0 && _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
GameData.CatSongIndices = new int[CBase.Songs.GetNumCategories()];
|
||||
for (int i = 0; i < GameData.CatSongIndices.Length; i++)
|
||||
GameData.CatSongIndices[i] = -1;
|
||||
_GameData.CatSongIndices = new int[CBase.Songs.GetNumCategories()];
|
||||
for (int i = 0; i < _GameData.CatSongIndices.Length; i++)
|
||||
_GameData.CatSongIndices[i] = -1;
|
||||
}
|
||||
|
||||
if (CBase.Songs.GetNumCategories() == 0 || _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF)
|
||||
GameData.CatSongIndices = null;
|
||||
_GameData.CatSongIndices = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
public class PartyScreenChallengeMedleyConfig : CMenuParty
|
||||
public class CPartyScreenChallengeMedleyConfig : CMenuParty
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -12,43 +12,43 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
private const string SelectSlideNumPlayers = "SelectSlideNumPlayers";
|
||||
private const string SelectSlideNumMics = "SelectSlideNumMics";
|
||||
private const string SelectSlideNumRounds = "SelectSlideNumRounds";
|
||||
private const string ButtonNext = "ButtonNext";
|
||||
private const string ButtonBack = "ButtonBack";
|
||||
private const string _SelectSlideNumPlayers = "SelectSlideNumPlayers";
|
||||
private const string _SelectSlideNumMics = "SelectSlideNumMics";
|
||||
private const string _SelectSlideNumRounds = "SelectSlideNumRounds";
|
||||
private const string _ButtonNext = "ButtonNext";
|
||||
private const string _ButtonBack = "ButtonBack";
|
||||
|
||||
private int _MaxNumMics = 2;
|
||||
private int _MaxNumRounds = 100;
|
||||
private int _RoundSteps = 1;
|
||||
|
||||
private DataFromScreen Data;
|
||||
private SDataFromScreen _Data;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
|
||||
_ThemeSelectSlides = new string[] {SelectSlideNumPlayers, SelectSlideNumMics, SelectSlideNumRounds};
|
||||
_ThemeButtons = new string[] {ButtonNext, ButtonBack};
|
||||
_ThemeSelectSlides = new string[] {_SelectSlideNumPlayers, _SelectSlideNumMics, _SelectSlideNumRounds};
|
||||
_ThemeButtons = new string[] {_ButtonNext, _ButtonBack};
|
||||
|
||||
Data = new DataFromScreen();
|
||||
FromScreenConfig config = new FromScreenConfig();
|
||||
_Data = new SDataFromScreen();
|
||||
SFromScreenConfig config = new SFromScreenConfig();
|
||||
config.NumPlayer = 4;
|
||||
config.NumPlayerAtOnce = 2;
|
||||
config.NumRounds = 12;
|
||||
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.NumPlayer = config.NumPlayer;
|
||||
Data.ScreenConfig.NumPlayerAtOnce = config.NumPlayerAtOnce;
|
||||
Data.ScreenConfig.NumRounds = config.NumRounds;
|
||||
config = (SDataToScreenConfig)receivedData;
|
||||
_Data.ScreenConfig.NumPlayer = config.NumPlayer;
|
||||
_Data.ScreenConfig.NumPlayerAtOnce = config.NumPlayerAtOnce;
|
||||
_Data.ScreenConfig.NumRounds = config.NumRounds;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleInput(KeyEvent keyEvent)
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
base.HandleInput(keyEvent);
|
||||
|
||||
@@ -67,47 +67,47 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
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;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
_MaxNumRounds = _PartyMode.GetMaxNumRounds();
|
||||
|
||||
RebuildSlides();
|
||||
_RebuildSlides();
|
||||
}
|
||||
|
||||
public override bool UpdateGame()
|
||||
@@ -136,92 +136,92 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return true;
|
||||
}
|
||||
|
||||
private void RebuildSlides()
|
||||
private void _RebuildSlides()
|
||||
{
|
||||
// build num player slide (min player ... max player);
|
||||
SelectSlides[SelectSlideNumPlayers].Clear();
|
||||
SelectSlides[_SelectSlideNumPlayers].Clear();
|
||||
for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++)
|
||||
SelectSlides[SelectSlideNumPlayers].AddValue(i.ToString());
|
||||
SelectSlides[SelectSlideNumPlayers].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
|
||||
SelectSlides[_SelectSlideNumPlayers].AddValue(i.ToString());
|
||||
SelectSlides[_SelectSlideNumPlayers].Selection = _Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
|
||||
|
||||
UpdateMicsAtOnce();
|
||||
SetRoundSteps();
|
||||
UpdateSlideRounds();
|
||||
_UpdateMicsAtOnce();
|
||||
_SetRoundSteps();
|
||||
_UpdateSlideRounds();
|
||||
}
|
||||
|
||||
private void UpdateSlides()
|
||||
private void _UpdateSlides()
|
||||
{
|
||||
int player = Data.ScreenConfig.NumPlayer;
|
||||
int mics = Data.ScreenConfig.NumPlayerAtOnce;
|
||||
Data.ScreenConfig.NumPlayer = SelectSlides[SelectSlideNumPlayers].Selection + _PartyMode.GetMinPlayer();
|
||||
Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[SelectSlideNumMics].Selection + _PartyMode.GetMinPlayer();
|
||||
Data.ScreenConfig.NumRounds = (SelectSlides[SelectSlideNumRounds].Selection + 1) * _RoundSteps;
|
||||
int player = _Data.ScreenConfig.NumPlayer;
|
||||
int mics = _Data.ScreenConfig.NumPlayerAtOnce;
|
||||
_Data.ScreenConfig.NumPlayer = SelectSlides[_SelectSlideNumPlayers].Selection + _PartyMode.GetMinPlayer();
|
||||
_Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[_SelectSlideNumMics].Selection + _PartyMode.GetMinPlayer();
|
||||
_Data.ScreenConfig.NumRounds = (SelectSlides[_SelectSlideNumRounds].Selection + 1) * _RoundSteps;
|
||||
|
||||
UpdateMicsAtOnce();
|
||||
SetRoundSteps();
|
||||
_UpdateMicsAtOnce();
|
||||
_SetRoundSteps();
|
||||
|
||||
if (player != Data.ScreenConfig.NumPlayer || mics != Data.ScreenConfig.NumPlayerAtOnce)
|
||||
if (player != _Data.ScreenConfig.NumPlayer || mics != _Data.ScreenConfig.NumPlayerAtOnce)
|
||||
{
|
||||
int num = CHelper.CombinationCount(Data.ScreenConfig.NumPlayer, Data.ScreenConfig.NumPlayerAtOnce);
|
||||
int num = CHelper.CombinationCount(_Data.ScreenConfig.NumPlayer, _Data.ScreenConfig.NumPlayerAtOnce);
|
||||
while (num > _MaxNumRounds)
|
||||
num -= _RoundSteps;
|
||||
Data.ScreenConfig.NumRounds = num;
|
||||
_Data.ScreenConfig.NumRounds = num;
|
||||
}
|
||||
|
||||
UpdateSlideRounds();
|
||||
_UpdateSlideRounds();
|
||||
}
|
||||
|
||||
private void UpdateMicsAtOnce()
|
||||
private void _UpdateMicsAtOnce()
|
||||
{
|
||||
//Data.ScreenConfig.NumPlayerAtOnce
|
||||
int MaxNum = _MaxNumMics;
|
||||
if (Data.ScreenConfig.NumPlayer < _MaxNumMics)
|
||||
MaxNum = Data.ScreenConfig.NumPlayer;
|
||||
int maxNum = _MaxNumMics;
|
||||
if (_Data.ScreenConfig.NumPlayer < _MaxNumMics)
|
||||
maxNum = _Data.ScreenConfig.NumPlayer;
|
||||
|
||||
if (Data.ScreenConfig.NumPlayerAtOnce > MaxNum)
|
||||
Data.ScreenConfig.NumPlayerAtOnce = MaxNum;
|
||||
if (_Data.ScreenConfig.NumPlayerAtOnce > maxNum)
|
||||
_Data.ScreenConfig.NumPlayerAtOnce = maxNum;
|
||||
|
||||
// build mics at once slide
|
||||
SelectSlides[SelectSlideNumMics].Clear();
|
||||
for (int i = 1; i <= MaxNum; i++)
|
||||
SelectSlides[SelectSlideNumMics].AddValue(i.ToString());
|
||||
SelectSlides[SelectSlideNumMics].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
|
||||
SelectSlides[_SelectSlideNumMics].Clear();
|
||||
for (int i = 1; i <= maxNum; i++)
|
||||
SelectSlides[_SelectSlideNumMics].AddValue(i.ToString());
|
||||
SelectSlides[_SelectSlideNumMics].Selection = _Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
|
||||
}
|
||||
|
||||
private void UpdateSlideRounds()
|
||||
private void _UpdateSlideRounds()
|
||||
{
|
||||
// build num rounds slide
|
||||
SelectSlides[SelectSlideNumRounds].Clear();
|
||||
SelectSlides[_SelectSlideNumRounds].Clear();
|
||||
for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps)
|
||||
SelectSlides[SelectSlideNumRounds].AddValue(i.ToString());
|
||||
SelectSlides[SelectSlideNumRounds].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1;
|
||||
SelectSlides[_SelectSlideNumRounds].AddValue(i.ToString());
|
||||
SelectSlides[_SelectSlideNumRounds].Selection = _Data.ScreenConfig.NumRounds / _RoundSteps - 1;
|
||||
}
|
||||
|
||||
private void SetRoundSteps()
|
||||
private void _SetRoundSteps()
|
||||
{
|
||||
if (Data.ScreenConfig.NumPlayerAtOnce < 1 || Data.ScreenConfig.NumPlayer < 1 || Data.ScreenConfig.NumPlayerAtOnce > Data.ScreenConfig.NumPlayer)
|
||||
if (_Data.ScreenConfig.NumPlayerAtOnce < 1 || _Data.ScreenConfig.NumPlayer < 1 || _Data.ScreenConfig.NumPlayerAtOnce > _Data.ScreenConfig.NumPlayer)
|
||||
{
|
||||
_RoundSteps = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
int res = Data.ScreenConfig.NumPlayer / Data.ScreenConfig.NumPlayerAtOnce;
|
||||
int mod = Data.ScreenConfig.NumPlayer % Data.ScreenConfig.NumPlayerAtOnce;
|
||||
int res = _Data.ScreenConfig.NumPlayer / _Data.ScreenConfig.NumPlayerAtOnce;
|
||||
int mod = _Data.ScreenConfig.NumPlayer % _Data.ScreenConfig.NumPlayerAtOnce;
|
||||
|
||||
if (mod == 0)
|
||||
_RoundSteps = res;
|
||||
else
|
||||
_RoundSteps = Data.ScreenConfig.NumPlayer;
|
||||
_RoundSteps = _Data.ScreenConfig.NumPlayer;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
struct TableRow
|
||||
struct STableRow
|
||||
{
|
||||
public CText Pos;
|
||||
public CText Name;
|
||||
@@ -15,14 +15,14 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
public CText GamePoints;
|
||||
}
|
||||
|
||||
class RoundsTableRow
|
||||
class CRoundsTableRow
|
||||
{
|
||||
public CText Number;
|
||||
public List<CText> TextPlayer;
|
||||
public List<CText> TextScores;
|
||||
}
|
||||
|
||||
public class PartyScreenChallengeMedleyMain : CMenuParty
|
||||
public class CPartyScreenChallengeMedleyMain : CMenuParty
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -30,55 +30,55 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
private const string TextPosition = "TextPosition";
|
||||
private const string TextPlayerName = "TextPlayerName";
|
||||
private const string TextNumPlayed = "TextNumPlayed";
|
||||
private const string TextWon = "TextWon";
|
||||
private const string TextSingPoints = "TextSingPoints";
|
||||
private const string TextGamePoints = "TextGamePoints";
|
||||
private const string TextNextPlayer = "TextNextPlayer";
|
||||
private const string TextPopupReallyExit = "TextPopupReallyExit";
|
||||
private const string TextRoundPlayer = "TextRoundPlayer";
|
||||
private const string TextRoundScore = "TextRoundScore";
|
||||
private const string TextRoundNumber = "TextRoundNumber";
|
||||
private const string TextFinishMessage = "TextFinishMessage";
|
||||
private const string TextFinishPlayerWin = "TextFinishPlayerWin";
|
||||
private const string TextNextPlayerMessage = "TextNextPlayerMessage";
|
||||
private const string _TextPosition = "TextPosition";
|
||||
private const string _TextPlayerName = "TextPlayerName";
|
||||
private const string _TextNumPlayed = "TextNumPlayed";
|
||||
private const string _TextWon = "TextWon";
|
||||
private const string _TextSingPoints = "TextSingPoints";
|
||||
private const string _TextGamePoints = "TextGamePoints";
|
||||
private const string _TextNextPlayer = "TextNextPlayer";
|
||||
private const string _TextPopupReallyExit = "TextPopupReallyExit";
|
||||
private const string _TextRoundPlayer = "TextRoundPlayer";
|
||||
private const string _TextRoundScore = "TextRoundScore";
|
||||
private const string _TextRoundNumber = "TextRoundNumber";
|
||||
private const string _TextFinishMessage = "TextFinishMessage";
|
||||
private const string _TextFinishPlayerWin = "TextFinishPlayerWin";
|
||||
private const string _TextNextPlayerMessage = "TextNextPlayerMessage";
|
||||
|
||||
private const string ButtonNextRound = "ButtonNextRound";
|
||||
private const string ButtonBack = "ButtonBack";
|
||||
private const string ButtonExit = "ButtonExit";
|
||||
private const string ButtonPopupYes = "ButtonPopupYes";
|
||||
private const string ButtonPopupNo = "ButtonPopupNo";
|
||||
private const string ButtonPlayerScrollUp = "ButtonPlayerScrollUp";
|
||||
private const string ButtonPlayerScrollDown = "ButtonPlayerScrollDown";
|
||||
private const string ButtonRoundsScrollUp = "ButtonRoundsScrollUp";
|
||||
private const string ButtonRoundsScrollDown = "ButtonRoundsScrollDown";
|
||||
private const string _ButtonNextRound = "ButtonNextRound";
|
||||
private const string _ButtonBack = "ButtonBack";
|
||||
private const string _ButtonExit = "ButtonExit";
|
||||
private const string _ButtonPopupYes = "ButtonPopupYes";
|
||||
private const string _ButtonPopupNo = "ButtonPopupNo";
|
||||
private const string _ButtonPlayerScrollUp = "ButtonPlayerScrollUp";
|
||||
private const string _ButtonPlayerScrollDown = "ButtonPlayerScrollDown";
|
||||
private const string _ButtonRoundsScrollUp = "ButtonRoundsScrollUp";
|
||||
private const string _ButtonRoundsScrollDown = "ButtonRoundsScrollDown";
|
||||
|
||||
private const string StaticPopupBG = "StaticPopupBG";
|
||||
private const string StaticNextPlayer = "StaticNextPlayer";
|
||||
private const string _StaticPopupBG = "StaticPopupBG";
|
||||
private const string _StaticNextPlayer = "StaticNextPlayer";
|
||||
|
||||
private bool ExitPopupVisible;
|
||||
private bool _ExitPopupVisible;
|
||||
|
||||
private DataFromScreen Data;
|
||||
private DataToScreenMain GameState;
|
||||
private List<TableRow> PlayerTable;
|
||||
private List<RoundsTableRow> RoundsTable;
|
||||
private SDataFromScreen _Data;
|
||||
private SDataToScreenMain _GameState;
|
||||
private List<STableRow> _PlayerTable;
|
||||
private List<CRoundsTableRow> _RoundsTable;
|
||||
|
||||
private List<CText> NextPlayerTexts;
|
||||
private List<CStatic> NextPlayerStatics;
|
||||
private List<CText> _NextPlayerTexts;
|
||||
private List<CStatic> _NextPlayerStatics;
|
||||
|
||||
private SRectF RoundsTableScrollArea;
|
||||
private SRectF PlayerTableScrollArea;
|
||||
private int RoundsTableOffset;
|
||||
private int PlayerTableOffset;
|
||||
private int NumPlayerVisible = 10;
|
||||
private int NumRoundsVisible = 3;
|
||||
private SRectF _RoundsTableScrollArea;
|
||||
private SRectF _PlayerTableScrollArea;
|
||||
private int _RoundsTableOffset;
|
||||
private int _PlayerTableOffset;
|
||||
private int _NumPlayerVisible = 10;
|
||||
private int _NumRoundsVisible = 3;
|
||||
|
||||
public PartyScreenChallengeMedleyMain()
|
||||
public CPartyScreenChallengeMedleyMain()
|
||||
{
|
||||
Data = new DataFromScreen();
|
||||
Data.ScreenMain = new FromScreenMain();
|
||||
_Data = new SDataFromScreen();
|
||||
_Data.ScreenMain = new SFromScreenMain();
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
@@ -87,41 +87,41 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
_ThemeTexts = new string[]
|
||||
{
|
||||
TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextNextPlayer, TextPopupReallyExit, TextRoundNumber, TextRoundPlayer,
|
||||
TextRoundScore, TextFinishMessage, TextFinishPlayerWin, TextNextPlayerMessage
|
||||
_TextPosition, _TextPlayerName, _TextNumPlayed, _TextWon, _TextSingPoints, _TextGamePoints, _TextNextPlayer, _TextPopupReallyExit, _TextRoundNumber, _TextRoundPlayer,
|
||||
_TextRoundScore, _TextFinishMessage, _TextFinishPlayerWin, _TextNextPlayerMessage
|
||||
};
|
||||
_ThemeButtons = new string[]
|
||||
{ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo, ButtonPlayerScrollDown, ButtonPlayerScrollUp, ButtonRoundsScrollDown, ButtonRoundsScrollUp};
|
||||
_ThemeStatics = new string[] {StaticPopupBG, StaticNextPlayer};
|
||||
{_ButtonNextRound, _ButtonBack, _ButtonExit, _ButtonPopupYes, _ButtonPopupNo, _ButtonPlayerScrollDown, _ButtonPlayerScrollUp, _ButtonRoundsScrollDown, _ButtonRoundsScrollUp};
|
||||
_ThemeStatics = new string[] {_StaticPopupBG, _StaticNextPlayer};
|
||||
}
|
||||
|
||||
public override void LoadTheme(string XmlPath)
|
||||
public override void LoadTheme(string xmlPath)
|
||||
{
|
||||
base.LoadTheme(XmlPath);
|
||||
base.LoadTheme(xmlPath);
|
||||
|
||||
GameState = new DataToScreenMain();
|
||||
BuildPlayerTable();
|
||||
CreateRoundsTable();
|
||||
NextPlayerTexts = new List<CText>();
|
||||
NextPlayerStatics = new List<CStatic>();
|
||||
_GameState = new SDataToScreenMain();
|
||||
_BuildPlayerTable();
|
||||
_CreateRoundsTable();
|
||||
_NextPlayerTexts = new List<CText>();
|
||||
_NextPlayerStatics = new List<CStatic>();
|
||||
|
||||
for (int i = 0; i < _PartyMode.GetMaxPlayer(); i++)
|
||||
{
|
||||
NextPlayerTexts.Add(GetNewText(Texts[TextNextPlayer]));
|
||||
AddText(NextPlayerTexts[NextPlayerTexts.Count - 1]);
|
||||
NextPlayerStatics.Add(GetNewStatic(Statics[StaticNextPlayer]));
|
||||
AddStatic(NextPlayerStatics[NextPlayerStatics.Count - 1]);
|
||||
_NextPlayerTexts.Add(GetNewText(Texts[_TextNextPlayer]));
|
||||
AddText(_NextPlayerTexts[_NextPlayerTexts.Count - 1]);
|
||||
_NextPlayerStatics.Add(GetNewStatic(Statics[_StaticNextPlayer]));
|
||||
AddStatic(_NextPlayerStatics[_NextPlayerStatics.Count - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
public override void DataToScreen(object ReceivedData)
|
||||
public override void DataToScreen(object receivedData)
|
||||
{
|
||||
DataToScreenMain data = new DataToScreenMain();
|
||||
SDataToScreenMain data = new SDataToScreenMain();
|
||||
|
||||
try
|
||||
{
|
||||
data = (DataToScreenMain)ReceivedData;
|
||||
GameState = data;
|
||||
data = (SDataToScreenMain)receivedData;
|
||||
_GameState = data;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -129,7 +129,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleInput(KeyEvent keyEvent)
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
base.HandleInput(keyEvent);
|
||||
|
||||
@@ -140,41 +140,41 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
case Keys.Back:
|
||||
case Keys.Escape:
|
||||
if (!ExitPopupVisible)
|
||||
if (!_ExitPopupVisible)
|
||||
{
|
||||
if (GameState.CurrentRoundNr == 1)
|
||||
Back();
|
||||
if (_GameState.CurrentRoundNr == 1)
|
||||
_Back();
|
||||
else
|
||||
ShowPopup(true);
|
||||
_ShowPopup(true);
|
||||
}
|
||||
else
|
||||
ShowPopup(false);
|
||||
_ShowPopup(false);
|
||||
break;
|
||||
|
||||
case Keys.Enter:
|
||||
if (!ExitPopupVisible)
|
||||
if (!_ExitPopupVisible)
|
||||
{
|
||||
if (Buttons[ButtonNextRound].Selected)
|
||||
NextRound();
|
||||
if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1)
|
||||
Back();
|
||||
if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1)
|
||||
ShowPopup(true);
|
||||
if (Buttons[ButtonPlayerScrollUp].Selected)
|
||||
ScrollPlayerTable(-1);
|
||||
if (Buttons[ButtonPlayerScrollDown].Selected)
|
||||
ScrollPlayerTable(1);
|
||||
if (Buttons[ButtonRoundsScrollUp].Selected)
|
||||
ScrollRoundsTable(-1);
|
||||
if (Buttons[ButtonRoundsScrollDown].Selected)
|
||||
ScrollRoundsTable(1);
|
||||
if (Buttons[_ButtonNextRound].Selected)
|
||||
_NextRound();
|
||||
if (Buttons[_ButtonBack].Selected && _GameState.CurrentRoundNr == 1)
|
||||
_Back();
|
||||
if (Buttons[_ButtonExit].Selected && _GameState.CurrentRoundNr > 1)
|
||||
_ShowPopup(true);
|
||||
if (Buttons[_ButtonPlayerScrollUp].Selected)
|
||||
_ScrollPlayerTable(-1);
|
||||
if (Buttons[_ButtonPlayerScrollDown].Selected)
|
||||
_ScrollPlayerTable(1);
|
||||
if (Buttons[_ButtonRoundsScrollUp].Selected)
|
||||
_ScrollRoundsTable(-1);
|
||||
if (Buttons[_ButtonRoundsScrollDown].Selected)
|
||||
_ScrollRoundsTable(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Buttons[ButtonPopupYes].Selected)
|
||||
EndParty();
|
||||
if (Buttons[ButtonPopupNo].Selected)
|
||||
ShowPopup(false);
|
||||
if (Buttons[_ButtonPopupYes].Selected)
|
||||
_EndParty();
|
||||
if (Buttons[_ButtonPopupNo].Selected)
|
||||
_ShowPopup(false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -182,57 +182,57 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool HandleMouse(MouseEvent mouseEvent)
|
||||
public override bool HandleMouse(SMouseEvent mouseEvent)
|
||||
{
|
||||
base.HandleMouse(mouseEvent);
|
||||
|
||||
if (mouseEvent.LB && IsMouseOver(mouseEvent))
|
||||
{
|
||||
if (!ExitPopupVisible)
|
||||
if (!_ExitPopupVisible)
|
||||
{
|
||||
if (Buttons[ButtonNextRound].Selected)
|
||||
NextRound();
|
||||
if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1)
|
||||
Back();
|
||||
if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1)
|
||||
ShowPopup(true);
|
||||
if (Buttons[ButtonPlayerScrollUp].Selected)
|
||||
ScrollPlayerTable(-1);
|
||||
if (Buttons[ButtonPlayerScrollDown].Selected)
|
||||
ScrollPlayerTable(1);
|
||||
if (Buttons[ButtonRoundsScrollUp].Selected)
|
||||
ScrollRoundsTable(-1);
|
||||
if (Buttons[ButtonRoundsScrollDown].Selected)
|
||||
ScrollRoundsTable(1);
|
||||
if (Buttons[_ButtonNextRound].Selected)
|
||||
_NextRound();
|
||||
if (Buttons[_ButtonBack].Selected && _GameState.CurrentRoundNr == 1)
|
||||
_Back();
|
||||
if (Buttons[_ButtonExit].Selected && _GameState.CurrentRoundNr > 1)
|
||||
_ShowPopup(true);
|
||||
if (Buttons[_ButtonPlayerScrollUp].Selected)
|
||||
_ScrollPlayerTable(-1);
|
||||
if (Buttons[_ButtonPlayerScrollDown].Selected)
|
||||
_ScrollPlayerTable(1);
|
||||
if (Buttons[_ButtonRoundsScrollUp].Selected)
|
||||
_ScrollRoundsTable(-1);
|
||||
if (Buttons[_ButtonRoundsScrollDown].Selected)
|
||||
_ScrollRoundsTable(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Buttons[ButtonPopupYes].Selected)
|
||||
EndParty();
|
||||
if (Buttons[ButtonPopupNo].Selected)
|
||||
ShowPopup(false);
|
||||
if (Buttons[_ButtonPopupYes].Selected)
|
||||
_EndParty();
|
||||
if (Buttons[_ButtonPopupNo].Selected)
|
||||
_ShowPopup(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (mouseEvent.RB)
|
||||
{
|
||||
if (!ExitPopupVisible)
|
||||
if (!_ExitPopupVisible)
|
||||
{
|
||||
if (GameState.CurrentRoundNr == 1)
|
||||
Back();
|
||||
if (_GameState.CurrentRoundNr == 1)
|
||||
_Back();
|
||||
else
|
||||
ShowPopup(true);
|
||||
_ShowPopup(true);
|
||||
}
|
||||
else
|
||||
ShowPopup(false);
|
||||
_ShowPopup(false);
|
||||
}
|
||||
|
||||
if (mouseEvent.Wheel != 0)
|
||||
{
|
||||
if (CHelper.IsInBounds(RoundsTableScrollArea, mouseEvent))
|
||||
ScrollRoundsTable(mouseEvent.Wheel);
|
||||
if (CHelper.IsInBounds(PlayerTableScrollArea, mouseEvent))
|
||||
ScrollPlayerTable(mouseEvent.Wheel);
|
||||
if (CHelper.IsInBounds(_RoundsTableScrollArea, mouseEvent))
|
||||
_ScrollRoundsTable(mouseEvent.Wheel);
|
||||
if (CHelper.IsInBounds(_PlayerTableScrollArea, mouseEvent))
|
||||
_ScrollPlayerTable(mouseEvent.Wheel);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -242,46 +242,46 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
base.OnShow();
|
||||
|
||||
PlayerTableOffset = 0;
|
||||
RoundsTableOffset = 0;
|
||||
_PlayerTableOffset = 0;
|
||||
_RoundsTableOffset = 0;
|
||||
|
||||
UpdatePlayerTable();
|
||||
UpdateNextPlayerPositions();
|
||||
UpdateNextPlayerContents();
|
||||
if (GameState.CurrentRoundNr == 1)
|
||||
BuildRoundsTable();
|
||||
_UpdatePlayerTable();
|
||||
_UpdateNextPlayerPositions();
|
||||
_UpdateNextPlayerContents();
|
||||
if (_GameState.CurrentRoundNr == 1)
|
||||
_BuildRoundsTable();
|
||||
else
|
||||
ScrollRoundsTable(GameState.CurrentRoundNr - 2);
|
||||
UpdateRoundsTable();
|
||||
_ScrollRoundsTable(_GameState.CurrentRoundNr - 2);
|
||||
_UpdateRoundsTable();
|
||||
|
||||
if (GameState.CurrentRoundNr == 1)
|
||||
if (_GameState.CurrentRoundNr == 1)
|
||||
{
|
||||
Buttons[ButtonBack].Visible = true;
|
||||
Buttons[ButtonExit].Visible = false;
|
||||
Buttons[_ButtonBack].Visible = true;
|
||||
Buttons[_ButtonExit].Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Buttons[ButtonBack].Visible = false;
|
||||
Buttons[ButtonExit].Visible = true;
|
||||
Buttons[_ButtonBack].Visible = false;
|
||||
Buttons[_ButtonExit].Visible = true;
|
||||
}
|
||||
|
||||
if (GameState.CurrentRoundNr <= GameState.Combs.Count)
|
||||
if (_GameState.CurrentRoundNr <= _GameState.Combs.Count)
|
||||
{
|
||||
Buttons[ButtonNextRound].Visible = true;
|
||||
Texts[TextFinishMessage].Visible = false;
|
||||
Texts[TextFinishPlayerWin].Visible = false;
|
||||
SetInteractionToButton(Buttons[ButtonNextRound]);
|
||||
Buttons[_ButtonNextRound].Visible = true;
|
||||
Texts[_TextFinishMessage].Visible = false;
|
||||
Texts[_TextFinishPlayerWin].Visible = false;
|
||||
SetInteractionToButton(Buttons[_ButtonNextRound]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Buttons[ButtonNextRound].Visible = false;
|
||||
Texts[TextFinishMessage].Visible = true;
|
||||
Texts[TextFinishPlayerWin].Visible = true;
|
||||
Texts[TextFinishPlayerWin].Text = GetPlayerWinString();
|
||||
SetInteractionToButton(Buttons[ButtonExit]);
|
||||
Buttons[_ButtonNextRound].Visible = false;
|
||||
Texts[_TextFinishMessage].Visible = true;
|
||||
Texts[_TextFinishPlayerWin].Visible = true;
|
||||
Texts[_TextFinishPlayerWin].Text = _GetPlayerWinString();
|
||||
SetInteractionToButton(Buttons[_ButtonExit]);
|
||||
}
|
||||
|
||||
ShowPopup(false);
|
||||
_ShowPopup(false);
|
||||
}
|
||||
|
||||
public override bool UpdateGame()
|
||||
@@ -295,246 +295,246 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return true;
|
||||
}
|
||||
|
||||
private void NextRound()
|
||||
private void _NextRound()
|
||||
{
|
||||
Data.ScreenMain.FadeToNameSelection = false;
|
||||
Data.ScreenMain.FadeToSongSelection = true;
|
||||
_PartyMode.DataFromScreen(ThemeName, Data);
|
||||
_Data.ScreenMain.FadeToNameSelection = false;
|
||||
_Data.ScreenMain.FadeToSongSelection = true;
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
}
|
||||
|
||||
private void EndParty()
|
||||
private void _EndParty()
|
||||
{
|
||||
FadeTo(EScreens.ScreenParty);
|
||||
_FadeTo(EScreens.ScreenParty);
|
||||
}
|
||||
|
||||
private void ShowPopup(bool Visible)
|
||||
private void _ShowPopup(bool visible)
|
||||
{
|
||||
ExitPopupVisible = Visible;
|
||||
_ExitPopupVisible = visible;
|
||||
|
||||
Statics[StaticPopupBG].Visible = ExitPopupVisible;
|
||||
Texts[TextPopupReallyExit].Visible = ExitPopupVisible;
|
||||
Buttons[ButtonPopupYes].Visible = ExitPopupVisible;
|
||||
Buttons[ButtonPopupNo].Visible = ExitPopupVisible;
|
||||
Statics[_StaticPopupBG].Visible = _ExitPopupVisible;
|
||||
Texts[_TextPopupReallyExit].Visible = _ExitPopupVisible;
|
||||
Buttons[_ButtonPopupYes].Visible = _ExitPopupVisible;
|
||||
Buttons[_ButtonPopupNo].Visible = _ExitPopupVisible;
|
||||
|
||||
if (ExitPopupVisible)
|
||||
SetInteractionToButton(Buttons[ButtonPopupNo]);
|
||||
if (_ExitPopupVisible)
|
||||
SetInteractionToButton(Buttons[_ButtonPopupNo]);
|
||||
}
|
||||
|
||||
private void Back()
|
||||
private void _Back()
|
||||
{
|
||||
Data.ScreenMain.FadeToNameSelection = true;
|
||||
Data.ScreenMain.FadeToSongSelection = false;
|
||||
_PartyMode.DataFromScreen(ThemeName, Data);
|
||||
_Data.ScreenMain.FadeToNameSelection = true;
|
||||
_Data.ScreenMain.FadeToSongSelection = false;
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
}
|
||||
|
||||
private void UpdateNextPlayerPositions()
|
||||
private void _UpdateNextPlayerPositions()
|
||||
{
|
||||
float x = CBase.Settings.GetRenderW() / 2 - ((GameState.NumPlayerAtOnce * Statics[StaticNextPlayer].Rect.W) + ((GameState.NumPlayerAtOnce - 1) * 15)) / 2;
|
||||
float static_y = 590;
|
||||
float text_y = 550;
|
||||
for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
|
||||
float x = CBase.Settings.GetRenderW() / 2 - ((_GameState.NumPlayerAtOnce * Statics[_StaticNextPlayer].Rect.W) + ((_GameState.NumPlayerAtOnce - 1) * 15)) / 2;
|
||||
float staticY = 590;
|
||||
float textY = 550;
|
||||
for (int i = 0; i < _GameState.NumPlayerAtOnce; i++)
|
||||
{
|
||||
//static
|
||||
NextPlayerStatics[i].Rect.X = x;
|
||||
NextPlayerStatics[i].Rect.Y = static_y;
|
||||
NextPlayerStatics[i].Visible = true;
|
||||
_NextPlayerStatics[i].Rect.X = x;
|
||||
_NextPlayerStatics[i].Rect.Y = staticY;
|
||||
_NextPlayerStatics[i].Visible = true;
|
||||
//text
|
||||
NextPlayerTexts[i].X = x + Statics[StaticNextPlayer].Rect.W / 2;
|
||||
NextPlayerTexts[i].Y = text_y;
|
||||
NextPlayerTexts[i].Visible = true;
|
||||
_NextPlayerTexts[i].X = x + Statics[_StaticNextPlayer].Rect.W / 2;
|
||||
_NextPlayerTexts[i].Y = textY;
|
||||
_NextPlayerTexts[i].Visible = true;
|
||||
|
||||
x += Statics[StaticNextPlayer].Rect.W + 15;
|
||||
x += Statics[_StaticNextPlayer].Rect.W + 15;
|
||||
}
|
||||
for (int i = GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++)
|
||||
for (int i = _GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++)
|
||||
{
|
||||
NextPlayerStatics[i].Visible = false;
|
||||
NextPlayerTexts[i].Visible = false;
|
||||
_NextPlayerStatics[i].Visible = false;
|
||||
_NextPlayerTexts[i].Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateNextPlayerContents()
|
||||
private void _UpdateNextPlayerContents()
|
||||
{
|
||||
if (GameState.CurrentRoundNr <= GameState.Combs.Count)
|
||||
if (_GameState.CurrentRoundNr <= _GameState.Combs.Count)
|
||||
{
|
||||
Texts[TextNextPlayerMessage].Visible = true;
|
||||
Texts[_TextNextPlayerMessage].Visible = true;
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
|
||||
for (int i = 0; i < _GameState.NumPlayerAtOnce; i++)
|
||||
{
|
||||
int pid = GameState.Combs[GameState.CurrentRoundNr - 1].Player[i];
|
||||
NextPlayerStatics[i].Texture = profiles[GameState.ProfileIDs[pid]].Avatar.Texture;
|
||||
NextPlayerTexts[i].Text = profiles[GameState.ProfileIDs[pid]].PlayerName;
|
||||
NextPlayerTexts[i].Color = CBase.Theme.GetPlayerColor(i + 1);
|
||||
int pid = _GameState.Combs[_GameState.CurrentRoundNr - 1].Player[i];
|
||||
_NextPlayerStatics[i].Texture = profiles[_GameState.ProfileIDs[pid]].Avatar.Texture;
|
||||
_NextPlayerTexts[i].Text = profiles[_GameState.ProfileIDs[pid]].PlayerName;
|
||||
_NextPlayerTexts[i].Color = CBase.Theme.GetPlayerColor(i + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Texts[TextNextPlayerMessage].Visible = false;
|
||||
for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
|
||||
Texts[_TextNextPlayerMessage].Visible = false;
|
||||
for (int i = 0; i < _GameState.NumPlayerAtOnce; i++)
|
||||
{
|
||||
NextPlayerStatics[i].Visible = false;
|
||||
NextPlayerTexts[i].Visible = false;
|
||||
_NextPlayerStatics[i].Visible = false;
|
||||
_NextPlayerTexts[i].Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateRoundsTable()
|
||||
private void _CreateRoundsTable()
|
||||
{
|
||||
//Create lists
|
||||
RoundsTable = new List<RoundsTableRow>();
|
||||
_RoundsTable = new List<CRoundsTableRow>();
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
RoundsTableRow rtr = new RoundsTableRow();
|
||||
CRoundsTableRow rtr = new CRoundsTableRow();
|
||||
rtr.TextPlayer = new List<CText>();
|
||||
rtr.TextScores = new List<CText>();
|
||||
RoundsTable.Add(rtr);
|
||||
_RoundsTable.Add(rtr);
|
||||
}
|
||||
//Create statics and texts for rounds
|
||||
for (int round = 0; round < RoundsTable.Count; round++)
|
||||
for (int round = 0; round < _RoundsTable.Count; round++)
|
||||
{
|
||||
//Round-number
|
||||
CText text = GetNewText(Texts[TextRoundNumber]);
|
||||
CText text = GetNewText(Texts[_TextRoundNumber]);
|
||||
AddText(text);
|
||||
RoundsTable[round].Number = text;
|
||||
_RoundsTable[round].Number = text;
|
||||
for (int row = 0; row < 2; row++)
|
||||
{
|
||||
for (int column = 0; column < 3; column++)
|
||||
{
|
||||
//Player
|
||||
text = GetNewText(Texts[TextRoundPlayer]);
|
||||
text = GetNewText(Texts[_TextRoundPlayer]);
|
||||
AddText(text);
|
||||
RoundsTable[round].TextPlayer.Add(text);
|
||||
_RoundsTable[round].TextPlayer.Add(text);
|
||||
//Score
|
||||
text = GetNewText(Texts[TextRoundScore]);
|
||||
text = GetNewText(Texts[_TextRoundScore]);
|
||||
AddText(text);
|
||||
RoundsTable[round].TextScores.Add(text);
|
||||
_RoundsTable[round].TextScores.Add(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BuildRoundsTable()
|
||||
private void _BuildRoundsTable()
|
||||
{
|
||||
RoundsTableScrollArea = new SRectF();
|
||||
_RoundsTableScrollArea = new SRectF();
|
||||
|
||||
int NumPlayerInOneRow = 3;
|
||||
if (GameState.NumPlayerAtOnce <= NumPlayerInOneRow)
|
||||
NumRoundsVisible = 5;
|
||||
int numPlayerInOneRow = 3;
|
||||
if (_GameState.NumPlayerAtOnce <= numPlayerInOneRow)
|
||||
_NumRoundsVisible = 5;
|
||||
else
|
||||
NumRoundsVisible = 3;
|
||||
_NumRoundsVisible = 3;
|
||||
|
||||
if (NumRoundsVisible > GameState.Combs.Count)
|
||||
NumRoundsVisible = GameState.Combs.Count;
|
||||
if (_NumRoundsVisible > _GameState.Combs.Count)
|
||||
_NumRoundsVisible = _GameState.Combs.Count;
|
||||
|
||||
float numberX = Texts[TextRoundNumber].X;
|
||||
float numberY = Texts[TextRoundNumber].Y;
|
||||
float numberX = Texts[_TextRoundNumber].X;
|
||||
float numberY = Texts[_TextRoundNumber].Y;
|
||||
|
||||
RoundsTableScrollArea.X = numberX;
|
||||
RoundsTableScrollArea.Y = numberY;
|
||||
RoundsTableScrollArea.W = CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20;
|
||||
_RoundsTableScrollArea.X = numberX;
|
||||
_RoundsTableScrollArea.Y = numberY;
|
||||
_RoundsTableScrollArea.W = CBase.Settings.GetRenderW() - Texts[_TextRoundNumber].X - 20;
|
||||
|
||||
float delta = Texts[TextRoundNumber].Height;
|
||||
float delta = Texts[_TextRoundNumber].Height;
|
||||
|
||||
//Update statics and texts for rounds
|
||||
for (int round = 0; round < RoundsTable.Count; round++)
|
||||
for (int round = 0; round < _RoundsTable.Count; round++)
|
||||
{
|
||||
//Round-number
|
||||
RoundsTable[round].Number.X = numberX;
|
||||
RoundsTable[round].Number.Y = numberY;
|
||||
int NumInnerRows = (int)Math.Ceiling(GameState.NumPlayerAtOnce / ((double)NumPlayerInOneRow));
|
||||
for (int row = 0; row < NumInnerRows; row++)
|
||||
_RoundsTable[round].Number.X = numberX;
|
||||
_RoundsTable[round].Number.Y = numberY;
|
||||
int numInnerRows = (int)Math.Ceiling(_GameState.NumPlayerAtOnce / ((double)numPlayerInOneRow));
|
||||
for (int row = 0; row < numInnerRows; row++)
|
||||
{
|
||||
int num = (row + 1) * NumPlayerInOneRow;
|
||||
int NumPlayerInThisRow = NumPlayerInOneRow;
|
||||
if (num > GameState.NumPlayerAtOnce)
|
||||
int num = (row + 1) * numPlayerInOneRow;
|
||||
int numPlayerInThisRow = numPlayerInOneRow;
|
||||
if (num > _GameState.NumPlayerAtOnce)
|
||||
{
|
||||
num = GameState.NumPlayerAtOnce;
|
||||
NumPlayerInThisRow = GameState.NumPlayerAtOnce - (row * NumPlayerInOneRow);
|
||||
num = _GameState.NumPlayerAtOnce;
|
||||
numPlayerInThisRow = _GameState.NumPlayerAtOnce - (row * numPlayerInOneRow);
|
||||
}
|
||||
for (int column = row * NumPlayerInOneRow; column < num; column++)
|
||||
for (int column = row * numPlayerInOneRow; column < num; column++)
|
||||
{
|
||||
//Player
|
||||
float _x = numberX + 15 + (CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) +
|
||||
((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2;
|
||||
float maxw = ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2 - 5;
|
||||
RoundsTable[round].TextPlayer[column].X = _x;
|
||||
RoundsTable[round].TextPlayer[column].Y = numberY;
|
||||
RoundsTable[round].TextPlayer[column].MaxWidth = maxw;
|
||||
float x = numberX + 15 + (CBase.Settings.GetRenderW() - Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow * (column - row * numPlayerInOneRow) +
|
||||
((CBase.Settings.GetRenderW() - Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow) / 2;
|
||||
float maxw = ((CBase.Settings.GetRenderW() - Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow) / 2 - 5;
|
||||
_RoundsTable[round].TextPlayer[column].X = x;
|
||||
_RoundsTable[round].TextPlayer[column].Y = numberY;
|
||||
_RoundsTable[round].TextPlayer[column].MaxWidth = maxw;
|
||||
//Score
|
||||
RoundsTable[round].TextScores[column] = RoundsTable[round].TextScores[column];
|
||||
RoundsTable[round].TextScores[column].X = _x;
|
||||
RoundsTable[round].TextScores[column].Y = numberY + delta;
|
||||
RoundsTable[round].TextScores[column].MaxWidth = maxw;
|
||||
_RoundsTable[round].TextScores[column] = _RoundsTable[round].TextScores[column];
|
||||
_RoundsTable[round].TextScores[column].X = x;
|
||||
_RoundsTable[round].TextScores[column].Y = numberY + delta;
|
||||
_RoundsTable[round].TextScores[column].MaxWidth = maxw;
|
||||
}
|
||||
numberY = numberY + delta + delta;
|
||||
}
|
||||
numberY = numberY + delta / 2;
|
||||
}
|
||||
RoundsTableScrollArea.H = numberY - RoundsTableScrollArea.Y;
|
||||
_RoundsTableScrollArea.H = numberY - _RoundsTableScrollArea.Y;
|
||||
}
|
||||
|
||||
private void UpdateRoundsTable()
|
||||
private void _UpdateRoundsTable()
|
||||
{
|
||||
SProfile[] profile = CBase.Profiles.GetProfiles();
|
||||
for (int i = 0; i < RoundsTable.Count; i++)
|
||||
for (int i = 0; i < _RoundsTable.Count; i++)
|
||||
{
|
||||
for (int p = 0; p < RoundsTable[i].TextPlayer.Count; p++)
|
||||
for (int p = 0; p < _RoundsTable[i].TextPlayer.Count; p++)
|
||||
{
|
||||
if (GameState.Combs.Count > i + RoundsTableOffset && GameState.Combs[i + RoundsTableOffset].Player.Count > p)
|
||||
if (_GameState.Combs.Count > i + _RoundsTableOffset && _GameState.Combs[i + _RoundsTableOffset].Player.Count > p)
|
||||
{
|
||||
RoundsTable[i].Number.Visible = true;
|
||||
RoundsTable[i].TextPlayer[p].Visible = true;
|
||||
RoundsTable[i].TextScores[p].Visible = true;
|
||||
RoundsTable[i].Number.Text = (i + 1 + RoundsTableOffset).ToString() + ")";
|
||||
int pID = GameState.ProfileIDs[GameState.Combs[i + RoundsTableOffset].Player[p]];
|
||||
RoundsTable[i].TextPlayer[p].Text = profile[pID].PlayerName;
|
||||
if ((GameState.CurrentRoundNr - 1) > i + RoundsTableOffset)
|
||||
RoundsTable[i].TextScores[p].Text = GameState.Results[i + RoundsTableOffset, p].ToString();
|
||||
_RoundsTable[i].Number.Visible = true;
|
||||
_RoundsTable[i].TextPlayer[p].Visible = true;
|
||||
_RoundsTable[i].TextScores[p].Visible = true;
|
||||
_RoundsTable[i].Number.Text = (i + 1 + _RoundsTableOffset).ToString() + ")";
|
||||
int pID = _GameState.ProfileIDs[_GameState.Combs[i + _RoundsTableOffset].Player[p]];
|
||||
_RoundsTable[i].TextPlayer[p].Text = profile[pID].PlayerName;
|
||||
if ((_GameState.CurrentRoundNr - 1) > i + _RoundsTableOffset)
|
||||
_RoundsTable[i].TextScores[p].Text = _GameState.Results[i + _RoundsTableOffset, p].ToString();
|
||||
else
|
||||
RoundsTable[i].TextScores[p].Text = "";
|
||||
_RoundsTable[i].TextScores[p].Text = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
RoundsTable[i].TextPlayer[p].Visible = false;
|
||||
RoundsTable[i].TextScores[p].Visible = false;
|
||||
_RoundsTable[i].TextPlayer[p].Visible = false;
|
||||
_RoundsTable[i].TextScores[p].Visible = false;
|
||||
}
|
||||
}
|
||||
if (GameState.Combs.Count < i + RoundsTableOffset || i + 1 > NumRoundsVisible)
|
||||
if (_GameState.Combs.Count < i + _RoundsTableOffset || i + 1 > _NumRoundsVisible)
|
||||
{
|
||||
RoundsTable[i].Number.Visible = false;
|
||||
for (int p = 0; p < RoundsTable[i].TextPlayer.Count; p++)
|
||||
_RoundsTable[i].Number.Visible = false;
|
||||
for (int p = 0; p < _RoundsTable[i].TextPlayer.Count; p++)
|
||||
{
|
||||
RoundsTable[i].TextPlayer[p].Visible = false;
|
||||
RoundsTable[i].TextScores[p].Visible = false;
|
||||
_RoundsTable[i].TextPlayer[p].Visible = false;
|
||||
_RoundsTable[i].TextScores[p].Visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Buttons[ButtonRoundsScrollUp].Visible = RoundsTableOffset > 0;
|
||||
Buttons[ButtonRoundsScrollDown].Visible = GameState.Combs.Count - NumRoundsVisible - RoundsTableOffset > 0;
|
||||
Buttons[_ButtonRoundsScrollUp].Visible = _RoundsTableOffset > 0;
|
||||
Buttons[_ButtonRoundsScrollDown].Visible = _GameState.Combs.Count - _NumRoundsVisible - _RoundsTableOffset > 0;
|
||||
}
|
||||
|
||||
private void BuildPlayerTable()
|
||||
private void _BuildPlayerTable()
|
||||
{
|
||||
PlayerTableScrollArea = new SRectF();
|
||||
PlayerTableScrollArea.X = Texts[TextPosition].X;
|
||||
PlayerTableScrollArea.Y = Texts[TextPosition].Y;
|
||||
PlayerTableScrollArea.W = Texts[TextGamePoints].X - Texts[TextPosition].X;
|
||||
_PlayerTableScrollArea = new SRectF();
|
||||
_PlayerTableScrollArea.X = Texts[_TextPosition].X;
|
||||
_PlayerTableScrollArea.Y = Texts[_TextPosition].Y;
|
||||
_PlayerTableScrollArea.W = Texts[_TextGamePoints].X - Texts[_TextPosition].X;
|
||||
|
||||
PlayerTable = new List<TableRow>();
|
||||
float delta = Texts[TextPosition].Height * 1.2f;
|
||||
_PlayerTable = new List<STableRow>();
|
||||
float delta = Texts[_TextPosition].Height * 1.2f;
|
||||
|
||||
float h = 0;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
TableRow row = new TableRow();
|
||||
STableRow row = new STableRow();
|
||||
|
||||
row.Pos = GetNewText(Texts[TextPosition]);
|
||||
row.Name = GetNewText(Texts[TextPlayerName]);
|
||||
row.Rounds = GetNewText(Texts[TextNumPlayed]);
|
||||
row.Won = GetNewText(Texts[TextWon]);
|
||||
row.SingPoints = GetNewText(Texts[TextSingPoints]);
|
||||
row.GamePoints = GetNewText(Texts[TextGamePoints]);
|
||||
row.Pos = GetNewText(Texts[_TextPosition]);
|
||||
row.Name = GetNewText(Texts[_TextPlayerName]);
|
||||
row.Rounds = GetNewText(Texts[_TextNumPlayed]);
|
||||
row.Won = GetNewText(Texts[_TextWon]);
|
||||
row.SingPoints = GetNewText(Texts[_TextSingPoints]);
|
||||
row.GamePoints = GetNewText(Texts[_TextGamePoints]);
|
||||
|
||||
row.Pos.Y += delta * (i + 1);
|
||||
row.Name.Y += delta * (i + 1);
|
||||
@@ -559,22 +559,22 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
AddText(row.SingPoints);
|
||||
AddText(row.GamePoints);
|
||||
|
||||
PlayerTable.Add(row);
|
||||
_PlayerTable.Add(row);
|
||||
|
||||
h = delta * (i + 1);
|
||||
}
|
||||
PlayerTableScrollArea.H = h + delta;
|
||||
_PlayerTableScrollArea.H = h + delta;
|
||||
}
|
||||
|
||||
private void UpdatePlayerTable()
|
||||
private void _UpdatePlayerTable()
|
||||
{
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
|
||||
for (int i = 0; i < PlayerTable.Count; i++)
|
||||
for (int i = 0; i < _PlayerTable.Count; i++)
|
||||
{
|
||||
TableRow row = PlayerTable[i];
|
||||
STableRow row = _PlayerTable[i];
|
||||
|
||||
if (i + PlayerTableOffset < GameState.ResultTable.Count)
|
||||
if (i + _PlayerTableOffset < _GameState.ResultTable.Count)
|
||||
{
|
||||
row.Pos.Visible = true;
|
||||
row.Name.Visible = true;
|
||||
@@ -583,12 +583,12 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
row.SingPoints.Visible = true;
|
||||
row.GamePoints.Visible = true;
|
||||
|
||||
row.Pos.Text = GameState.ResultTable[i + PlayerTableOffset].Position.ToString() + ".";
|
||||
row.Name.Text = profiles[GameState.ResultTable[i + PlayerTableOffset].PlayerID].PlayerName;
|
||||
row.Rounds.Text = GameState.ResultTable[i + PlayerTableOffset].NumRounds.ToString();
|
||||
row.Won.Text = GameState.ResultTable[i + PlayerTableOffset].NumWon.ToString();
|
||||
row.SingPoints.Text = GameState.ResultTable[i + PlayerTableOffset].NumSingPoints.ToString();
|
||||
row.GamePoints.Text = GameState.ResultTable[i + PlayerTableOffset].NumGamePoints.ToString();
|
||||
row.Pos.Text = _GameState.ResultTable[i + _PlayerTableOffset].Position.ToString() + ".";
|
||||
row.Name.Text = profiles[_GameState.ResultTable[i + _PlayerTableOffset].PlayerID].PlayerName;
|
||||
row.Rounds.Text = _GameState.ResultTable[i + _PlayerTableOffset].NumRounds.ToString();
|
||||
row.Won.Text = _GameState.ResultTable[i + _PlayerTableOffset].NumWon.ToString();
|
||||
row.SingPoints.Text = _GameState.ResultTable[i + _PlayerTableOffset].NumSingPoints.ToString();
|
||||
row.GamePoints.Text = _GameState.ResultTable[i + _PlayerTableOffset].NumGamePoints.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -601,54 +601,54 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
|
||||
Buttons[ButtonPlayerScrollUp].Visible = PlayerTableOffset > 0;
|
||||
Buttons[ButtonPlayerScrollDown].Visible = GameState.ProfileIDs.Count - NumPlayerVisible - PlayerTableOffset > 0;
|
||||
Buttons[_ButtonPlayerScrollUp].Visible = _PlayerTableOffset > 0;
|
||||
Buttons[_ButtonPlayerScrollDown].Visible = _GameState.ProfileIDs.Count - _NumPlayerVisible - _PlayerTableOffset > 0;
|
||||
}
|
||||
|
||||
private void ScrollPlayerTable(int Offset)
|
||||
private void _ScrollPlayerTable(int offset)
|
||||
{
|
||||
if (GameState.ProfileIDs.Count <= NumPlayerVisible)
|
||||
PlayerTableOffset = 0;
|
||||
else if (Offset < 0 && PlayerTableOffset + Offset >= 0)
|
||||
PlayerTableOffset += Offset;
|
||||
else if (Offset < 0 && PlayerTableOffset + Offset < 0)
|
||||
PlayerTableOffset = 0;
|
||||
else if (Offset > 0 && PlayerTableOffset + Offset <= GameState.ProfileIDs.Count - NumPlayerVisible)
|
||||
PlayerTableOffset += Offset;
|
||||
else if (Offset > 0 && PlayerTableOffset + Offset > GameState.ProfileIDs.Count - NumPlayerVisible)
|
||||
PlayerTableOffset = GameState.ProfileIDs.Count - NumPlayerVisible;
|
||||
if (_GameState.ProfileIDs.Count <= _NumPlayerVisible)
|
||||
_PlayerTableOffset = 0;
|
||||
else if (offset < 0 && _PlayerTableOffset + offset >= 0)
|
||||
_PlayerTableOffset += offset;
|
||||
else if (offset < 0 && _PlayerTableOffset + offset < 0)
|
||||
_PlayerTableOffset = 0;
|
||||
else if (offset > 0 && _PlayerTableOffset + offset <= _GameState.ProfileIDs.Count - _NumPlayerVisible)
|
||||
_PlayerTableOffset += offset;
|
||||
else if (offset > 0 && _PlayerTableOffset + offset > _GameState.ProfileIDs.Count - _NumPlayerVisible)
|
||||
_PlayerTableOffset = _GameState.ProfileIDs.Count - _NumPlayerVisible;
|
||||
|
||||
UpdatePlayerTable();
|
||||
_UpdatePlayerTable();
|
||||
}
|
||||
|
||||
private void ScrollRoundsTable(int Offset)
|
||||
private void _ScrollRoundsTable(int offset)
|
||||
{
|
||||
if (GameState.Combs.Count <= NumRoundsVisible)
|
||||
RoundsTableOffset = 0;
|
||||
else if (Offset < 0 && RoundsTableOffset + Offset >= 0)
|
||||
RoundsTableOffset += Offset;
|
||||
else if (Offset < 0 && RoundsTableOffset + Offset < 0)
|
||||
RoundsTableOffset = 0;
|
||||
else if (Offset > 0 && RoundsTableOffset + Offset <= GameState.Combs.Count - NumRoundsVisible)
|
||||
RoundsTableOffset += Offset;
|
||||
else if (Offset > 0 && RoundsTableOffset + Offset > GameState.Combs.Count - NumRoundsVisible)
|
||||
RoundsTableOffset = GameState.Combs.Count - NumRoundsVisible;
|
||||
if (_GameState.Combs.Count <= _NumRoundsVisible)
|
||||
_RoundsTableOffset = 0;
|
||||
else if (offset < 0 && _RoundsTableOffset + offset >= 0)
|
||||
_RoundsTableOffset += offset;
|
||||
else if (offset < 0 && _RoundsTableOffset + offset < 0)
|
||||
_RoundsTableOffset = 0;
|
||||
else if (offset > 0 && _RoundsTableOffset + offset <= _GameState.Combs.Count - _NumRoundsVisible)
|
||||
_RoundsTableOffset += offset;
|
||||
else if (offset > 0 && _RoundsTableOffset + offset > _GameState.Combs.Count - _NumRoundsVisible)
|
||||
_RoundsTableOffset = _GameState.Combs.Count - _NumRoundsVisible;
|
||||
|
||||
UpdateRoundsTable();
|
||||
_UpdateRoundsTable();
|
||||
}
|
||||
|
||||
private string GetPlayerWinString()
|
||||
private string _GetPlayerWinString()
|
||||
{
|
||||
string s = "";
|
||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
|
||||
for (int i = 0; i < GameState.ResultTable.Count; i++)
|
||||
for (int i = 0; i < _GameState.ResultTable.Count; i++)
|
||||
{
|
||||
if (GameState.ResultTable[i].Position == 1)
|
||||
if (_GameState.ResultTable[i].Position == 1)
|
||||
{
|
||||
if (i > 0)
|
||||
s += ", ";
|
||||
s += profiles[GameState.ResultTable[i].PlayerID].PlayerName;
|
||||
s += profiles[_GameState.ResultTable[i].PlayerID].PlayerName;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
@@ -5,7 +5,7 @@ using VocaluxeLib.Menu;
|
||||
|
||||
namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
public class PartyScreenChallengeMedleyNames : CMenuParty
|
||||
public class CPartyScreenChallengeMedleyNames : CMenuParty
|
||||
{
|
||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||
protected override int _ScreenVersion
|
||||
@@ -13,40 +13,40 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
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 _ButtonNext = "ButtonNext";
|
||||
private const string _ButtonBack = "ButtonBack";
|
||||
private const string _ButtonPlayerDestination = "ButtonPlayerDestination";
|
||||
private const string _ButtonPlayerChoose = "ButtonPlayerChoose";
|
||||
|
||||
private List<CPlayerChooseButton> PlayerChooseButtons;
|
||||
private List<CButton> PlayerDestinationButtons;
|
||||
private List<CPlayerChooseButton> _PlayerChooseButtons;
|
||||
private List<CButton> _PlayerDestinationButtons;
|
||||
//PlayerDestinationButtons-Option
|
||||
private const int PlayerDestinationButtonsNumH = 3;
|
||||
private const int PlayerDestinationButtonsNumW = 4;
|
||||
private const int PlayerDestinationButtonsFirstX = 900;
|
||||
private const int PlayerDestinationButtonsFirstY = 105;
|
||||
private const int PlayerDestinationButtonsSpaceH = 15;
|
||||
private const int PlayerDestinationButtonsSpaceW = 25;
|
||||
private const int _PlayerDestinationButtonsNumH = 3;
|
||||
private const int _PlayerDestinationButtonsNumW = 4;
|
||||
private const int _PlayerDestinationButtonsFirstX = 900;
|
||||
private const int _PlayerDestinationButtonsFirstY = 105;
|
||||
private const int _PlayerDestinationButtonsSpaceH = 15;
|
||||
private const int _PlayerDestinationButtonsSpaceW = 25;
|
||||
//PlayerChooseButtons-Option
|
||||
private List<int> PlayerChooseButtonsVisibleProfiles;
|
||||
private const int PlayerChooseButtonsNumH = 7;
|
||||
private const int PlayerChooseButtonsNumW = 4;
|
||||
private const int PlayerChooseButtonsFirstX = 52;
|
||||
private const int PlayerChooseButtonsFirstY = 105;
|
||||
private const int PlayerChooseButtonsSpaceH = 15;
|
||||
private const int PlayerChooseButtonsSpaceW = 25;
|
||||
private int PlayerChooseButtonsOffset = 0;
|
||||
private List<int> _PlayerChooseButtonsVisibleProfiles;
|
||||
private const int _PlayerChooseButtonsNumH = 7;
|
||||
private const int _PlayerChooseButtonsNumW = 4;
|
||||
private const int _PlayerChooseButtonsFirstX = 52;
|
||||
private const int _PlayerChooseButtonsFirstY = 105;
|
||||
private const int _PlayerChooseButtonsSpaceH = 15;
|
||||
private const int _PlayerChooseButtonsSpaceW = 25;
|
||||
private int _PlayerChooseButtonsOffset = 0;
|
||||
|
||||
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 NumPlayer = 4;
|
||||
private int _NumPlayer = 4;
|
||||
|
||||
private DataFromScreen Data;
|
||||
private SDataFromScreen _Data;
|
||||
|
||||
private class CPlayerChooseButton
|
||||
{
|
||||
@@ -58,39 +58,39 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
base.Init();
|
||||
|
||||
chooseAvatarStatic = GetNewStatic();
|
||||
chooseAvatarStatic.Visible = false;
|
||||
_ChooseAvatarStatic = GetNewStatic();
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
|
||||
PlayerChooseButtonsVisibleProfiles = new List<int>();
|
||||
_PlayerChooseButtonsVisibleProfiles = new List<int>();
|
||||
|
||||
Data.ScreenNames.ProfileIDs = new List<int>();
|
||||
_Data.ScreenNames.ProfileIDs = new List<int>();
|
||||
|
||||
List<string> buttons = new List<string>();
|
||||
_ThemeButtons = new string[] {ButtonBack, ButtonNext, ButtonPlayerDestination, ButtonPlayerChoose};
|
||||
_ThemeButtons = new string[] {_ButtonBack, _ButtonNext, _ButtonPlayerDestination, _ButtonPlayerChoose};
|
||||
|
||||
Data = new DataFromScreen();
|
||||
FromScreenNames names = new FromScreenNames();
|
||||
_Data = new SDataFromScreen();
|
||||
SFromScreenNames names = new SFromScreenNames();
|
||||
names.FadeToConfig = false;
|
||||
names.FadeToMain = false;
|
||||
names.ProfileIDs = 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.ProfileIDs = config.ProfileIDs;
|
||||
if (Data.ScreenNames.ProfileIDs == null)
|
||||
Data.ScreenNames.ProfileIDs = new List<int>();
|
||||
config = (SDataToScreenNames)receivedData;
|
||||
_Data.ScreenNames.ProfileIDs = config.ProfileIDs;
|
||||
if (_Data.ScreenNames.ProfileIDs == null)
|
||||
_Data.ScreenNames.ProfileIDs = new List<int>();
|
||||
|
||||
NumPlayer = config.NumPlayer;
|
||||
_NumPlayer = config.NumPlayer;
|
||||
|
||||
while (Data.ScreenNames.ProfileIDs.Count > NumPlayer)
|
||||
Data.ScreenNames.ProfileIDs.RemoveAt(Data.ScreenNames.ProfileIDs.Count - 1);
|
||||
while (_Data.ScreenNames.ProfileIDs.Count > _NumPlayer)
|
||||
_Data.ScreenNames.ProfileIDs.RemoveAt(_Data.ScreenNames.ProfileIDs.Count - 1);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -98,7 +98,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleInput(KeyEvent keyEvent)
|
||||
public override bool HandleInput(SKeyEvent keyEvent)
|
||||
{
|
||||
base.HandleInput(keyEvent);
|
||||
|
||||
@@ -109,29 +109,29 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
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 (!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);
|
||||
|
||||
@@ -164,74 +164,74 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}*/
|
||||
|
||||
//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;
|
||||
}
|
||||
// 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 (Data.ScreenNames.ProfileIDs.Count < (i + 1))
|
||||
if (_Data.ScreenNames.ProfileIDs.Count < (i + 1))
|
||||
{
|
||||
Data.ScreenNames.ProfileIDs.Add(SelectedPlayerNr);
|
||||
added = Data.ScreenNames.ProfileIDs.Count - 1;
|
||||
_Data.ScreenNames.ProfileIDs.Add(_SelectedPlayerNr);
|
||||
added = _Data.ScreenNames.ProfileIDs.Count - 1;
|
||||
}
|
||||
else if (Data.ScreenNames.ProfileIDs.Count >= (i + 1))
|
||||
else if (_Data.ScreenNames.ProfileIDs.Count >= (i + 1))
|
||||
{
|
||||
Data.ScreenNames.ProfileIDs[i] = SelectedPlayerNr;
|
||||
_Data.ScreenNames.ProfileIDs[i] = _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].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;
|
||||
//Update Tiles-List
|
||||
UpdateButtonPlayerChoose();
|
||||
_UpdateButtonPlayerChoose();
|
||||
}
|
||||
}
|
||||
}
|
||||
SelectedPlayerNr = -1;
|
||||
_SelectedPlayerNr = -1;
|
||||
}
|
||||
//Reset variables
|
||||
SelectingMouseActive = false;
|
||||
chooseAvatarStatic.Visible = false;
|
||||
_SelectingMouseActive = false;
|
||||
_ChooseAvatarStatic.Visible = false;
|
||||
}
|
||||
|
||||
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 (!OnAdd())
|
||||
OnRemove();
|
||||
if (!_OnAdd())
|
||||
_OnRemove();
|
||||
}
|
||||
|
||||
if (mouseEvent.RB)
|
||||
Back();
|
||||
_Back();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -240,17 +240,17 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
base.OnShow();
|
||||
|
||||
if (!ButtonsAdded)
|
||||
if (!_ButtonsAdded)
|
||||
{
|
||||
AddButtonPlayerDestination();
|
||||
AddButtonPlayerChoose();
|
||||
ButtonsAdded = true;
|
||||
_AddButtonPlayerDestination();
|
||||
_AddButtonPlayerChoose();
|
||||
_ButtonsAdded = true;
|
||||
}
|
||||
|
||||
UpdateButtonPlayerDestination();
|
||||
UpdateButtonPlayerChoose();
|
||||
_UpdateButtonPlayerDestination();
|
||||
_UpdateButtonPlayerChoose();
|
||||
|
||||
UpdateButtonNext();
|
||||
_UpdateButtonNext();
|
||||
}
|
||||
|
||||
public override bool UpdateGame()
|
||||
@@ -261,25 +261,25 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
public override bool Draw()
|
||||
{
|
||||
base.Draw();
|
||||
if (chooseAvatarStatic.Visible)
|
||||
chooseAvatarStatic.Draw();
|
||||
if (_ChooseAvatarStatic.Visible)
|
||||
_ChooseAvatarStatic.Draw();
|
||||
return true;
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -290,23 +290,23 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -317,53 +317,53 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
_UpdateButtonPlayerChoose(_PlayerChooseButtonsOffset);
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -372,10 +372,10 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
visible = true;
|
||||
|
||||
for (int p = 0; p < Data.ScreenNames.ProfileIDs.Count; p++)
|
||||
for (int p = 0; p < _Data.ScreenNames.ProfileIDs.Count; p++)
|
||||
{
|
||||
//Don't show profile if is selected
|
||||
if (Data.ScreenNames.ProfileIDs[p] == i)
|
||||
if (_Data.ScreenNames.ProfileIDs[p] == i)
|
||||
{
|
||||
visible = false;
|
||||
break;
|
||||
@@ -383,82 +383,82 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
}
|
||||
}
|
||||
if (visible)
|
||||
PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||
_PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateButtonPlayerDestination()
|
||||
private void _UpdateButtonPlayerDestination()
|
||||
{
|
||||
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
||||
for (int i = 0; i < _PlayerDestinationButtons.Count; i++)
|
||||
{
|
||||
if (NumPlayer > i)
|
||||
if (_NumPlayer > 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 < NumPlayer; i++)
|
||||
for (int i = 0; i < _NumPlayer; i++)
|
||||
{
|
||||
if (i < Data.ScreenNames.ProfileIDs.Count)
|
||||
if (i < _Data.ScreenNames.ProfileIDs.Count)
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDs[i] != -1)
|
||||
if (_Data.ScreenNames.ProfileIDs[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.ProfileIDs[i]].Avatar.Texture;
|
||||
PlayerDestinationButtons[i].SelTexture = CBase.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDs[i]].Avatar.Texture;
|
||||
PlayerDestinationButtons[i].Text.Text = CBase.Profiles.GetProfiles()[Data.ScreenNames.ProfileIDs[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.ProfileIDs[i]].Avatar.Texture;
|
||||
_PlayerDestinationButtons[i].SelTexture = CBase.Profiles.GetProfiles()[_Data.ScreenNames.ProfileIDs[i]].Avatar.Texture;
|
||||
_PlayerDestinationButtons[i].Text.Text = CBase.Profiles.GetProfiles()[_Data.ScreenNames.ProfileIDs[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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateButtonNext()
|
||||
private void _UpdateButtonNext()
|
||||
{
|
||||
if (Data.ScreenNames.ProfileIDs.Count == NumPlayer)
|
||||
if (_Data.ScreenNames.ProfileIDs.Count == _NumPlayer)
|
||||
{
|
||||
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.ProfileIDs.Count < NumPlayer)
|
||||
if (_Data.ScreenNames.ProfileIDs.Count < _NumPlayer)
|
||||
{
|
||||
Data.ScreenNames.ProfileIDs.Add(PlayerChooseButtons[i].ProfileID);
|
||||
int added = Data.ScreenNames.ProfileIDs.Count - 1;
|
||||
UpdateButtonNext();
|
||||
_Data.ScreenNames.ProfileIDs.Add(_PlayerChooseButtons[i].ProfileID);
|
||||
int added = _Data.ScreenNames.ProfileIDs.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;
|
||||
}
|
||||
@@ -467,18 +467,18 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool OnRemove()
|
||||
private bool _OnRemove()
|
||||
{
|
||||
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
||||
for (int i = 0; i < _PlayerDestinationButtons.Count; i++)
|
||||
{
|
||||
if (PlayerDestinationButtons[i].Selected)
|
||||
if (_PlayerDestinationButtons[i].Selected)
|
||||
{
|
||||
if ((i + 1) <= Data.ScreenNames.ProfileIDs.Count)
|
||||
if ((i + 1) <= _Data.ScreenNames.ProfileIDs.Count)
|
||||
{
|
||||
Data.ScreenNames.ProfileIDs.RemoveAt(i);
|
||||
UpdateButtonNext();
|
||||
UpdateButtonPlayerDestination();
|
||||
UpdateButtonPlayerChoose();
|
||||
_Data.ScreenNames.ProfileIDs.RemoveAt(i);
|
||||
_UpdateButtonNext();
|
||||
_UpdateButtonPlayerDestination();
|
||||
_UpdateButtonPlayerChoose();
|
||||
CheckInteraction();
|
||||
return true;
|
||||
}
|
||||
@@ -487,18 +487,18 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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