PartyNames: Could change team/player-nums on name-selection now if allowed.
This commit is contained in:
1 parent
f5407f1815
commit
3f28d6405c
7 files changed
+169
-345
No files matched your search
@@ -34,7 +34,6 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
private int _NumPlayer = 4;
|
||||
private SDataFromScreen _Data;
|
||||
|
||||
public override void Init()
|
||||
@@ -45,6 +44,8 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
_Data = new SDataFromScreen();
|
||||
var names = new SFromScreenNames {FadeBack = false, ProfileIDs = new List<int>()};
|
||||
_Data.ScreenNames = names;
|
||||
|
||||
_AllowChangePlayerNum = false;
|
||||
}
|
||||
|
||||
public override void DataToScreen(object receivedData)
|
||||
@@ -54,7 +55,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
var config = (SDataToScreenNames)receivedData;
|
||||
_Data.ScreenNames.ProfileIDs = config.ProfileIDs ?? new List<int>();
|
||||
|
||||
_NumPlayer = config.NumPlayer;
|
||||
SetPartyModeData(config.NumPlayer);
|
||||
|
||||
while (_Data.ScreenNames.ProfileIDs.Count > _NumPlayer)
|
||||
_Data.ScreenNames.ProfileIDs.RemoveAt(_Data.ScreenNames.ProfileIDs.Count - 1);
|
||||
@@ -73,16 +74,18 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
|
||||
public override void Back()
|
||||
{
|
||||
List<int> ids = GetTeamIDs(0);
|
||||
_Data.ScreenNames.ProfileIDs = ids;
|
||||
SPartyNameOptions options = GetData();
|
||||
if(options.TeamList.Length == 1)
|
||||
_Data.ScreenNames.ProfileIDs = options.TeamList[0];
|
||||
_Data.ScreenNames.FadeBack = true;
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
}
|
||||
|
||||
public override void Next()
|
||||
{
|
||||
List<int> ids = GetTeamIDs(0);
|
||||
_Data.ScreenNames.ProfileIDs = ids;
|
||||
SPartyNameOptions options = GetData();
|
||||
if (options.TeamList.Length == 1)
|
||||
_Data.ScreenNames.ProfileIDs = options.TeamList[0];
|
||||
_Data.ScreenNames.FadeBack = false;
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
}
|
||||
|
||||
@@ -58,8 +58,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
#region ToScreen
|
||||
public struct SDataToScreenConfig
|
||||
{
|
||||
public int NumPlayerTeam1;
|
||||
public int NumPlayerTeam2;
|
||||
public int NumFields;
|
||||
public ESongSource SongSource;
|
||||
public int CategoryID;
|
||||
@@ -99,8 +97,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
public struct SFromScreenConfig
|
||||
{
|
||||
public int NumPlayerTeam1;
|
||||
public int NumPlayerTeam2;
|
||||
public int NumFields;
|
||||
public ESongSource SongSource;
|
||||
public int CategoryID;
|
||||
@@ -111,6 +107,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
public struct SFromScreenNames
|
||||
{
|
||||
public bool FadeToConfig;
|
||||
public int NumPlayerTeam1;
|
||||
public int NumPlayerTeam2;
|
||||
public List<int> ProfileIDsTeam1;
|
||||
public List<int> ProfileIDsTeam2;
|
||||
}
|
||||
@@ -255,8 +253,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
try
|
||||
{
|
||||
dataFrom = (SDataFromScreen)data;
|
||||
_GameData.NumPlayerTeam1 = dataFrom.ScreenConfig.NumPlayerTeam1;
|
||||
_GameData.NumPlayerTeam2 = dataFrom.ScreenConfig.NumPlayerTeam2;
|
||||
_GameData.NumFields = dataFrom.ScreenConfig.NumFields;
|
||||
_GameData.SongSource = dataFrom.ScreenConfig.SongSource;
|
||||
_GameData.CategoryID = dataFrom.ScreenConfig.CategoryID;
|
||||
@@ -281,6 +277,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
else
|
||||
{
|
||||
_GameData.Team = CBase.Game.GetRandom(100) < 50 ? 0 : 1;
|
||||
_GameData.NumPlayerTeam1 = dataFrom.ScreenNames.NumPlayerTeam1;
|
||||
_GameData.NumPlayerTeam2 = dataFrom.ScreenNames.NumPlayerTeam2;
|
||||
_GameData.ProfileIDsTeam1 = dataFrom.ScreenNames.ProfileIDsTeam1;
|
||||
_GameData.ProfileIDsTeam2 = dataFrom.ScreenNames.ProfileIDsTeam2;
|
||||
_Stage = EStage.Names;
|
||||
@@ -348,8 +346,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_Screens.TryGetValue("CPartyScreenTicTacToeConfig", out screen);
|
||||
if (screen != null)
|
||||
{
|
||||
_ToScreenConfig.NumPlayerTeam1 = _GameData.NumPlayerTeam1;
|
||||
_ToScreenConfig.NumPlayerTeam2 = _GameData.NumPlayerTeam2;
|
||||
_ToScreenConfig.NumFields = _GameData.NumFields;
|
||||
_ToScreenConfig.SongSource = _GameData.SongSource;
|
||||
_ToScreenConfig.CategoryID = _GameData.CategoryID;
|
||||
|
||||
@@ -34,8 +34,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
get { return 1; }
|
||||
}
|
||||
|
||||
private const string _SelectSlideNumPlayerTeam1 = "SelectSlideNumPlayerTeam1";
|
||||
private const string _SelectSlideNumPlayerTeam2 = "SelectSlideNumPlayerTeam2";
|
||||
private const string _SelectSlideNumFields = "SelectSlideNumFields";
|
||||
private const string _SelectSlideSongSource = "SelectSlideSongSource";
|
||||
private const string _SelectSlidePlaylist = "SelectSlidePlaylist";
|
||||
@@ -54,8 +52,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
_ThemeSelectSlides = new string[]
|
||||
{
|
||||
_SelectSlideNumPlayerTeam1, _SelectSlideNumPlayerTeam2, _SelectSlideNumFields, _SelectSlideSongSource, _SelectSlidePlaylist, _SelectSlideCategory,
|
||||
_SelectSlideGameMode
|
||||
_SelectSlideNumFields, _SelectSlideSongSource, _SelectSlidePlaylist, _SelectSlideCategory, _SelectSlideGameMode
|
||||
};
|
||||
_ThemeButtons = new string[] {_ButtonNext, _ButtonBack};
|
||||
|
||||
@@ -64,8 +61,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
PlaylistID = 0,
|
||||
NumFields = 9,
|
||||
NumPlayerTeam1 = 2,
|
||||
NumPlayerTeam2 = 2,
|
||||
GameMode = EPartyGameMode.TR_GAMEMODE_NORMAL,
|
||||
CategoryID = 0,
|
||||
SongSource = ESongSource.TR_ALLSONGS
|
||||
@@ -79,8 +74,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
{
|
||||
var config = (SDataToScreenConfig)receivedData;
|
||||
_Data.ScreenConfig.NumFields = config.NumFields;
|
||||
_Data.ScreenConfig.NumPlayerTeam1 = config.NumPlayerTeam1;
|
||||
_Data.ScreenConfig.NumPlayerTeam2 = config.NumPlayerTeam2;
|
||||
_Data.ScreenConfig.PlaylistID = config.PlaylistID;
|
||||
_Data.ScreenConfig.CategoryID = config.CategoryID;
|
||||
_Data.ScreenConfig.SongSource = config.SongSource;
|
||||
@@ -173,17 +166,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
private void _FillSlides()
|
||||
{
|
||||
// build num player slide (min player ... max player);
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam1].Clear();
|
||||
for (int i = _PartyMode.GetMinPlayer() / 2; i <= _PartyMode.GetMaxPlayer() / 2; i++)
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam1].AddValue(i.ToString());
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam1].Selection = _Data.ScreenConfig.NumPlayerTeam1 - (_PartyMode.GetMinPlayer() / 2);
|
||||
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam2].Clear();
|
||||
for (int i = _PartyMode.GetMinPlayer() / 2; i <= _PartyMode.GetMaxPlayer() / 2; i++)
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam2].AddValue(i.ToString());
|
||||
_SelectSlides[_SelectSlideNumPlayerTeam2].Selection = _Data.ScreenConfig.NumPlayerTeam2 - (_PartyMode.GetMinPlayer() / 2);
|
||||
|
||||
_SelectSlides[_SelectSlideNumFields].Clear();
|
||||
_SelectSlides[_SelectSlideNumFields].AddValue("9");
|
||||
_SelectSlides[_SelectSlideNumFields].AddValue("16");
|
||||
@@ -226,9 +208,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
private void _UpdateSlides()
|
||||
{
|
||||
_Data.ScreenConfig.NumPlayerTeam1 = _SelectSlides[_SelectSlideNumPlayerTeam1].Selection + (_PartyMode.GetMinPlayer() / 2);
|
||||
_Data.ScreenConfig.NumPlayerTeam2 = _SelectSlides[_SelectSlideNumPlayerTeam2].Selection + (_PartyMode.GetMinPlayer() / 2);
|
||||
|
||||
if (_SelectSlides[_SelectSlideNumFields].Selection == 0)
|
||||
_Data.ScreenConfig.NumFields = 9;
|
||||
else if (_SelectSlides[_SelectSlideNumFields].Selection == 1)
|
||||
|
||||
@@ -39,12 +39,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
private SDataFromScreen _Data;
|
||||
|
||||
private class CPlayerChooseButton
|
||||
{
|
||||
public CButton Button;
|
||||
public int ProfileID;
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
@@ -92,11 +86,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
public override void Back()
|
||||
{
|
||||
List<int>[] ids = GetTeamIDs();
|
||||
if(ids.Length == 2)
|
||||
SPartyNameOptions options = GetData();
|
||||
if(options.TeamList.Length == 2)
|
||||
{
|
||||
_Data.ScreenNames.ProfileIDsTeam1 = ids[0];
|
||||
_Data.ScreenNames.ProfileIDsTeam2 = ids[1];
|
||||
_Data.ScreenNames.ProfileIDsTeam1 = options.TeamList[0];
|
||||
_Data.ScreenNames.ProfileIDsTeam2 = options.TeamList[1];
|
||||
}
|
||||
if (options.NumPlayerTeams.Length == 2)
|
||||
{
|
||||
_Data.ScreenNames.NumPlayerTeam1 = options.NumPlayerTeams[0];
|
||||
_Data.ScreenNames.NumPlayerTeam2 = options.NumPlayerTeams[1];
|
||||
}
|
||||
_Data.ScreenNames.FadeToConfig = true;
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
@@ -104,11 +103,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
|
||||
public override void Next()
|
||||
{
|
||||
List<int>[] ids = GetTeamIDs();
|
||||
if (ids.Length == 2)
|
||||
SPartyNameOptions options = GetData();
|
||||
if (options.TeamList.Length == 2)
|
||||
{
|
||||
_Data.ScreenNames.ProfileIDsTeam1 = ids[0];
|
||||
_Data.ScreenNames.ProfileIDsTeam2 = ids[1];
|
||||
_Data.ScreenNames.ProfileIDsTeam1 = options.TeamList[0];
|
||||
_Data.ScreenNames.ProfileIDsTeam2 = options.TeamList[1];
|
||||
}
|
||||
if (options.NumPlayerTeams.Length == 2)
|
||||
{
|
||||
_Data.ScreenNames.NumPlayerTeam1 = options.NumPlayerTeams[0];
|
||||
_Data.ScreenNames.NumPlayerTeam2 = options.NumPlayerTeams[1];
|
||||
}
|
||||
_Data.ScreenNames.FadeToConfig = false;
|
||||
_PartyMode.DataFromScreen(ThemeName, _Data);
|
||||
|
||||
Reference in new issue
Block a user