diff --git a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml index 0caf0686..c87205b7 100644 --- a/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml +++ b/Output/PartyModes/Challenge/Screens/PartyScreenChallengeNames.xml @@ -172,6 +172,202 @@ 26 + + + Plus + + Plus + + 145 + 1200 + 0,00 + 40 + 40 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 27 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + + + + Minus + + Minus + + 145 + 1200 + 0,00 + 40 + 40 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 27 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + + + + Plus + + Plus + + 145 + 1200 + 0,00 + 40 + 40 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 27 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + + + + Minus + + Minus + + 145 + 1200 + 0,00 + 40 + 40 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 27 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + Invisible diff --git a/Output/PartyModes/Challenge/Textures/Minus.png b/Output/PartyModes/Challenge/Textures/Minus.png new file mode 100644 index 00000000..9bdede57 Binary files /dev/null and b/Output/PartyModes/Challenge/Textures/Minus.png differ diff --git a/Output/PartyModes/Challenge/Textures/Plus.png b/Output/PartyModes/Challenge/Textures/Plus.png new file mode 100644 index 00000000..5b813c53 Binary files /dev/null and b/Output/PartyModes/Challenge/Textures/Plus.png differ diff --git a/Output/PartyModes/Challenge/Textures/Skin.xml b/Output/PartyModes/Challenge/Textures/Skin.xml index 229c0284..b2ea588c 100644 --- a/Output/PartyModes/Challenge/Textures/Skin.xml +++ b/Output/PartyModes/Challenge/Textures/Skin.xml @@ -149,6 +149,8 @@ ScrollDown.png Invisible.png PlayerSelector.png + Plus.png + Minus.png [Blue]BG_Video.mp4 diff --git a/Output/PartyModes/TicTacToe/Screens/PartyScreenTicTacToeNames.xml b/Output/PartyModes/TicTacToe/Screens/PartyScreenTicTacToeNames.xml index 7a9c3fe5..00a64260 100644 --- a/Output/PartyModes/TicTacToe/Screens/PartyScreenTicTacToeNames.xml +++ b/Output/PartyModes/TicTacToe/Screens/PartyScreenTicTacToeNames.xml @@ -172,6 +172,202 @@ 26 + + + Plus + + Plus + + 145 + 1200 + 0,00 + 40 + 40 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 27 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + + + + Minus + + Minus + + 145 + 1200 + 0,00 + 40 + 40 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 27 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + + + + Plus + + Plus + + 145 + 1200 + 0,00 + 40 + 40 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 27 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + + + + Minus + + Minus + + 145 + 1200 + 0,00 + 40 + 40 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 27 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + Center + + + + Outline + + + + + + + + + + Invisible diff --git a/Output/PartyModes/TicTacToe/Textures/Minus.png b/Output/PartyModes/TicTacToe/Textures/Minus.png new file mode 100644 index 00000000..9bdede57 Binary files /dev/null and b/Output/PartyModes/TicTacToe/Textures/Minus.png differ diff --git a/Output/PartyModes/TicTacToe/Textures/Plus.png b/Output/PartyModes/TicTacToe/Textures/Plus.png new file mode 100644 index 00000000..5b813c53 Binary files /dev/null and b/Output/PartyModes/TicTacToe/Textures/Plus.png differ diff --git a/Output/PartyModes/TicTacToe/Textures/Skin.xml b/Output/PartyModes/TicTacToe/Textures/Skin.xml index 7cc7e4a2..9145b6bf 100644 --- a/Output/PartyModes/TicTacToe/Textures/Skin.xml +++ b/Output/PartyModes/TicTacToe/Textures/Skin.xml @@ -223,6 +223,8 @@ ScrollDown.png Invisible.png PlayerSelector.png + Plus.png + Minus.png [Blue]BG_Video.mp4 diff --git a/PartyModes/PartyModeTicTacToe/CPartyModeTicTacToe.cs b/PartyModes/PartyModeTicTacToe/CPartyModeTicTacToe.cs index d3628d3e..404ae1f5 100644 --- a/PartyModes/PartyModeTicTacToe/CPartyModeTicTacToe.cs +++ b/PartyModes/PartyModeTicTacToe/CPartyModeTicTacToe.cs @@ -135,6 +135,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe private const int _MinPlayer = 2; private const int _MaxTeams = 2; private const int _MinTeams = 2; + private const int _MinPlayerPerTeam = 1; + private const int _MaxPlayerPerTeam = 10; private const int _NumFields = 9; private enum EStage @@ -480,6 +482,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe return _MinTeams; } + public override int GetMinPlayerPerTeam() + { + return _MinPlayerPerTeam; + } + + public override int GetMaxPlayerPerTeam() + { + return _MaxPlayerPerTeam; + } + public override int GetMaxNumRounds() { return _NumFields; diff --git a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs index a54bb5a9..42497756 100644 --- a/VocaluxeLib/Menu/CMenuPartyNameSelection.cs +++ b/VocaluxeLib/Menu/CMenuPartyNameSelection.cs @@ -31,6 +31,9 @@ namespace VocaluxeLib.Menu protected int _NumTeams = -1; protected int _NumPlayer = -1; protected int[] _NumPlayerTeams; + protected bool _AllowChangePlayerNum = true; + protected bool _AllowChangeTeamNum = true; + protected bool _ChangePlayerNumDynamic = true; private int _CurrentTeam = 0; private bool _AvatarsChanged; @@ -48,6 +51,10 @@ namespace VocaluxeLib.Menu private const string _ButtonNext = "ButtonNext"; private const string _ButtonBack = "ButtonBack"; + private const string _ButtonIncreaseTeams = "ButtonIncreaseTeams"; + private const string _ButtonDecreaseTeams = "ButtonDecreaseTeams"; + private const string _ButtonIncreasePlayer = "ButtonIncreasePlayer"; + private const string _ButtonDecreasePlayer = "ButtonDecreasePlayer"; private const string _SelectSlideTeams = "SelectSlideTeams"; private const string _SelectSlidePlayer = "SelectSlidePlayer"; private const string _NameSelection = "NameSelection"; @@ -59,7 +66,7 @@ namespace VocaluxeLib.Menu base.Init(); _Teams = _PartyMode.GetMinTeams() > 0; - _ThemeButtons = new string[] { _ButtonBack, _ButtonNext }; + _ThemeButtons = new string[] { _ButtonBack, _ButtonNext, _ButtonIncreaseTeams, _ButtonDecreaseTeams, _ButtonIncreasePlayer, _ButtonDecreasePlayer }; _ThemeSelectSlides = new string[] { _SelectSlideTeams, _SelectSlidePlayer }; _ThemeNameSelections = new string[] { _NameSelection }; @@ -120,8 +127,12 @@ namespace VocaluxeLib.Menu _AddPlayer(_CurrentTeam, _SelectedProfileID); } //Started selecting with 'P' - if (_SelectingFast &&_SelectSlides[_SelectSlidePlayer].NumValues == _NumPlayerTeams[_CurrentTeam]) + if (_SelectingFast) { + if (!_ChangePlayerNumDynamic && _TeamList[_CurrentTeam].Count == _NumPlayerTeams[_CurrentTeam]) resetSelection = true; + else if (_TeamList[_CurrentTeam].Count == _PartyMode.GetMaxPlayerPerTeam()) + resetSelection = true; + } else if(!_SelectingFast) resetSelection = true; break; @@ -166,6 +177,18 @@ namespace VocaluxeLib.Menu if (_Buttons[_ButtonNext].Selected) Next(); + if (_Buttons[_ButtonIncreaseTeams].Selected) + IncreaseTeamNum(); + + if (_Buttons[_ButtonDecreaseTeams].Selected) + DecreaseTeamNum(); + + if (_Buttons[_ButtonIncreasePlayer].Selected) + IncreasePlayerNum(_CurrentTeam); + + if (_Buttons[_ButtonDecreasePlayer].Selected) + DecreasePlayerNum(_CurrentTeam); + break; case Keys.Delete: @@ -272,7 +295,9 @@ namespace VocaluxeLib.Menu _AddPlayer(_CurrentTeam, _SelectedProfileID); - if (_SelectSlides[_SelectSlidePlayer].NumValues == _NumPlayerTeams[_CurrentTeam]) + if (!_ChangePlayerNumDynamic && _TeamList[_CurrentTeam].Count == _NumPlayerTeams[_CurrentTeam]) + stopSelectingFast = true; + else if (_TeamList[_CurrentTeam].Count == _PartyMode.GetMaxPlayerPerTeam()) stopSelectingFast = true; } else @@ -288,6 +313,18 @@ namespace VocaluxeLib.Menu if (_Buttons[_ButtonNext].Selected) Next(); + if (_Buttons[_ButtonIncreaseTeams].Selected) + IncreaseTeamNum(); + + if (_Buttons[_ButtonDecreaseTeams].Selected) + DecreaseTeamNum(); + + if (_Buttons[_ButtonIncreasePlayer].Selected) + IncreasePlayerNum(_CurrentTeam); + + if (_Buttons[_ButtonDecreasePlayer].Selected) + DecreasePlayerNum(_CurrentTeam); + if (_SelectSlides[_SelectSlideTeams].Selected) _OnChangeTeamSlide(); @@ -327,7 +364,9 @@ namespace VocaluxeLib.Menu if (mouseEvent.MB && _SelectingFast) { - if (_SelectSlides[_SelectSlidePlayer].NumValues == _NumPlayerTeams[_CurrentTeam]) + if (!_ChangePlayerNumDynamic && _TeamList[_CurrentTeam].Count == _NumPlayerTeams[_CurrentTeam]) + stopSelectingFast = true; + else if (_TeamList[_CurrentTeam].Count == _PartyMode.GetMaxPlayerPerTeam()) stopSelectingFast = true; } else if (mouseEvent.MB) @@ -364,6 +403,10 @@ namespace VocaluxeLib.Menu _SelectSlides[_SelectSlidePlayer].WithTextures = true; _SelectSlides[_SelectSlidePlayer].SelectionByHover = true; _SelectSlides[_SelectSlideTeams].Visible = _Teams; + _Buttons[_ButtonIncreaseTeams].Visible = _AllowChangePlayerNum && _Teams; + _Buttons[_ButtonDecreaseTeams].Visible = _AllowChangePlayerNum && _Teams; + _Buttons[_ButtonIncreasePlayer].Visible = _AllowChangePlayerNum; + _Buttons[_ButtonDecreasePlayer].Visible = _AllowChangePlayerNum; } public override bool UpdateGame() @@ -405,6 +448,72 @@ namespace VocaluxeLib.Menu { return _TeamList; } + + public void IncreaseTeamNum() + { + if (!_AllowChangeTeamNum) + return; + + if (_NumTeams + 1 <= _PartyMode.GetMaxTeams()) + { + _NumTeams++; + int[] numPlayerTeams = _NumPlayerTeams; + List[] teamList = _TeamList; + _NumPlayerTeams = new int[_NumTeams]; + _TeamList = new List[_NumTeams]; + for (int i = 0; i < _NumPlayerTeams.Length; i++) + { + if (i < numPlayerTeams.Length) + { + _NumPlayerTeams[i] = numPlayerTeams[i]; + _TeamList[i] = teamList[i]; + } + else + { + _NumPlayerTeams[i] = _NumPlayer; + _TeamList[i] = new List(); + } + } + } + } + + public void DecreaseTeamNum() + { + if (!_AllowChangeTeamNum) + return; + + if (_NumTeams - 1 >= _PartyMode.GetMinTeams()) + { + _NumTeams--; + } + } + + public void IncreasePlayerNum(int team) + { + if (!_AllowChangePlayerNum) + return; + if (_NumPlayerTeams.Length < team) + { + if (_NumPlayerTeams[team] + 1 <= _PartyMode.GetMaxPlayerPerTeam()) + _NumPlayerTeams[team]++; + _UpdatePlayerSlide(); + } + } + + public void DecreasePlayerNum(int team) + { + if (!_AllowChangePlayerNum) + return; + if (_NumPlayerTeams.Length < team) + { + if (_NumPlayerTeams[team] - 1 >= _PartyMode.GetMinPlayerPerTeam()) + _NumPlayerTeams[team]--; + if (_TeamList[team].Count > _NumPlayerTeams[team]) + _RemovePlayerByIndex(team, _NumPlayerTeams[team] - 1); + _UpdatePlayerSlide(); + } + } + #region private methods private void _OnProfileChanged(EProfileChangedFlags flags) @@ -471,7 +580,9 @@ namespace VocaluxeLib.Menu private void _AddPlayer(int team, int profileID) { - if (_NumPlayerTeams[team] == _TeamList[team].Count) + if (_NumPlayerTeams[team] == _TeamList[team].Count && !_ChangePlayerNumDynamic) + return; + else if (_NumPlayerTeams[team] == _PartyMode.GetMaxPlayerPerTeam()) return; _NameSelections[_NameSelection].UseProfile(profileID); diff --git a/VocaluxeLib/PartyModes/CPartyMode.cs b/VocaluxeLib/PartyModes/CPartyMode.cs index 370d125a..5ef78a60 100644 --- a/VocaluxeLib/PartyModes/CPartyMode.cs +++ b/VocaluxeLib/PartyModes/CPartyMode.cs @@ -95,6 +95,16 @@ namespace VocaluxeLib.PartyModes return 0; } + public virtual int GetMinPlayerPerTeam() + { + return GetMinPlayer(); + } + + public virtual int GetMaxPlayerPerTeam() + { + return GetMaxPlayer(); + } + public virtual int GetMaxNumRounds() { return 1; diff --git a/VocaluxeLib/PartyModes/IPartyMode.cs b/VocaluxeLib/PartyModes/IPartyMode.cs index e720d096..d71e8135 100644 --- a/VocaluxeLib/PartyModes/IPartyMode.cs +++ b/VocaluxeLib/PartyModes/IPartyMode.cs @@ -101,6 +101,8 @@ namespace VocaluxeLib.PartyModes int GetMinPlayer(); int GetMaxTeams(); int GetMinTeams(); + int GetMinPlayerPerTeam(); + int GetMaxPlayerPerTeam(); int GetMaxNumRounds(); string GetFolder(); void SetFolder(string folder);