Auto cleanup of party modes
This commit is contained in:
1 parent
91e6d4901b
commit
cd62c3cd88
16 files changed
+456
-554
No files matched your search
@@ -5,15 +5,15 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
{
|
{
|
||||||
public class ChallengeRounds
|
public class ChallengeRounds
|
||||||
{
|
{
|
||||||
private Random _Rand;
|
private readonly Random _Rand;
|
||||||
private int _NumPlayer;
|
private readonly int _NumPlayer;
|
||||||
|
|
||||||
public List<Combination> Rounds;
|
public List<Combination> Rounds;
|
||||||
|
|
||||||
public ChallengeRounds(int NumRounds, int NumPlayer, int NumPlayerAtOnce)
|
public ChallengeRounds(int NumRounds, int NumPlayer, int NumPlayerAtOnce)
|
||||||
{
|
{
|
||||||
Rounds = new List<Combination>();
|
Rounds = new List<Combination>();
|
||||||
_Rand = new Random(System.DateTime.Now.Millisecond);
|
_Rand = new Random(DateTime.Now.Millisecond);
|
||||||
|
|
||||||
if (NumPlayerAtOnce < 1 || NumRounds < 1 || NumPlayer == 0)
|
if (NumPlayerAtOnce < 1 || NumRounds < 1 || NumPlayer == 0)
|
||||||
_NumPlayer = 0;
|
_NumPlayer = 0;
|
||||||
@@ -38,26 +38,19 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
Rounds.Add(Combinations.GetNextCombination(null));
|
Rounds.Add(Combinations.GetNextCombination(null));
|
||||||
|
|
||||||
for (int i = 1; i < NumRounds; i++)
|
for (int i = 1; i < NumRounds; i++)
|
||||||
{
|
|
||||||
|
|
||||||
Rounds.Add(Combinations.GetNextCombination(GetPlayerDemand(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++)
|
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)
|
foreach (int PlayerIndex in Rounds[i].Player)
|
||||||
{
|
|
||||||
NumPlayed[PlayerIndex]++;
|
NumPlayed[PlayerIndex]++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int max = 0;
|
int max = 0;
|
||||||
@@ -92,7 +85,6 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
last.Add(i);
|
last.Add(i);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,10 +118,10 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
|
|
||||||
class Combinations
|
class Combinations
|
||||||
{
|
{
|
||||||
private List<Combination> _Combs;
|
private readonly List<Combination> _Combs;
|
||||||
private Random _Rand;
|
private readonly Random _Rand;
|
||||||
private int _NumPlayer;
|
private readonly int _NumPlayer;
|
||||||
private int _NumMics;
|
private readonly int _NumMics;
|
||||||
|
|
||||||
public Combinations(int NumPlayer, int NumMics, Random Rand)
|
public Combinations(int NumPlayer, int NumMics, Random Rand)
|
||||||
{
|
{
|
||||||
@@ -147,9 +139,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
Combination combs = new Combination();
|
Combination combs = new Combination();
|
||||||
|
|
||||||
if (_NumPlayer == _NumMics)
|
if (_NumPlayer == _NumMics)
|
||||||
{
|
|
||||||
return _Combs[0];
|
return _Combs[0];
|
||||||
}
|
|
||||||
|
|
||||||
//filter against PlayerNrDemand
|
//filter against PlayerNrDemand
|
||||||
List<Combination> combsFiltered = new List<Combination>();
|
List<Combination> combsFiltered = new List<Combination>();
|
||||||
@@ -176,18 +166,14 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
if (combsFiltered.Count == 0)
|
if (combsFiltered.Count == 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _Combs.Count; i++)
|
for (int i = 0; i < _Combs.Count; i++)
|
||||||
{
|
|
||||||
combsFiltered.Add(_Combs[i]);
|
combsFiltered.Add(_Combs[i]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int num = combsFiltered.Count;
|
int num = combsFiltered.Count;
|
||||||
int rand = _Rand.Next(num);
|
int rand = _Rand.Next(num);
|
||||||
Combination c = new Combination();
|
Combination c = new Combination();
|
||||||
for (int i = 0; i < combsFiltered[rand].Player.Count; i++)
|
for (int i = 0; i < combsFiltered[rand].Player.Count; i++)
|
||||||
{
|
|
||||||
c.Player.Add(combsFiltered[rand].Player[i]);
|
c.Player.Add(combsFiltered[rand].Player[i]);
|
||||||
}
|
|
||||||
_Combs.Remove(combsFiltered[rand]);
|
_Combs.Remove(combsFiltered[rand]);
|
||||||
|
|
||||||
return combsFiltered[rand];
|
return combsFiltered[rand];
|
||||||
@@ -206,9 +192,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
for (int j = 0; j < _NumPlayer; j++)
|
for (int j = 0; j < _NumPlayer; j++)
|
||||||
{
|
{
|
||||||
if ((i & (1 << j)) > 0)
|
if ((i & (1 << j)) > 0)
|
||||||
{
|
|
||||||
c.Player.Add(j);
|
c.Player.Add(j);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c.Player.Count == _NumMics)
|
if (c.Player.Count == _NumMics)
|
||||||
@@ -240,9 +224,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
foreach (int p in PlayerIndices)
|
foreach (int p in PlayerIndices)
|
||||||
{
|
|
||||||
result &= IsAvailable(p);
|
result &= IsAvailable(p);
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,9 +232,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
foreach (int p in PlayerIndices)
|
foreach (int p in PlayerIndices)
|
||||||
{
|
|
||||||
result |= IsAvailable(p);
|
result |= IsAvailable(p);
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -7,30 +7,29 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
public class PartyScreenChallengeConfig : CMenuParty
|
public class PartyScreenChallengeConfig : CMenuParty
|
||||||
{
|
{
|
||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion { get { return 1; } }
|
protected override int _ScreenVersion
|
||||||
|
{
|
||||||
|
get { return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
const string SelectSlideNumPlayers = "SelectSlideNumPlayers";
|
private const string SelectSlideNumPlayers = "SelectSlideNumPlayers";
|
||||||
const string SelectSlideNumMics = "SelectSlideNumMics";
|
private const string SelectSlideNumMics = "SelectSlideNumMics";
|
||||||
const string SelectSlideNumRounds = "SelectSlideNumRounds";
|
private const string SelectSlideNumRounds = "SelectSlideNumRounds";
|
||||||
const string ButtonNext = "ButtonNext";
|
private const string ButtonNext = "ButtonNext";
|
||||||
const string ButtonBack = "ButtonBack";
|
private const string ButtonBack = "ButtonBack";
|
||||||
|
|
||||||
private int _MaxNumMics = 2;
|
private int _MaxNumMics = 2;
|
||||||
private int _MaxNumRounds = 100;
|
private int _MaxNumRounds = 100;
|
||||||
private int _RoundSteps = 1;
|
private int _RoundSteps = 1;
|
||||||
|
|
||||||
DataFromScreen Data;
|
private DataFromScreen Data;
|
||||||
|
|
||||||
public PartyScreenChallengeConfig()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|
||||||
_ThemeSelectSlides = new string[] { SelectSlideNumPlayers, SelectSlideNumMics, SelectSlideNumRounds };
|
_ThemeSelectSlides = new[] {SelectSlideNumPlayers, SelectSlideNumMics, SelectSlideNumRounds};
|
||||||
_ThemeButtons = new string[] { ButtonNext, ButtonBack };
|
_ThemeButtons = new[] {ButtonNext, ButtonBack};
|
||||||
|
|
||||||
Data = new DataFromScreen();
|
Data = new DataFromScreen();
|
||||||
FromScreenConfig config = new FromScreenConfig();
|
FromScreenConfig config = new FromScreenConfig();
|
||||||
@@ -42,7 +41,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
|
|
||||||
public override void LoadTheme(string XmlPath)
|
public override void LoadTheme(string XmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DataToScreen(object ReceivedData)
|
public override void DataToScreen(object ReceivedData)
|
||||||
@@ -58,19 +57,16 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CBase.Log.LogError("Error in party mode screen challenge config. Can't cast received data from game mode " + ThemeName + ". " + e.Message);;
|
CBase.Log.LogError("Error in party mode screen challenge config. Can't cast received data from game mode " + ThemeName + ". " + e.Message);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
|
|
||||||
if (KeyEvent.KeyPressed)
|
if (KeyEvent.KeyPressed) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (KeyEvent.Key)
|
switch (KeyEvent.Key)
|
||||||
@@ -117,9 +113,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
|
||||||
Back();
|
Back();
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -153,9 +147,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
// build num player slide (min player ... max player);
|
// build num player slide (min player ... max player);
|
||||||
SelectSlides[SelectSlideNumPlayers].Clear();
|
SelectSlides[SelectSlideNumPlayers].Clear();
|
||||||
for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++)
|
for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++)
|
||||||
{
|
|
||||||
SelectSlides[SelectSlideNumPlayers].AddValue(i.ToString());
|
SelectSlides[SelectSlideNumPlayers].AddValue(i.ToString());
|
||||||
}
|
|
||||||
SelectSlides[SelectSlideNumPlayers].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
|
SelectSlides[SelectSlideNumPlayers].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
|
||||||
|
|
||||||
UpdateMicsAtOnce();
|
UpdateMicsAtOnce();
|
||||||
@@ -178,9 +170,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
{
|
{
|
||||||
int num = CHelper.nCk(Data.ScreenConfig.NumPlayer, Data.ScreenConfig.NumPlayerAtOnce);
|
int num = CHelper.nCk(Data.ScreenConfig.NumPlayer, Data.ScreenConfig.NumPlayerAtOnce);
|
||||||
while (num > _MaxNumRounds)
|
while (num > _MaxNumRounds)
|
||||||
{
|
|
||||||
num -= _RoundSteps;
|
num -= _RoundSteps;
|
||||||
}
|
|
||||||
Data.ScreenConfig.NumRounds = num;
|
Data.ScreenConfig.NumRounds = num;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,9 +190,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
// build mics at once slide
|
// build mics at once slide
|
||||||
SelectSlides[SelectSlideNumMics].Clear();
|
SelectSlides[SelectSlideNumMics].Clear();
|
||||||
for (int i = 1; i <= MaxNum; i++)
|
for (int i = 1; i <= MaxNum; i++)
|
||||||
{
|
|
||||||
SelectSlides[SelectSlideNumMics].AddValue(i.ToString());
|
SelectSlides[SelectSlideNumMics].AddValue(i.ToString());
|
||||||
}
|
|
||||||
SelectSlides[SelectSlideNumMics].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
|
SelectSlides[SelectSlideNumMics].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,9 +199,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
// build num rounds slide
|
// build num rounds slide
|
||||||
SelectSlides[SelectSlideNumRounds].Clear();
|
SelectSlides[SelectSlideNumRounds].Clear();
|
||||||
for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps)
|
for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps)
|
||||||
{
|
|
||||||
SelectSlides[SelectSlideNumRounds].AddValue(i.ToString());
|
SelectSlides[SelectSlideNumRounds].AddValue(i.ToString());
|
||||||
}
|
|
||||||
SelectSlides[SelectSlideNumRounds].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1;
|
SelectSlides[SelectSlideNumRounds].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,41 +22,43 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
public List<CText> TextScores;
|
public List<CText> TextScores;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class PartyScreenChallengeMain : CMenuParty
|
public class PartyScreenChallengeMain : CMenuParty
|
||||||
{
|
{
|
||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion { get { return 1; } }
|
protected override int _ScreenVersion
|
||||||
|
{
|
||||||
|
get { return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
const string TextPosition = "TextPosition";
|
private const string TextPosition = "TextPosition";
|
||||||
const string TextPlayerName = "TextPlayerName";
|
private const string TextPlayerName = "TextPlayerName";
|
||||||
const string TextNumPlayed = "TextNumPlayed";
|
private const string TextNumPlayed = "TextNumPlayed";
|
||||||
const string TextWon = "TextWon";
|
private const string TextWon = "TextWon";
|
||||||
const string TextSingPoints = "TextSingPoints";
|
private const string TextSingPoints = "TextSingPoints";
|
||||||
const string TextGamePoints = "TextGamePoints";
|
private const string TextGamePoints = "TextGamePoints";
|
||||||
const string TextNextPlayer = "TextNextPlayer";
|
private const string TextNextPlayer = "TextNextPlayer";
|
||||||
const string TextPopupReallyExit = "TextPopupReallyExit";
|
private const string TextPopupReallyExit = "TextPopupReallyExit";
|
||||||
const string TextRoundPlayer = "TextRoundPlayer";
|
private const string TextRoundPlayer = "TextRoundPlayer";
|
||||||
const string TextRoundScore = "TextRoundScore";
|
private const string TextRoundScore = "TextRoundScore";
|
||||||
const string TextRoundNumber = "TextRoundNumber";
|
private const string TextRoundNumber = "TextRoundNumber";
|
||||||
const string TextFinishMessage = "TextFinishMessage";
|
private const string TextFinishMessage = "TextFinishMessage";
|
||||||
const string TextFinishPlayerWin = "TextFinishPlayerWin";
|
private const string TextFinishPlayerWin = "TextFinishPlayerWin";
|
||||||
const string TextNextPlayerMessage = "TextNextPlayerMessage";
|
private const string TextNextPlayerMessage = "TextNextPlayerMessage";
|
||||||
|
|
||||||
const string ButtonNextRound = "ButtonNextRound";
|
private const string ButtonNextRound = "ButtonNextRound";
|
||||||
const string ButtonBack = "ButtonBack";
|
private const string ButtonBack = "ButtonBack";
|
||||||
const string ButtonExit = "ButtonExit";
|
private const string ButtonExit = "ButtonExit";
|
||||||
const string ButtonPopupYes = "ButtonPopupYes";
|
private const string ButtonPopupYes = "ButtonPopupYes";
|
||||||
const string ButtonPopupNo = "ButtonPopupNo";
|
private const string ButtonPopupNo = "ButtonPopupNo";
|
||||||
const string ButtonPlayerScrollUp = "ButtonPlayerScrollUp";
|
private const string ButtonPlayerScrollUp = "ButtonPlayerScrollUp";
|
||||||
const string ButtonPlayerScrollDown = "ButtonPlayerScrollDown";
|
private const string ButtonPlayerScrollDown = "ButtonPlayerScrollDown";
|
||||||
const string ButtonRoundsScrollUp = "ButtonRoundsScrollUp";
|
private const string ButtonRoundsScrollUp = "ButtonRoundsScrollUp";
|
||||||
const string ButtonRoundsScrollDown = "ButtonRoundsScrollDown";
|
private const string ButtonRoundsScrollDown = "ButtonRoundsScrollDown";
|
||||||
|
|
||||||
const string StaticPopupBG = "StaticPopupBG";
|
private const string StaticPopupBG = "StaticPopupBG";
|
||||||
const string StaticNextPlayer = "StaticNextPlayer";
|
private const string StaticNextPlayer = "StaticNextPlayer";
|
||||||
|
|
||||||
private bool ExitPopupVisible = false;
|
private bool ExitPopupVisible;
|
||||||
|
|
||||||
private DataFromScreen Data;
|
private DataFromScreen Data;
|
||||||
private DataToScreenMain GameState;
|
private DataToScreenMain GameState;
|
||||||
@@ -68,8 +70,8 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
|
|
||||||
private SRectF RoundsTableScrollArea;
|
private SRectF RoundsTableScrollArea;
|
||||||
private SRectF PlayerTableScrollArea;
|
private SRectF PlayerTableScrollArea;
|
||||||
private int RoundsTableOffset = 0;
|
private int RoundsTableOffset;
|
||||||
private int PlayerTableOffset = 0;
|
private int PlayerTableOffset;
|
||||||
private int NumPlayerVisible = 10;
|
private int NumPlayerVisible = 10;
|
||||||
private int NumRoundsVisible = 3;
|
private int NumRoundsVisible = 3;
|
||||||
|
|
||||||
@@ -83,14 +85,19 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|
||||||
_ThemeTexts = new string[] { TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextNextPlayer, TextPopupReallyExit, TextRoundNumber, TextRoundPlayer, TextRoundScore, TextFinishMessage, TextFinishPlayerWin, TextNextPlayerMessage };
|
_ThemeTexts = new[]
|
||||||
_ThemeButtons = new string[] { ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo, ButtonPlayerScrollDown, ButtonPlayerScrollUp, ButtonRoundsScrollDown, ButtonRoundsScrollUp };
|
{
|
||||||
_ThemeStatics = new string[] { StaticPopupBG, StaticNextPlayer };
|
TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextNextPlayer, TextPopupReallyExit, TextRoundNumber, TextRoundPlayer,
|
||||||
|
TextRoundScore, TextFinishMessage, TextFinishPlayerWin, TextNextPlayerMessage
|
||||||
|
};
|
||||||
|
_ThemeButtons = new[]
|
||||||
|
{ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo, ButtonPlayerScrollDown, ButtonPlayerScrollUp, ButtonRoundsScrollDown, ButtonRoundsScrollUp};
|
||||||
|
_ThemeStatics = new[] {StaticPopupBG, StaticNextPlayer};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LoadTheme(string XmlPath)
|
public override void LoadTheme(string XmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
|
|
||||||
GameState = new DataToScreenMain();
|
GameState = new DataToScreenMain();
|
||||||
BuildPlayerTable();
|
BuildPlayerTable();
|
||||||
@@ -118,19 +125,16 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CBase.Log.LogError("Error in party mode screen challenge main. Can't cast received data from game mode " + ThemeName + ". " + e.Message); ;
|
CBase.Log.LogError("Error in party mode screen challenge main. Can't cast received data from game mode " + ThemeName + ". " + e.Message);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
|
|
||||||
if (KeyEvent.KeyPressed)
|
if (KeyEvent.KeyPressed) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (KeyEvent.Key)
|
switch (KeyEvent.Key)
|
||||||
@@ -138,10 +142,12 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
case Keys.Back:
|
case Keys.Back:
|
||||||
case Keys.Escape:
|
case Keys.Escape:
|
||||||
if (!ExitPopupVisible)
|
if (!ExitPopupVisible)
|
||||||
|
{
|
||||||
if (GameState.CurrentRoundNr == 1)
|
if (GameState.CurrentRoundNr == 1)
|
||||||
Back();
|
Back();
|
||||||
else
|
else
|
||||||
ShowPopup(true);
|
ShowPopup(true);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ShowPopup(false);
|
ShowPopup(false);
|
||||||
break;
|
break;
|
||||||
@@ -212,19 +218,21 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
{
|
||||||
if (!ExitPopupVisible)
|
if (!ExitPopupVisible)
|
||||||
|
{
|
||||||
if (GameState.CurrentRoundNr == 1)
|
if (GameState.CurrentRoundNr == 1)
|
||||||
Back();
|
Back();
|
||||||
else
|
else
|
||||||
ShowPopup(true);
|
ShowPopup(true);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ShowPopup(false);
|
ShowPopup(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MouseEvent.Wheel != 0)
|
if (MouseEvent.Wheel != 0)
|
||||||
{
|
{
|
||||||
if(CHelper.IsInBounds(RoundsTableScrollArea, MouseEvent))
|
if (CHelper.IsInBounds(RoundsTableScrollArea, MouseEvent))
|
||||||
ScrollRoundsTable(MouseEvent.Wheel);
|
ScrollRoundsTable(MouseEvent.Wheel);
|
||||||
if(CHelper.IsInBounds(PlayerTableScrollArea, MouseEvent))
|
if (CHelper.IsInBounds(PlayerTableScrollArea, MouseEvent))
|
||||||
ScrollPlayerTable(MouseEvent.Wheel);
|
ScrollPlayerTable(MouseEvent.Wheel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,7 +330,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
|
|
||||||
private void UpdateNextPlayerPositions()
|
private void UpdateNextPlayerPositions()
|
||||||
{
|
{
|
||||||
float x = CBase.Settings.GetRenderW()/2 - ((GameState.NumPlayerAtOnce * Statics[StaticNextPlayer].Rect.W) + ((GameState.NumPlayerAtOnce-1) * 15))/2;
|
float x = CBase.Settings.GetRenderW() / 2 - ((GameState.NumPlayerAtOnce * Statics[StaticNextPlayer].Rect.W) + ((GameState.NumPlayerAtOnce - 1) * 15)) / 2;
|
||||||
float static_y = 590;
|
float static_y = 590;
|
||||||
float text_y = 550;
|
float text_y = 550;
|
||||||
for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
|
for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
|
||||||
@@ -446,7 +454,8 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
for (int column = row * NumPlayerInOneRow; column < num; column++)
|
for (int column = row * NumPlayerInOneRow; column < num; column++)
|
||||||
{
|
{
|
||||||
//Player
|
//Player
|
||||||
float _x = x + 15 + (CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) + ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2;
|
float _x = x + 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;
|
float maxw = ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2 - 5;
|
||||||
RoundsTable[round].TextPlayer[column].X = _x;
|
RoundsTable[round].TextPlayer[column].X = _x;
|
||||||
RoundsTable[round].TextPlayer[column].Y = y;
|
RoundsTable[round].TextPlayer[column].Y = y;
|
||||||
@@ -469,7 +478,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
SProfile[] profile = CBase.Profiles.GetProfiles();
|
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)
|
||||||
{
|
{
|
||||||
@@ -566,7 +575,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
{
|
{
|
||||||
TableRow row = PlayerTable[i];
|
TableRow row = PlayerTable[i];
|
||||||
|
|
||||||
if (i+PlayerTableOffset < GameState.ResultTable.Count)
|
if (i + PlayerTableOffset < GameState.ResultTable.Count)
|
||||||
{
|
{
|
||||||
row.Pos.Visible = true;
|
row.Pos.Visible = true;
|
||||||
row.Name.Visible = true;
|
row.Name.Visible = true;
|
||||||
@@ -576,11 +585,11 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
row.GamePoints.Visible = true;
|
row.GamePoints.Visible = true;
|
||||||
|
|
||||||
row.Pos.Text = GameState.ResultTable[i + PlayerTableOffset].Position.ToString() + ".";
|
row.Pos.Text = GameState.ResultTable[i + PlayerTableOffset].Position.ToString() + ".";
|
||||||
row.Name.Text = profiles[GameState.ResultTable[i+PlayerTableOffset].PlayerID].PlayerName;
|
row.Name.Text = profiles[GameState.ResultTable[i + PlayerTableOffset].PlayerID].PlayerName;
|
||||||
row.Rounds.Text = GameState.ResultTable[i+PlayerTableOffset].NumRounds.ToString();
|
row.Rounds.Text = GameState.ResultTable[i + PlayerTableOffset].NumRounds.ToString();
|
||||||
row.Won.Text = GameState.ResultTable[i+PlayerTableOffset].NumWon.ToString();
|
row.Won.Text = GameState.ResultTable[i + PlayerTableOffset].NumWon.ToString();
|
||||||
row.SingPoints.Text = GameState.ResultTable[i+PlayerTableOffset].NumSingPoints.ToString();
|
row.SingPoints.Text = GameState.ResultTable[i + PlayerTableOffset].NumSingPoints.ToString();
|
||||||
row.GamePoints.Text = GameState.ResultTable[i+PlayerTableOffset].NumGamePoints.ToString();
|
row.GamePoints.Text = GameState.ResultTable[i + PlayerTableOffset].NumGamePoints.ToString();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,12 +8,15 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
public class PartyScreenChallengeNames : CMenuParty
|
public class PartyScreenChallengeNames : CMenuParty
|
||||||
{
|
{
|
||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion { get { return 1; } }
|
protected override int _ScreenVersion
|
||||||
|
{
|
||||||
|
get { return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
const string ButtonNext = "ButtonNext";
|
private const string ButtonNext = "ButtonNext";
|
||||||
const string ButtonBack = "ButtonBack";
|
private const string ButtonBack = "ButtonBack";
|
||||||
const string ButtonPlayerDestination = "ButtonPlayerDestination";
|
private const string ButtonPlayerDestination = "ButtonPlayerDestination";
|
||||||
const string ButtonPlayerChoose = "ButtonPlayerChoose";
|
private const string ButtonPlayerChoose = "ButtonPlayerChoose";
|
||||||
|
|
||||||
private List<CPlayerChooseButton> PlayerChooseButtons;
|
private List<CPlayerChooseButton> PlayerChooseButtons;
|
||||||
private List<CButton> PlayerDestinationButtons;
|
private List<CButton> PlayerDestinationButtons;
|
||||||
@@ -35,11 +38,11 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
private int PlayerChooseButtonsOffset = 0;
|
private int PlayerChooseButtonsOffset = 0;
|
||||||
|
|
||||||
private CStatic chooseAvatarStatic;
|
private CStatic chooseAvatarStatic;
|
||||||
private bool SelectingMouseActive = false;
|
private bool SelectingMouseActive;
|
||||||
private int OldMouseX = 0;
|
private int OldMouseX;
|
||||||
private int OldMouseY = 0;
|
private int OldMouseY;
|
||||||
private int SelectedPlayerNr = -1;
|
private int SelectedPlayerNr = -1;
|
||||||
private bool ButtonsAdded = false;
|
private bool ButtonsAdded;
|
||||||
|
|
||||||
private int NumPlayer = 4;
|
private int NumPlayer = 4;
|
||||||
|
|
||||||
@@ -51,10 +54,6 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
public int ProfileID;
|
public int ProfileID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartyScreenChallengeNames()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
@@ -67,7 +66,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
Data.ScreenNames.ProfileIDs = new List<int>();
|
Data.ScreenNames.ProfileIDs = new List<int>();
|
||||||
|
|
||||||
List<string> buttons = new List<string>();
|
List<string> buttons = new List<string>();
|
||||||
_ThemeButtons = new string[] { ButtonBack, ButtonNext, ButtonPlayerDestination, ButtonPlayerChoose };
|
_ThemeButtons = new[] {ButtonBack, ButtonNext, ButtonPlayerDestination, ButtonPlayerChoose};
|
||||||
|
|
||||||
Data = new DataFromScreen();
|
Data = new DataFromScreen();
|
||||||
FromScreenNames names = new FromScreenNames();
|
FromScreenNames names = new FromScreenNames();
|
||||||
@@ -79,7 +78,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
|
|
||||||
public override void LoadTheme(string XmlPath)
|
public override void LoadTheme(string XmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DataToScreen(object ReceivedData)
|
public override void DataToScreen(object ReceivedData)
|
||||||
@@ -96,52 +95,45 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
NumPlayer = config.NumPlayer;
|
NumPlayer = config.NumPlayer;
|
||||||
|
|
||||||
while (Data.ScreenNames.ProfileIDs.Count > NumPlayer)
|
while (Data.ScreenNames.ProfileIDs.Count > NumPlayer)
|
||||||
{
|
|
||||||
Data.ScreenNames.ProfileIDs.RemoveAt(Data.ScreenNames.ProfileIDs.Count - 1);
|
Data.ScreenNames.ProfileIDs.RemoveAt(Data.ScreenNames.ProfileIDs.Count - 1);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CBase.Log.LogError("Error in party mode screen challenge names. Can't cast received data from game mode " + ThemeName + ". " + e.Message); ;
|
CBase.Log.LogError("Error in party mode screen challenge names. Can't cast received data from game mode " + ThemeName + ". " + e.Message);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
|
|
||||||
if (KeyEvent.KeyPressed)
|
if (KeyEvent.KeyPressed) {}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (KeyEvent.Key)
|
||||||
{
|
{
|
||||||
|
case Keys.Back:
|
||||||
|
case Keys.Escape:
|
||||||
|
Back();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case Keys.Enter:
|
||||||
else
|
if (Buttons[ButtonBack].Selected)
|
||||||
{
|
|
||||||
switch (KeyEvent.Key)
|
|
||||||
{
|
|
||||||
case Keys.Back:
|
|
||||||
case Keys.Escape:
|
|
||||||
Back();
|
Back();
|
||||||
break;
|
|
||||||
|
|
||||||
case Keys.Enter:
|
if (Buttons[ButtonNext].Selected)
|
||||||
if (Buttons[ButtonBack].Selected)
|
Next();
|
||||||
Back();
|
|
||||||
|
|
||||||
if (Buttons[ButtonNext].Selected)
|
if (!OnAdd())
|
||||||
Next();
|
|
||||||
|
|
||||||
if (!OnAdd())
|
|
||||||
OnRemove();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Keys.Delete:
|
|
||||||
OnRemove();
|
OnRemove();
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
case Keys.Delete:
|
||||||
|
OnRemove();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +178,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
OldMouseX = MouseEvent.X;
|
OldMouseX = MouseEvent.X;
|
||||||
OldMouseY = MouseEvent.Y;
|
OldMouseY = MouseEvent.Y;
|
||||||
}
|
}
|
||||||
// LeftButton isn't hold anymore, but Selec-Mode is still active -> "Drop" of Avatar
|
// 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
|
//Check if really a player was selected
|
||||||
@@ -196,7 +188,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
||||||
{
|
{
|
||||||
//Check first, if area is "active"
|
//Check first, if area is "active"
|
||||||
if (PlayerDestinationButtons[i].Visible == true)
|
if (PlayerDestinationButtons[i].Visible)
|
||||||
{
|
{
|
||||||
//Check if Mouse is in area
|
//Check if Mouse is in area
|
||||||
if (CHelper.IsInBounds(PlayerDestinationButtons[i].Rect, MouseEvent))
|
if (CHelper.IsInBounds(PlayerDestinationButtons[i].Rect, MouseEvent))
|
||||||
@@ -245,9 +237,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
|
||||||
Back();
|
Back();
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -336,14 +326,11 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
private void UpdateButtonPlayerChoose()
|
private void UpdateButtonPlayerChoose()
|
||||||
{
|
{
|
||||||
UpdateVisibleProfiles();
|
UpdateVisibleProfiles();
|
||||||
if ((PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * (PlayerChooseButtonsOffset + 1) - PlayerChooseButtonsVisibleProfiles.Count >= (PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * PlayerChooseButtonsOffset)
|
if ((PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * (PlayerChooseButtonsOffset + 1) - PlayerChooseButtonsVisibleProfiles.Count >=
|
||||||
{
|
(PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * PlayerChooseButtonsOffset)
|
||||||
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset - 1);
|
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset - 1);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset);
|
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateButtonPlayerChoose(int Offset)
|
private void UpdateButtonPlayerChoose(int Offset)
|
||||||
@@ -402,9 +389,7 @@ namespace VocaluxeLib.PartyModes.Challenge
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (visible)
|
if (visible)
|
||||||
{
|
|
||||||
PlayerChooseButtonsVisibleProfiles.Add(i);
|
PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
public class ChallengeRounds
|
public class ChallengeRounds
|
||||||
{
|
{
|
||||||
private Random _Rand;
|
private readonly Random _Rand;
|
||||||
private int _NumPlayer;
|
private readonly int _NumPlayer;
|
||||||
|
|
||||||
public List<Combination> Rounds;
|
public List<Combination> Rounds;
|
||||||
|
|
||||||
public ChallengeRounds(int NumRounds, int NumPlayer, int NumPlayerAtOnce)
|
public ChallengeRounds(int NumRounds, int NumPlayer, int NumPlayerAtOnce)
|
||||||
{
|
{
|
||||||
Rounds = new List<Combination>();
|
Rounds = new List<Combination>();
|
||||||
_Rand = new Random(System.DateTime.Now.Millisecond);
|
_Rand = new Random(DateTime.Now.Millisecond);
|
||||||
|
|
||||||
if (NumPlayerAtOnce < 1 || NumRounds < 1 || NumPlayer == 0)
|
if (NumPlayerAtOnce < 1 || NumRounds < 1 || NumPlayer == 0)
|
||||||
_NumPlayer = 0;
|
_NumPlayer = 0;
|
||||||
@@ -38,26 +38,19 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
Rounds.Add(Combinations.GetNextCombination(null));
|
Rounds.Add(Combinations.GetNextCombination(null));
|
||||||
|
|
||||||
for (int i = 1; i < NumRounds; i++)
|
for (int i = 1; i < NumRounds; i++)
|
||||||
{
|
|
||||||
|
|
||||||
Rounds.Add(Combinations.GetNextCombination(GetPlayerDemand(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++)
|
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)
|
foreach (int PlayerIndex in Rounds[i].Player)
|
||||||
{
|
|
||||||
NumPlayed[PlayerIndex]++;
|
NumPlayed[PlayerIndex]++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int max = 0;
|
int max = 0;
|
||||||
@@ -92,7 +85,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
last.Add(i);
|
last.Add(i);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,10 +118,10 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
|
|
||||||
class Combinations
|
class Combinations
|
||||||
{
|
{
|
||||||
private List<Combination> _Combs;
|
private readonly List<Combination> _Combs;
|
||||||
private Random _Rand;
|
private readonly Random _Rand;
|
||||||
private int _NumPlayer;
|
private readonly int _NumPlayer;
|
||||||
private int _NumMics;
|
private readonly int _NumMics;
|
||||||
|
|
||||||
public Combinations(int NumPlayer, int NumMics, Random Rand)
|
public Combinations(int NumPlayer, int NumMics, Random Rand)
|
||||||
{
|
{
|
||||||
@@ -147,9 +139,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
Combination combs = new Combination();
|
Combination combs = new Combination();
|
||||||
|
|
||||||
if (_NumPlayer == _NumMics)
|
if (_NumPlayer == _NumMics)
|
||||||
{
|
|
||||||
return _Combs[0];
|
return _Combs[0];
|
||||||
}
|
|
||||||
|
|
||||||
//filter against PlayerNrDemand
|
//filter against PlayerNrDemand
|
||||||
List<Combination> combsFiltered = new List<Combination>();
|
List<Combination> combsFiltered = new List<Combination>();
|
||||||
@@ -176,18 +166,14 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
if (combsFiltered.Count == 0)
|
if (combsFiltered.Count == 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _Combs.Count; i++)
|
for (int i = 0; i < _Combs.Count; i++)
|
||||||
{
|
|
||||||
combsFiltered.Add(_Combs[i]);
|
combsFiltered.Add(_Combs[i]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int num = combsFiltered.Count;
|
int num = combsFiltered.Count;
|
||||||
int rand = _Rand.Next(num);
|
int rand = _Rand.Next(num);
|
||||||
Combination c = new Combination();
|
Combination c = new Combination();
|
||||||
for (int i = 0; i < combsFiltered[rand].Player.Count; i++)
|
for (int i = 0; i < combsFiltered[rand].Player.Count; i++)
|
||||||
{
|
|
||||||
c.Player.Add(combsFiltered[rand].Player[i]);
|
c.Player.Add(combsFiltered[rand].Player[i]);
|
||||||
}
|
|
||||||
_Combs.Remove(combsFiltered[rand]);
|
_Combs.Remove(combsFiltered[rand]);
|
||||||
|
|
||||||
return combsFiltered[rand];
|
return combsFiltered[rand];
|
||||||
@@ -206,9 +192,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
for (int j = 0; j < _NumPlayer; j++)
|
for (int j = 0; j < _NumPlayer; j++)
|
||||||
{
|
{
|
||||||
if ((i & (1 << j)) > 0)
|
if ((i & (1 << j)) > 0)
|
||||||
{
|
|
||||||
c.Player.Add(j);
|
c.Player.Add(j);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c.Player.Count == _NumMics)
|
if (c.Player.Count == _NumMics)
|
||||||
@@ -240,9 +224,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
foreach (int p in PlayerIndices)
|
foreach (int p in PlayerIndices)
|
||||||
{
|
|
||||||
result &= IsAvailable(p);
|
result &= IsAvailable(p);
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,9 +232,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
foreach (int p in PlayerIndices)
|
foreach (int p in PlayerIndices)
|
||||||
{
|
|
||||||
result |= IsAvailable(p);
|
result |= IsAvailable(p);
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -1,12 +1,16 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
using VocaluxeLib.Menu.SongMenu;
|
using VocaluxeLib.Menu.SongMenu;
|
||||||
|
|
||||||
[assembly: System.Runtime.InteropServices.ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
namespace VocaluxeLib.PartyModes.ChallengeMedley
|
namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Communication
|
#region Communication
|
||||||
|
|
||||||
#region ToScreen
|
#region ToScreen
|
||||||
public struct DataToScreenConfig
|
public struct DataToScreenConfig
|
||||||
{
|
{
|
||||||
@@ -52,9 +56,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
res = row.NumSingPoints.CompareTo(NumSingPoints);
|
res = row.NumSingPoints.CompareTo(NumSingPoints);
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
{
|
|
||||||
res = row.NumWon.CompareTo(NumWon);
|
res = row.NumWon.CompareTo(NumWon);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -62,7 +64,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
throw new ArgumentException("object is not a ResultTableRow");
|
throw new ArgumentException("object is not a ResultTableRow");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion ToScreen
|
#endregion ToScreen
|
||||||
|
|
||||||
#region FromScreen
|
#region FromScreen
|
||||||
@@ -93,6 +94,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
public bool FadeToNameSelection;
|
public bool FadeToNameSelection;
|
||||||
}
|
}
|
||||||
#endregion FromScreen
|
#endregion FromScreen
|
||||||
|
|
||||||
#endregion Communication
|
#endregion Communication
|
||||||
|
|
||||||
public sealed class PartyModeChallengeMedley : CPartyMode
|
public sealed class PartyModeChallengeMedley : CPartyMode
|
||||||
@@ -104,7 +106,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
private const int MaxNumRounds = 100;
|
private const int MaxNumRounds = 100;
|
||||||
private const int NumSongs = 5;
|
private const int NumSongs = 5;
|
||||||
|
|
||||||
enum EStage
|
private enum EStage
|
||||||
{
|
{
|
||||||
NotStarted,
|
NotStarted,
|
||||||
Config,
|
Config,
|
||||||
@@ -113,7 +115,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
Singing
|
Singing
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Data
|
private struct Data
|
||||||
{
|
{
|
||||||
public int NumPlayer;
|
public int NumPlayer;
|
||||||
public int NumPlayerAtOnce;
|
public int NumPlayerAtOnce;
|
||||||
@@ -129,7 +131,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
public int[] CatSongIndices;
|
public int[] CatSongIndices;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Stats
|
private struct Stats
|
||||||
{
|
{
|
||||||
public int ProfileID;
|
public int ProfileID;
|
||||||
public int SingPoints;
|
public int SingPoints;
|
||||||
@@ -149,8 +151,8 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||||
_ScreenSongOptions.Selection.PartyMode = true;
|
_ScreenSongOptions.Selection.PartyMode = true;
|
||||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
||||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
|
_ScreenSongOptions.Selection.NumJokers = new[] {5, 5};
|
||||||
_ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
|
_ScreenSongOptions.Selection.TeamNames = new[] {"foo", "bar"};
|
||||||
|
|
||||||
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
||||||
_ScreenSongOptions.Sorting.SearchActive = false;
|
_ScreenSongOptions.Sorting.SearchActive = false;
|
||||||
@@ -441,9 +443,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = false;
|
_ScreenSongOptions.Selection.CategoryChangeAllowed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SongSelected(int SongID)
|
public override void SongSelected(int SongID) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void LeavingHighscore()
|
public override void LeavingHighscore()
|
||||||
{
|
{
|
||||||
@@ -522,7 +522,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
if (mode == EGameMode.TR_GAMEMODE_MEDLEY)
|
if (mode == EGameMode.TR_GAMEMODE_MEDLEY)
|
||||||
IDs.Add(VisSongs[i].ID);
|
IDs.Add(VisSongs[i].ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IDs.Count == 0)
|
if (IDs.Count == 0)
|
||||||
@@ -550,30 +549,30 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
switch (GameData.NumPlayerAtOnce)
|
switch (GameData.NumPlayerAtOnce)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 10 };
|
_ScreenSongOptions.Selection.NumJokers = new[] {10};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
|
_ScreenSongOptions.Selection.NumJokers = new[] {5, 5};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 4, 4, 4 };
|
_ScreenSongOptions.Selection.NumJokers = new[] {4, 4, 4};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 3, 3, 3, 3 };
|
_ScreenSongOptions.Selection.NumJokers = new[] {3, 3, 3, 3};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 2, 2, 2, 2, 2 };
|
_ScreenSongOptions.Selection.NumJokers = new[] {2, 2, 2, 2, 2};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 2, 2, 2, 2, 2, 2 };
|
_ScreenSongOptions.Selection.NumJokers = new[] {2, 2, 2, 2, 2, 2};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
|
_ScreenSongOptions.Selection.NumJokers = new[] {5, 5};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -584,13 +583,13 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
|
|
||||||
if (profiles == null)
|
if (profiles == null)
|
||||||
{
|
{
|
||||||
_ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
|
_ScreenSongOptions.Selection.TeamNames = new[] {"foo", "bar"};
|
||||||
return;
|
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" };
|
_ScreenSongOptions.Selection.TeamNames = new[] {"foo", "bar"};
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -627,13 +626,11 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
GameData.ResultTable.Add(row);
|
GameData.ResultTable.Add(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameData.Results = new int[GameData.NumRounds, GameData.NumPlayerAtOnce];
|
GameData.Results = new int[GameData.NumRounds,GameData.NumPlayerAtOnce];
|
||||||
for (int i = 0; i < GameData.NumRounds; i++)
|
for (int i = 0; i < GameData.NumRounds; i++)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < GameData.NumPlayerAtOnce; j++)
|
for (int j = 0; j < GameData.NumPlayerAtOnce; j++)
|
||||||
{
|
|
||||||
GameData.Results[i, j] = 0;
|
GameData.Results[i, j] = 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -656,9 +653,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
SPlayer[] temp = GamePoints.GetPlayer(i, GameData.NumPlayerAtOnce);
|
SPlayer[] temp = GamePoints.GetPlayer(i, GameData.NumPlayerAtOnce);
|
||||||
for (int p = 0; p < GameData.NumPlayerAtOnce; p++)
|
for (int p = 0; p < GameData.NumPlayerAtOnce; p++)
|
||||||
{
|
|
||||||
results[p].Points += temp[p].Points;
|
results[p].Points += temp[p].Points;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < GameData.NumPlayerAtOnce; j++)
|
for (int j = 0; j < GameData.NumPlayerAtOnce; j++)
|
||||||
@@ -673,13 +668,13 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
int index = -1;
|
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;
|
index = j;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
@@ -702,7 +697,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
int pos = 1;
|
int pos = 1;
|
||||||
int lastPoints = 0;
|
int lastPoints = 0;
|
||||||
int lastSingPoints = 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++;
|
pos++;
|
||||||
@@ -715,7 +710,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
private List<Stats> GetPointsForPlayer(SPlayer[] Results)
|
private List<Stats> GetPointsForPlayer(SPlayer[] Results)
|
||||||
{
|
{
|
||||||
List<Stats> result = new List<Stats>();
|
List<Stats> result = new List<Stats>();
|
||||||
for(int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||||
{
|
{
|
||||||
Stats stat = new Stats();
|
Stats stat = new Stats();
|
||||||
stat.ProfileID = Results[i].ProfileID;
|
stat.ProfileID = Results[i].ProfileID;
|
||||||
@@ -762,7 +757,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,9 +766,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
GameData.CatSongIndices = new int[CBase.Songs.GetNumCategories()];
|
GameData.CatSongIndices = new int[CBase.Songs.GetNumCategories()];
|
||||||
for (int i = 0; i < GameData.CatSongIndices.Length; i++)
|
for (int i = 0; i < GameData.CatSongIndices.Length; i++)
|
||||||
{
|
|
||||||
GameData.CatSongIndices[i] = -1;
|
GameData.CatSongIndices[i] = -1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CBase.Songs.GetNumCategories() == 0 || _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF)
|
if (CBase.Songs.GetNumCategories() == 0 || _ScreenSongOptions.Sorting.Tabs == EOffOn.TR_CONFIG_OFF)
|
||||||
|
|||||||
@@ -7,30 +7,29 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
public class PartyScreenChallengeMedleyConfig : CMenuParty
|
public class PartyScreenChallengeMedleyConfig : CMenuParty
|
||||||
{
|
{
|
||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion { get { return 1; } }
|
protected override int _ScreenVersion
|
||||||
|
{
|
||||||
|
get { return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
const string SelectSlideNumPlayers = "SelectSlideNumPlayers";
|
private const string SelectSlideNumPlayers = "SelectSlideNumPlayers";
|
||||||
const string SelectSlideNumMics = "SelectSlideNumMics";
|
private const string SelectSlideNumMics = "SelectSlideNumMics";
|
||||||
const string SelectSlideNumRounds = "SelectSlideNumRounds";
|
private const string SelectSlideNumRounds = "SelectSlideNumRounds";
|
||||||
const string ButtonNext = "ButtonNext";
|
private const string ButtonNext = "ButtonNext";
|
||||||
const string ButtonBack = "ButtonBack";
|
private const string ButtonBack = "ButtonBack";
|
||||||
|
|
||||||
private int _MaxNumMics = 2;
|
private int _MaxNumMics = 2;
|
||||||
private int _MaxNumRounds = 100;
|
private int _MaxNumRounds = 100;
|
||||||
private int _RoundSteps = 1;
|
private int _RoundSteps = 1;
|
||||||
|
|
||||||
DataFromScreen Data;
|
private DataFromScreen Data;
|
||||||
|
|
||||||
public PartyScreenChallengeMedleyConfig()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|
||||||
_ThemeSelectSlides = new string[] { SelectSlideNumPlayers, SelectSlideNumMics, SelectSlideNumRounds };
|
_ThemeSelectSlides = new[] {SelectSlideNumPlayers, SelectSlideNumMics, SelectSlideNumRounds};
|
||||||
_ThemeButtons = new string[] { ButtonNext, ButtonBack };
|
_ThemeButtons = new[] {ButtonNext, ButtonBack};
|
||||||
|
|
||||||
Data = new DataFromScreen();
|
Data = new DataFromScreen();
|
||||||
FromScreenConfig config = new FromScreenConfig();
|
FromScreenConfig config = new FromScreenConfig();
|
||||||
@@ -42,7 +41,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
|
|
||||||
public override void LoadTheme(string XmlPath)
|
public override void LoadTheme(string XmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DataToScreen(object ReceivedData)
|
public override void DataToScreen(object ReceivedData)
|
||||||
@@ -58,19 +57,16 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CBase.Log.LogError("Error in party mode screen challenge config. Can't cast received data from game mode " + ThemeName + ". " + e.Message);;
|
CBase.Log.LogError("Error in party mode screen challenge config. Can't cast received data from game mode " + ThemeName + ". " + e.Message);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
|
|
||||||
if (KeyEvent.KeyPressed)
|
if (KeyEvent.KeyPressed) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (KeyEvent.Key)
|
switch (KeyEvent.Key)
|
||||||
@@ -117,9 +113,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
|
||||||
Back();
|
Back();
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -153,9 +147,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
// build num player slide (min player ... max player);
|
// build num player slide (min player ... max player);
|
||||||
SelectSlides[SelectSlideNumPlayers].Clear();
|
SelectSlides[SelectSlideNumPlayers].Clear();
|
||||||
for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++)
|
for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++)
|
||||||
{
|
|
||||||
SelectSlides[SelectSlideNumPlayers].AddValue(i.ToString());
|
SelectSlides[SelectSlideNumPlayers].AddValue(i.ToString());
|
||||||
}
|
|
||||||
SelectSlides[SelectSlideNumPlayers].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
|
SelectSlides[SelectSlideNumPlayers].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
|
||||||
|
|
||||||
UpdateMicsAtOnce();
|
UpdateMicsAtOnce();
|
||||||
@@ -178,9 +170,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
int num = CHelper.nCk(Data.ScreenConfig.NumPlayer, Data.ScreenConfig.NumPlayerAtOnce);
|
int num = CHelper.nCk(Data.ScreenConfig.NumPlayer, Data.ScreenConfig.NumPlayerAtOnce);
|
||||||
while (num > _MaxNumRounds)
|
while (num > _MaxNumRounds)
|
||||||
{
|
|
||||||
num -= _RoundSteps;
|
num -= _RoundSteps;
|
||||||
}
|
|
||||||
Data.ScreenConfig.NumRounds = num;
|
Data.ScreenConfig.NumRounds = num;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,9 +190,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
// build mics at once slide
|
// build mics at once slide
|
||||||
SelectSlides[SelectSlideNumMics].Clear();
|
SelectSlides[SelectSlideNumMics].Clear();
|
||||||
for (int i = 1; i <= MaxNum; i++)
|
for (int i = 1; i <= MaxNum; i++)
|
||||||
{
|
|
||||||
SelectSlides[SelectSlideNumMics].AddValue(i.ToString());
|
SelectSlides[SelectSlideNumMics].AddValue(i.ToString());
|
||||||
}
|
|
||||||
SelectSlides[SelectSlideNumMics].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
|
SelectSlides[SelectSlideNumMics].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,9 +199,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
// build num rounds slide
|
// build num rounds slide
|
||||||
SelectSlides[SelectSlideNumRounds].Clear();
|
SelectSlides[SelectSlideNumRounds].Clear();
|
||||||
for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps)
|
for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps)
|
||||||
{
|
|
||||||
SelectSlides[SelectSlideNumRounds].AddValue(i.ToString());
|
SelectSlides[SelectSlideNumRounds].AddValue(i.ToString());
|
||||||
}
|
|
||||||
SelectSlides[SelectSlideNumRounds].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1;
|
SelectSlides[SelectSlideNumRounds].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,41 +22,43 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
public List<CText> TextScores;
|
public List<CText> TextScores;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class PartyScreenChallengeMedleyMain : CMenuParty
|
public class PartyScreenChallengeMedleyMain : CMenuParty
|
||||||
{
|
{
|
||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion { get { return 1; } }
|
protected override int _ScreenVersion
|
||||||
|
{
|
||||||
|
get { return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
const string TextPosition = "TextPosition";
|
private const string TextPosition = "TextPosition";
|
||||||
const string TextPlayerName = "TextPlayerName";
|
private const string TextPlayerName = "TextPlayerName";
|
||||||
const string TextNumPlayed = "TextNumPlayed";
|
private const string TextNumPlayed = "TextNumPlayed";
|
||||||
const string TextWon = "TextWon";
|
private const string TextWon = "TextWon";
|
||||||
const string TextSingPoints = "TextSingPoints";
|
private const string TextSingPoints = "TextSingPoints";
|
||||||
const string TextGamePoints = "TextGamePoints";
|
private const string TextGamePoints = "TextGamePoints";
|
||||||
const string TextNextPlayer = "TextNextPlayer";
|
private const string TextNextPlayer = "TextNextPlayer";
|
||||||
const string TextPopupReallyExit = "TextPopupReallyExit";
|
private const string TextPopupReallyExit = "TextPopupReallyExit";
|
||||||
const string TextRoundPlayer = "TextRoundPlayer";
|
private const string TextRoundPlayer = "TextRoundPlayer";
|
||||||
const string TextRoundScore = "TextRoundScore";
|
private const string TextRoundScore = "TextRoundScore";
|
||||||
const string TextRoundNumber = "TextRoundNumber";
|
private const string TextRoundNumber = "TextRoundNumber";
|
||||||
const string TextFinishMessage = "TextFinishMessage";
|
private const string TextFinishMessage = "TextFinishMessage";
|
||||||
const string TextFinishPlayerWin = "TextFinishPlayerWin";
|
private const string TextFinishPlayerWin = "TextFinishPlayerWin";
|
||||||
const string TextNextPlayerMessage = "TextNextPlayerMessage";
|
private const string TextNextPlayerMessage = "TextNextPlayerMessage";
|
||||||
|
|
||||||
const string ButtonNextRound = "ButtonNextRound";
|
private const string ButtonNextRound = "ButtonNextRound";
|
||||||
const string ButtonBack = "ButtonBack";
|
private const string ButtonBack = "ButtonBack";
|
||||||
const string ButtonExit = "ButtonExit";
|
private const string ButtonExit = "ButtonExit";
|
||||||
const string ButtonPopupYes = "ButtonPopupYes";
|
private const string ButtonPopupYes = "ButtonPopupYes";
|
||||||
const string ButtonPopupNo = "ButtonPopupNo";
|
private const string ButtonPopupNo = "ButtonPopupNo";
|
||||||
const string ButtonPlayerScrollUp = "ButtonPlayerScrollUp";
|
private const string ButtonPlayerScrollUp = "ButtonPlayerScrollUp";
|
||||||
const string ButtonPlayerScrollDown = "ButtonPlayerScrollDown";
|
private const string ButtonPlayerScrollDown = "ButtonPlayerScrollDown";
|
||||||
const string ButtonRoundsScrollUp = "ButtonRoundsScrollUp";
|
private const string ButtonRoundsScrollUp = "ButtonRoundsScrollUp";
|
||||||
const string ButtonRoundsScrollDown = "ButtonRoundsScrollDown";
|
private const string ButtonRoundsScrollDown = "ButtonRoundsScrollDown";
|
||||||
|
|
||||||
const string StaticPopupBG = "StaticPopupBG";
|
private const string StaticPopupBG = "StaticPopupBG";
|
||||||
const string StaticNextPlayer = "StaticNextPlayer";
|
private const string StaticNextPlayer = "StaticNextPlayer";
|
||||||
|
|
||||||
private bool ExitPopupVisible = false;
|
private bool ExitPopupVisible;
|
||||||
|
|
||||||
private DataFromScreen Data;
|
private DataFromScreen Data;
|
||||||
private DataToScreenMain GameState;
|
private DataToScreenMain GameState;
|
||||||
@@ -68,8 +70,8 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
|
|
||||||
private SRectF RoundsTableScrollArea;
|
private SRectF RoundsTableScrollArea;
|
||||||
private SRectF PlayerTableScrollArea;
|
private SRectF PlayerTableScrollArea;
|
||||||
private int RoundsTableOffset = 0;
|
private int RoundsTableOffset;
|
||||||
private int PlayerTableOffset = 0;
|
private int PlayerTableOffset;
|
||||||
private int NumPlayerVisible = 10;
|
private int NumPlayerVisible = 10;
|
||||||
private int NumRoundsVisible = 3;
|
private int NumRoundsVisible = 3;
|
||||||
|
|
||||||
@@ -83,14 +85,19 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|
||||||
_ThemeTexts = new string[] { TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextNextPlayer, TextPopupReallyExit, TextRoundNumber, TextRoundPlayer, TextRoundScore, TextFinishMessage, TextFinishPlayerWin, TextNextPlayerMessage };
|
_ThemeTexts = new[]
|
||||||
_ThemeButtons = new string[] { ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo, ButtonPlayerScrollDown, ButtonPlayerScrollUp, ButtonRoundsScrollDown, ButtonRoundsScrollUp };
|
{
|
||||||
_ThemeStatics = new string[] { StaticPopupBG, StaticNextPlayer };
|
TextPosition, TextPlayerName, TextNumPlayed, TextWon, TextSingPoints, TextGamePoints, TextNextPlayer, TextPopupReallyExit, TextRoundNumber, TextRoundPlayer,
|
||||||
|
TextRoundScore, TextFinishMessage, TextFinishPlayerWin, TextNextPlayerMessage
|
||||||
|
};
|
||||||
|
_ThemeButtons = new[]
|
||||||
|
{ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo, ButtonPlayerScrollDown, ButtonPlayerScrollUp, ButtonRoundsScrollDown, ButtonRoundsScrollUp};
|
||||||
|
_ThemeStatics = new[] {StaticPopupBG, StaticNextPlayer};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LoadTheme(string XmlPath)
|
public override void LoadTheme(string XmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
|
|
||||||
GameState = new DataToScreenMain();
|
GameState = new DataToScreenMain();
|
||||||
BuildPlayerTable();
|
BuildPlayerTable();
|
||||||
@@ -118,19 +125,16 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CBase.Log.LogError("Error in party mode screen challenge main. Can't cast received data from game mode " + ThemeName + ". " + e.Message); ;
|
CBase.Log.LogError("Error in party mode screen challenge main. Can't cast received data from game mode " + ThemeName + ". " + e.Message);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
|
|
||||||
if (KeyEvent.KeyPressed)
|
if (KeyEvent.KeyPressed) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (KeyEvent.Key)
|
switch (KeyEvent.Key)
|
||||||
@@ -138,10 +142,12 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
case Keys.Back:
|
case Keys.Back:
|
||||||
case Keys.Escape:
|
case Keys.Escape:
|
||||||
if (!ExitPopupVisible)
|
if (!ExitPopupVisible)
|
||||||
|
{
|
||||||
if (GameState.CurrentRoundNr == 1)
|
if (GameState.CurrentRoundNr == 1)
|
||||||
Back();
|
Back();
|
||||||
else
|
else
|
||||||
ShowPopup(true);
|
ShowPopup(true);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ShowPopup(false);
|
ShowPopup(false);
|
||||||
break;
|
break;
|
||||||
@@ -212,19 +218,21 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
{
|
||||||
if (!ExitPopupVisible)
|
if (!ExitPopupVisible)
|
||||||
|
{
|
||||||
if (GameState.CurrentRoundNr == 1)
|
if (GameState.CurrentRoundNr == 1)
|
||||||
Back();
|
Back();
|
||||||
else
|
else
|
||||||
ShowPopup(true);
|
ShowPopup(true);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ShowPopup(false);
|
ShowPopup(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MouseEvent.Wheel != 0)
|
if (MouseEvent.Wheel != 0)
|
||||||
{
|
{
|
||||||
if(CHelper.IsInBounds(RoundsTableScrollArea, MouseEvent))
|
if (CHelper.IsInBounds(RoundsTableScrollArea, MouseEvent))
|
||||||
ScrollRoundsTable(MouseEvent.Wheel);
|
ScrollRoundsTable(MouseEvent.Wheel);
|
||||||
if(CHelper.IsInBounds(PlayerTableScrollArea, MouseEvent))
|
if (CHelper.IsInBounds(PlayerTableScrollArea, MouseEvent))
|
||||||
ScrollPlayerTable(MouseEvent.Wheel);
|
ScrollPlayerTable(MouseEvent.Wheel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,7 +330,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
|
|
||||||
private void UpdateNextPlayerPositions()
|
private void UpdateNextPlayerPositions()
|
||||||
{
|
{
|
||||||
float x = CBase.Settings.GetRenderW()/2 - ((GameState.NumPlayerAtOnce * Statics[StaticNextPlayer].Rect.W) + ((GameState.NumPlayerAtOnce-1) * 15))/2;
|
float x = CBase.Settings.GetRenderW() / 2 - ((GameState.NumPlayerAtOnce * Statics[StaticNextPlayer].Rect.W) + ((GameState.NumPlayerAtOnce - 1) * 15)) / 2;
|
||||||
float static_y = 590;
|
float static_y = 590;
|
||||||
float text_y = 550;
|
float text_y = 550;
|
||||||
for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
|
for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
|
||||||
@@ -446,7 +454,8 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
for (int column = row * NumPlayerInOneRow; column < num; column++)
|
for (int column = row * NumPlayerInOneRow; column < num; column++)
|
||||||
{
|
{
|
||||||
//Player
|
//Player
|
||||||
float _x = x + 15 + (CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) + ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2;
|
float _x = x + 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;
|
float maxw = ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2 - 5;
|
||||||
RoundsTable[round].TextPlayer[column].X = _x;
|
RoundsTable[round].TextPlayer[column].X = _x;
|
||||||
RoundsTable[round].TextPlayer[column].Y = y;
|
RoundsTable[round].TextPlayer[column].Y = y;
|
||||||
@@ -469,7 +478,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
SProfile[] profile = CBase.Profiles.GetProfiles();
|
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)
|
||||||
{
|
{
|
||||||
@@ -566,7 +575,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
{
|
{
|
||||||
TableRow row = PlayerTable[i];
|
TableRow row = PlayerTable[i];
|
||||||
|
|
||||||
if (i+PlayerTableOffset < GameState.ResultTable.Count)
|
if (i + PlayerTableOffset < GameState.ResultTable.Count)
|
||||||
{
|
{
|
||||||
row.Pos.Visible = true;
|
row.Pos.Visible = true;
|
||||||
row.Name.Visible = true;
|
row.Name.Visible = true;
|
||||||
@@ -576,11 +585,11 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
row.GamePoints.Visible = true;
|
row.GamePoints.Visible = true;
|
||||||
|
|
||||||
row.Pos.Text = GameState.ResultTable[i + PlayerTableOffset].Position.ToString() + ".";
|
row.Pos.Text = GameState.ResultTable[i + PlayerTableOffset].Position.ToString() + ".";
|
||||||
row.Name.Text = profiles[GameState.ResultTable[i+PlayerTableOffset].PlayerID].PlayerName;
|
row.Name.Text = profiles[GameState.ResultTable[i + PlayerTableOffset].PlayerID].PlayerName;
|
||||||
row.Rounds.Text = GameState.ResultTable[i+PlayerTableOffset].NumRounds.ToString();
|
row.Rounds.Text = GameState.ResultTable[i + PlayerTableOffset].NumRounds.ToString();
|
||||||
row.Won.Text = GameState.ResultTable[i+PlayerTableOffset].NumWon.ToString();
|
row.Won.Text = GameState.ResultTable[i + PlayerTableOffset].NumWon.ToString();
|
||||||
row.SingPoints.Text = GameState.ResultTable[i+PlayerTableOffset].NumSingPoints.ToString();
|
row.SingPoints.Text = GameState.ResultTable[i + PlayerTableOffset].NumSingPoints.ToString();
|
||||||
row.GamePoints.Text = GameState.ResultTable[i+PlayerTableOffset].NumGamePoints.ToString();
|
row.GamePoints.Text = GameState.ResultTable[i + PlayerTableOffset].NumGamePoints.ToString();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,12 +8,15 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
public class PartyScreenChallengeMedleyNames : CMenuParty
|
public class PartyScreenChallengeMedleyNames : CMenuParty
|
||||||
{
|
{
|
||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion { get { return 1; } }
|
protected override int _ScreenVersion
|
||||||
|
{
|
||||||
|
get { return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
const string ButtonNext = "ButtonNext";
|
private const string ButtonNext = "ButtonNext";
|
||||||
const string ButtonBack = "ButtonBack";
|
private const string ButtonBack = "ButtonBack";
|
||||||
const string ButtonPlayerDestination = "ButtonPlayerDestination";
|
private const string ButtonPlayerDestination = "ButtonPlayerDestination";
|
||||||
const string ButtonPlayerChoose = "ButtonPlayerChoose";
|
private const string ButtonPlayerChoose = "ButtonPlayerChoose";
|
||||||
|
|
||||||
private List<CPlayerChooseButton> PlayerChooseButtons;
|
private List<CPlayerChooseButton> PlayerChooseButtons;
|
||||||
private List<CButton> PlayerDestinationButtons;
|
private List<CButton> PlayerDestinationButtons;
|
||||||
@@ -35,11 +38,11 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
private int PlayerChooseButtonsOffset = 0;
|
private int PlayerChooseButtonsOffset = 0;
|
||||||
|
|
||||||
private CStatic chooseAvatarStatic;
|
private CStatic chooseAvatarStatic;
|
||||||
private bool SelectingMouseActive = false;
|
private bool SelectingMouseActive;
|
||||||
private int OldMouseX = 0;
|
private int OldMouseX;
|
||||||
private int OldMouseY = 0;
|
private int OldMouseY;
|
||||||
private int SelectedPlayerNr = -1;
|
private int SelectedPlayerNr = -1;
|
||||||
private bool ButtonsAdded = false;
|
private bool ButtonsAdded;
|
||||||
|
|
||||||
private int NumPlayer = 4;
|
private int NumPlayer = 4;
|
||||||
|
|
||||||
@@ -51,10 +54,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
public int ProfileID;
|
public int ProfileID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartyScreenChallengeMedleyNames()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
@@ -67,7 +66,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
Data.ScreenNames.ProfileIDs = new List<int>();
|
Data.ScreenNames.ProfileIDs = new List<int>();
|
||||||
|
|
||||||
List<string> buttons = new List<string>();
|
List<string> buttons = new List<string>();
|
||||||
_ThemeButtons = new string[] { ButtonBack, ButtonNext, ButtonPlayerDestination, ButtonPlayerChoose };
|
_ThemeButtons = new[] {ButtonBack, ButtonNext, ButtonPlayerDestination, ButtonPlayerChoose};
|
||||||
|
|
||||||
Data = new DataFromScreen();
|
Data = new DataFromScreen();
|
||||||
FromScreenNames names = new FromScreenNames();
|
FromScreenNames names = new FromScreenNames();
|
||||||
@@ -79,7 +78,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
|
|
||||||
public override void LoadTheme(string XmlPath)
|
public override void LoadTheme(string XmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DataToScreen(object ReceivedData)
|
public override void DataToScreen(object ReceivedData)
|
||||||
@@ -96,52 +95,45 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
NumPlayer = config.NumPlayer;
|
NumPlayer = config.NumPlayer;
|
||||||
|
|
||||||
while (Data.ScreenNames.ProfileIDs.Count > NumPlayer)
|
while (Data.ScreenNames.ProfileIDs.Count > NumPlayer)
|
||||||
{
|
|
||||||
Data.ScreenNames.ProfileIDs.RemoveAt(Data.ScreenNames.ProfileIDs.Count - 1);
|
Data.ScreenNames.ProfileIDs.RemoveAt(Data.ScreenNames.ProfileIDs.Count - 1);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CBase.Log.LogError("Error in party mode screen challenge names. Can't cast received data from game mode " + ThemeName + ". " + e.Message); ;
|
CBase.Log.LogError("Error in party mode screen challenge names. Can't cast received data from game mode " + ThemeName + ". " + e.Message);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
|
|
||||||
if (KeyEvent.KeyPressed)
|
if (KeyEvent.KeyPressed) {}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (KeyEvent.Key)
|
||||||
{
|
{
|
||||||
|
case Keys.Back:
|
||||||
|
case Keys.Escape:
|
||||||
|
Back();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case Keys.Enter:
|
||||||
else
|
if (Buttons[ButtonBack].Selected)
|
||||||
{
|
|
||||||
switch (KeyEvent.Key)
|
|
||||||
{
|
|
||||||
case Keys.Back:
|
|
||||||
case Keys.Escape:
|
|
||||||
Back();
|
Back();
|
||||||
break;
|
|
||||||
|
|
||||||
case Keys.Enter:
|
if (Buttons[ButtonNext].Selected)
|
||||||
if (Buttons[ButtonBack].Selected)
|
Next();
|
||||||
Back();
|
|
||||||
|
|
||||||
if (Buttons[ButtonNext].Selected)
|
if (!OnAdd())
|
||||||
Next();
|
|
||||||
|
|
||||||
if (!OnAdd())
|
|
||||||
OnRemove();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Keys.Delete:
|
|
||||||
OnRemove();
|
OnRemove();
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
case Keys.Delete:
|
||||||
|
OnRemove();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +178,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
OldMouseX = MouseEvent.X;
|
OldMouseX = MouseEvent.X;
|
||||||
OldMouseY = MouseEvent.Y;
|
OldMouseY = MouseEvent.Y;
|
||||||
}
|
}
|
||||||
// LeftButton isn't hold anymore, but Selec-Mode is still active -> "Drop" of Avatar
|
// 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
|
//Check if really a player was selected
|
||||||
@@ -196,7 +188,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
||||||
{
|
{
|
||||||
//Check first, if area is "active"
|
//Check first, if area is "active"
|
||||||
if (PlayerDestinationButtons[i].Visible == true)
|
if (PlayerDestinationButtons[i].Visible)
|
||||||
{
|
{
|
||||||
//Check if Mouse is in area
|
//Check if Mouse is in area
|
||||||
if (CHelper.IsInBounds(PlayerDestinationButtons[i].Rect, MouseEvent))
|
if (CHelper.IsInBounds(PlayerDestinationButtons[i].Rect, MouseEvent))
|
||||||
@@ -245,9 +237,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
|
||||||
Back();
|
Back();
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -336,14 +326,11 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
private void UpdateButtonPlayerChoose()
|
private void UpdateButtonPlayerChoose()
|
||||||
{
|
{
|
||||||
UpdateVisibleProfiles();
|
UpdateVisibleProfiles();
|
||||||
if ((PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * (PlayerChooseButtonsOffset + 1) - PlayerChooseButtonsVisibleProfiles.Count >= (PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * PlayerChooseButtonsOffset)
|
if ((PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * (PlayerChooseButtonsOffset + 1) - PlayerChooseButtonsVisibleProfiles.Count >=
|
||||||
{
|
(PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * PlayerChooseButtonsOffset)
|
||||||
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset - 1);
|
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset - 1);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset);
|
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateButtonPlayerChoose(int Offset)
|
private void UpdateButtonPlayerChoose(int Offset)
|
||||||
@@ -402,9 +389,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (visible)
|
if (visible)
|
||||||
{
|
|
||||||
PlayerChooseButtonsVisibleProfiles.Add(i);
|
PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1,8 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
|
|
||||||
[assembly: System.Runtime.InteropServices.ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
namespace VocaluxeLib.PartyModes.TicTacToe
|
namespace VocaluxeLib.PartyModes.TicTacToe
|
||||||
{
|
{
|
||||||
public enum ESongSource
|
public enum ESongSource
|
||||||
@@ -29,7 +31,9 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
public int Winner;
|
public int Winner;
|
||||||
public bool Finished = false;
|
public bool Finished = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Communication
|
#region Communication
|
||||||
|
|
||||||
#region ToScreen
|
#region ToScreen
|
||||||
public struct DataToScreenConfig
|
public struct DataToScreenConfig
|
||||||
{
|
{
|
||||||
@@ -104,6 +108,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
public List<int> Songs;
|
public List<int> Songs;
|
||||||
}
|
}
|
||||||
#endregion FromScreen
|
#endregion FromScreen
|
||||||
|
|
||||||
#endregion Communication
|
#endregion Communication
|
||||||
|
|
||||||
public sealed class PartyModeTicTacToe : CPartyMode
|
public sealed class PartyModeTicTacToe : CPartyMode
|
||||||
@@ -114,7 +119,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
private const int MinTeams = 2;
|
private const int MinTeams = 2;
|
||||||
private const int NumFields = 9;
|
private const int NumFields = 9;
|
||||||
|
|
||||||
enum EStage
|
private enum EStage
|
||||||
{
|
{
|
||||||
NotStarted,
|
NotStarted,
|
||||||
Config,
|
Config,
|
||||||
@@ -123,7 +128,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
Singing
|
Singing
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Data
|
private struct Data
|
||||||
{
|
{
|
||||||
public int NumPlayerTeam1;
|
public int NumPlayerTeam1;
|
||||||
public int NumPlayerTeam2;
|
public int NumPlayerTeam2;
|
||||||
@@ -162,8 +167,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||||
_ScreenSongOptions.Selection.PartyMode = true;
|
_ScreenSongOptions.Selection.PartyMode = true;
|
||||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
||||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
|
_ScreenSongOptions.Selection.NumJokers = new[] {5, 5};
|
||||||
_ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
|
_ScreenSongOptions.Selection.TeamNames = new[] {"foo", "bar"};
|
||||||
|
|
||||||
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
||||||
_ScreenSongOptions.Sorting.SearchActive = false;
|
_ScreenSongOptions.Sorting.SearchActive = false;
|
||||||
@@ -284,9 +289,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
GameData.PlayerTeam2 = data.ScreenMain.PlayerTeam2;
|
GameData.PlayerTeam2 = data.ScreenMain.PlayerTeam2;
|
||||||
}
|
}
|
||||||
if (data.ScreenMain.FadeToNameSelection)
|
if (data.ScreenMain.FadeToNameSelection)
|
||||||
{
|
|
||||||
_Stage = EStage.Config;
|
_Stage = EStage.Config;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -471,9 +474,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
return NumFields;
|
return NumFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void JokerUsed(int TeamNr)
|
public override void JokerUsed(int TeamNr) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void SongSelected(int SongID)
|
public override void SongSelected(int SongID)
|
||||||
{
|
{
|
||||||
@@ -528,14 +529,19 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
int num = 0;
|
int num = 0;
|
||||||
int random = 0;
|
int random = 0;
|
||||||
//Add IDs to team-list
|
//Add IDs to team-list
|
||||||
while (GameData.PlayerTeam1.Count < GameData.NumFields + GameData.NumJokerRetry[0] && IDs1.Count == 0 && GameData.PlayerTeam2.Count < GameData.NumFields + GameData.NumJokerRetry[1] && IDs2.Count == 0)
|
while (GameData.PlayerTeam1.Count < GameData.NumFields + GameData.NumJokerRetry[0] && IDs1.Count == 0 &&
|
||||||
|
GameData.PlayerTeam2.Count < GameData.NumFields + GameData.NumJokerRetry[1] && IDs2.Count == 0)
|
||||||
{
|
{
|
||||||
if (IDs1.Count == 0)
|
if (IDs1.Count == 0)
|
||||||
|
{
|
||||||
for (int i = 0; i < GameData.NumPlayerTeam1; i++)
|
for (int i = 0; i < GameData.NumPlayerTeam1; i++)
|
||||||
IDs1.Add(i);
|
IDs1.Add(i);
|
||||||
|
}
|
||||||
if (IDs2.Count == 0)
|
if (IDs2.Count == 0)
|
||||||
|
{
|
||||||
for (int i = 0; i < GameData.NumPlayerTeam2; i++)
|
for (int i = 0; i < GameData.NumPlayerTeam2; i++)
|
||||||
IDs2.Add(i);
|
IDs2.Add(i);
|
||||||
|
}
|
||||||
if (GameData.PlayerTeam1.Count < GameData.NumFields + GameData.NumJokerRetry[0])
|
if (GameData.PlayerTeam1.Count < GameData.NumFields + GameData.NumJokerRetry[0])
|
||||||
{
|
{
|
||||||
random = CBase.Game.GetRandom((IDs1.Count - 1) * 10);
|
random = CBase.Game.GetRandom((IDs1.Count - 1) * 10);
|
||||||
@@ -566,8 +572,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
while (GameData.PlayerTeam1.Count < GameData.NumFields + GameData.NumJokerRetry[0] && IDs.Count == 0)
|
while (GameData.PlayerTeam1.Count < GameData.NumFields + GameData.NumJokerRetry[0] && IDs.Count == 0)
|
||||||
{
|
{
|
||||||
if (IDs.Count == 0)
|
if (IDs.Count == 0)
|
||||||
|
{
|
||||||
for (int i = 0; i < GameData.NumPlayerTeam1; i++)
|
for (int i = 0; i < GameData.NumPlayerTeam1; i++)
|
||||||
IDs.Add(i);
|
IDs.Add(i);
|
||||||
|
}
|
||||||
if (GameData.PlayerTeam1.Count < GameData.NumFields + GameData.NumJokerRetry[0])
|
if (GameData.PlayerTeam1.Count < GameData.NumFields + GameData.NumJokerRetry[0])
|
||||||
{
|
{
|
||||||
random = CBase.Game.GetRandom((IDs.Count - 1) * 10);
|
random = CBase.Game.GetRandom((IDs.Count - 1) * 10);
|
||||||
@@ -589,8 +597,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
while (GameData.PlayerTeam2.Count < GameData.NumFields + GameData.NumJokerRetry[1] && IDs.Count == 0)
|
while (GameData.PlayerTeam2.Count < GameData.NumFields + GameData.NumJokerRetry[1] && IDs.Count == 0)
|
||||||
{
|
{
|
||||||
if (IDs.Count == 0)
|
if (IDs.Count == 0)
|
||||||
|
{
|
||||||
for (int i = 0; i < GameData.NumPlayerTeam2; i++)
|
for (int i = 0; i < GameData.NumPlayerTeam2; i++)
|
||||||
IDs.Add(i);
|
IDs.Add(i);
|
||||||
|
}
|
||||||
if (GameData.PlayerTeam2.Count < GameData.NumFields + GameData.NumJokerRetry[1])
|
if (GameData.PlayerTeam2.Count < GameData.NumFields + GameData.NumJokerRetry[1])
|
||||||
{
|
{
|
||||||
random = CBase.Game.GetRandom((IDs.Count - 1) * 20);
|
random = CBase.Game.GetRandom((IDs.Count - 1) * 20);
|
||||||
@@ -623,7 +633,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(GameData.Songs.Count < (GameData.NumFields + GameData.NumJokerRandom[0] + GameData.NumJokerRandom[1])){
|
while (GameData.Songs.Count < (GameData.NumFields + GameData.NumJokerRandom[0] + GameData.NumJokerRandom[1]))
|
||||||
|
{
|
||||||
List<int> Songs = new List<int>();
|
List<int> Songs = new List<int>();
|
||||||
switch (GameData.SongSource)
|
switch (GameData.SongSource)
|
||||||
{
|
{
|
||||||
@@ -632,8 +643,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
{
|
{
|
||||||
int id = CBase.Playlist.GetPlaylistSong(GameData.PlaylistID, i).SongID;
|
int id = CBase.Playlist.GetPlaylistSong(GameData.PlaylistID, i).SongID;
|
||||||
foreach (EGameMode mode in CBase.Songs.GetSongByID(id).AvailableGameModes)
|
foreach (EGameMode mode in CBase.Songs.GetSongByID(id).AvailableGameModes)
|
||||||
|
{
|
||||||
if (mode == gm)
|
if (mode == gm)
|
||||||
Songs.Add(id);
|
Songs.Add(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -641,8 +654,10 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
for (int i = 0; i < CBase.Songs.GetNumSongs(); i++)
|
for (int i = 0; i < CBase.Songs.GetNumSongs(); i++)
|
||||||
{
|
{
|
||||||
foreach (EGameMode mode in CBase.Songs.GetSongByID(i).AvailableGameModes)
|
foreach (EGameMode mode in CBase.Songs.GetSongByID(i).AvailableGameModes)
|
||||||
|
{
|
||||||
if (mode == gm)
|
if (mode == gm)
|
||||||
Songs.Add(i);
|
Songs.Add(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -650,14 +665,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
CBase.Songs.SetCategory(GameData.CategoryID);
|
CBase.Songs.SetCategory(GameData.CategoryID);
|
||||||
for (int i = 0; i < CBase.Songs.NumSongsInCategory(GameData.CategoryID); i++)
|
for (int i = 0; i < CBase.Songs.NumSongsInCategory(GameData.CategoryID); i++)
|
||||||
{
|
{
|
||||||
foreach(EGameMode mode in CBase.Songs.GetVisibleSong(i).AvailableGameModes)
|
foreach (EGameMode mode in CBase.Songs.GetVisibleSong(i).AvailableGameModes)
|
||||||
if(mode == gm)
|
{
|
||||||
|
if (mode == gm)
|
||||||
Songs.Add(CBase.Songs.GetVisibleSong(i).ID);
|
Songs.Add(CBase.Songs.GetVisibleSong(i).ID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CBase.Songs.SetCategory(-1);
|
CBase.Songs.SetCategory(-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while(Songs.Count > 0)
|
while (Songs.Count > 0)
|
||||||
{
|
{
|
||||||
GameData.Songs.Add(Songs[CBase.Game.GetRandom(Songs.Count - 1)]);
|
GameData.Songs.Add(Songs[CBase.Game.GetRandom(Songs.Count - 1)]);
|
||||||
Songs.Remove(GameData.Songs[GameData.Songs.Count - 1]);
|
Songs.Remove(GameData.Songs[GameData.Songs.Count - 1]);
|
||||||
@@ -773,13 +790,9 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
GameData.Rounds[GameData.SingRoundNr].PointsTeam2 = (int)Math.Round(results[1].Points);
|
GameData.Rounds[GameData.SingRoundNr].PointsTeam2 = (int)Math.Round(results[1].Points);
|
||||||
GameData.Rounds[GameData.SingRoundNr].Finished = true;
|
GameData.Rounds[GameData.SingRoundNr].Finished = true;
|
||||||
if (GameData.Rounds[GameData.SingRoundNr].PointsTeam1 < GameData.Rounds[GameData.SingRoundNr].PointsTeam2)
|
if (GameData.Rounds[GameData.SingRoundNr].PointsTeam1 < GameData.Rounds[GameData.SingRoundNr].PointsTeam2)
|
||||||
{
|
|
||||||
GameData.Rounds[GameData.SingRoundNr].Winner = 2;
|
GameData.Rounds[GameData.SingRoundNr].Winner = 2;
|
||||||
}
|
|
||||||
else if (GameData.Rounds[GameData.SingRoundNr].PointsTeam1 > GameData.Rounds[GameData.SingRoundNr].PointsTeam2)
|
else if (GameData.Rounds[GameData.SingRoundNr].PointsTeam1 > GameData.Rounds[GameData.SingRoundNr].PointsTeam2)
|
||||||
{
|
|
||||||
GameData.Rounds[GameData.SingRoundNr].Winner = 1;
|
GameData.Rounds[GameData.SingRoundNr].Winner = 1;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameData.Rounds[GameData.SingRoundNr].Finished = false;
|
GameData.Rounds[GameData.SingRoundNr].Finished = false;
|
||||||
|
|||||||
@@ -7,32 +7,32 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
public class PartyScreenTicTacToeConfig : CMenuParty
|
public class PartyScreenTicTacToeConfig : CMenuParty
|
||||||
{
|
{
|
||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion { get { return 1; } }
|
protected override int _ScreenVersion
|
||||||
|
{
|
||||||
|
get { return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
const string SelectSlideNumPlayerTeam1 = "SelectSlideNumPlayerTeam1";
|
private const string SelectSlideNumPlayerTeam1 = "SelectSlideNumPlayerTeam1";
|
||||||
const string SelectSlideNumPlayerTeam2 = "SelectSlideNumPlayerTeam2";
|
private const string SelectSlideNumPlayerTeam2 = "SelectSlideNumPlayerTeam2";
|
||||||
const string SelectSlideNumFields = "SelectSlideNumFields";
|
private const string SelectSlideNumFields = "SelectSlideNumFields";
|
||||||
const string SelectSlideSongSource = "SelectSlideSongSource";
|
private const string SelectSlideSongSource = "SelectSlideSongSource";
|
||||||
const string SelectSlidePlaylist = "SelectSlidePlaylist";
|
private const string SelectSlidePlaylist = "SelectSlidePlaylist";
|
||||||
const string SelectSlideCategory = "SelectSlideCategory";
|
private const string SelectSlideCategory = "SelectSlideCategory";
|
||||||
const string SelectSlideGameMode = "SelectSlideGameMode";
|
private const string SelectSlideGameMode = "SelectSlideGameMode";
|
||||||
const string ButtonNext = "ButtonNext";
|
private const string ButtonNext = "ButtonNext";
|
||||||
const string ButtonBack = "ButtonBack";
|
private const string ButtonBack = "ButtonBack";
|
||||||
|
|
||||||
private bool ConfigOk = true;
|
private bool ConfigOk = true;
|
||||||
|
|
||||||
DataFromScreen Data;
|
private DataFromScreen Data;
|
||||||
|
|
||||||
public PartyScreenTicTacToeConfig()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|
||||||
_ThemeSelectSlides = new string[] { SelectSlideNumPlayerTeam1, SelectSlideNumPlayerTeam2, SelectSlideNumFields, SelectSlideSongSource, SelectSlidePlaylist, SelectSlideCategory, SelectSlideGameMode };
|
_ThemeSelectSlides = new[]
|
||||||
_ThemeButtons = new string[] { ButtonNext, ButtonBack };
|
{SelectSlideNumPlayerTeam1, SelectSlideNumPlayerTeam2, SelectSlideNumFields, SelectSlideSongSource, SelectSlidePlaylist, SelectSlideCategory, SelectSlideGameMode};
|
||||||
|
_ThemeButtons = new[] {ButtonNext, ButtonBack};
|
||||||
|
|
||||||
Data = new DataFromScreen();
|
Data = new DataFromScreen();
|
||||||
FromScreenConfig config = new FromScreenConfig();
|
FromScreenConfig config = new FromScreenConfig();
|
||||||
@@ -48,7 +48,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
|
|
||||||
public override void LoadTheme(string XmlPath)
|
public override void LoadTheme(string XmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DataToScreen(object ReceivedData)
|
public override void DataToScreen(object ReceivedData)
|
||||||
@@ -68,19 +68,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CBase.Log.LogError("Error in party mode screen TicTacToe config. Can't cast received data from game mode " + ThemeName + ". " + e.Message);;
|
CBase.Log.LogError("Error in party mode screen TicTacToe config. Can't cast received data from game mode " + ThemeName + ". " + e.Message);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
|
|
||||||
if (KeyEvent.KeyPressed)
|
if (KeyEvent.KeyPressed) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (KeyEvent.Key)
|
switch (KeyEvent.Key)
|
||||||
@@ -127,9 +124,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
|
||||||
Back();
|
Back();
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -161,18 +156,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
{
|
{
|
||||||
// build num player slide (min player ... max player);
|
// build num player slide (min player ... max player);
|
||||||
SelectSlides[SelectSlideNumPlayerTeam1].Clear();
|
SelectSlides[SelectSlideNumPlayerTeam1].Clear();
|
||||||
for (int i = _PartyMode.GetMinPlayer()/2; i <= _PartyMode.GetMaxPlayer() / 2; i++)
|
for (int i = _PartyMode.GetMinPlayer() / 2; i <= _PartyMode.GetMaxPlayer() / 2; i++)
|
||||||
{
|
|
||||||
SelectSlides[SelectSlideNumPlayerTeam1].AddValue(i.ToString());
|
SelectSlides[SelectSlideNumPlayerTeam1].AddValue(i.ToString());
|
||||||
}
|
SelectSlides[SelectSlideNumPlayerTeam1].Selection = Data.ScreenConfig.NumPlayerTeam1 - (_PartyMode.GetMinPlayer() / 2);
|
||||||
SelectSlides[SelectSlideNumPlayerTeam1].Selection = Data.ScreenConfig.NumPlayerTeam1 - (_PartyMode.GetMinPlayer()/2);
|
|
||||||
|
|
||||||
SelectSlides[SelectSlideNumPlayerTeam2].Clear();
|
SelectSlides[SelectSlideNumPlayerTeam2].Clear();
|
||||||
for (int i = _PartyMode.GetMinPlayer()/2; i <= _PartyMode.GetMaxPlayer() / 2; i++)
|
for (int i = _PartyMode.GetMinPlayer() / 2; i <= _PartyMode.GetMaxPlayer() / 2; i++)
|
||||||
{
|
|
||||||
SelectSlides[SelectSlideNumPlayerTeam2].AddValue(i.ToString());
|
SelectSlides[SelectSlideNumPlayerTeam2].AddValue(i.ToString());
|
||||||
}
|
SelectSlides[SelectSlideNumPlayerTeam2].Selection = Data.ScreenConfig.NumPlayerTeam2 - (_PartyMode.GetMinPlayer() / 2);
|
||||||
SelectSlides[SelectSlideNumPlayerTeam2].Selection = Data.ScreenConfig.NumPlayerTeam2 -( _PartyMode.GetMinPlayer()/2);
|
|
||||||
|
|
||||||
SelectSlides[SelectSlideNumFields].Clear();
|
SelectSlides[SelectSlideNumFields].Clear();
|
||||||
SelectSlides[SelectSlideNumFields].AddValue("9");
|
SelectSlides[SelectSlideNumFields].AddValue("9");
|
||||||
@@ -199,10 +190,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
SelectSlides[SelectSlidePlaylist].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST;
|
SelectSlides[SelectSlidePlaylist].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST;
|
||||||
|
|
||||||
string[] _Categories = new string[CBase.Songs.GetNumCategories()];
|
string[] _Categories = new string[CBase.Songs.GetNumCategories()];
|
||||||
for (int i = 0; i < CBase.Songs.GetNumCategories(); i++ )
|
for (int i = 0; i < CBase.Songs.GetNumCategories(); i++)
|
||||||
{
|
|
||||||
_Categories[i] = CBase.Songs.GetCategory(i).Name;
|
_Categories[i] = CBase.Songs.GetCategory(i).Name;
|
||||||
}
|
|
||||||
SelectSlides[SelectSlideCategory].Clear();
|
SelectSlides[SelectSlideCategory].Clear();
|
||||||
for (int i = 0; i < _Categories.Length; i++)
|
for (int i = 0; i < _Categories.Length; i++)
|
||||||
{
|
{
|
||||||
@@ -218,8 +207,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
|
|
||||||
private void UpdateSlides()
|
private void UpdateSlides()
|
||||||
{
|
{
|
||||||
Data.ScreenConfig.NumPlayerTeam1 = SelectSlides[SelectSlideNumPlayerTeam1].Selection + (_PartyMode.GetMinPlayer()/2);
|
Data.ScreenConfig.NumPlayerTeam1 = SelectSlides[SelectSlideNumPlayerTeam1].Selection + (_PartyMode.GetMinPlayer() / 2);
|
||||||
Data.ScreenConfig.NumPlayerTeam2 = SelectSlides[SelectSlideNumPlayerTeam2].Selection + (_PartyMode.GetMinPlayer()/2);
|
Data.ScreenConfig.NumPlayerTeam2 = SelectSlides[SelectSlideNumPlayerTeam2].Selection + (_PartyMode.GetMinPlayer() / 2);
|
||||||
|
|
||||||
if (SelectSlides[SelectSlideNumFields].Selection == 0)
|
if (SelectSlides[SelectSlideNumFields].Selection == 0)
|
||||||
Data.ScreenConfig.NumFields = 9;
|
Data.ScreenConfig.NumFields = 9;
|
||||||
@@ -253,6 +242,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
if (Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST)
|
if (Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST)
|
||||||
{
|
{
|
||||||
if (CBase.Playlist.GetNumPlaylists() > 0)
|
if (CBase.Playlist.GetNumPlaylists() > 0)
|
||||||
|
{
|
||||||
if (CBase.Playlist.GetPlaylistSongCount(Data.ScreenConfig.PlaylistID) > 0)
|
if (CBase.Playlist.GetPlaylistSongCount(Data.ScreenConfig.PlaylistID) > 0)
|
||||||
{
|
{
|
||||||
ConfigOk = false;
|
ConfigOk = false;
|
||||||
@@ -260,23 +250,27 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
{
|
{
|
||||||
int id = CBase.Playlist.GetPlaylistSong(Data.ScreenConfig.PlaylistID, i).SongID;
|
int id = CBase.Playlist.GetPlaylistSong(Data.ScreenConfig.PlaylistID, i).SongID;
|
||||||
foreach (EGameMode mode in CBase.Songs.GetSongByID(id).AvailableGameModes)
|
foreach (EGameMode mode in CBase.Songs.GetSongByID(id).AvailableGameModes)
|
||||||
|
{
|
||||||
if (mode == gm)
|
if (mode == gm)
|
||||||
{
|
{
|
||||||
ConfigOk = true;
|
ConfigOk = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (ConfigOk)
|
if (ConfigOk)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ConfigOk = false;
|
ConfigOk = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ConfigOk = false;
|
ConfigOk = false;
|
||||||
}
|
}
|
||||||
if (Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY)
|
if (Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY)
|
||||||
{
|
{
|
||||||
if (CBase.Songs.GetNumCategories() > 0)
|
if (CBase.Songs.GetNumCategories() > 0)
|
||||||
|
{
|
||||||
if (CBase.Songs.NumSongsInCategory(Data.ScreenConfig.CategoryID) > 0)
|
if (CBase.Songs.NumSongsInCategory(Data.ScreenConfig.CategoryID) > 0)
|
||||||
{
|
{
|
||||||
CBase.Songs.SetCategory(Data.ScreenConfig.CategoryID);
|
CBase.Songs.SetCategory(Data.ScreenConfig.CategoryID);
|
||||||
@@ -284,11 +278,13 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
for (int i = 0; i < CBase.Songs.NumSongsInCategory(Data.ScreenConfig.CategoryID); i++)
|
for (int i = 0; i < CBase.Songs.NumSongsInCategory(Data.ScreenConfig.CategoryID); i++)
|
||||||
{
|
{
|
||||||
foreach (EGameMode mode in CBase.Songs.GetVisibleSong(i).AvailableGameModes)
|
foreach (EGameMode mode in CBase.Songs.GetVisibleSong(i).AvailableGameModes)
|
||||||
|
{
|
||||||
if (mode == gm)
|
if (mode == gm)
|
||||||
{
|
{
|
||||||
ConfigOk = true;
|
ConfigOk = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (ConfigOk)
|
if (ConfigOk)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -296,6 +292,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
ConfigOk = false;
|
ConfigOk = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ConfigOk = false;
|
ConfigOk = false;
|
||||||
}
|
}
|
||||||
@@ -306,11 +303,13 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
for (int i = 0; i < CBase.Songs.GetNumSongs(); i++)
|
for (int i = 0; i < CBase.Songs.GetNumSongs(); i++)
|
||||||
{
|
{
|
||||||
foreach (EGameMode mode in CBase.Songs.GetSongByID(i).AvailableGameModes)
|
foreach (EGameMode mode in CBase.Songs.GetSongByID(i).AvailableGameModes)
|
||||||
|
{
|
||||||
if (mode == gm)
|
if (mode == gm)
|
||||||
{
|
{
|
||||||
ConfigOk = true;
|
ConfigOk = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (ConfigOk)
|
if (ConfigOk)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,34 +23,36 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
public class PartyScreenTicTacToeMain : CMenuParty
|
public class PartyScreenTicTacToeMain : CMenuParty
|
||||||
{
|
{
|
||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion { get { return 1; } }
|
protected override int _ScreenVersion
|
||||||
|
{
|
||||||
|
get { return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
const string TextPopupReallyExit = "TextPopupReallyExit";
|
private const string TextPopupReallyExit = "TextPopupReallyExit";
|
||||||
const string TextTeamChoosing = "TextTeamChoosing";
|
private const string TextTeamChoosing = "TextTeamChoosing";
|
||||||
const string TextFinishMessage = "TextFinishMessage";
|
private const string TextFinishMessage = "TextFinishMessage";
|
||||||
const string TextNextPlayerT1 = "TextNextPlayerT1";
|
private const string TextNextPlayerT1 = "TextNextPlayerT1";
|
||||||
const string TextNextPlayerT2 = "TextNextPlayerT2";
|
private const string TextNextPlayerT2 = "TextNextPlayerT2";
|
||||||
const string TextNextPlayerNameT1 = "TextNextPlayerNameT1";
|
private const string TextNextPlayerNameT1 = "TextNextPlayerNameT1";
|
||||||
const string TextNextPlayerNameT2 = "TextNextPlayerNameT2";
|
private const string TextNextPlayerNameT2 = "TextNextPlayerNameT2";
|
||||||
|
|
||||||
const string ButtonNextRound = "ButtonNextRound";
|
private const string ButtonNextRound = "ButtonNextRound";
|
||||||
const string ButtonBack = "ButtonBack";
|
private const string ButtonBack = "ButtonBack";
|
||||||
const string ButtonExit = "ButtonExit";
|
private const string ButtonExit = "ButtonExit";
|
||||||
const string ButtonPopupYes = "ButtonPopupYes";
|
private const string ButtonPopupYes = "ButtonPopupYes";
|
||||||
const string ButtonPopupNo = "ButtonPopupNo";
|
private const string ButtonPopupNo = "ButtonPopupNo";
|
||||||
const string ButtonField = "ButtonField";
|
private const string ButtonField = "ButtonField";
|
||||||
|
|
||||||
const string ButtonJokerRandomT1 = "ButtonJokerRandomT1";
|
private const string ButtonJokerRandomT1 = "ButtonJokerRandomT1";
|
||||||
const string ButtonJokerRandomT2 = "ButtonJokerRandomT2";
|
private const string ButtonJokerRandomT2 = "ButtonJokerRandomT2";
|
||||||
const string ButtonJokerRetryT1 = "ButtonJokerRetryT1";
|
private const string ButtonJokerRetryT1 = "ButtonJokerRetryT1";
|
||||||
const string ButtonJokerRetryT2 = "ButtonJokerRetryT2";
|
private const string ButtonJokerRetryT2 = "ButtonJokerRetryT2";
|
||||||
|
|
||||||
|
private const string StaticPopupBG = "StaticPopupBG";
|
||||||
|
private const string StaticAvatarT1 = "StaticAvatarT1";
|
||||||
|
private const string StaticAvatarT2 = "StaticAvatarT2";
|
||||||
|
|
||||||
const string StaticPopupBG = "StaticPopupBG";
|
private bool ExitPopupVisible;
|
||||||
const string StaticAvatarT1 = "StaticAvatarT1";
|
|
||||||
const string StaticAvatarT2 = "StaticAvatarT2";
|
|
||||||
|
|
||||||
private bool ExitPopupVisible = false;
|
|
||||||
|
|
||||||
private DataFromScreen Data;
|
private DataFromScreen Data;
|
||||||
private DataToScreenMain GameData;
|
private DataToScreenMain GameData;
|
||||||
@@ -68,17 +70,17 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
private int[,] Possibilities;
|
private int[,] Possibilities;
|
||||||
private EStatus Status;
|
private EStatus Status;
|
||||||
|
|
||||||
public PartyScreenTicTacToeMain()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
|
|
||||||
_ThemeTexts = new string[] { TextPopupReallyExit, TextTeamChoosing, TextFinishMessage, TextNextPlayerT1, TextNextPlayerT2, TextNextPlayerNameT1, TextNextPlayerNameT2 };
|
_ThemeTexts = new[] {TextPopupReallyExit, TextTeamChoosing, TextFinishMessage, TextNextPlayerT1, TextNextPlayerT2, TextNextPlayerNameT1, TextNextPlayerNameT2};
|
||||||
_ThemeButtons = new string[] { ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo, ButtonField, ButtonJokerRandomT1, ButtonJokerRandomT2, ButtonJokerRetryT1, ButtonJokerRetryT2 };
|
_ThemeButtons = new[]
|
||||||
_ThemeStatics = new string[] { StaticPopupBG, StaticAvatarT1, StaticAvatarT2 };
|
{
|
||||||
|
ButtonNextRound, ButtonBack, ButtonExit, ButtonPopupYes, ButtonPopupNo, ButtonField, ButtonJokerRandomT1, ButtonJokerRandomT2, ButtonJokerRetryT1,
|
||||||
|
ButtonJokerRetryT2
|
||||||
|
};
|
||||||
|
_ThemeStatics = new[] {StaticPopupBG, StaticAvatarT1, StaticAvatarT2};
|
||||||
|
|
||||||
Data = new DataFromScreen();
|
Data = new DataFromScreen();
|
||||||
FromScreenMain config = new FromScreenMain();
|
FromScreenMain config = new FromScreenMain();
|
||||||
@@ -97,7 +99,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
|
|
||||||
public override void LoadTheme(string XmlPath)
|
public override void LoadTheme(string XmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
|
|
||||||
CreateFields();
|
CreateFields();
|
||||||
Buttons[ButtonField].Visible = false;
|
Buttons[ButtonField].Visible = false;
|
||||||
@@ -114,19 +116,16 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CBase.Log.LogError("Error in party mode screen TicTacToe main. Can't cast received data from game mode " + ThemeName + ". " + e.Message); ;
|
CBase.Log.LogError("Error in party mode screen TicTacToe main. Can't cast received data from game mode " + ThemeName + ". " + e.Message);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
|
|
||||||
if (KeyEvent.KeyPressed)
|
if (KeyEvent.KeyPressed) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (KeyEvent.Key)
|
switch (KeyEvent.Key)
|
||||||
@@ -134,12 +133,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
case Keys.Back:
|
case Keys.Back:
|
||||||
case Keys.Escape:
|
case Keys.Escape:
|
||||||
if (!ExitPopupVisible)
|
if (!ExitPopupVisible)
|
||||||
|
{
|
||||||
if (GameData.CurrentRoundNr == 1 && Status != EStatus.FieldSelected)
|
if (GameData.CurrentRoundNr == 1 && Status != EStatus.FieldSelected)
|
||||||
Back();
|
Back();
|
||||||
else if(Status == EStatus.None)
|
else if (Status == EStatus.None)
|
||||||
EndParty();
|
EndParty();
|
||||||
else
|
else
|
||||||
ShowPopup(true);
|
ShowPopup(true);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ShowPopup(false);
|
ShowPopup(false);
|
||||||
break;
|
break;
|
||||||
@@ -214,10 +215,12 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
if (Buttons[ButtonBack].Selected)
|
if (Buttons[ButtonBack].Selected)
|
||||||
Back();
|
Back();
|
||||||
if (Buttons[ButtonExit].Selected)
|
if (Buttons[ButtonExit].Selected)
|
||||||
|
{
|
||||||
if (Status == EStatus.None)
|
if (Status == EStatus.None)
|
||||||
EndParty();
|
EndParty();
|
||||||
else
|
else
|
||||||
ShowPopup(true);
|
ShowPopup(true);
|
||||||
|
}
|
||||||
for (int i = 0; i < GameData.NumFields; i++)
|
for (int i = 0; i < GameData.NumFields; i++)
|
||||||
{
|
{
|
||||||
switch (Status)
|
switch (Status)
|
||||||
@@ -239,7 +242,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Status == EStatus.FieldSelected)
|
if (Status == EStatus.FieldSelected)
|
||||||
{
|
{
|
||||||
if (Buttons[ButtonJokerRandomT1].Selected)
|
if (Buttons[ButtonJokerRandomT1].Selected)
|
||||||
UseJoker(0, 0);
|
UseJoker(0, 0);
|
||||||
@@ -249,7 +252,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
UseJoker(0, 1);
|
UseJoker(0, 1);
|
||||||
if (Buttons[ButtonJokerRetryT2].Selected)
|
if (Buttons[ButtonJokerRetryT2].Selected)
|
||||||
UseJoker(1, 1);
|
UseJoker(1, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -264,19 +266,19 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
{
|
||||||
if (!ExitPopupVisible)
|
if (!ExitPopupVisible)
|
||||||
|
{
|
||||||
if (GameData.CurrentRoundNr == 1 && Status != EStatus.FieldSelected)
|
if (GameData.CurrentRoundNr == 1 && Status != EStatus.FieldSelected)
|
||||||
Back();
|
Back();
|
||||||
else if(Status == EStatus.None)
|
else if (Status == EStatus.None)
|
||||||
EndParty();
|
EndParty();
|
||||||
else
|
else
|
||||||
ShowPopup(true);
|
ShowPopup(true);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ShowPopup(false);
|
ShowPopup(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MouseEvent.Wheel != 0)
|
if (MouseEvent.Wheel != 0) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -333,7 +335,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
if (Winner > 0)
|
if (Winner > 0)
|
||||||
{
|
{
|
||||||
Texts[TextFinishMessage].Color = CBase.Theme.GetPlayerColor(Winner);
|
Texts[TextFinishMessage].Color = CBase.Theme.GetPlayerColor(Winner);
|
||||||
Texts[TextFinishMessage].Text = CBase.Language.Translate("TR_SCREENMAIN_WINNER", _PartyModeID) + " " + CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + Winner;
|
Texts[TextFinishMessage].Text = CBase.Language.Translate("TR_SCREENMAIN_WINNER", _PartyModeID) + " " + CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " +
|
||||||
|
Winner;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -379,7 +382,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
|
|
||||||
private void UpdateFields()
|
private void UpdateFields()
|
||||||
{
|
{
|
||||||
int NumOneRow = (int)Math.Sqrt((double)GameData.NumFields);
|
int NumOneRow = (int)Math.Sqrt(GameData.NumFields);
|
||||||
float FieldSizeY = (CBase.Settings.GetRenderH() - 150 - NumOneRow * FieldSpace) / NumOneRow;
|
float FieldSizeY = (CBase.Settings.GetRenderH() - 150 - NumOneRow * FieldSpace) / NumOneRow;
|
||||||
float FieldSizeX = (CBase.Settings.GetRenderW() - 300 - NumOneRow * FieldSpace) / NumOneRow;
|
float FieldSizeX = (CBase.Settings.GetRenderW() - 300 - NumOneRow * FieldSpace) / NumOneRow;
|
||||||
if (FieldSizeX < FieldSizeY)
|
if (FieldSizeX < FieldSizeY)
|
||||||
@@ -403,7 +406,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
Fields[i].Button.Visible = true;
|
Fields[i].Button.Visible = true;
|
||||||
Fields[i].Button.Enabled = true;
|
Fields[i].Button.Enabled = true;
|
||||||
column++;
|
column++;
|
||||||
if ((i+1) >= NumOneRow * (row+1))
|
if ((i + 1) >= NumOneRow * (row + 1))
|
||||||
{
|
{
|
||||||
column = 0;
|
column = 0;
|
||||||
row++;
|
row++;
|
||||||
@@ -446,17 +449,13 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
}
|
}
|
||||||
if (Status == EStatus.JokerRetry && Fields[i].Content.Finished)
|
if (Status == EStatus.JokerRetry && Fields[i].Content.Finished)
|
||||||
{
|
{
|
||||||
Fields[i].Button.SColor = CBase.Theme.GetPlayerColor(GameData.Team+1);
|
Fields[i].Button.SColor = CBase.Theme.GetPlayerColor(GameData.Team + 1);
|
||||||
Fields[i].Button.Enabled = true;
|
Fields[i].Button.Enabled = true;
|
||||||
}
|
}
|
||||||
if (Status == EStatus.JokerRetry && !Fields[i].Content.Finished)
|
if (Status == EStatus.JokerRetry && !Fields[i].Content.Finished)
|
||||||
{
|
|
||||||
Fields[i].Button.Enabled = false;
|
Fields[i].Button.Enabled = false;
|
||||||
}
|
if (Status == EStatus.FieldSelected)
|
||||||
if(Status == EStatus.FieldSelected)
|
|
||||||
{
|
|
||||||
Fields[i].Button.Enabled = false;
|
Fields[i].Button.Enabled = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,7 +500,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
Texts[TextNextPlayerT2].Visible = true;
|
Texts[TextNextPlayerT2].Visible = true;
|
||||||
Texts[TextNextPlayerNameT1].Visible = true;
|
Texts[TextNextPlayerNameT1].Visible = true;
|
||||||
Texts[TextNextPlayerNameT2].Visible = true;
|
Texts[TextNextPlayerNameT2].Visible = true;
|
||||||
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
SProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||||
Texts[TextNextPlayerNameT1].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName;
|
Texts[TextNextPlayerNameT1].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName;
|
||||||
Texts[TextNextPlayerNameT2].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName;
|
Texts[TextNextPlayerNameT2].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName;
|
||||||
Statics[StaticAvatarT1].Visible = true;
|
Statics[StaticAvatarT1].Visible = true;
|
||||||
@@ -561,7 +560,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
{
|
{
|
||||||
switch (JokerNum)
|
switch (JokerNum)
|
||||||
{
|
{
|
||||||
//Random-Joker
|
//Random-Joker
|
||||||
case 0:
|
case 0:
|
||||||
if (GameData.NumJokerRandom[TeamNr] > 0)
|
if (GameData.NumJokerRandom[TeamNr] > 0)
|
||||||
{
|
{
|
||||||
@@ -572,7 +571,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//Retry-Joker
|
//Retry-Joker
|
||||||
case 1:
|
case 1:
|
||||||
if (GameData.NumJokerRetry[TeamNr] > 0 && GameData.CurrentRoundNr > 1)
|
if (GameData.NumJokerRetry[TeamNr] > 0 && GameData.CurrentRoundNr > 1)
|
||||||
{
|
{
|
||||||
@@ -593,7 +592,8 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
private void UpdateTeamChoosingMessage()
|
private void UpdateTeamChoosingMessage()
|
||||||
{
|
{
|
||||||
Texts[TextTeamChoosing].Color = CBase.Theme.GetPlayerColor(GameData.Team + 1);
|
Texts[TextTeamChoosing].Color = CBase.Theme.GetPlayerColor(GameData.Team + 1);
|
||||||
Texts[TextTeamChoosing].Text = CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + (GameData.Team + 1) + "! " + CBase.Language.Translate("TR_SCREENMAIN_TEAM_CHOOSE", _PartyModeID);
|
Texts[TextTeamChoosing].Text = CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + (GameData.Team + 1) + "! " +
|
||||||
|
CBase.Language.Translate("TR_SCREENMAIN_TEAM_CHOOSE", _PartyModeID);
|
||||||
if (Status == EStatus.JokerRetry || Status == EStatus.FieldChoosing)
|
if (Status == EStatus.JokerRetry || Status == EStatus.FieldChoosing)
|
||||||
Texts[TextTeamChoosing].Visible = true;
|
Texts[TextTeamChoosing].Visible = true;
|
||||||
else
|
else
|
||||||
@@ -659,36 +659,29 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
|
|
||||||
private int BuildWinnerPossibilities()
|
private int BuildWinnerPossibilities()
|
||||||
{
|
{
|
||||||
int NumOneRow = (int)Math.Sqrt((double)GameData.NumFields);
|
int NumOneRow = (int)Math.Sqrt(GameData.NumFields);
|
||||||
Possibilities = new int[(NumOneRow * 2) + 2, NumOneRow];
|
Possibilities = new int[(NumOneRow * 2) + 2,NumOneRow];
|
||||||
for (int i = 0; i < Possibilities.GetLength(0); i++)
|
for (int i = 0; i < Possibilities.GetLength(0); i++)
|
||||||
{
|
{
|
||||||
if (i < NumOneRow)
|
if (i < NumOneRow)
|
||||||
{
|
{
|
||||||
for(int c = 0; c < NumOneRow; c++){
|
for (int c = 0; c < NumOneRow; c++)
|
||||||
Possibilities[i, c] = i * NumOneRow + c;
|
Possibilities[i, c] = i * NumOneRow + c;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (i < NumOneRow * 2)
|
else if (i < NumOneRow * 2)
|
||||||
{
|
{
|
||||||
for (int c = 0; c < NumOneRow; c++)
|
for (int c = 0; c < NumOneRow; c++)
|
||||||
{
|
Possibilities[i, c] = (i - NumOneRow) + (c * NumOneRow);
|
||||||
Possibilities[i, c] = (i-NumOneRow) + (c*NumOneRow);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if( i == Possibilities.GetLength(0) - 2)
|
else if (i == Possibilities.GetLength(0) - 2)
|
||||||
{
|
{
|
||||||
for (int c = 0; c < NumOneRow;c++)
|
for (int c = 0; c < NumOneRow; c++)
|
||||||
{
|
|
||||||
Possibilities[i, c] = (NumOneRow + 1) * c;
|
Possibilities[i, c] = (NumOneRow + 1) * c;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (i == Possibilities.GetLength(0) - 1)
|
else if (i == Possibilities.GetLength(0) - 1)
|
||||||
{
|
{
|
||||||
for (int c = 0; c < NumOneRow; c++)
|
for (int c = 0; c < NumOneRow; c++)
|
||||||
{
|
|
||||||
Possibilities[i, c] = (NumOneRow - 1) * c + (NumOneRow - 1);
|
Possibilities[i, c] = (NumOneRow - 1) * c + (NumOneRow - 1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -8,14 +8,17 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
public class PartyScreenTicTacToeNames : CMenuParty
|
public class PartyScreenTicTacToeNames : CMenuParty
|
||||||
{
|
{
|
||||||
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
// Version number for theme files. Increment it, if you've changed something on the theme files!
|
||||||
protected override int _ScreenVersion { get { return 1; } }
|
protected override int _ScreenVersion
|
||||||
|
{
|
||||||
|
get { return 1; }
|
||||||
|
}
|
||||||
|
|
||||||
const string ButtonNext = "ButtonNext";
|
private const string ButtonNext = "ButtonNext";
|
||||||
const string ButtonBack = "ButtonBack";
|
private const string ButtonBack = "ButtonBack";
|
||||||
const string ButtonPlayerDestination = "ButtonPlayerDestination";
|
private const string ButtonPlayerDestination = "ButtonPlayerDestination";
|
||||||
const string ButtonPlayerChoose = "ButtonPlayerChoose";
|
private const string ButtonPlayerChoose = "ButtonPlayerChoose";
|
||||||
const string ButtonPlayerChooseScrollUp = "ButtonPlayerChooseScrollUp";
|
private const string ButtonPlayerChooseScrollUp = "ButtonPlayerChooseScrollUp";
|
||||||
const string ButtonPlayerChooseScrollDown = "ButtonPlayerChooseScrollDown";
|
private const string ButtonPlayerChooseScrollDown = "ButtonPlayerChooseScrollDown";
|
||||||
|
|
||||||
private List<CPlayerChooseButton> PlayerChooseButtons;
|
private List<CPlayerChooseButton> PlayerChooseButtons;
|
||||||
private List<CButton> PlayerDestinationButtons;
|
private List<CButton> PlayerDestinationButtons;
|
||||||
@@ -34,14 +37,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
private const int PlayerChooseButtonsFirstY = 105;
|
private const int PlayerChooseButtonsFirstY = 105;
|
||||||
private const int PlayerChooseButtonsSpaceH = 15;
|
private const int PlayerChooseButtonsSpaceH = 15;
|
||||||
private const int PlayerChooseButtonsSpaceW = 25;
|
private const int PlayerChooseButtonsSpaceW = 25;
|
||||||
private int PlayerChooseButtonsOffset = 0;
|
private int PlayerChooseButtonsOffset;
|
||||||
|
|
||||||
private CStatic chooseAvatarStatic;
|
private CStatic chooseAvatarStatic;
|
||||||
private bool SelectingMouseActive = false;
|
private bool SelectingMouseActive;
|
||||||
private int OldMouseX = 0;
|
private int OldMouseX;
|
||||||
private int OldMouseY = 0;
|
private int OldMouseY;
|
||||||
private int SelectedPlayerNr = -1;
|
private int SelectedPlayerNr = -1;
|
||||||
private bool ButtonsAdded = false;
|
private bool ButtonsAdded;
|
||||||
|
|
||||||
private int NumPlayerTeam1 = 2;
|
private int NumPlayerTeam1 = 2;
|
||||||
private int NumPlayerTeam2 = 2;
|
private int NumPlayerTeam2 = 2;
|
||||||
@@ -54,10 +57,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
public int ProfileID;
|
public int ProfileID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PartyScreenTicTacToeNames()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
base.Init();
|
base.Init();
|
||||||
@@ -71,7 +70,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
Data.ScreenNames.ProfileIDsTeam2 = new List<int>();
|
Data.ScreenNames.ProfileIDsTeam2 = new List<int>();
|
||||||
|
|
||||||
List<string> buttons = new List<string>();
|
List<string> buttons = new List<string>();
|
||||||
_ThemeButtons = new string[] { ButtonBack, ButtonNext, ButtonPlayerDestination, ButtonPlayerChoose, ButtonPlayerChooseScrollUp, ButtonPlayerChooseScrollDown };
|
_ThemeButtons = new[] {ButtonBack, ButtonNext, ButtonPlayerDestination, ButtonPlayerChoose, ButtonPlayerChooseScrollUp, ButtonPlayerChooseScrollDown};
|
||||||
|
|
||||||
Data = new DataFromScreen();
|
Data = new DataFromScreen();
|
||||||
FromScreenNames names = new FromScreenNames();
|
FromScreenNames names = new FromScreenNames();
|
||||||
@@ -84,7 +83,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
|
|
||||||
public override void LoadTheme(string XmlPath)
|
public override void LoadTheme(string XmlPath)
|
||||||
{
|
{
|
||||||
base.LoadTheme(XmlPath);
|
base.LoadTheme(XmlPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DataToScreen(object ReceivedData)
|
public override void DataToScreen(object ReceivedData)
|
||||||
@@ -105,62 +104,53 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
NumPlayerTeam2 = config.NumPlayerTeam2;
|
NumPlayerTeam2 = config.NumPlayerTeam2;
|
||||||
|
|
||||||
while (Data.ScreenNames.ProfileIDsTeam1.Count > NumPlayerTeam1)
|
while (Data.ScreenNames.ProfileIDsTeam1.Count > NumPlayerTeam1)
|
||||||
{
|
|
||||||
Data.ScreenNames.ProfileIDsTeam1.RemoveAt(Data.ScreenNames.ProfileIDsTeam1.Count - 1);
|
Data.ScreenNames.ProfileIDsTeam1.RemoveAt(Data.ScreenNames.ProfileIDsTeam1.Count - 1);
|
||||||
}
|
|
||||||
while (Data.ScreenNames.ProfileIDsTeam2.Count > NumPlayerTeam2)
|
while (Data.ScreenNames.ProfileIDsTeam2.Count > NumPlayerTeam2)
|
||||||
{
|
|
||||||
Data.ScreenNames.ProfileIDsTeam2.RemoveAt(Data.ScreenNames.ProfileIDsTeam2.Count - 1);
|
Data.ScreenNames.ProfileIDsTeam2.RemoveAt(Data.ScreenNames.ProfileIDsTeam2.Count - 1);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
CBase.Log.LogError("Error in party mode screen TicTacToe names. Can't cast received data from game mode " + ThemeName + ". " + e.Message); ;
|
CBase.Log.LogError("Error in party mode screen TicTacToe names. Can't cast received data from game mode " + ThemeName + ". " + e.Message);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput(KeyEvent KeyEvent)
|
public override bool HandleInput(KeyEvent KeyEvent)
|
||||||
{
|
{
|
||||||
base.HandleInput(KeyEvent);
|
base.HandleInput(KeyEvent);
|
||||||
|
|
||||||
if (KeyEvent.KeyPressed)
|
if (KeyEvent.KeyPressed) {}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (KeyEvent.Key)
|
||||||
{
|
{
|
||||||
|
case Keys.Back:
|
||||||
|
case Keys.Escape:
|
||||||
|
Back();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case Keys.Enter:
|
||||||
else
|
if (Buttons[ButtonBack].Selected)
|
||||||
{
|
|
||||||
switch (KeyEvent.Key)
|
|
||||||
{
|
|
||||||
case Keys.Back:
|
|
||||||
case Keys.Escape:
|
|
||||||
Back();
|
Back();
|
||||||
break;
|
|
||||||
|
|
||||||
case Keys.Enter:
|
if (Buttons[ButtonNext].Selected)
|
||||||
if (Buttons[ButtonBack].Selected)
|
Next();
|
||||||
Back();
|
|
||||||
|
|
||||||
if (Buttons[ButtonNext].Selected)
|
if (Buttons[ButtonPlayerChooseScrollUp].Selected)
|
||||||
Next();
|
Scroll(-1);
|
||||||
|
|
||||||
if (Buttons[ButtonPlayerChooseScrollUp].Selected)
|
if (Buttons[ButtonPlayerChooseScrollDown].Selected)
|
||||||
Scroll(-1);
|
Scroll(1);
|
||||||
|
|
||||||
if (Buttons[ButtonPlayerChooseScrollDown].Selected)
|
if (!OnAdd())
|
||||||
Scroll(1);
|
|
||||||
|
|
||||||
if (!OnAdd())
|
|
||||||
OnRemove();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Keys.Delete:
|
|
||||||
OnRemove();
|
OnRemove();
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
case Keys.Delete:
|
||||||
|
OnRemove();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +197,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// LeftButton isn't hold anymore, but Selec-Mode is still active -> "Drop" of Avatar
|
// 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
|
//Check if really a player was selected
|
||||||
@@ -217,7 +207,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
for (int i = 0; i < PlayerDestinationButtons.Count; i++)
|
||||||
{
|
{
|
||||||
//Check first, if area is "active"
|
//Check first, if area is "active"
|
||||||
if (PlayerDestinationButtons[i].Visible == true)
|
if (PlayerDestinationButtons[i].Visible)
|
||||||
{
|
{
|
||||||
//Check if Mouse is in area
|
//Check if Mouse is in area
|
||||||
if (CHelper.IsInBounds(PlayerDestinationButtons[i].Rect, MouseEvent))
|
if (CHelper.IsInBounds(PlayerDestinationButtons[i].Rect, MouseEvent))
|
||||||
@@ -286,14 +276,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
Scroll(1);
|
Scroll(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(MouseEvent.LD && IsMouseOver(MouseEvent))
|
if (MouseEvent.LD && IsMouseOver(MouseEvent))
|
||||||
|
{
|
||||||
if (!OnAdd())
|
if (!OnAdd())
|
||||||
OnRemove();
|
OnRemove();
|
||||||
|
}
|
||||||
|
|
||||||
if (MouseEvent.RB)
|
if (MouseEvent.RB)
|
||||||
{
|
|
||||||
Back();
|
Back();
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -340,7 +330,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
PlayerChooseButtonsOffset += Offset;
|
PlayerChooseButtonsOffset += Offset;
|
||||||
UpdateButtonPlayerChoose();
|
UpdateButtonPlayerChoose();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddButtonPlayerDestination()
|
private void AddButtonPlayerDestination()
|
||||||
@@ -397,16 +386,14 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
private void UpdateButtonPlayerChoose()
|
private void UpdateButtonPlayerChoose()
|
||||||
{
|
{
|
||||||
UpdateVisibleProfiles();
|
UpdateVisibleProfiles();
|
||||||
if ((PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * (PlayerChooseButtonsOffset + 1) - PlayerChooseButtonsVisibleProfiles.Count >= (PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * PlayerChooseButtonsOffset)
|
if ((PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * (PlayerChooseButtonsOffset + 1) - PlayerChooseButtonsVisibleProfiles.Count >=
|
||||||
{
|
(PlayerChooseButtonsNumW * PlayerChooseButtonsNumH) * PlayerChooseButtonsOffset)
|
||||||
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset - 1);
|
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset - 1);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset);
|
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset);
|
||||||
}
|
|
||||||
Buttons[ButtonPlayerChooseScrollUp].Enabled = PlayerChooseButtonsOffset > 0;
|
Buttons[ButtonPlayerChooseScrollUp].Enabled = PlayerChooseButtonsOffset > 0;
|
||||||
Buttons[ButtonPlayerChooseScrollDown].Enabled = PlayerChooseButtonsVisibleProfiles.Count > PlayerChooseButtons.Count + PlayerChooseButtonsOffset * PlayerChooseButtonsNumH;
|
Buttons[ButtonPlayerChooseScrollDown].Enabled = PlayerChooseButtonsVisibleProfiles.Count >
|
||||||
|
PlayerChooseButtons.Count + PlayerChooseButtonsOffset * PlayerChooseButtonsNumH;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateButtonPlayerChoose(int Offset)
|
private void UpdateButtonPlayerChoose(int Offset)
|
||||||
@@ -475,9 +462,7 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (visible)
|
if (visible)
|
||||||
{
|
|
||||||
PlayerChooseButtonsVisibleProfiles.Add(i);
|
PlayerChooseButtonsVisibleProfiles.Add(i);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -632,11 +617,11 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = PlayerDestinationButtonsNumH; i < PlayerDestinationButtonsNumH*2; i++)
|
for (int i = PlayerDestinationButtonsNumH; i < PlayerDestinationButtonsNumH * 2; i++)
|
||||||
{
|
{
|
||||||
if (PlayerDestinationButtons[i].Selected)
|
if (PlayerDestinationButtons[i].Selected)
|
||||||
{
|
{
|
||||||
if (((i-PlayerDestinationButtonsNumH) + 1) <= Data.ScreenNames.ProfileIDsTeam2.Count)
|
if (((i - PlayerDestinationButtonsNumH) + 1) <= Data.ScreenNames.ProfileIDsTeam2.Count)
|
||||||
{
|
{
|
||||||
Data.ScreenNames.ProfileIDsTeam2.RemoveAt(i - PlayerDestinationButtonsNumH);
|
Data.ScreenNames.ProfileIDsTeam2.RemoveAt(i - PlayerDestinationButtonsNumH);
|
||||||
UpdateButtonNext();
|
UpdateButtonNext();
|
||||||
|
|||||||
Reference in new issue
Block a user