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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user