More refactoring (unused stuff removed)
This commit is contained in:
1 parent
ec766aa7b5
commit
477b023520
38 files changed
+217
-350
No files matched your search
@@ -643,13 +643,12 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
int pos = 1;
|
||||
int lastPoints = 0;
|
||||
int lastSingPoints = 0;
|
||||
for (int i = 0; i < _GameData.ResultTable.Count; i++)
|
||||
{
|
||||
if (lastPoints > _GameData.ResultTable[i].NumGamePoints || lastSingPoints > _GameData.ResultTable[i].NumSingPoints)
|
||||
foreach (CResultTableRow resultRow in _GameData.ResultTable) {
|
||||
if (lastPoints > resultRow.NumGamePoints || lastSingPoints > resultRow.NumSingPoints)
|
||||
pos++;
|
||||
_GameData.ResultTable[i].Position = pos;
|
||||
lastPoints = _GameData.ResultTable[i].NumGamePoints;
|
||||
lastSingPoints = _GameData.ResultTable[i].NumSingPoints;
|
||||
resultRow.Position = pos;
|
||||
lastPoints = resultRow.NumGamePoints;
|
||||
lastSingPoints = resultRow.NumSingPoints;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -412,12 +412,11 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
_RoundsTable.Add(rtr);
|
||||
}
|
||||
//Create statics and texts for rounds
|
||||
for (int round = 0; round < _RoundsTable.Count; round++)
|
||||
{
|
||||
foreach (CRoundsTableRow roundRow in _RoundsTable) {
|
||||
//Round-number
|
||||
CText text = GetNewText(_Texts[_TextRoundNumber]);
|
||||
_AddText(text);
|
||||
_RoundsTable[round].Number = text;
|
||||
roundRow.Number = text;
|
||||
for (int row = 0; row < 2; row++)
|
||||
{
|
||||
for (int column = 0; column < 3; column++)
|
||||
@@ -425,11 +424,11 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
//Player
|
||||
text = GetNewText(_Texts[_TextRoundPlayer]);
|
||||
_AddText(text);
|
||||
_RoundsTable[round].TextPlayer.Add(text);
|
||||
roundRow.TextPlayer.Add(text);
|
||||
//Score
|
||||
text = GetNewText(_Texts[_TextRoundScore]);
|
||||
_AddText(text);
|
||||
_RoundsTable[round].TextScores.Add(text);
|
||||
roundRow.TextScores.Add(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -458,11 +457,10 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
float delta = _Texts[_TextRoundNumber].Height;
|
||||
|
||||
//Update statics and texts for rounds
|
||||
for (int round = 0; round < _RoundsTable.Count; round++)
|
||||
{
|
||||
foreach (CRoundsTableRow roundRow in _RoundsTable) {
|
||||
//Round-number
|
||||
_RoundsTable[round].Number.X = numberX;
|
||||
_RoundsTable[round].Number.Y = numberY;
|
||||
roundRow.Number.X = numberX;
|
||||
roundRow.Number.Y = numberY;
|
||||
int numInnerRows = (int)Math.Ceiling(_GameState.NumPlayerAtOnce / ((double)numPlayerInOneRow));
|
||||
for (int row = 0; row < numInnerRows; row++)
|
||||
{
|
||||
@@ -479,14 +477,14 @@ namespace VocaluxeLib.PartyModes.Challenge
|
||||
float x = numberX + 15 + (CBase.Settings.GetRenderW() - _Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow * (column - row * numPlayerInOneRow) +
|
||||
((CBase.Settings.GetRenderW() - _Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow) / 2;
|
||||
float maxw = ((CBase.Settings.GetRenderW() - _Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow) / 2 - 5;
|
||||
_RoundsTable[round].TextPlayer[column].X = x;
|
||||
_RoundsTable[round].TextPlayer[column].Y = numberY;
|
||||
_RoundsTable[round].TextPlayer[column].MaxWidth = maxw;
|
||||
roundRow.TextPlayer[column].X = x;
|
||||
roundRow.TextPlayer[column].Y = numberY;
|
||||
roundRow.TextPlayer[column].MaxWidth = maxw;
|
||||
//Score
|
||||
_RoundsTable[round].TextScores[column] = _RoundsTable[round].TextScores[column];
|
||||
_RoundsTable[round].TextScores[column].X = x;
|
||||
_RoundsTable[round].TextScores[column].Y = numberY + delta;
|
||||
_RoundsTable[round].TextScores[column].MaxWidth = maxw;
|
||||
roundRow.TextScores[column] = roundRow.TextScores[column];
|
||||
roundRow.TextScores[column].X = x;
|
||||
roundRow.TextScores[column].Y = numberY + delta;
|
||||
roundRow.TextScores[column].MaxWidth = maxw;
|
||||
}
|
||||
numberY = numberY + delta + delta;
|
||||
}
|
||||
|
||||
@@ -155,8 +155,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
if (_Combs.Count == 0)
|
||||
_Create();
|
||||
|
||||
CCombination combs = new CCombination();
|
||||
|
||||
if (_NumPlayer == _NumMics)
|
||||
return _Combs[0];
|
||||
|
||||
|
||||
@@ -718,13 +718,12 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
int pos = 1;
|
||||
int lastPoints = 0;
|
||||
int lastSingPoints = 0;
|
||||
for (int i = 0; i < _GameData.ResultTable.Count; i++)
|
||||
{
|
||||
if (lastPoints > _GameData.ResultTable[i].NumGamePoints || lastSingPoints > _GameData.ResultTable[i].NumSingPoints)
|
||||
foreach (CResultTableRow resultRow in _GameData.ResultTable) {
|
||||
if (lastPoints > resultRow.NumGamePoints || lastSingPoints > resultRow.NumSingPoints)
|
||||
pos++;
|
||||
_GameData.ResultTable[i].Position = pos;
|
||||
lastPoints = _GameData.ResultTable[i].NumGamePoints;
|
||||
lastSingPoints = _GameData.ResultTable[i].NumSingPoints;
|
||||
resultRow.Position = pos;
|
||||
lastPoints = resultRow.NumGamePoints;
|
||||
lastSingPoints = resultRow.NumSingPoints;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -412,12 +412,11 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
_RoundsTable.Add(rtr);
|
||||
}
|
||||
//Create statics and texts for rounds
|
||||
for (int round = 0; round < _RoundsTable.Count; round++)
|
||||
{
|
||||
foreach (CRoundsTableRow roundRow in _RoundsTable) {
|
||||
//Round-number
|
||||
CText text = GetNewText(_Texts[_TextRoundNumber]);
|
||||
_AddText(text);
|
||||
_RoundsTable[round].Number = text;
|
||||
roundRow.Number = text;
|
||||
for (int row = 0; row < 2; row++)
|
||||
{
|
||||
for (int column = 0; column < 3; column++)
|
||||
@@ -425,11 +424,11 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
//Player
|
||||
text = GetNewText(_Texts[_TextRoundPlayer]);
|
||||
_AddText(text);
|
||||
_RoundsTable[round].TextPlayer.Add(text);
|
||||
roundRow.TextPlayer.Add(text);
|
||||
//Score
|
||||
text = GetNewText(_Texts[_TextRoundScore]);
|
||||
_AddText(text);
|
||||
_RoundsTable[round].TextScores.Add(text);
|
||||
roundRow.TextScores.Add(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -458,11 +457,10 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
float delta = _Texts[_TextRoundNumber].Height;
|
||||
|
||||
//Update statics and texts for rounds
|
||||
for (int round = 0; round < _RoundsTable.Count; round++)
|
||||
{
|
||||
foreach (CRoundsTableRow roundRow in _RoundsTable) {
|
||||
//Round-number
|
||||
_RoundsTable[round].Number.X = numberX;
|
||||
_RoundsTable[round].Number.Y = numberY;
|
||||
roundRow.Number.X = numberX;
|
||||
roundRow.Number.Y = numberY;
|
||||
int numInnerRows = (int)Math.Ceiling(_GameState.NumPlayerAtOnce / ((double)numPlayerInOneRow));
|
||||
for (int row = 0; row < numInnerRows; row++)
|
||||
{
|
||||
@@ -479,14 +477,14 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
float x = numberX + 15 + (CBase.Settings.GetRenderW() - _Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow * (column - row * numPlayerInOneRow) +
|
||||
((CBase.Settings.GetRenderW() - _Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow) / 2;
|
||||
float maxw = ((CBase.Settings.GetRenderW() - _Texts[_TextRoundNumber].X - 20) / numPlayerInThisRow) / 2 - 5;
|
||||
_RoundsTable[round].TextPlayer[column].X = x;
|
||||
_RoundsTable[round].TextPlayer[column].Y = numberY;
|
||||
_RoundsTable[round].TextPlayer[column].MaxWidth = maxw;
|
||||
roundRow.TextPlayer[column].X = x;
|
||||
roundRow.TextPlayer[column].Y = numberY;
|
||||
roundRow.TextPlayer[column].MaxWidth = maxw;
|
||||
//Score
|
||||
_RoundsTable[round].TextScores[column] = _RoundsTable[round].TextScores[column];
|
||||
_RoundsTable[round].TextScores[column].X = x;
|
||||
_RoundsTable[round].TextScores[column].Y = numberY + delta;
|
||||
_RoundsTable[round].TextScores[column].MaxWidth = maxw;
|
||||
roundRow.TextScores[column] = roundRow.TextScores[column];
|
||||
roundRow.TextScores[column].X = x;
|
||||
roundRow.TextScores[column].Y = numberY + delta;
|
||||
roundRow.TextScores[column].MaxWidth = maxw;
|
||||
}
|
||||
numberY = numberY + delta + delta;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
_Data.ScreenNames.ProfileIDs = new List<int>();
|
||||
|
||||
List<string> buttons = new List<string>();
|
||||
_ThemeButtons = new string[] {_ButtonBack, _ButtonNext, _ButtonPlayerDestination, _ButtonPlayerChoose};
|
||||
|
||||
_Data = new SDataFromScreen();
|
||||
@@ -459,21 +458,20 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
private bool _OnAdd()
|
||||
{
|
||||
for (int i = 0; i < _PlayerChooseButtons.Count; i++)
|
||||
{
|
||||
if (_PlayerChooseButtons[i].Button.Selected && _PlayerChooseButtons[i].ProfileID != -1)
|
||||
foreach (CPlayerChooseButton chooseButton in _PlayerChooseButtons) {
|
||||
if (chooseButton.Button.Selected && chooseButton.ProfileID != -1)
|
||||
{
|
||||
if (_Data.ScreenNames.ProfileIDs.Count < _NumPlayer)
|
||||
{
|
||||
_Data.ScreenNames.ProfileIDs.Add(_PlayerChooseButtons[i].ProfileID);
|
||||
_Data.ScreenNames.ProfileIDs.Add(chooseButton.ProfileID);
|
||||
int added = _Data.ScreenNames.ProfileIDs.Count - 1;
|
||||
_UpdateButtonNext();
|
||||
//Update texture and name
|
||||
_PlayerDestinationButtons[added].Color = new SColorF(1, 1, 1, 0.6f);
|
||||
_PlayerDestinationButtons[added].SelColor = new SColorF(1, 1, 1, 1);
|
||||
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[_PlayerChooseButtons[i].ProfileID].PlayerName;
|
||||
_PlayerDestinationButtons[added].Texture = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].SelTexture = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].Avatar.Texture;
|
||||
_PlayerDestinationButtons[added].Text.Text = CBase.Profiles.GetProfiles()[chooseButton.ProfileID].PlayerName;
|
||||
_PlayerDestinationButtons[added].Enabled = true;
|
||||
//Update Tiles-List
|
||||
_UpdateButtonPlayerChoose();
|
||||
|
||||
@@ -90,7 +90,6 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_Data.ScreenNames.ProfileIDsTeam1 = new List<int>();
|
||||
_Data.ScreenNames.ProfileIDsTeam2 = new List<int>();
|
||||
|
||||
List<string> buttons = new List<string>();
|
||||
_ThemeButtons = new string[] {_ButtonBack, _ButtonNext, _ButtonPlayerDestination, _ButtonPlayerChoose, _ButtonPlayerChooseScrollUp, _ButtonPlayerChooseScrollDown};
|
||||
|
||||
_Data = new SDataFromScreen();
|
||||
@@ -178,18 +177,17 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
_OldMouseX = mouseEvent.X;
|
||||
_OldMouseY = mouseEvent.Y;
|
||||
//Check if mouse if over tile
|
||||
for (int i = 0; i < _PlayerChooseButtons.Count; i++)
|
||||
{
|
||||
if (_PlayerChooseButtons[i].Button.Selected)
|
||||
foreach (CPlayerChooseButton chooseButton in _PlayerChooseButtons) {
|
||||
if (chooseButton.Button.Selected)
|
||||
{
|
||||
_SelectedPlayerNr = _PlayerChooseButtons[i].ProfileID;
|
||||
_SelectedPlayerNr = chooseButton.ProfileID;
|
||||
if (_SelectedPlayerNr != -1)
|
||||
{
|
||||
//Activate mouse-selecting
|
||||
_SelectingMouseActive = true;
|
||||
//Update of Drag/Drop-Texture
|
||||
_ChooseAvatarStatic.Visible = true;
|
||||
_ChooseAvatarStatic.Rect = _PlayerChooseButtons[i].Button.Rect;
|
||||
_ChooseAvatarStatic.Rect = chooseButton.Button.Rect;
|
||||
_ChooseAvatarStatic.Rect.Z = -100;
|
||||
_ChooseAvatarStatic.Color = new SColorF(1, 1, 1, 1);
|
||||
_ChooseAvatarStatic.Texture = CBase.Profiles.GetProfiles()[_SelectedPlayerNr].Avatar.Texture;
|
||||
|
||||
Reference in new issue
Block a user