Removed duplicate code in CMenu

This commit is contained in:
Flamefire committed 2013-03-14 00:16:41 +01:00
1 parent d1705147e0
commit da889c9d40
31 files changed
+1595 -1964

No files matched your search

@@ -131,10 +131,10 @@ namespace Vocaluxe.PartyModes
break;
case Keys.Enter:
if (Buttons[htButtons(ButtonBack)].Selected)
if (Buttons[ButtonBack].Selected)
Back();
if (Buttons[htButtons(ButtonNext)].Selected)
if (Buttons[ButtonNext].Selected)
Next();
if (!OnAdd())
@@ -238,10 +238,10 @@ namespace Vocaluxe.PartyModes
if (MouseEvent.LB && IsMouseOver(MouseEvent))
{
if (Buttons[htButtons(ButtonBack)].Selected)
if (Buttons[ButtonBack].Selected)
Back();
if (Buttons[htButtons(ButtonNext)].Selected)
if (Buttons[ButtonNext].Selected)
Next();
if (!OnAdd())
@@ -293,13 +293,13 @@ namespace Vocaluxe.PartyModes
private void AddButtonPlayerDestination()
{
Buttons[htButtons(ButtonPlayerDestination)].Visible = false;
Buttons[ButtonPlayerDestination].Visible = false;
PlayerDestinationButtons = new List<CButton>();
int row = 0;
int column = 0;
for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++)
{
CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerDestination)]);
CButton b = GetNewButton(Buttons[ButtonPlayerDestination]);
b.Rect.X = PlayerDestinationButtonsFirstX + column * (b.Rect.W + PlayerDestinationButtonsSpaceH);
b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW);
PlayerDestinationButtons.Add(b);
@@ -317,13 +317,13 @@ namespace Vocaluxe.PartyModes
private void AddButtonPlayerChoose()
{
Buttons[htButtons(ButtonPlayerChoose)].Visible = false;
Buttons[ButtonPlayerChoose].Visible = false;
PlayerChooseButtons = new List<CPlayerChooseButton>();
int row = 0;
int column = 0;
for (int i = 1; i <= PlayerChooseButtonsNumH * PlayerChooseButtonsNumW; i++)
{
CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerChoose)]);
CButton b = GetNewButton(Buttons[ButtonPlayerChoose]);
b.Rect.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH);
b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW);
CPlayerChooseButton pcb = new CPlayerChooseButton();
@@ -379,10 +379,10 @@ namespace Vocaluxe.PartyModes
{
PlayerChooseButtons[i].ProfileID = -1;
PlayerChooseButtons[i].Button.Text.Text = String.Empty;
PlayerChooseButtons[i].Button.Texture = Buttons[htButtons(ButtonPlayerChoose)].Texture;
PlayerChooseButtons[i].Button.STexture = Buttons[htButtons(ButtonPlayerChoose)].STexture;
PlayerChooseButtons[i].Button.Color = Buttons[htButtons(ButtonPlayerChoose)].Color;
PlayerChooseButtons[i].Button.SColor = Buttons[htButtons(ButtonPlayerChoose)].SColor;
PlayerChooseButtons[i].Button.Texture = Buttons[ButtonPlayerChoose].Texture;
PlayerChooseButtons[i].Button.STexture = Buttons[ButtonPlayerChoose].STexture;
PlayerChooseButtons[i].Button.Color = Buttons[ButtonPlayerChoose].Color;
PlayerChooseButtons[i].Button.SColor = Buttons[ButtonPlayerChoose].SColor;
PlayerChooseButtons[i].Button.Enabled = false;
}
}
@@ -448,10 +448,10 @@ namespace Vocaluxe.PartyModes
}
else
{
PlayerDestinationButtons[i].Color = Buttons[htButtons(ButtonPlayerDestination)].Color;
PlayerDestinationButtons[i].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor;
PlayerDestinationButtons[i].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture;
PlayerDestinationButtons[i].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture;
PlayerDestinationButtons[i].Color = Buttons[ButtonPlayerDestination].Color;
PlayerDestinationButtons[i].SColor = Buttons[ButtonPlayerDestination].SColor;
PlayerDestinationButtons[i].Texture = Buttons[ButtonPlayerDestination].Texture;
PlayerDestinationButtons[i].STexture = Buttons[ButtonPlayerDestination].STexture;
PlayerDestinationButtons[i].Text.Text = String.Empty;
PlayerDestinationButtons[i].Enabled = false;
}
@@ -462,11 +462,11 @@ namespace Vocaluxe.PartyModes
{
if (Data.ScreenNames.ProfileIDs.Count == NumPlayer)
{
Buttons[htButtons(ButtonNext)].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonNext)]);
Buttons[ButtonNext].Visible = true;
SetInteractionToButton(Buttons[ButtonNext]);
}
else
Buttons[htButtons(ButtonNext)].Visible = false;
Buttons[ButtonNext].Visible = false;
}
private bool OnAdd()