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
+1565 -1934

No files matched your search

+13
View File
@@ -34,3 +34,16 @@ Output/Songs
*.log *.log
/Output/Playlists/*.xml /Output/Playlists/*.xml
/Output/x64/gstreamer/GstreamerHelper.dll
*.tlog
*.suo
*.obj
*.lastbuildstate
*.pch
*.idb
*.exp
*.ilk
*.lib
*.opensdf
*.sdf
Binary file not shown.
@@ -88,10 +88,10 @@ namespace Vocaluxe.PartyModes
case Keys.Enter: case Keys.Enter:
UpdateSlides(); UpdateSlides();
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
break; break;
@@ -114,10 +114,10 @@ namespace Vocaluxe.PartyModes
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
UpdateSlides(); UpdateSlides();
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
} }
@@ -161,12 +161,12 @@ namespace Vocaluxe.PartyModes
private void RebuildSlides() private void RebuildSlides()
{ {
// build num player slide (min player ... max player); // build num player slide (min player ... max player);
SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Clear(); SelectSlides[SelectSlideNumPlayers].Clear();
for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++) for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++)
{ {
SelectSlides[htSelectSlides(SelectSlideNumPlayers)].AddValue(i.ToString()); SelectSlides[SelectSlideNumPlayers].AddValue(i.ToString());
} }
SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer(); SelectSlides[SelectSlideNumPlayers].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
UpdateMicsAtOnce(); UpdateMicsAtOnce();
SetRoundSteps(); SetRoundSteps();
@@ -177,9 +177,9 @@ namespace Vocaluxe.PartyModes
{ {
int player = Data.ScreenConfig.NumPlayer; int player = Data.ScreenConfig.NumPlayer;
int mics = Data.ScreenConfig.NumPlayerAtOnce; int mics = Data.ScreenConfig.NumPlayerAtOnce;
Data.ScreenConfig.NumPlayer = SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Selection + _PartyMode.GetMinPlayer(); Data.ScreenConfig.NumPlayer = SelectSlides[SelectSlideNumPlayers].Selection + _PartyMode.GetMinPlayer();
Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[htSelectSlides(SelectSlideNumMics)].Selection + _PartyMode.GetMinPlayer(); Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[SelectSlideNumMics].Selection + _PartyMode.GetMinPlayer();
Data.ScreenConfig.NumRounds = (SelectSlides[htSelectSlides(SelectSlideNumRounds)].Selection + 1) * _RoundSteps; Data.ScreenConfig.NumRounds = (SelectSlides[SelectSlideNumRounds].Selection + 1) * _RoundSteps;
UpdateMicsAtOnce(); UpdateMicsAtOnce();
SetRoundSteps(); SetRoundSteps();
@@ -208,23 +208,23 @@ namespace Vocaluxe.PartyModes
Data.ScreenConfig.NumPlayerAtOnce = MaxNum; Data.ScreenConfig.NumPlayerAtOnce = MaxNum;
// build mics at once slide // build mics at once slide
SelectSlides[htSelectSlides(SelectSlideNumMics)].Clear(); SelectSlides[SelectSlideNumMics].Clear();
for (int i = 1; i <= MaxNum; i++) for (int i = 1; i <= MaxNum; i++)
{ {
SelectSlides[htSelectSlides(SelectSlideNumMics)].AddValue(i.ToString()); SelectSlides[SelectSlideNumMics].AddValue(i.ToString());
} }
SelectSlides[htSelectSlides(SelectSlideNumMics)].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer(); SelectSlides[SelectSlideNumMics].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
} }
private void UpdateSlideRounds() private void UpdateSlideRounds()
{ {
// build num rounds slide // build num rounds slide
SelectSlides[htSelectSlides(SelectSlideNumRounds)].Clear(); SelectSlides[SelectSlideNumRounds].Clear();
for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps) for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps)
{ {
SelectSlides[htSelectSlides(SelectSlideNumRounds)].AddValue(i.ToString()); SelectSlides[SelectSlideNumRounds].AddValue(i.ToString());
} }
SelectSlides[htSelectSlides(SelectSlideNumRounds)].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1; SelectSlides[SelectSlideNumRounds].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1;
} }
private void SetRoundSteps() private void SetRoundSteps()
@@ -104,9 +104,9 @@ namespace Vocaluxe.PartyModes
for (int i = 0; i < _PartyMode.GetMaxPlayer(); i++) for (int i = 0; i < _PartyMode.GetMaxPlayer(); i++)
{ {
NextPlayerTexts.Add(GetNewText(Texts[htTexts(TextNextPlayer)])); NextPlayerTexts.Add(GetNewText(Texts[TextNextPlayer]));
AddText(NextPlayerTexts[NextPlayerTexts.Count - 1]); AddText(NextPlayerTexts[NextPlayerTexts.Count - 1]);
NextPlayerStatics.Add(GetNewStatic(Statics[htStatics(StaticNextPlayer)])); NextPlayerStatics.Add(GetNewStatic(Statics[StaticNextPlayer]));
AddStatic(NextPlayerStatics[NextPlayerStatics.Count - 1]); AddStatic(NextPlayerStatics[NextPlayerStatics.Count - 1]);
} }
} }
@@ -153,26 +153,26 @@ namespace Vocaluxe.PartyModes
case Keys.Enter: case Keys.Enter:
if (!ExitPopupVisible) if (!ExitPopupVisible)
{ {
if (Buttons[htButtons(ButtonNextRound)].Selected) if (Buttons[ButtonNextRound].Selected)
NextRound(); NextRound();
if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1)
Back(); Back();
if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1)
ShowPopup(true); ShowPopup(true);
if (Buttons[htButtons(ButtonPlayerScrollUp)].Selected) if (Buttons[ButtonPlayerScrollUp].Selected)
ScrollPlayerTable(-1); ScrollPlayerTable(-1);
if (Buttons[htButtons(ButtonPlayerScrollDown)].Selected) if (Buttons[ButtonPlayerScrollDown].Selected)
ScrollPlayerTable(1); ScrollPlayerTable(1);
if (Buttons[htButtons(ButtonRoundsScrollUp)].Selected) if (Buttons[ButtonRoundsScrollUp].Selected)
ScrollRoundsTable(-1); ScrollRoundsTable(-1);
if (Buttons[htButtons(ButtonRoundsScrollDown)].Selected) if (Buttons[ButtonRoundsScrollDown].Selected)
ScrollRoundsTable(1); ScrollRoundsTable(1);
} }
else else
{ {
if (Buttons[htButtons(ButtonPopupYes)].Selected) if (Buttons[ButtonPopupYes].Selected)
EndParty(); EndParty();
if (Buttons[htButtons(ButtonPopupNo)].Selected) if (Buttons[ButtonPopupNo].Selected)
ShowPopup(false); ShowPopup(false);
} }
break; break;
@@ -189,26 +189,26 @@ namespace Vocaluxe.PartyModes
{ {
if (!ExitPopupVisible) if (!ExitPopupVisible)
{ {
if (Buttons[htButtons(ButtonNextRound)].Selected) if (Buttons[ButtonNextRound].Selected)
NextRound(); NextRound();
if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1)
Back(); Back();
if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1)
ShowPopup(true); ShowPopup(true);
if (Buttons[htButtons(ButtonPlayerScrollUp)].Selected) if (Buttons[ButtonPlayerScrollUp].Selected)
ScrollPlayerTable(-1); ScrollPlayerTable(-1);
if (Buttons[htButtons(ButtonPlayerScrollDown)].Selected) if (Buttons[ButtonPlayerScrollDown].Selected)
ScrollPlayerTable(1); ScrollPlayerTable(1);
if (Buttons[htButtons(ButtonRoundsScrollUp)].Selected) if (Buttons[ButtonRoundsScrollUp].Selected)
ScrollRoundsTable(-1); ScrollRoundsTable(-1);
if (Buttons[htButtons(ButtonRoundsScrollDown)].Selected) if (Buttons[ButtonRoundsScrollDown].Selected)
ScrollRoundsTable(1); ScrollRoundsTable(1);
} }
else else
{ {
if (Buttons[htButtons(ButtonPopupYes)].Selected) if (Buttons[ButtonPopupYes].Selected)
EndParty(); EndParty();
if (Buttons[htButtons(ButtonPopupNo)].Selected) if (Buttons[ButtonPopupNo].Selected)
ShowPopup(false); ShowPopup(false);
} }
} }
@@ -253,29 +253,29 @@ namespace Vocaluxe.PartyModes
if (GameState.CurrentRoundNr == 1) if (GameState.CurrentRoundNr == 1)
{ {
Buttons[htButtons(ButtonBack)].Visible = true; Buttons[ButtonBack].Visible = true;
Buttons[htButtons(ButtonExit)].Visible = false; Buttons[ButtonExit].Visible = false;
} }
else else
{ {
Buttons[htButtons(ButtonBack)].Visible = false; Buttons[ButtonBack].Visible = false;
Buttons[htButtons(ButtonExit)].Visible = true; Buttons[ButtonExit].Visible = true;
} }
if (GameState.CurrentRoundNr <= GameState.Combs.Count) if (GameState.CurrentRoundNr <= GameState.Combs.Count)
{ {
Buttons[htButtons(ButtonNextRound)].Visible = true; Buttons[ButtonNextRound].Visible = true;
Texts[htTexts(TextFinishMessage)].Visible = false; Texts[TextFinishMessage].Visible = false;
Texts[htTexts(TextFinishPlayerWin)].Visible = false; Texts[TextFinishPlayerWin].Visible = false;
SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); SetInteractionToButton(Buttons[ButtonNextRound]);
} }
else else
{ {
Buttons[htButtons(ButtonNextRound)].Visible = false; Buttons[ButtonNextRound].Visible = false;
Texts[htTexts(TextFinishMessage)].Visible = true; Texts[TextFinishMessage].Visible = true;
Texts[htTexts(TextFinishPlayerWin)].Visible = true; Texts[TextFinishPlayerWin].Visible = true;
Texts[htTexts(TextFinishPlayerWin)].Text = GetPlayerWinString(); Texts[TextFinishPlayerWin].Text = GetPlayerWinString();
SetInteractionToButton(Buttons[htButtons(ButtonExit)]); SetInteractionToButton(Buttons[ButtonExit]);
} }
ShowPopup(false); ShowPopup(false);
@@ -313,13 +313,13 @@ namespace Vocaluxe.PartyModes
{ {
ExitPopupVisible = Visible; ExitPopupVisible = Visible;
Statics[htStatics(StaticPopupBG)].Visible = ExitPopupVisible; Statics[StaticPopupBG].Visible = ExitPopupVisible;
Texts[htTexts(TextPopupReallyExit)].Visible = ExitPopupVisible; Texts[TextPopupReallyExit].Visible = ExitPopupVisible;
Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible; Buttons[ButtonPopupYes].Visible = ExitPopupVisible;
Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible; Buttons[ButtonPopupNo].Visible = ExitPopupVisible;
if (ExitPopupVisible) if (ExitPopupVisible)
SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]); SetInteractionToButton(Buttons[ButtonPopupNo]);
} }
private void Back() private void Back()
@@ -331,7 +331,7 @@ namespace Vocaluxe.PartyModes
private void UpdateNextPlayerPositions() private void UpdateNextPlayerPositions()
{ {
float x = CBase.Settings.GetRenderW()/2 - ((GameState.NumPlayerAtOnce * Statics[htStatics(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++)
@@ -341,11 +341,11 @@ namespace Vocaluxe.PartyModes
NextPlayerStatics[i].Rect.Y = static_y; NextPlayerStatics[i].Rect.Y = static_y;
NextPlayerStatics[i].Visible = true; NextPlayerStatics[i].Visible = true;
//text //text
NextPlayerTexts[i].X = x + Statics[htStatics(StaticNextPlayer)].Rect.W / 2; NextPlayerTexts[i].X = x + Statics[StaticNextPlayer].Rect.W / 2;
NextPlayerTexts[i].Y = text_y; NextPlayerTexts[i].Y = text_y;
NextPlayerTexts[i].Visible = true; NextPlayerTexts[i].Visible = true;
x += Statics[htStatics(StaticNextPlayer)].Rect.W + 15; x += Statics[StaticNextPlayer].Rect.W + 15;
} }
for (int i = GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++) for (int i = GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++)
{ {
@@ -358,7 +358,7 @@ namespace Vocaluxe.PartyModes
{ {
if (GameState.CurrentRoundNr <= GameState.Combs.Count) if (GameState.CurrentRoundNr <= GameState.Combs.Count)
{ {
Texts[htTexts(TextNextPlayerMessage)].Visible = true; Texts[TextNextPlayerMessage].Visible = true;
SProfile[] profiles = CBase.Profiles.GetProfiles(); SProfile[] profiles = CBase.Profiles.GetProfiles();
for (int i = 0; i < GameState.NumPlayerAtOnce; i++) for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
{ {
@@ -370,7 +370,7 @@ namespace Vocaluxe.PartyModes
} }
else else
{ {
Texts[htTexts(TextNextPlayerMessage)].Visible = false; Texts[TextNextPlayerMessage].Visible = false;
for (int i = 0; i < GameState.NumPlayerAtOnce; i++) for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
{ {
NextPlayerStatics[i].Visible = false; NextPlayerStatics[i].Visible = false;
@@ -394,7 +394,7 @@ namespace Vocaluxe.PartyModes
for (int round = 0; round < RoundsTable.Count; round++) for (int round = 0; round < RoundsTable.Count; round++)
{ {
//Round-number //Round-number
CText text = GetNewText(Texts[htTexts(TextRoundNumber)]); CText text = GetNewText(Texts[TextRoundNumber]);
AddText(text); AddText(text);
RoundsTable[round].Number = text; RoundsTable[round].Number = text;
for (int row = 0; row < 2; row++) for (int row = 0; row < 2; row++)
@@ -402,11 +402,11 @@ namespace Vocaluxe.PartyModes
for (int column = 0; column < 3; column++) for (int column = 0; column < 3; column++)
{ {
//Player //Player
text = GetNewText(Texts[htTexts(TextRoundPlayer)]); text = GetNewText(Texts[TextRoundPlayer]);
AddText(text); AddText(text);
RoundsTable[round].TextPlayer.Add(text); RoundsTable[round].TextPlayer.Add(text);
//Score //Score
text = GetNewText(Texts[htTexts(TextRoundScore)]); text = GetNewText(Texts[TextRoundScore]);
AddText(text); AddText(text);
RoundsTable[round].TextScores.Add(text); RoundsTable[round].TextScores.Add(text);
} }
@@ -427,14 +427,14 @@ namespace Vocaluxe.PartyModes
if (NumRoundsVisible > GameState.Combs.Count) if (NumRoundsVisible > GameState.Combs.Count)
NumRoundsVisible = GameState.Combs.Count; NumRoundsVisible = GameState.Combs.Count;
float x = Texts[htTexts(TextRoundNumber)].X; float x = Texts[TextRoundNumber].X;
float y = Texts[htTexts(TextRoundNumber)].Y; float y = Texts[TextRoundNumber].Y;
RoundsTableScrollArea.X = x; RoundsTableScrollArea.X = x;
RoundsTableScrollArea.Y = y; RoundsTableScrollArea.Y = y;
RoundsTableScrollArea.W = CBase.Settings.GetRenderW() - Texts[htTexts(TextRoundNumber)].X - 20; RoundsTableScrollArea.W = CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20;
float delta = Texts[htTexts(TextRoundNumber)].Height; float delta = Texts[TextRoundNumber].Height;
//Update statics and texts for rounds //Update statics and texts for rounds
for (int round = 0; round < RoundsTable.Count; round++) for (int round = 0; round < RoundsTable.Count; round++)
@@ -455,8 +455,8 @@ namespace Vocaluxe.PartyModes
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[htTexts(TextRoundNumber)].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) + ((CBase.Settings.GetRenderW() - Texts[htTexts(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[htTexts(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;
RoundsTable[round].TextPlayer[column].MaxWidth = maxw; RoundsTable[round].TextPlayer[column].MaxWidth = maxw;
@@ -510,19 +510,19 @@ namespace Vocaluxe.PartyModes
} }
} }
Buttons[htButtons(ButtonRoundsScrollUp)].Visible = RoundsTableOffset > 0; Buttons[ButtonRoundsScrollUp].Visible = RoundsTableOffset > 0;
Buttons[htButtons(ButtonRoundsScrollDown)].Visible = GameState.Combs.Count - NumRoundsVisible - RoundsTableOffset > 0; Buttons[ButtonRoundsScrollDown].Visible = GameState.Combs.Count - NumRoundsVisible - RoundsTableOffset > 0;
} }
private void BuildPlayerTable() private void BuildPlayerTable()
{ {
PlayerTableScrollArea = new SRectF(); PlayerTableScrollArea = new SRectF();
PlayerTableScrollArea.X = Texts[htTexts(TextPosition)].X; PlayerTableScrollArea.X = Texts[TextPosition].X;
PlayerTableScrollArea.Y = Texts[htTexts(TextPosition)].Y; PlayerTableScrollArea.Y = Texts[TextPosition].Y;
PlayerTableScrollArea.W = Texts[htTexts(TextGamePoints)].X - Texts[htTexts(TextPosition)].X; PlayerTableScrollArea.W = Texts[TextGamePoints].X - Texts[TextPosition].X;
PlayerTable = new List<TableRow>(); PlayerTable = new List<TableRow>();
float delta = Texts[htTexts(TextPosition)].Height * 1.2f; float delta = Texts[TextPosition].Height * 1.2f;
float h = 0; float h = 0;
@@ -530,12 +530,12 @@ namespace Vocaluxe.PartyModes
{ {
TableRow row = new TableRow(); TableRow row = new TableRow();
row.Pos = GetNewText(Texts[htTexts(TextPosition)]); row.Pos = GetNewText(Texts[TextPosition]);
row.Name = GetNewText(Texts[htTexts(TextPlayerName)]); row.Name = GetNewText(Texts[TextPlayerName]);
row.Rounds = GetNewText(Texts[htTexts(TextNumPlayed)]); row.Rounds = GetNewText(Texts[TextNumPlayed]);
row.Won = GetNewText(Texts[htTexts(TextWon)]); row.Won = GetNewText(Texts[TextWon]);
row.SingPoints = GetNewText(Texts[htTexts(TextSingPoints)]); row.SingPoints = GetNewText(Texts[TextSingPoints]);
row.GamePoints = GetNewText(Texts[htTexts(TextGamePoints)]); row.GamePoints = GetNewText(Texts[TextGamePoints]);
row.Pos.Y += delta * (i + 1); row.Pos.Y += delta * (i + 1);
row.Name.Y += delta * (i + 1); row.Name.Y += delta * (i + 1);
@@ -602,8 +602,8 @@ namespace Vocaluxe.PartyModes
} }
} }
Buttons[htButtons(ButtonPlayerScrollUp)].Visible = PlayerTableOffset > 0; Buttons[ButtonPlayerScrollUp].Visible = PlayerTableOffset > 0;
Buttons[htButtons(ButtonPlayerScrollDown)].Visible = GameState.ProfileIDs.Count - NumPlayerVisible - PlayerTableOffset > 0; Buttons[ButtonPlayerScrollDown].Visible = GameState.ProfileIDs.Count - NumPlayerVisible - PlayerTableOffset > 0;
} }
private void ScrollPlayerTable(int Offset) private void ScrollPlayerTable(int Offset)
@@ -131,10 +131,10 @@ namespace Vocaluxe.PartyModes
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
if (!OnAdd()) if (!OnAdd())
@@ -238,10 +238,10 @@ namespace Vocaluxe.PartyModes
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
if (!OnAdd()) if (!OnAdd())
@@ -293,13 +293,13 @@ namespace Vocaluxe.PartyModes
private void AddButtonPlayerDestination() private void AddButtonPlayerDestination()
{ {
Buttons[htButtons(ButtonPlayerDestination)].Visible = false; Buttons[ButtonPlayerDestination].Visible = false;
PlayerDestinationButtons = new List<CButton>(); PlayerDestinationButtons = new List<CButton>();
int row = 0; int row = 0;
int column = 0; int column = 0;
for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++) 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.X = PlayerDestinationButtonsFirstX + column * (b.Rect.W + PlayerDestinationButtonsSpaceH);
b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW); b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW);
PlayerDestinationButtons.Add(b); PlayerDestinationButtons.Add(b);
@@ -317,13 +317,13 @@ namespace Vocaluxe.PartyModes
private void AddButtonPlayerChoose() private void AddButtonPlayerChoose()
{ {
Buttons[htButtons(ButtonPlayerChoose)].Visible = false; Buttons[ButtonPlayerChoose].Visible = false;
PlayerChooseButtons = new List<CPlayerChooseButton>(); PlayerChooseButtons = new List<CPlayerChooseButton>();
int row = 0; int row = 0;
int column = 0; int column = 0;
for (int i = 1; i <= PlayerChooseButtonsNumH * PlayerChooseButtonsNumW; i++) 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.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH);
b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW); b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW);
CPlayerChooseButton pcb = new CPlayerChooseButton(); CPlayerChooseButton pcb = new CPlayerChooseButton();
@@ -379,10 +379,10 @@ namespace Vocaluxe.PartyModes
{ {
PlayerChooseButtons[i].ProfileID = -1; PlayerChooseButtons[i].ProfileID = -1;
PlayerChooseButtons[i].Button.Text.Text = String.Empty; PlayerChooseButtons[i].Button.Text.Text = String.Empty;
PlayerChooseButtons[i].Button.Texture = Buttons[htButtons(ButtonPlayerChoose)].Texture; PlayerChooseButtons[i].Button.Texture = Buttons[ButtonPlayerChoose].Texture;
PlayerChooseButtons[i].Button.STexture = Buttons[htButtons(ButtonPlayerChoose)].STexture; PlayerChooseButtons[i].Button.STexture = Buttons[ButtonPlayerChoose].STexture;
PlayerChooseButtons[i].Button.Color = Buttons[htButtons(ButtonPlayerChoose)].Color; PlayerChooseButtons[i].Button.Color = Buttons[ButtonPlayerChoose].Color;
PlayerChooseButtons[i].Button.SColor = Buttons[htButtons(ButtonPlayerChoose)].SColor; PlayerChooseButtons[i].Button.SColor = Buttons[ButtonPlayerChoose].SColor;
PlayerChooseButtons[i].Button.Enabled = false; PlayerChooseButtons[i].Button.Enabled = false;
} }
} }
@@ -448,10 +448,10 @@ namespace Vocaluxe.PartyModes
} }
else else
{ {
PlayerDestinationButtons[i].Color = Buttons[htButtons(ButtonPlayerDestination)].Color; PlayerDestinationButtons[i].Color = Buttons[ButtonPlayerDestination].Color;
PlayerDestinationButtons[i].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor; PlayerDestinationButtons[i].SColor = Buttons[ButtonPlayerDestination].SColor;
PlayerDestinationButtons[i].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture; PlayerDestinationButtons[i].Texture = Buttons[ButtonPlayerDestination].Texture;
PlayerDestinationButtons[i].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture; PlayerDestinationButtons[i].STexture = Buttons[ButtonPlayerDestination].STexture;
PlayerDestinationButtons[i].Text.Text = String.Empty; PlayerDestinationButtons[i].Text.Text = String.Empty;
PlayerDestinationButtons[i].Enabled = false; PlayerDestinationButtons[i].Enabled = false;
} }
@@ -462,11 +462,11 @@ namespace Vocaluxe.PartyModes
{ {
if (Data.ScreenNames.ProfileIDs.Count == NumPlayer) if (Data.ScreenNames.ProfileIDs.Count == NumPlayer)
{ {
Buttons[htButtons(ButtonNext)].Visible = true; Buttons[ButtonNext].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonNext)]); SetInteractionToButton(Buttons[ButtonNext]);
} }
else else
Buttons[htButtons(ButtonNext)].Visible = false; Buttons[ButtonNext].Visible = false;
} }
private bool OnAdd() private bool OnAdd()
@@ -88,10 +88,10 @@ namespace Vocaluxe.PartyModes
case Keys.Enter: case Keys.Enter:
UpdateSlides(); UpdateSlides();
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
break; break;
@@ -114,10 +114,10 @@ namespace Vocaluxe.PartyModes
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
UpdateSlides(); UpdateSlides();
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
} }
@@ -161,12 +161,12 @@ namespace Vocaluxe.PartyModes
private void RebuildSlides() private void RebuildSlides()
{ {
// build num player slide (min player ... max player); // build num player slide (min player ... max player);
SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Clear(); SelectSlides[SelectSlideNumPlayers].Clear();
for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++) for (int i = _PartyMode.GetMinPlayer(); i <= _PartyMode.GetMaxPlayer(); i++)
{ {
SelectSlides[htSelectSlides(SelectSlideNumPlayers)].AddValue(i.ToString()); SelectSlides[SelectSlideNumPlayers].AddValue(i.ToString());
} }
SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer(); SelectSlides[SelectSlideNumPlayers].Selection = Data.ScreenConfig.NumPlayer - _PartyMode.GetMinPlayer();
UpdateMicsAtOnce(); UpdateMicsAtOnce();
SetRoundSteps(); SetRoundSteps();
@@ -177,9 +177,9 @@ namespace Vocaluxe.PartyModes
{ {
int player = Data.ScreenConfig.NumPlayer; int player = Data.ScreenConfig.NumPlayer;
int mics = Data.ScreenConfig.NumPlayerAtOnce; int mics = Data.ScreenConfig.NumPlayerAtOnce;
Data.ScreenConfig.NumPlayer = SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Selection + _PartyMode.GetMinPlayer(); Data.ScreenConfig.NumPlayer = SelectSlides[SelectSlideNumPlayers].Selection + _PartyMode.GetMinPlayer();
Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[htSelectSlides(SelectSlideNumMics)].Selection + _PartyMode.GetMinPlayer(); Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[SelectSlideNumMics].Selection + _PartyMode.GetMinPlayer();
Data.ScreenConfig.NumRounds = (SelectSlides[htSelectSlides(SelectSlideNumRounds)].Selection + 1) * _RoundSteps; Data.ScreenConfig.NumRounds = (SelectSlides[SelectSlideNumRounds].Selection + 1) * _RoundSteps;
UpdateMicsAtOnce(); UpdateMicsAtOnce();
SetRoundSteps(); SetRoundSteps();
@@ -208,23 +208,23 @@ namespace Vocaluxe.PartyModes
Data.ScreenConfig.NumPlayerAtOnce = MaxNum; Data.ScreenConfig.NumPlayerAtOnce = MaxNum;
// build mics at once slide // build mics at once slide
SelectSlides[htSelectSlides(SelectSlideNumMics)].Clear(); SelectSlides[SelectSlideNumMics].Clear();
for (int i = 1; i <= MaxNum; i++) for (int i = 1; i <= MaxNum; i++)
{ {
SelectSlides[htSelectSlides(SelectSlideNumMics)].AddValue(i.ToString()); SelectSlides[SelectSlideNumMics].AddValue(i.ToString());
} }
SelectSlides[htSelectSlides(SelectSlideNumMics)].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer(); SelectSlides[SelectSlideNumMics].Selection = Data.ScreenConfig.NumPlayerAtOnce - _PartyMode.GetMinPlayer();
} }
private void UpdateSlideRounds() private void UpdateSlideRounds()
{ {
// build num rounds slide // build num rounds slide
SelectSlides[htSelectSlides(SelectSlideNumRounds)].Clear(); SelectSlides[SelectSlideNumRounds].Clear();
for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps) for (int i = _RoundSteps; i <= _MaxNumRounds; i += _RoundSteps)
{ {
SelectSlides[htSelectSlides(SelectSlideNumRounds)].AddValue(i.ToString()); SelectSlides[SelectSlideNumRounds].AddValue(i.ToString());
} }
SelectSlides[htSelectSlides(SelectSlideNumRounds)].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1; SelectSlides[SelectSlideNumRounds].Selection = Data.ScreenConfig.NumRounds / _RoundSteps - 1;
} }
private void SetRoundSteps() private void SetRoundSteps()
@@ -104,9 +104,9 @@ namespace Vocaluxe.PartyModes
for (int i = 0; i < _PartyMode.GetMaxPlayer(); i++) for (int i = 0; i < _PartyMode.GetMaxPlayer(); i++)
{ {
NextPlayerTexts.Add(GetNewText(Texts[htTexts(TextNextPlayer)])); NextPlayerTexts.Add(GetNewText(Texts[TextNextPlayer]));
AddText(NextPlayerTexts[NextPlayerTexts.Count - 1]); AddText(NextPlayerTexts[NextPlayerTexts.Count - 1]);
NextPlayerStatics.Add(GetNewStatic(Statics[htStatics(StaticNextPlayer)])); NextPlayerStatics.Add(GetNewStatic(Statics[StaticNextPlayer]));
AddStatic(NextPlayerStatics[NextPlayerStatics.Count - 1]); AddStatic(NextPlayerStatics[NextPlayerStatics.Count - 1]);
} }
} }
@@ -153,26 +153,26 @@ namespace Vocaluxe.PartyModes
case Keys.Enter: case Keys.Enter:
if (!ExitPopupVisible) if (!ExitPopupVisible)
{ {
if (Buttons[htButtons(ButtonNextRound)].Selected) if (Buttons[ButtonNextRound].Selected)
NextRound(); NextRound();
if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1)
Back(); Back();
if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1)
ShowPopup(true); ShowPopup(true);
if (Buttons[htButtons(ButtonPlayerScrollUp)].Selected) if (Buttons[ButtonPlayerScrollUp].Selected)
ScrollPlayerTable(-1); ScrollPlayerTable(-1);
if (Buttons[htButtons(ButtonPlayerScrollDown)].Selected) if (Buttons[ButtonPlayerScrollDown].Selected)
ScrollPlayerTable(1); ScrollPlayerTable(1);
if (Buttons[htButtons(ButtonRoundsScrollUp)].Selected) if (Buttons[ButtonRoundsScrollUp].Selected)
ScrollRoundsTable(-1); ScrollRoundsTable(-1);
if (Buttons[htButtons(ButtonRoundsScrollDown)].Selected) if (Buttons[ButtonRoundsScrollDown].Selected)
ScrollRoundsTable(1); ScrollRoundsTable(1);
} }
else else
{ {
if (Buttons[htButtons(ButtonPopupYes)].Selected) if (Buttons[ButtonPopupYes].Selected)
EndParty(); EndParty();
if (Buttons[htButtons(ButtonPopupNo)].Selected) if (Buttons[ButtonPopupNo].Selected)
ShowPopup(false); ShowPopup(false);
} }
break; break;
@@ -189,26 +189,26 @@ namespace Vocaluxe.PartyModes
{ {
if (!ExitPopupVisible) if (!ExitPopupVisible)
{ {
if (Buttons[htButtons(ButtonNextRound)].Selected) if (Buttons[ButtonNextRound].Selected)
NextRound(); NextRound();
if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1)
Back(); Back();
if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1)
ShowPopup(true); ShowPopup(true);
if (Buttons[htButtons(ButtonPlayerScrollUp)].Selected) if (Buttons[ButtonPlayerScrollUp].Selected)
ScrollPlayerTable(-1); ScrollPlayerTable(-1);
if (Buttons[htButtons(ButtonPlayerScrollDown)].Selected) if (Buttons[ButtonPlayerScrollDown].Selected)
ScrollPlayerTable(1); ScrollPlayerTable(1);
if (Buttons[htButtons(ButtonRoundsScrollUp)].Selected) if (Buttons[ButtonRoundsScrollUp].Selected)
ScrollRoundsTable(-1); ScrollRoundsTable(-1);
if (Buttons[htButtons(ButtonRoundsScrollDown)].Selected) if (Buttons[ButtonRoundsScrollDown].Selected)
ScrollRoundsTable(1); ScrollRoundsTable(1);
} }
else else
{ {
if (Buttons[htButtons(ButtonPopupYes)].Selected) if (Buttons[ButtonPopupYes].Selected)
EndParty(); EndParty();
if (Buttons[htButtons(ButtonPopupNo)].Selected) if (Buttons[ButtonPopupNo].Selected)
ShowPopup(false); ShowPopup(false);
} }
} }
@@ -253,29 +253,29 @@ namespace Vocaluxe.PartyModes
if (GameState.CurrentRoundNr == 1) if (GameState.CurrentRoundNr == 1)
{ {
Buttons[htButtons(ButtonBack)].Visible = true; Buttons[ButtonBack].Visible = true;
Buttons[htButtons(ButtonExit)].Visible = false; Buttons[ButtonExit].Visible = false;
} }
else else
{ {
Buttons[htButtons(ButtonBack)].Visible = false; Buttons[ButtonBack].Visible = false;
Buttons[htButtons(ButtonExit)].Visible = true; Buttons[ButtonExit].Visible = true;
} }
if (GameState.CurrentRoundNr <= GameState.Combs.Count) if (GameState.CurrentRoundNr <= GameState.Combs.Count)
{ {
Buttons[htButtons(ButtonNextRound)].Visible = true; Buttons[ButtonNextRound].Visible = true;
Texts[htTexts(TextFinishMessage)].Visible = false; Texts[TextFinishMessage].Visible = false;
Texts[htTexts(TextFinishPlayerWin)].Visible = false; Texts[TextFinishPlayerWin].Visible = false;
SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); SetInteractionToButton(Buttons[ButtonNextRound]);
} }
else else
{ {
Buttons[htButtons(ButtonNextRound)].Visible = false; Buttons[ButtonNextRound].Visible = false;
Texts[htTexts(TextFinishMessage)].Visible = true; Texts[TextFinishMessage].Visible = true;
Texts[htTexts(TextFinishPlayerWin)].Visible = true; Texts[TextFinishPlayerWin].Visible = true;
Texts[htTexts(TextFinishPlayerWin)].Text = GetPlayerWinString(); Texts[TextFinishPlayerWin].Text = GetPlayerWinString();
SetInteractionToButton(Buttons[htButtons(ButtonExit)]); SetInteractionToButton(Buttons[ButtonExit]);
} }
ShowPopup(false); ShowPopup(false);
@@ -313,13 +313,13 @@ namespace Vocaluxe.PartyModes
{ {
ExitPopupVisible = Visible; ExitPopupVisible = Visible;
Statics[htStatics(StaticPopupBG)].Visible = ExitPopupVisible; Statics[StaticPopupBG].Visible = ExitPopupVisible;
Texts[htTexts(TextPopupReallyExit)].Visible = ExitPopupVisible; Texts[TextPopupReallyExit].Visible = ExitPopupVisible;
Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible; Buttons[ButtonPopupYes].Visible = ExitPopupVisible;
Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible; Buttons[ButtonPopupNo].Visible = ExitPopupVisible;
if (ExitPopupVisible) if (ExitPopupVisible)
SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]); SetInteractionToButton(Buttons[ButtonPopupNo]);
} }
private void Back() private void Back()
@@ -331,7 +331,7 @@ namespace Vocaluxe.PartyModes
private void UpdateNextPlayerPositions() private void UpdateNextPlayerPositions()
{ {
float x = CBase.Settings.GetRenderW()/2 - ((GameState.NumPlayerAtOnce * Statics[htStatics(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++)
@@ -341,11 +341,11 @@ namespace Vocaluxe.PartyModes
NextPlayerStatics[i].Rect.Y = static_y; NextPlayerStatics[i].Rect.Y = static_y;
NextPlayerStatics[i].Visible = true; NextPlayerStatics[i].Visible = true;
//text //text
NextPlayerTexts[i].X = x + Statics[htStatics(StaticNextPlayer)].Rect.W / 2; NextPlayerTexts[i].X = x + Statics[StaticNextPlayer].Rect.W / 2;
NextPlayerTexts[i].Y = text_y; NextPlayerTexts[i].Y = text_y;
NextPlayerTexts[i].Visible = true; NextPlayerTexts[i].Visible = true;
x += Statics[htStatics(StaticNextPlayer)].Rect.W + 15; x += Statics[StaticNextPlayer].Rect.W + 15;
} }
for (int i = GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++) for (int i = GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++)
{ {
@@ -358,7 +358,7 @@ namespace Vocaluxe.PartyModes
{ {
if (GameState.CurrentRoundNr <= GameState.Combs.Count) if (GameState.CurrentRoundNr <= GameState.Combs.Count)
{ {
Texts[htTexts(TextNextPlayerMessage)].Visible = true; Texts[TextNextPlayerMessage].Visible = true;
SProfile[] profiles = CBase.Profiles.GetProfiles(); SProfile[] profiles = CBase.Profiles.GetProfiles();
for (int i = 0; i < GameState.NumPlayerAtOnce; i++) for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
{ {
@@ -370,7 +370,7 @@ namespace Vocaluxe.PartyModes
} }
else else
{ {
Texts[htTexts(TextNextPlayerMessage)].Visible = false; Texts[TextNextPlayerMessage].Visible = false;
for (int i = 0; i < GameState.NumPlayerAtOnce; i++) for (int i = 0; i < GameState.NumPlayerAtOnce; i++)
{ {
NextPlayerStatics[i].Visible = false; NextPlayerStatics[i].Visible = false;
@@ -394,7 +394,7 @@ namespace Vocaluxe.PartyModes
for (int round = 0; round < RoundsTable.Count; round++) for (int round = 0; round < RoundsTable.Count; round++)
{ {
//Round-number //Round-number
CText text = GetNewText(Texts[htTexts(TextRoundNumber)]); CText text = GetNewText(Texts[TextRoundNumber]);
AddText(text); AddText(text);
RoundsTable[round].Number = text; RoundsTable[round].Number = text;
for (int row = 0; row < 2; row++) for (int row = 0; row < 2; row++)
@@ -402,11 +402,11 @@ namespace Vocaluxe.PartyModes
for (int column = 0; column < 3; column++) for (int column = 0; column < 3; column++)
{ {
//Player //Player
text = GetNewText(Texts[htTexts(TextRoundPlayer)]); text = GetNewText(Texts[TextRoundPlayer]);
AddText(text); AddText(text);
RoundsTable[round].TextPlayer.Add(text); RoundsTable[round].TextPlayer.Add(text);
//Score //Score
text = GetNewText(Texts[htTexts(TextRoundScore)]); text = GetNewText(Texts[TextRoundScore]);
AddText(text); AddText(text);
RoundsTable[round].TextScores.Add(text); RoundsTable[round].TextScores.Add(text);
} }
@@ -427,14 +427,14 @@ namespace Vocaluxe.PartyModes
if (NumRoundsVisible > GameState.Combs.Count) if (NumRoundsVisible > GameState.Combs.Count)
NumRoundsVisible = GameState.Combs.Count; NumRoundsVisible = GameState.Combs.Count;
float x = Texts[htTexts(TextRoundNumber)].X; float x = Texts[TextRoundNumber].X;
float y = Texts[htTexts(TextRoundNumber)].Y; float y = Texts[TextRoundNumber].Y;
RoundsTableScrollArea.X = x; RoundsTableScrollArea.X = x;
RoundsTableScrollArea.Y = y; RoundsTableScrollArea.Y = y;
RoundsTableScrollArea.W = CBase.Settings.GetRenderW() - Texts[htTexts(TextRoundNumber)].X - 20; RoundsTableScrollArea.W = CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20;
float delta = Texts[htTexts(TextRoundNumber)].Height; float delta = Texts[TextRoundNumber].Height;
//Update statics and texts for rounds //Update statics and texts for rounds
for (int round = 0; round < RoundsTable.Count; round++) for (int round = 0; round < RoundsTable.Count; round++)
@@ -455,8 +455,8 @@ namespace Vocaluxe.PartyModes
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[htTexts(TextRoundNumber)].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) + ((CBase.Settings.GetRenderW() - Texts[htTexts(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[htTexts(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;
RoundsTable[round].TextPlayer[column].MaxWidth = maxw; RoundsTable[round].TextPlayer[column].MaxWidth = maxw;
@@ -510,19 +510,19 @@ namespace Vocaluxe.PartyModes
} }
} }
Buttons[htButtons(ButtonRoundsScrollUp)].Visible = RoundsTableOffset > 0; Buttons[ButtonRoundsScrollUp].Visible = RoundsTableOffset > 0;
Buttons[htButtons(ButtonRoundsScrollDown)].Visible = GameState.Combs.Count - NumRoundsVisible - RoundsTableOffset > 0; Buttons[ButtonRoundsScrollDown].Visible = GameState.Combs.Count - NumRoundsVisible - RoundsTableOffset > 0;
} }
private void BuildPlayerTable() private void BuildPlayerTable()
{ {
PlayerTableScrollArea = new SRectF(); PlayerTableScrollArea = new SRectF();
PlayerTableScrollArea.X = Texts[htTexts(TextPosition)].X; PlayerTableScrollArea.X = Texts[TextPosition].X;
PlayerTableScrollArea.Y = Texts[htTexts(TextPosition)].Y; PlayerTableScrollArea.Y = Texts[TextPosition].Y;
PlayerTableScrollArea.W = Texts[htTexts(TextGamePoints)].X - Texts[htTexts(TextPosition)].X; PlayerTableScrollArea.W = Texts[TextGamePoints].X - Texts[TextPosition].X;
PlayerTable = new List<TableRow>(); PlayerTable = new List<TableRow>();
float delta = Texts[htTexts(TextPosition)].Height * 1.2f; float delta = Texts[TextPosition].Height * 1.2f;
float h = 0; float h = 0;
@@ -530,12 +530,12 @@ namespace Vocaluxe.PartyModes
{ {
TableRow row = new TableRow(); TableRow row = new TableRow();
row.Pos = GetNewText(Texts[htTexts(TextPosition)]); row.Pos = GetNewText(Texts[TextPosition]);
row.Name = GetNewText(Texts[htTexts(TextPlayerName)]); row.Name = GetNewText(Texts[TextPlayerName]);
row.Rounds = GetNewText(Texts[htTexts(TextNumPlayed)]); row.Rounds = GetNewText(Texts[TextNumPlayed]);
row.Won = GetNewText(Texts[htTexts(TextWon)]); row.Won = GetNewText(Texts[TextWon]);
row.SingPoints = GetNewText(Texts[htTexts(TextSingPoints)]); row.SingPoints = GetNewText(Texts[TextSingPoints]);
row.GamePoints = GetNewText(Texts[htTexts(TextGamePoints)]); row.GamePoints = GetNewText(Texts[TextGamePoints]);
row.Pos.Y += delta * (i + 1); row.Pos.Y += delta * (i + 1);
row.Name.Y += delta * (i + 1); row.Name.Y += delta * (i + 1);
@@ -602,8 +602,8 @@ namespace Vocaluxe.PartyModes
} }
} }
Buttons[htButtons(ButtonPlayerScrollUp)].Visible = PlayerTableOffset > 0; Buttons[ButtonPlayerScrollUp].Visible = PlayerTableOffset > 0;
Buttons[htButtons(ButtonPlayerScrollDown)].Visible = GameState.ProfileIDs.Count - NumPlayerVisible - PlayerTableOffset > 0; Buttons[ButtonPlayerScrollDown].Visible = GameState.ProfileIDs.Count - NumPlayerVisible - PlayerTableOffset > 0;
} }
private void ScrollPlayerTable(int Offset) private void ScrollPlayerTable(int Offset)
@@ -131,10 +131,10 @@ namespace Vocaluxe.PartyModes
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
if (!OnAdd()) if (!OnAdd())
@@ -238,10 +238,10 @@ namespace Vocaluxe.PartyModes
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
if (!OnAdd()) if (!OnAdd())
@@ -293,13 +293,13 @@ namespace Vocaluxe.PartyModes
private void AddButtonPlayerDestination() private void AddButtonPlayerDestination()
{ {
Buttons[htButtons(ButtonPlayerDestination)].Visible = false; Buttons[ButtonPlayerDestination].Visible = false;
PlayerDestinationButtons = new List<CButton>(); PlayerDestinationButtons = new List<CButton>();
int row = 0; int row = 0;
int column = 0; int column = 0;
for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++) 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.X = PlayerDestinationButtonsFirstX + column * (b.Rect.W + PlayerDestinationButtonsSpaceH);
b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW); b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW);
PlayerDestinationButtons.Add(b); PlayerDestinationButtons.Add(b);
@@ -317,13 +317,13 @@ namespace Vocaluxe.PartyModes
private void AddButtonPlayerChoose() private void AddButtonPlayerChoose()
{ {
Buttons[htButtons(ButtonPlayerChoose)].Visible = false; Buttons[ButtonPlayerChoose].Visible = false;
PlayerChooseButtons = new List<CPlayerChooseButton>(); PlayerChooseButtons = new List<CPlayerChooseButton>();
int row = 0; int row = 0;
int column = 0; int column = 0;
for (int i = 1; i <= PlayerChooseButtonsNumH * PlayerChooseButtonsNumW; i++) 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.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH);
b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW); b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW);
CPlayerChooseButton pcb = new CPlayerChooseButton(); CPlayerChooseButton pcb = new CPlayerChooseButton();
@@ -379,10 +379,10 @@ namespace Vocaluxe.PartyModes
{ {
PlayerChooseButtons[i].ProfileID = -1; PlayerChooseButtons[i].ProfileID = -1;
PlayerChooseButtons[i].Button.Text.Text = String.Empty; PlayerChooseButtons[i].Button.Text.Text = String.Empty;
PlayerChooseButtons[i].Button.Texture = Buttons[htButtons(ButtonPlayerChoose)].Texture; PlayerChooseButtons[i].Button.Texture = Buttons[ButtonPlayerChoose].Texture;
PlayerChooseButtons[i].Button.STexture = Buttons[htButtons(ButtonPlayerChoose)].STexture; PlayerChooseButtons[i].Button.STexture = Buttons[ButtonPlayerChoose].STexture;
PlayerChooseButtons[i].Button.Color = Buttons[htButtons(ButtonPlayerChoose)].Color; PlayerChooseButtons[i].Button.Color = Buttons[ButtonPlayerChoose].Color;
PlayerChooseButtons[i].Button.SColor = Buttons[htButtons(ButtonPlayerChoose)].SColor; PlayerChooseButtons[i].Button.SColor = Buttons[ButtonPlayerChoose].SColor;
PlayerChooseButtons[i].Button.Enabled = false; PlayerChooseButtons[i].Button.Enabled = false;
} }
} }
@@ -448,10 +448,10 @@ namespace Vocaluxe.PartyModes
} }
else else
{ {
PlayerDestinationButtons[i].Color = Buttons[htButtons(ButtonPlayerDestination)].Color; PlayerDestinationButtons[i].Color = Buttons[ButtonPlayerDestination].Color;
PlayerDestinationButtons[i].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor; PlayerDestinationButtons[i].SColor = Buttons[ButtonPlayerDestination].SColor;
PlayerDestinationButtons[i].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture; PlayerDestinationButtons[i].Texture = Buttons[ButtonPlayerDestination].Texture;
PlayerDestinationButtons[i].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture; PlayerDestinationButtons[i].STexture = Buttons[ButtonPlayerDestination].STexture;
PlayerDestinationButtons[i].Text.Text = String.Empty; PlayerDestinationButtons[i].Text.Text = String.Empty;
PlayerDestinationButtons[i].Enabled = false; PlayerDestinationButtons[i].Enabled = false;
} }
@@ -462,11 +462,11 @@ namespace Vocaluxe.PartyModes
{ {
if (Data.ScreenNames.ProfileIDs.Count == NumPlayer) if (Data.ScreenNames.ProfileIDs.Count == NumPlayer)
{ {
Buttons[htButtons(ButtonNext)].Visible = true; Buttons[ButtonNext].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonNext)]); SetInteractionToButton(Buttons[ButtonNext]);
} }
else else
Buttons[htButtons(ButtonNext)].Visible = false; Buttons[ButtonNext].Visible = false;
} }
private bool OnAdd() private bool OnAdd()
@@ -98,10 +98,10 @@ namespace Vocaluxe.PartyModes
case Keys.Enter: case Keys.Enter:
UpdateSlides(); UpdateSlides();
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
break; break;
@@ -124,10 +124,10 @@ namespace Vocaluxe.PartyModes
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
UpdateSlides(); UpdateSlides();
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
} }
@@ -152,7 +152,7 @@ namespace Vocaluxe.PartyModes
public override bool UpdateGame() public override bool UpdateGame()
{ {
Buttons[htButtons(ButtonNext)].Visible = ConfigOk; Buttons[ButtonNext].Visible = ConfigOk;
return true; return true;
} }
@@ -170,78 +170,78 @@ namespace Vocaluxe.PartyModes
private void FillSlides() private void FillSlides()
{ {
// build num player slide (min player ... max player); // build num player slide (min player ... max player);
SelectSlides[htSelectSlides(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[htSelectSlides(SelectSlideNumPlayerTeam1)].AddValue(i.ToString()); SelectSlides[SelectSlideNumPlayerTeam1].AddValue(i.ToString());
} }
SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam1)].Selection = Data.ScreenConfig.NumPlayerTeam1 - (_PartyMode.GetMinPlayer()/2); SelectSlides[SelectSlideNumPlayerTeam1].Selection = Data.ScreenConfig.NumPlayerTeam1 - (_PartyMode.GetMinPlayer()/2);
SelectSlides[htSelectSlides(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[htSelectSlides(SelectSlideNumPlayerTeam2)].AddValue(i.ToString()); SelectSlides[SelectSlideNumPlayerTeam2].AddValue(i.ToString());
} }
SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam2)].Selection = Data.ScreenConfig.NumPlayerTeam2 -( _PartyMode.GetMinPlayer()/2); SelectSlides[SelectSlideNumPlayerTeam2].Selection = Data.ScreenConfig.NumPlayerTeam2 -( _PartyMode.GetMinPlayer()/2);
SelectSlides[htSelectSlides(SelectSlideNumFields)].Clear(); SelectSlides[SelectSlideNumFields].Clear();
SelectSlides[htSelectSlides(SelectSlideNumFields)].AddValue("9"); SelectSlides[SelectSlideNumFields].AddValue("9");
SelectSlides[htSelectSlides(SelectSlideNumFields)].AddValue("16"); SelectSlides[SelectSlideNumFields].AddValue("16");
SelectSlides[htSelectSlides(SelectSlideNumFields)].AddValue("25"); SelectSlides[SelectSlideNumFields].AddValue("25");
if (Data.ScreenConfig.NumFields == 9) if (Data.ScreenConfig.NumFields == 9)
SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection = 0; SelectSlides[SelectSlideNumFields].Selection = 0;
else if (Data.ScreenConfig.NumFields == 16) else if (Data.ScreenConfig.NumFields == 16)
SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection = 1; SelectSlides[SelectSlideNumFields].Selection = 1;
else if (Data.ScreenConfig.NumFields == 25) else if (Data.ScreenConfig.NumFields == 25)
SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection = 2; SelectSlides[SelectSlideNumFields].Selection = 2;
SelectSlides[htSelectSlides(SelectSlideSongSource)].Clear(); SelectSlides[SelectSlideSongSource].Clear();
SelectSlides[htSelectSlides(SelectSlideSongSource)].SetValues<ESongSource>((int)Data.ScreenConfig.SongSource); SelectSlides[SelectSlideSongSource].SetValues<ESongSource>((int)Data.ScreenConfig.SongSource);
string[] _Playlists = CBase.Playlist.GetPlaylistNames(); string[] _Playlists = CBase.Playlist.GetPlaylistNames();
SelectSlides[htSelectSlides(SelectSlidePlaylist)].Clear(); SelectSlides[SelectSlidePlaylist].Clear();
for (int i = 0; i < _Playlists.Length; i++) for (int i = 0; i < _Playlists.Length; i++)
{ {
string value = _Playlists[i] + " (" + CBase.Playlist.GetPlaylistSongCount(i) + " " + CBase.Language.Translate("TR_SONGS", _PartyModeID) + ")"; string value = _Playlists[i] + " (" + CBase.Playlist.GetPlaylistSongCount(i) + " " + CBase.Language.Translate("TR_SONGS", _PartyModeID) + ")";
SelectSlides[htSelectSlides(SelectSlidePlaylist)].AddValue(value); SelectSlides[SelectSlidePlaylist].AddValue(value);
} }
SelectSlides[htSelectSlides(SelectSlidePlaylist)].Selection = Data.ScreenConfig.PlaylistID; SelectSlides[SelectSlidePlaylist].Selection = Data.ScreenConfig.PlaylistID;
SelectSlides[htSelectSlides(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[htSelectSlides(SelectSlideCategory)].Clear(); SelectSlides[SelectSlideCategory].Clear();
for (int i = 0; i < _Categories.Length; i++) for (int i = 0; i < _Categories.Length; i++)
{ {
string value = _Categories[i] + " (" + CBase.Songs.NumSongsInCategory(i) + " " + CBase.Language.Translate("TR_SONGS", _PartyModeID) + ")"; string value = _Categories[i] + " (" + CBase.Songs.NumSongsInCategory(i) + " " + CBase.Language.Translate("TR_SONGS", _PartyModeID) + ")";
SelectSlides[htSelectSlides(SelectSlideCategory)].AddValue(value); SelectSlides[SelectSlideCategory].AddValue(value);
} }
SelectSlides[htSelectSlides(SelectSlideCategory)].Selection = Data.ScreenConfig.CategoryID; SelectSlides[SelectSlideCategory].Selection = Data.ScreenConfig.CategoryID;
SelectSlides[htSelectSlides(SelectSlideCategory)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY; SelectSlides[SelectSlideCategory].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY;
SelectSlides[htSelectSlides(SelectSlideGameMode)].Visible = true; SelectSlides[SelectSlideGameMode].Visible = true;
SelectSlides[htSelectSlides(SelectSlideGameMode)].SetValues<EPartyGameMode>((int)Data.ScreenConfig.GameMode); SelectSlides[SelectSlideGameMode].SetValues<EPartyGameMode>((int)Data.ScreenConfig.GameMode);
} }
private void UpdateSlides() private void UpdateSlides()
{ {
Data.ScreenConfig.NumPlayerTeam1 = SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam1)].Selection + (_PartyMode.GetMinPlayer()/2); Data.ScreenConfig.NumPlayerTeam1 = SelectSlides[SelectSlideNumPlayerTeam1].Selection + (_PartyMode.GetMinPlayer()/2);
Data.ScreenConfig.NumPlayerTeam2 = SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam2)].Selection + (_PartyMode.GetMinPlayer()/2); Data.ScreenConfig.NumPlayerTeam2 = SelectSlides[SelectSlideNumPlayerTeam2].Selection + (_PartyMode.GetMinPlayer()/2);
if (SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection == 0) if (SelectSlides[SelectSlideNumFields].Selection == 0)
Data.ScreenConfig.NumFields = 9; Data.ScreenConfig.NumFields = 9;
else if (SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection == 1) else if (SelectSlides[SelectSlideNumFields].Selection == 1)
Data.ScreenConfig.NumFields = 16; Data.ScreenConfig.NumFields = 16;
else if (SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection == 2) else if (SelectSlides[SelectSlideNumFields].Selection == 2)
Data.ScreenConfig.NumFields = 25; Data.ScreenConfig.NumFields = 25;
Data.ScreenConfig.SongSource = (ESongSource)SelectSlides[htSelectSlides(SelectSlideSongSource)].Selection; Data.ScreenConfig.SongSource = (ESongSource)SelectSlides[SelectSlideSongSource].Selection;
Data.ScreenConfig.PlaylistID = SelectSlides[htSelectSlides(SelectSlidePlaylist)].Selection; Data.ScreenConfig.PlaylistID = SelectSlides[SelectSlidePlaylist].Selection;
Data.ScreenConfig.CategoryID = SelectSlides[htSelectSlides(SelectSlideCategory)].Selection; Data.ScreenConfig.CategoryID = SelectSlides[SelectSlideCategory].Selection;
Data.ScreenConfig.GameMode = (EPartyGameMode)SelectSlides[htSelectSlides(SelectSlideGameMode)].Selection; Data.ScreenConfig.GameMode = (EPartyGameMode)SelectSlides[SelectSlideGameMode].Selection;
EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL; EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL;
@@ -328,8 +328,8 @@ namespace Vocaluxe.PartyModes
else else
ConfigOk = false; ConfigOk = false;
} }
SelectSlides[htSelectSlides(SelectSlideCategory)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY; SelectSlides[SelectSlideCategory].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY;
SelectSlides[htSelectSlides(SelectSlidePlaylist)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST; SelectSlides[SelectSlidePlaylist].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST;
} }
private void Back() private void Back()
@@ -103,7 +103,7 @@ namespace Vocaluxe.PartyModes
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
CreateFields(); CreateFields();
Buttons[htButtons(ButtonField)].Visible = false; Buttons[ButtonField].Visible = false;
} }
public override void DataToScreen(object ReceivedData) public override void DataToScreen(object ReceivedData)
@@ -150,11 +150,11 @@ namespace Vocaluxe.PartyModes
case Keys.Enter: case Keys.Enter:
if (!ExitPopupVisible) if (!ExitPopupVisible)
{ {
if (Buttons[htButtons(ButtonNextRound)].Selected) if (Buttons[ButtonNextRound].Selected)
NextRound(); NextRound();
if (Buttons[htButtons(ButtonBack)].Selected && GameData.CurrentRoundNr == 1 && Status != EStatus.FieldSelected) if (Buttons[ButtonBack].Selected && GameData.CurrentRoundNr == 1 && Status != EStatus.FieldSelected)
Back(); Back();
if (Buttons[htButtons(ButtonExit)].Selected && (GameData.CurrentRoundNr > 1 || Status == EStatus.FieldSelected) && Status != EStatus.None) if (Buttons[ButtonExit].Selected && (GameData.CurrentRoundNr > 1 || Status == EStatus.FieldSelected) && Status != EStatus.None)
ShowPopup(true); ShowPopup(true);
else if (Status == EStatus.None) else if (Status == EStatus.None)
EndParty(); EndParty();
@@ -181,21 +181,21 @@ namespace Vocaluxe.PartyModes
} }
if (Status == EStatus.FieldSelected) if (Status == EStatus.FieldSelected)
{ {
if (Buttons[htButtons(ButtonJokerRandomT1)].Selected) if (Buttons[ButtonJokerRandomT1].Selected)
UseJoker(0, 0); UseJoker(0, 0);
if (Buttons[htButtons(ButtonJokerRandomT2)].Selected) if (Buttons[ButtonJokerRandomT2].Selected)
UseJoker(1, 0); UseJoker(1, 0);
if (Buttons[htButtons(ButtonJokerRetryT1)].Selected) if (Buttons[ButtonJokerRetryT1].Selected)
UseJoker(0, 1); UseJoker(0, 1);
if (Buttons[htButtons(ButtonJokerRetryT2)].Selected) if (Buttons[ButtonJokerRetryT2].Selected)
UseJoker(1, 1); UseJoker(1, 1);
} }
} }
else else
{ {
if (Buttons[htButtons(ButtonPopupYes)].Selected) if (Buttons[ButtonPopupYes].Selected)
EndParty(); EndParty();
if (Buttons[htButtons(ButtonPopupNo)].Selected) if (Buttons[ButtonPopupNo].Selected)
ShowPopup(false); ShowPopup(false);
} }
break; break;
@@ -212,11 +212,11 @@ namespace Vocaluxe.PartyModes
{ {
if (!ExitPopupVisible) if (!ExitPopupVisible)
{ {
if (Buttons[htButtons(ButtonNextRound)].Selected) if (Buttons[ButtonNextRound].Selected)
NextRound(); NextRound();
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
if (Status == EStatus.None) if (Status == EStatus.None)
EndParty(); EndParty();
else else
@@ -244,22 +244,22 @@ namespace Vocaluxe.PartyModes
} }
if(Status == EStatus.FieldSelected) if(Status == EStatus.FieldSelected)
{ {
if (Buttons[htButtons(ButtonJokerRandomT1)].Selected) if (Buttons[ButtonJokerRandomT1].Selected)
UseJoker(0, 0); UseJoker(0, 0);
if (Buttons[htButtons(ButtonJokerRandomT2)].Selected) if (Buttons[ButtonJokerRandomT2].Selected)
UseJoker(1, 0); UseJoker(1, 0);
if (Buttons[htButtons(ButtonJokerRetryT1)].Selected) if (Buttons[ButtonJokerRetryT1].Selected)
UseJoker(0, 1); UseJoker(0, 1);
if (Buttons[htButtons(ButtonJokerRetryT2)].Selected) if (Buttons[ButtonJokerRetryT2].Selected)
UseJoker(1, 1); UseJoker(1, 1);
} }
} }
else else
{ {
if (Buttons[htButtons(ButtonPopupYes)].Selected) if (Buttons[ButtonPopupYes].Selected)
EndParty(); EndParty();
if (Buttons[htButtons(ButtonPopupNo)].Selected) if (Buttons[ButtonPopupNo].Selected)
ShowPopup(false); ShowPopup(false);
} }
} }
@@ -294,15 +294,15 @@ namespace Vocaluxe.PartyModes
{ {
BuildWinnerPossibilities(); BuildWinnerPossibilities();
SelectedField = -1; SelectedField = -1;
Buttons[htButtons(ButtonBack)].Visible = true; Buttons[ButtonBack].Visible = true;
Buttons[htButtons(ButtonExit)].Visible = false; Buttons[ButtonExit].Visible = false;
SetInteractionToButton(Buttons[htButtons(ButtonBack)]); SetInteractionToButton(Buttons[ButtonBack]);
} }
else else
{ {
Buttons[htButtons(ButtonBack)].Visible = false; Buttons[ButtonBack].Visible = false;
Buttons[htButtons(ButtonExit)].Visible = true; Buttons[ButtonExit].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonExit)]); SetInteractionToButton(Buttons[ButtonExit]);
} }
Status = EStatus.FieldChoosing; Status = EStatus.FieldChoosing;
@@ -314,36 +314,36 @@ namespace Vocaluxe.PartyModes
if (GameData.CurrentRoundNr <= GameData.NumFields && Winner == 0) if (GameData.CurrentRoundNr <= GameData.NumFields && Winner == 0)
{ {
UpdateTeamChoosingMessage(); UpdateTeamChoosingMessage();
Texts[htTexts(TextNextPlayerT1)].Visible = false; Texts[TextNextPlayerT1].Visible = false;
Texts[htTexts(TextNextPlayerT2)].Visible = false; Texts[TextNextPlayerT2].Visible = false;
Texts[htTexts(TextNextPlayerNameT1)].Visible = false; Texts[TextNextPlayerNameT1].Visible = false;
Texts[htTexts(TextNextPlayerNameT2)].Visible = false; Texts[TextNextPlayerNameT2].Visible = false;
Statics[htStatics(StaticAvatarT1)].Visible = false; Statics[StaticAvatarT1].Visible = false;
Statics[htStatics(StaticAvatarT2)].Visible = false; Statics[StaticAvatarT2].Visible = false;
Buttons[htButtons(ButtonJokerRandomT1)].Visible = false; Buttons[ButtonJokerRandomT1].Visible = false;
Buttons[htButtons(ButtonJokerRandomT2)].Visible = false; Buttons[ButtonJokerRandomT2].Visible = false;
Buttons[htButtons(ButtonJokerRetryT1)].Visible = false; Buttons[ButtonJokerRetryT1].Visible = false;
Buttons[htButtons(ButtonJokerRetryT2)].Visible = false; Buttons[ButtonJokerRetryT2].Visible = false;
Buttons[htButtons(ButtonNextRound)].Visible = false; Buttons[ButtonNextRound].Visible = false;
Texts[htTexts(TextFinishMessage)].Visible = false; Texts[TextFinishMessage].Visible = false;
} }
else else
{ {
Status = EStatus.None; Status = EStatus.None;
Buttons[htButtons(ButtonNextRound)].Visible = false; Buttons[ButtonNextRound].Visible = false;
Texts[htTexts(TextFinishMessage)].Visible = true; Texts[TextFinishMessage].Visible = true;
Texts[htTexts(TextTeamChoosing)].Visible = false; Texts[TextTeamChoosing].Visible = false;
if (Winner > 0) if (Winner > 0)
{ {
Texts[htTexts(TextFinishMessage)].Color = CBase.Theme.GetPlayerColor(Winner); Texts[TextFinishMessage].Color = CBase.Theme.GetPlayerColor(Winner);
Texts[htTexts(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
{ {
Texts[htTexts(TextFinishMessage)].Color = new SColorF(1, 1, 1, 1); Texts[TextFinishMessage].Color = new SColorF(1, 1, 1, 1);
Texts[htTexts(TextFinishMessage)].Text = CBase.Language.Translate("TR_SCREENMAIN_NOWINNER", _PartyModeID); Texts[TextFinishMessage].Text = CBase.Language.Translate("TR_SCREENMAIN_NOWINNER", _PartyModeID);
} }
SetInteractionToButton(Buttons[htButtons(ButtonExit)]); SetInteractionToButton(Buttons[ButtonExit]);
} }
ShowPopup(false); ShowPopup(false);
@@ -372,7 +372,7 @@ namespace Vocaluxe.PartyModes
for (int i = 0; i < 25; i++) for (int i = 0; i < 25; i++)
{ {
Field f = new Field(); Field f = new Field();
f.Button = GetNewButton(Buttons[htButtons(ButtonField)]); f.Button = GetNewButton(Buttons[ButtonField]);
f.Button.Visible = false; f.Button.Visible = false;
f.Content = new Round(); f.Content = new Round();
AddButton(f.Button); AddButton(f.Button);
@@ -429,9 +429,9 @@ namespace Vocaluxe.PartyModes
for (int i = 0; i < GameData.Rounds.Count; i++) for (int i = 0; i < GameData.Rounds.Count; i++)
{ {
Fields[i].Button.Enabled = true; Fields[i].Button.Enabled = true;
Fields[i].Button.Texture = Buttons[htButtons(ButtonField)].Texture; Fields[i].Button.Texture = Buttons[ButtonField].Texture;
Fields[i].Button.Color = Buttons[htButtons(ButtonField)].Color; Fields[i].Button.Color = Buttons[ButtonField].Color;
Fields[i].Button.SColor = Buttons[htButtons(ButtonField)].SColor; Fields[i].Button.SColor = Buttons[ButtonField].SColor;
Fields[i].Content = GameData.Rounds[i]; Fields[i].Content = GameData.Rounds[i];
if (Fields[i].Content.Finished) if (Fields[i].Content.Finished)
{ {
@@ -500,25 +500,25 @@ namespace Vocaluxe.PartyModes
GameData.Rounds[SelectedField].SingerTeam2 = SingerTeam2; GameData.Rounds[SelectedField].SingerTeam2 = SingerTeam2;
UpdateFieldContents(); UpdateFieldContents();
Texts[htTexts(TextNextPlayerT1)].Visible = true; Texts[TextNextPlayerT1].Visible = true;
Texts[htTexts(TextNextPlayerT2)].Visible = true; Texts[TextNextPlayerT2].Visible = true;
Texts[htTexts(TextNextPlayerNameT1)].Visible = true; Texts[TextNextPlayerNameT1].Visible = true;
Texts[htTexts(TextNextPlayerNameT2)].Visible = true; Texts[TextNextPlayerNameT2].Visible = true;
SProfile[] profiles = CBase.Profiles.GetProfiles(); SProfile[] profiles = CBase.Profiles.GetProfiles();
Texts[htTexts(TextNextPlayerNameT1)].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName; Texts[TextNextPlayerNameT1].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName;
Texts[htTexts(TextNextPlayerNameT2)].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName; Texts[TextNextPlayerNameT2].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName;
Statics[htStatics(StaticAvatarT1)].Visible = true; Statics[StaticAvatarT1].Visible = true;
Statics[htStatics(StaticAvatarT2)].Visible = true; Statics[StaticAvatarT2].Visible = true;
Statics[htStatics(StaticAvatarT1)].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture; Statics[StaticAvatarT1].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture;
Statics[htStatics(StaticAvatarT2)].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture; Statics[StaticAvatarT2].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture;
UpdateJokerButtons(); UpdateJokerButtons();
Buttons[htButtons(ButtonNextRound)].Visible = true; Buttons[ButtonNextRound].Visible = true;
Buttons[htButtons(ButtonExit)].Visible = true; Buttons[ButtonExit].Visible = true;
Buttons[htButtons(ButtonBack)].Visible = false; Buttons[ButtonBack].Visible = false;
SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); SetInteractionToButton(Buttons[ButtonNextRound]);
} }
private void FieldSelectedAgain() private void FieldSelectedAgain()
@@ -539,25 +539,25 @@ namespace Vocaluxe.PartyModes
GameData.Rounds[SelectedField].SingerTeam2 = GameData.Rounds[OldSelectedField].SingerTeam2; GameData.Rounds[SelectedField].SingerTeam2 = GameData.Rounds[OldSelectedField].SingerTeam2;
UpdateFieldContents(); UpdateFieldContents();
Texts[htTexts(TextNextPlayerT1)].Visible = true; Texts[TextNextPlayerT1].Visible = true;
Texts[htTexts(TextNextPlayerT2)].Visible = true; Texts[TextNextPlayerT2].Visible = true;
Texts[htTexts(TextNextPlayerNameT1)].Visible = true; Texts[TextNextPlayerNameT1].Visible = true;
Texts[htTexts(TextNextPlayerNameT2)].Visible = true; Texts[TextNextPlayerNameT2].Visible = true;
SProfile[] profiles = CBase.Profiles.GetProfiles(); SProfile[] profiles = CBase.Profiles.GetProfiles();
Texts[htTexts(TextNextPlayerNameT1)].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName; Texts[TextNextPlayerNameT1].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName;
Texts[htTexts(TextNextPlayerNameT2)].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName; Texts[TextNextPlayerNameT2].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName;
Statics[htStatics(StaticAvatarT1)].Visible = true; Statics[StaticAvatarT1].Visible = true;
Statics[htStatics(StaticAvatarT2)].Visible = true; Statics[StaticAvatarT2].Visible = true;
Statics[htStatics(StaticAvatarT1)].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture; Statics[StaticAvatarT1].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture;
Statics[htStatics(StaticAvatarT2)].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture; Statics[StaticAvatarT2].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture;
UpdateJokerButtons(); UpdateJokerButtons();
Buttons[htButtons(ButtonNextRound)].Visible = true; Buttons[ButtonNextRound].Visible = true;
Buttons[htButtons(ButtonExit)].Visible = true; Buttons[ButtonExit].Visible = true;
Buttons[htButtons(ButtonBack)].Visible = false; Buttons[ButtonBack].Visible = false;
SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); SetInteractionToButton(Buttons[ButtonNextRound]);
} }
private void UseJoker(int TeamNr, int JokerNum) private void UseJoker(int TeamNr, int JokerNum)
@@ -595,28 +595,28 @@ namespace Vocaluxe.PartyModes
private void UpdateTeamChoosingMessage() private void UpdateTeamChoosingMessage()
{ {
Texts[htTexts(TextTeamChoosing)].Color = CBase.Theme.GetPlayerColor(GameData.Team + 1); Texts[TextTeamChoosing].Color = CBase.Theme.GetPlayerColor(GameData.Team + 1);
Texts[htTexts(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[htTexts(TextTeamChoosing)].Visible = true; Texts[TextTeamChoosing].Visible = true;
else else
Texts[htTexts(TextTeamChoosing)].Visible = false; Texts[TextTeamChoosing].Visible = false;
} }
private void UpdateJokerButtons() private void UpdateJokerButtons()
{ {
Buttons[htButtons(ButtonJokerRandomT1)].Visible = true; Buttons[ButtonJokerRandomT1].Visible = true;
Buttons[htButtons(ButtonJokerRandomT2)].Visible = true; Buttons[ButtonJokerRandomT2].Visible = true;
Buttons[htButtons(ButtonJokerRandomT1)].Text.Text = GameData.NumJokerRandom[0].ToString(); Buttons[ButtonJokerRandomT1].Text.Text = GameData.NumJokerRandom[0].ToString();
Buttons[htButtons(ButtonJokerRandomT2)].Text.Text = GameData.NumJokerRandom[1].ToString(); Buttons[ButtonJokerRandomT2].Text.Text = GameData.NumJokerRandom[1].ToString();
Buttons[htButtons(ButtonJokerRandomT1)].Enabled = GameData.NumJokerRandom[0] > 0; Buttons[ButtonJokerRandomT1].Enabled = GameData.NumJokerRandom[0] > 0;
Buttons[htButtons(ButtonJokerRandomT2)].Enabled = GameData.NumJokerRandom[1] > 0; Buttons[ButtonJokerRandomT2].Enabled = GameData.NumJokerRandom[1] > 0;
Buttons[htButtons(ButtonJokerRetryT1)].Visible = true; Buttons[ButtonJokerRetryT1].Visible = true;
Buttons[htButtons(ButtonJokerRetryT2)].Visible = true; Buttons[ButtonJokerRetryT2].Visible = true;
Buttons[htButtons(ButtonJokerRetryT1)].Text.Text = GameData.NumJokerRetry[0].ToString(); Buttons[ButtonJokerRetryT1].Text.Text = GameData.NumJokerRetry[0].ToString();
Buttons[htButtons(ButtonJokerRetryT2)].Text.Text = GameData.NumJokerRetry[1].ToString(); Buttons[ButtonJokerRetryT2].Text.Text = GameData.NumJokerRetry[1].ToString();
Buttons[htButtons(ButtonJokerRetryT1)].Enabled = GameData.NumJokerRetry[0] > 0; Buttons[ButtonJokerRetryT1].Enabled = GameData.NumJokerRetry[0] > 0;
Buttons[htButtons(ButtonJokerRetryT2)].Enabled = GameData.NumJokerRetry[1] > 0; Buttons[ButtonJokerRetryT2].Enabled = GameData.NumJokerRetry[1] > 0;
} }
private void NextRound() private void NextRound()
@@ -642,13 +642,13 @@ namespace Vocaluxe.PartyModes
{ {
ExitPopupVisible = Visible; ExitPopupVisible = Visible;
Statics[htStatics(StaticPopupBG)].Visible = ExitPopupVisible; Statics[StaticPopupBG].Visible = ExitPopupVisible;
Texts[htTexts(TextPopupReallyExit)].Visible = ExitPopupVisible; Texts[TextPopupReallyExit].Visible = ExitPopupVisible;
Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible; Buttons[ButtonPopupYes].Visible = ExitPopupVisible;
Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible; Buttons[ButtonPopupNo].Visible = ExitPopupVisible;
if (ExitPopupVisible) if (ExitPopupVisible)
SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]); SetInteractionToButton(Buttons[ButtonPopupNo]);
} }
private void Back() private void Back()
@@ -144,16 +144,16 @@ namespace Vocaluxe.PartyModes
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
if (Buttons[htButtons(ButtonPlayerChooseScrollUp)].Selected) if (Buttons[ButtonPlayerChooseScrollUp].Selected)
Scroll(-1); Scroll(-1);
if (Buttons[htButtons(ButtonPlayerChooseScrollDown)].Selected) if (Buttons[ButtonPlayerChooseScrollDown].Selected)
Scroll(1); Scroll(1);
if (!OnAdd()) if (!OnAdd())
@@ -277,16 +277,16 @@ namespace Vocaluxe.PartyModes
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonBack)].Selected) if (Buttons[ButtonBack].Selected)
Back(); Back();
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
Next(); Next();
if (Buttons[htButtons(ButtonPlayerChooseScrollUp)].Selected) if (Buttons[ButtonPlayerChooseScrollUp].Selected)
Scroll(-1); Scroll(-1);
if (Buttons[htButtons(ButtonPlayerChooseScrollDown)].Selected) if (Buttons[ButtonPlayerChooseScrollDown].Selected)
Scroll(1); Scroll(1);
} }
@@ -354,13 +354,13 @@ namespace Vocaluxe.PartyModes
private void AddButtonPlayerDestination() private void AddButtonPlayerDestination()
{ {
Buttons[htButtons(ButtonPlayerDestination)].Visible = false; Buttons[ButtonPlayerDestination].Visible = false;
PlayerDestinationButtons = new List<CButton>(); PlayerDestinationButtons = new List<CButton>();
int row = 0; int row = 0;
int column = 0; int column = 0;
for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++) 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.X = PlayerDestinationButtonsFirstX + column * (b.Rect.W + PlayerDestinationButtonsSpaceH);
b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW); b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW);
PlayerDestinationButtons.Add(b); PlayerDestinationButtons.Add(b);
@@ -378,13 +378,13 @@ namespace Vocaluxe.PartyModes
private void AddButtonPlayerChoose() private void AddButtonPlayerChoose()
{ {
Buttons[htButtons(ButtonPlayerChoose)].Visible = false; Buttons[ButtonPlayerChoose].Visible = false;
PlayerChooseButtons = new List<CPlayerChooseButton>(); PlayerChooseButtons = new List<CPlayerChooseButton>();
int row = 0; int row = 0;
int column = 0; int column = 0;
for (int i = 1; i <= PlayerChooseButtonsNumH * PlayerChooseButtonsNumW; i++) 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.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH);
b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW); b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW);
CPlayerChooseButton pcb = new CPlayerChooseButton(); CPlayerChooseButton pcb = new CPlayerChooseButton();
@@ -414,8 +414,8 @@ namespace Vocaluxe.PartyModes
{ {
UpdateButtonPlayerChoose(PlayerChooseButtonsOffset); UpdateButtonPlayerChoose(PlayerChooseButtonsOffset);
} }
Buttons[htButtons(ButtonPlayerChooseScrollUp)].Enabled = PlayerChooseButtonsOffset > 0; Buttons[ButtonPlayerChooseScrollUp].Enabled = PlayerChooseButtonsOffset > 0;
Buttons[htButtons(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)
@@ -442,10 +442,10 @@ namespace Vocaluxe.PartyModes
{ {
PlayerChooseButtons[i].ProfileID = -1; PlayerChooseButtons[i].ProfileID = -1;
PlayerChooseButtons[i].Button.Text.Text = String.Empty; PlayerChooseButtons[i].Button.Text.Text = String.Empty;
PlayerChooseButtons[i].Button.Texture = Buttons[htButtons(ButtonPlayerChoose)].Texture; PlayerChooseButtons[i].Button.Texture = Buttons[ButtonPlayerChoose].Texture;
PlayerChooseButtons[i].Button.STexture = Buttons[htButtons(ButtonPlayerChoose)].STexture; PlayerChooseButtons[i].Button.STexture = Buttons[ButtonPlayerChoose].STexture;
PlayerChooseButtons[i].Button.Color = Buttons[htButtons(ButtonPlayerChoose)].Color; PlayerChooseButtons[i].Button.Color = Buttons[ButtonPlayerChoose].Color;
PlayerChooseButtons[i].Button.SColor = Buttons[htButtons(ButtonPlayerChoose)].SColor; PlayerChooseButtons[i].Button.SColor = Buttons[ButtonPlayerChoose].SColor;
PlayerChooseButtons[i].Button.Enabled = false; PlayerChooseButtons[i].Button.Enabled = false;
} }
} }
@@ -534,10 +534,10 @@ namespace Vocaluxe.PartyModes
} }
else else
{ {
PlayerDestinationButtons[i].Color = Buttons[htButtons(ButtonPlayerDestination)].Color; PlayerDestinationButtons[i].Color = Buttons[ButtonPlayerDestination].Color;
PlayerDestinationButtons[i].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor; PlayerDestinationButtons[i].SColor = Buttons[ButtonPlayerDestination].SColor;
PlayerDestinationButtons[i].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture; PlayerDestinationButtons[i].Texture = Buttons[ButtonPlayerDestination].Texture;
PlayerDestinationButtons[i].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture; PlayerDestinationButtons[i].STexture = Buttons[ButtonPlayerDestination].STexture;
PlayerDestinationButtons[i].Text.Text = String.Empty; PlayerDestinationButtons[i].Text.Text = String.Empty;
PlayerDestinationButtons[i].Enabled = false; PlayerDestinationButtons[i].Enabled = false;
} }
@@ -558,10 +558,10 @@ namespace Vocaluxe.PartyModes
} }
else else
{ {
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Color = Buttons[htButtons(ButtonPlayerDestination)].Color; PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Color = Buttons[ButtonPlayerDestination].Color;
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor; PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].SColor = Buttons[ButtonPlayerDestination].SColor;
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture; PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Texture = Buttons[ButtonPlayerDestination].Texture;
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture; PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].STexture = Buttons[ButtonPlayerDestination].STexture;
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Text.Text = String.Empty; PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Text.Text = String.Empty;
PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Enabled = false; PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Enabled = false;
} }
@@ -572,11 +572,11 @@ namespace Vocaluxe.PartyModes
{ {
if (Data.ScreenNames.ProfileIDsTeam1.Count == NumPlayerTeam1 && Data.ScreenNames.ProfileIDsTeam2.Count == NumPlayerTeam2) if (Data.ScreenNames.ProfileIDsTeam1.Count == NumPlayerTeam1 && Data.ScreenNames.ProfileIDsTeam2.Count == NumPlayerTeam2)
{ {
Buttons[htButtons(ButtonNext)].Visible = true; Buttons[ButtonNext].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonNext)]); SetInteractionToButton(Buttons[ButtonNext]);
} }
else else
Buttons[htButtons(ButtonNext)].Visible = false; Buttons[ButtonNext].Visible = false;
} }
private bool OnAdd() private bool OnAdd()
+1 -1
View File
@@ -42,7 +42,7 @@ namespace Vocaluxe.Lib.Video
i = CGstreamerVideoWrapper.LoadVideo(u.AbsoluteUri); i = CGstreamerVideoWrapper.LoadVideo(u.AbsoluteUri);
return i; return i;
} }
catch (Exception e) { } catch (Exception) { }
return i; return i;
} }
+27 -27
View File
@@ -104,7 +104,7 @@ namespace Vocaluxe.Screens
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
_ScreenArea = Statics[htStatics(StaticBG)].Rect; _ScreenArea = Statics[StaticBG].Rect;
} }
public override bool HandleInput(KeyEvent KeyEvent) public override bool HandleInput(KeyEvent KeyEvent)
@@ -124,21 +124,21 @@ namespace Vocaluxe.Screens
return false; return false;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
CBackgroundMusic.Next(); CBackgroundMusic.Next();
if (Buttons[htButtons(ButtonPrevious)].Selected) if (Buttons[ButtonPrevious].Selected)
CBackgroundMusic.Previous(); CBackgroundMusic.Previous();
if (Buttons[htButtons(ButtonPlay)].Selected) if (Buttons[ButtonPlay].Selected)
CBackgroundMusic.Play(); CBackgroundMusic.Play();
if (Buttons[htButtons(ButtonPause)].Selected) if (Buttons[ButtonPause].Selected)
CBackgroundMusic.Pause(); CBackgroundMusic.Pause();
if (Buttons[htButtons(ButtonRepeat)].Selected) if (Buttons[ButtonRepeat].Selected)
CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong; CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong;
if (Buttons[htButtons(ButtonShowVideo)].Selected) if (Buttons[ButtonShowVideo].Selected)
VideoPreview = !VideoPreview; VideoPreview = !VideoPreview;
if (Buttons[htButtons(ButtonSing)].Selected) if (Buttons[ButtonSing].Selected)
StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet); StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet);
if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected) if (Buttons[ButtonToBackgroundVideo].Selected)
VideoBackground = !VideoBackground; VideoBackground = !VideoBackground;
break; break;
} }
@@ -152,21 +152,21 @@ namespace Vocaluxe.Screens
base.HandleMouse(MouseEvent); base.HandleMouse(MouseEvent);
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[ButtonNext].Selected)
CBackgroundMusic.Next(); CBackgroundMusic.Next();
if (Buttons[htButtons(ButtonPrevious)].Selected) if (Buttons[ButtonPrevious].Selected)
CBackgroundMusic.Previous(); CBackgroundMusic.Previous();
if (Buttons[htButtons(ButtonPlay)].Selected) if (Buttons[ButtonPlay].Selected)
CBackgroundMusic.Play(); CBackgroundMusic.Play();
if (Buttons[htButtons(ButtonPause)].Selected) if (Buttons[ButtonPause].Selected)
CBackgroundMusic.Pause(); CBackgroundMusic.Pause();
if (Buttons[htButtons(ButtonRepeat)].Selected) if (Buttons[ButtonRepeat].Selected)
CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong; CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong;
if (Buttons[htButtons(ButtonShowVideo)].Selected) if (Buttons[ButtonShowVideo].Selected)
VideoPreview = !VideoPreview; VideoPreview = !VideoPreview;
if (Buttons[htButtons(ButtonSing)].Selected) if (Buttons[ButtonSing].Selected)
StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet); StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet);
if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected) if (Buttons[ButtonToBackgroundVideo].Selected)
VideoBackground = !VideoBackground; VideoBackground = !VideoBackground;
} else if (MouseEvent.LB) } else if (MouseEvent.LB)
{ {
@@ -183,11 +183,11 @@ namespace Vocaluxe.Screens
public override bool UpdateGame() public override bool UpdateGame()
{ {
Statics[htStatics(StaticCover)].Visible = !_VideoPreview || !CBackgroundMusic.SongHasVideo; Statics[StaticCover].Visible = !_VideoPreview || !CBackgroundMusic.SongHasVideo;
Buttons[htButtons(ButtonToBackgroundVideo)].Pressed = VideoBackground; Buttons[ButtonToBackgroundVideo].Pressed = VideoBackground;
Buttons[htButtons(ButtonShowVideo)].Pressed = _VideoPreview; Buttons[ButtonShowVideo].Pressed = _VideoPreview;
Buttons[htButtons(ButtonRepeat)].Pressed = CBackgroundMusic.RepeatSong; Buttons[ButtonRepeat].Pressed = CBackgroundMusic.RepeatSong;
Buttons[htButtons(ButtonSing)].Visible = CBackgroundMusic.CanSing && CParty.CurrentPartyModeID == -1; Buttons[ButtonSing].Visible = CBackgroundMusic.CanSing && CParty.CurrentPartyModeID == -1;
return true; return true;
} }
@@ -200,12 +200,12 @@ namespace Vocaluxe.Screens
{ {
if (!_Active) if (!_Active)
return false; return false;
Statics[htStatics(StaticCover)].Texture = CBackgroundMusic.Cover; Statics[StaticCover].Texture = CBackgroundMusic.Cover;
if (CBackgroundMusic.VideoEnabled && VideoPreview && CBackgroundMusic.SongHasVideo) if (CBackgroundMusic.VideoEnabled && VideoPreview && CBackgroundMusic.SongHasVideo)
CDraw.DrawTexture(Statics[htStatics(StaticCover)], CBackgroundMusic.GetVideoTexture(), EAspect.Crop); CDraw.DrawTexture(Statics[StaticCover], CBackgroundMusic.GetVideoTexture(), EAspect.Crop);
Buttons[htButtons(ButtonPause)].Visible = CBackgroundMusic.Playing; Buttons[ButtonPause].Visible = CBackgroundMusic.Playing;
Buttons[htButtons(ButtonPlay)].Visible = !CBackgroundMusic.Playing; Buttons[ButtonPlay].Visible = !CBackgroundMusic.Playing;
Texts[htTexts(TextCurrentSong)].Text = CBackgroundMusic.ArtistAndTitle; Texts[TextCurrentSong].Text = CBackgroundMusic.ArtistAndTitle;
return base.Draw(); return base.Draw();
} }
+18 -18
View File
@@ -42,8 +42,8 @@ namespace Vocaluxe.Screens
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
_ScreenArea = Statics[htStatics(StaticBG)].Rect; _ScreenArea = Statics[StaticBG].Rect;
SelectSlides[htSelectSlides(SelectSlideVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" }); SelectSlides[SelectSlideVolume].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" });
} }
public override bool HandleInput(KeyEvent KeyEvent) public override bool HandleInput(KeyEvent KeyEvent)
@@ -62,19 +62,19 @@ namespace Vocaluxe.Screens
} }
else if (MouseEvent.Wheel > 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent)) else if (MouseEvent.Wheel > 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent))
{ {
if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel >= 0) if (SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel >= 0)
SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel; SelectSlides[SelectSlideVolume].Selection = SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel;
else if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel < 0) else if (SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel < 0)
SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = 0; SelectSlides[SelectSlideVolume].Selection = 0;
SaveConfig(); SaveConfig();
return true; return true;
} }
else if (MouseEvent.Wheel < 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent)) else if (MouseEvent.Wheel < 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent))
{ {
if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel < SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues) if (SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel < SelectSlides[SelectSlideVolume].NumValues)
SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel; SelectSlides[SelectSlideVolume].Selection = SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel;
else if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel >= SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues) else if (SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel >= SelectSlides[SelectSlideVolume].NumValues)
SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues - 1; SelectSlides[SelectSlideVolume].Selection = SelectSlides[SelectSlideVolume].NumValues - 1;
SaveConfig(); SaveConfig();
return true; return true;
} }
@@ -111,20 +111,20 @@ namespace Vocaluxe.Screens
{ {
case EScreens.ScreenSong: case EScreens.ScreenSong:
if (CSongs.IsInCategory) if (CSongs.IsInCategory)
CConfig.PreviewMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5; CConfig.PreviewMusicVolume = SelectSlides[SelectSlideVolume].Selection * 5;
else else
{ {
CConfig.BackgroundMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5; CConfig.BackgroundMusicVolume = SelectSlides[SelectSlideVolume].Selection * 5;
CBackgroundMusic.ApplyVolume(); CBackgroundMusic.ApplyVolume();
} }
break; break;
case EScreens.ScreenSing: case EScreens.ScreenSing:
CConfig.GameMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5; CConfig.GameMusicVolume = SelectSlides[SelectSlideVolume].Selection * 5;
break; break;
default: default:
CConfig.BackgroundMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5; CConfig.BackgroundMusicVolume = SelectSlides[SelectSlideVolume].Selection * 5;
CBackgroundMusic.ApplyVolume(); CBackgroundMusic.ApplyVolume();
break; break;
} }
@@ -137,17 +137,17 @@ namespace Vocaluxe.Screens
{ {
case EScreens.ScreenSong: case EScreens.ScreenSong:
if(CSongs.IsInCategory) if(CSongs.IsInCategory)
SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = (int)(CConfig.PreviewMusicVolume / 5); SelectSlides[SelectSlideVolume].Selection = (int)(CConfig.PreviewMusicVolume / 5);
else else
SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = ((int)CConfig.BackgroundMusicVolume / 5); SelectSlides[SelectSlideVolume].Selection = ((int)CConfig.BackgroundMusicVolume / 5);
break; break;
case EScreens.ScreenSing: case EScreens.ScreenSing:
SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = ((int)CConfig.GameMusicVolume / 5); SelectSlides[SelectSlideVolume].Selection = ((int)CConfig.GameMusicVolume / 5);
break; break;
default: default:
SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = ((int)CConfig.BackgroundMusicVolume / 5); SelectSlides[SelectSlideVolume].Selection = ((int)CConfig.BackgroundMusicVolume / 5);
break; break;
} }
} }
+22 -22
View File
@@ -160,38 +160,38 @@ namespace Vocaluxe.Screens
{ {
if (_Pos + p < _Scores[_Round].Count) if (_Pos + p < _Scores[_Round].Count)
{ {
Texts[htTexts(TextNumber[p])].Visible = true; Texts[TextNumber[p]].Visible = true;
Texts[htTexts(TextName[p])].Visible = true; Texts[TextName[p]].Visible = true;
Texts[htTexts(TextScore[p])].Visible = true; Texts[TextScore[p]].Visible = true;
Texts[htTexts(TextDate[p])].Visible = true; Texts[TextDate[p]].Visible = true;
Texts[htTexts(TextNumber[p])].Text = (_Pos + p + 1).ToString(); Texts[TextNumber[p]].Text = (_Pos + p + 1).ToString();
string name = _Scores[_Round][_Pos + p].Name; string name = _Scores[_Round][_Pos + p].Name;
name += " [" + CLanguage.Translate(Enum.GetName(typeof(EGameDifficulty), _Scores[_Round][_Pos + p].Difficulty)) + "]"; name += " [" + CLanguage.Translate(Enum.GetName(typeof(EGameDifficulty), _Scores[_Round][_Pos + p].Difficulty)) + "]";
if (_IsDuet) if (_IsDuet)
name += " (P" + (_Scores[_Round][_Pos + p].LineNr + 1).ToString() + ")"; name += " (P" + (_Scores[_Round][_Pos + p].LineNr + 1).ToString() + ")";
Texts[htTexts(TextName[p])].Text = name; Texts[TextName[p]].Text = name;
Texts[htTexts(TextScore[p])].Text = _Scores[_Round][_Pos + p].Score.ToString("00000"); Texts[TextScore[p]].Text = _Scores[_Round][_Pos + p].Score.ToString("00000");
Texts[htTexts(TextDate[p])].Text = _Scores[_Round][_Pos + p].Date; Texts[TextDate[p]].Text = _Scores[_Round][_Pos + p].Date;
if (isNewEntry(_Scores[_Round][_Pos + p].ID) == true) if (isNewEntry(_Scores[_Round][_Pos + p].ID) == true)
{ {
ParticleEffects[htParticleEffects(ParticleEffectNew[p])].Visible = true; ParticleEffects[ParticleEffectNew[p]].Visible = true;
} }
else else
{ {
ParticleEffects[htParticleEffects(ParticleEffectNew[p])].Visible = false; ParticleEffects[ParticleEffectNew[p]].Visible = false;
} }
} }
else else
{ {
Texts[htTexts(TextNumber[p])].Visible = false; Texts[TextNumber[p]].Visible = false;
Texts[htTexts(TextName[p])].Visible = false; Texts[TextName[p]].Visible = false;
Texts[htTexts(TextScore[p])].Visible = false; Texts[TextScore[p]].Visible = false;
Texts[htTexts(TextDate[p])].Visible = false; Texts[TextDate[p]].Visible = false;
ParticleEffects[htParticleEffects(ParticleEffectNew[p])].Visible = false; ParticleEffects[ParticleEffectNew[p]].Visible = false;
} }
} }
return true; return true;
@@ -275,33 +275,33 @@ namespace Vocaluxe.Screens
if (song == null) if (song == null)
return; return;
Texts[htTexts(TextSongName)].Text = song.Artist + " - " + song.Title; Texts[TextSongName].Text = song.Artist + " - " + song.Title;
if (points.NumRounds > 1) if (points.NumRounds > 1)
{ {
Texts[htTexts(TextSongName)].Text += " (" + (_Round+1) + "/" + points.NumRounds + ")"; Texts[TextSongName].Text += " (" + (_Round+1) + "/" + points.NumRounds + ")";
} }
switch (CGame.GetGameMode(_Round)) switch (CGame.GetGameMode(_Round))
{ {
case EGameMode.TR_GAMEMODE_NORMAL: case EGameMode.TR_GAMEMODE_NORMAL:
Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; Texts[TextSongMode].Text = "TR_GAMEMODE_NORMAL";
break; break;
case EGameMode.TR_GAMEMODE_MEDLEY: case EGameMode.TR_GAMEMODE_MEDLEY:
Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_MEDLEY"; Texts[TextSongMode].Text = "TR_GAMEMODE_MEDLEY";
break; break;
case EGameMode.TR_GAMEMODE_DUET: case EGameMode.TR_GAMEMODE_DUET:
Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_DUET"; Texts[TextSongMode].Text = "TR_GAMEMODE_DUET";
_IsDuet = true; _IsDuet = true;
break; break;
case EGameMode.TR_GAMEMODE_SHORTSONG: case EGameMode.TR_GAMEMODE_SHORTSONG:
Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_SHORTSONG"; Texts[TextSongMode].Text = "TR_GAMEMODE_SHORTSONG";
break; break;
default: default:
Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; Texts[TextSongMode].Text = "TR_GAMEMODE_NORMAL";
break; break;
} }
+2 -2
View File
@@ -106,7 +106,7 @@ namespace Vocaluxe.Screens
_SongLoaderThread = new Thread(new ThreadStart(CSongs.LoadSongs)); _SongLoaderThread = new Thread(new ThreadStart(CSongs.LoadSongs));
_SongLoaderThread.Name = "SongLoader"; _SongLoaderThread.Name = "SongLoader";
Texts[htTexts(TextStatus)].Text = CLanguage.Translate("TR_SCREENLOAD_TOTAL") + ": 0 " + Texts[TextStatus].Text = CLanguage.Translate("TR_SCREENLOAD_TOTAL") + ": 0 " +
CLanguage.Translate("TR_SCREENLOAD_SONGS") + " (0 " + CLanguage.Translate("TR_SCREENLOAD_SONGS") + " (0 " +
CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")"; CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")";
@@ -175,7 +175,7 @@ namespace Vocaluxe.Screens
if (CSettings.GameState == EGameState.Normal) if (CSettings.GameState == EGameState.Normal)
CGraphics.FadeTo(EScreens.ScreenMain); CGraphics.FadeTo(EScreens.ScreenMain);
Texts[htTexts(TextStatus)].Text = Texts[TextStatus].Text =
CLanguage.Translate("TR_SCREENLOAD_TOTAL") + ": " + CSongs.NumAllSongs.ToString() + " " + CLanguage.Translate("TR_SCREENLOAD_TOTAL") + ": " + CSongs.NumAllSongs.ToString() + " " +
CLanguage.Translate("TR_SCREENLOAD_SONGS") + " (" + CSongs.NumSongsWithCoverLoaded + " " + CLanguage.Translate("TR_SCREENLOAD_SONGS") + " (" + CSongs.NumSongsWithCoverLoaded + " " +
CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")"; CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")";
+10 -10
View File
@@ -74,22 +74,22 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonSing)].Selected) if (Buttons[ButtonSing].Selected)
{ {
CParty.SetNormalGameMode(); CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreens.ScreenSong); CGraphics.FadeTo(EScreens.ScreenSong);
} }
if (Buttons[htButtons(ButtonParty)].Selected) if (Buttons[ButtonParty].Selected)
CGraphics.FadeTo(EScreens.ScreenParty); CGraphics.FadeTo(EScreens.ScreenParty);
if (Buttons[htButtons(ButtonOptions)].Selected) if (Buttons[ButtonOptions].Selected)
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
if (Buttons[htButtons(ButtonProfiles)].Selected) if (Buttons[ButtonProfiles].Selected)
CGraphics.FadeTo(EScreens.ScreenProfiles); CGraphics.FadeTo(EScreens.ScreenProfiles);
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
return false; return false;
break; break;
@@ -104,22 +104,22 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonSing)].Selected) if (Buttons[ButtonSing].Selected)
{ {
CParty.SetNormalGameMode(); CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreens.ScreenSong); CGraphics.FadeTo(EScreens.ScreenSong);
} }
if (Buttons[htButtons(ButtonParty)].Selected) if (Buttons[ButtonParty].Selected)
CGraphics.FadeTo(EScreens.ScreenParty); CGraphics.FadeTo(EScreens.ScreenParty);
if (Buttons[htButtons(ButtonOptions)].Selected) if (Buttons[ButtonOptions].Selected)
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
if (Buttons[htButtons(ButtonProfiles)].Selected) if (Buttons[ButtonProfiles].Selected)
CGraphics.FadeTo(EScreens.ScreenProfiles); CGraphics.FadeTo(EScreens.ScreenProfiles);
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
return false; return false;
} }
+104 -104
View File
@@ -107,12 +107,12 @@ namespace Vocaluxe.Screens
for (int i = 0; i < CSettings.MaxNumPlayer; i++) for (int i = 0; i < CSettings.MaxNumPlayer; i++)
{ {
OriginalPlayerAvatarTextures[i] = Statics[htStatics(StaticPlayerAvatar[i])].Texture; OriginalPlayerAvatarTextures[i] = Statics[StaticPlayerAvatar[i]].Texture;
} }
for (int i = 1; i <= CSettings.MaxNumPlayer; i++) for (int i = 1; i <= CSettings.MaxNumPlayer; i++)
{ {
Equalizers[htEqualizer("EqualizerPlayer" + i)].ScreenHandles = true; Equalizers["EqualizerPlayer" + i].ScreenHandles = true;
} }
} }
@@ -123,20 +123,20 @@ namespace Vocaluxe.Screens
case Keys.Add: case Keys.Add:
if (CConfig.NumPlayer + 1 <= CSettings.MaxNumPlayer) if (CConfig.NumPlayer + 1 <= CSettings.MaxNumPlayer)
{ {
SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Selection = CConfig.NumPlayer; SelectSlides[SelectSlidePlayerNumber].Selection = CConfig.NumPlayer;
UpdatePlayerNumber(); UpdatePlayerNumber();
//Update Tiles-List //Update Tiles-List
NameSelections[htNameSelections(NameSelection)].UpdateList(); NameSelections[NameSelection].UpdateList();
} }
break; break;
case Keys.Subtract: case Keys.Subtract:
if (CConfig.NumPlayer - 1 > 0) if (CConfig.NumPlayer - 1 > 0)
{ {
SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Selection = CConfig.NumPlayer - 2; SelectSlides[SelectSlidePlayerNumber].Selection = CConfig.NumPlayer - 2;
UpdatePlayerNumber(); UpdatePlayerNumber();
//Update Tiles-List //Update Tiles-List
NameSelections[htNameSelections(NameSelection)].UpdateList(); NameSelections[NameSelection].UpdateList();
} }
break; break;
@@ -152,7 +152,7 @@ namespace Vocaluxe.Screens
selectingKeyboardPlayerNr++; selectingKeyboardPlayerNr++;
else else
selectingKeyboardPlayerNr = 1; selectingKeyboardPlayerNr = 1;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, selectingKeyboardPlayerNr); NameSelections[NameSelection].KeyboardSelection(true, selectingKeyboardPlayerNr);
} }
break; break;
} }
@@ -160,14 +160,14 @@ namespace Vocaluxe.Screens
if (selectingKeyboardActive) if (selectingKeyboardActive)
{ {
//Handle left/right/up/down //Handle left/right/up/down
NameSelections[htNameSelections(NameSelection)].HandleInput(KeyEvent); NameSelections[NameSelection].HandleInput(KeyEvent);
switch (KeyEvent.Key) switch (KeyEvent.Key)
{ {
case Keys.Enter: case Keys.Enter:
//Check, if a player is selected //Check, if a player is selected
if (NameSelections[htNameSelections(NameSelection)].Selection > -1) if (NameSelections[NameSelection].Selection > -1)
{ {
SelectedPlayerNr = NameSelections[htNameSelections(NameSelection)].Selection; SelectedPlayerNr = NameSelections[NameSelection].Selection;
//Update Game-infos with new player //Update Game-infos with new player
CGame.Player[selectingKeyboardPlayerNr-1].Name = CProfiles.Profiles[SelectedPlayerNr].PlayerName; CGame.Player[selectingKeyboardPlayerNr-1].Name = CProfiles.Profiles[SelectedPlayerNr].PlayerName;
CGame.Player[selectingKeyboardPlayerNr-1].Difficulty = CProfiles.Profiles[SelectedPlayerNr].Difficulty; CGame.Player[selectingKeyboardPlayerNr-1].Difficulty = CProfiles.Profiles[SelectedPlayerNr].Difficulty;
@@ -176,13 +176,13 @@ namespace Vocaluxe.Screens
CConfig.Players[selectingKeyboardPlayerNr - 1] = CProfiles.Profiles[SelectedPlayerNr].ProfileFile; CConfig.Players[selectingKeyboardPlayerNr - 1] = CProfiles.Profiles[SelectedPlayerNr].ProfileFile;
CConfig.SaveConfig(); CConfig.SaveConfig();
//Update texture and name //Update texture and name
Statics[htStatics(StaticPlayerAvatar[selectingKeyboardPlayerNr-1])].Texture = CProfiles.Profiles[SelectedPlayerNr].Avatar.Texture; Statics[StaticPlayerAvatar[selectingKeyboardPlayerNr-1]].Texture = CProfiles.Profiles[SelectedPlayerNr].Avatar.Texture;
Texts[htTexts(TextPlayer[selectingKeyboardPlayerNr-1])].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName; Texts[TextPlayer[selectingKeyboardPlayerNr-1]].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName;
//Update profile-warning //Update profile-warning
CheckPlayers(); CheckPlayers();
//Update Tiles-List //Update Tiles-List
NameSelections[htNameSelections(NameSelection)].UpdateList(); NameSelections[NameSelection].UpdateList();
SetInteractionToButton(Buttons[htButtons(ButtonStart)]); SetInteractionToButton(Buttons[ButtonStart]);
} }
//Started selecting with 'P' //Started selecting with 'P'
if (selectingKeyboardUnendless) if (selectingKeyboardUnendless)
@@ -192,12 +192,12 @@ namespace Vocaluxe.Screens
//Reset all values //Reset all values
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
} }
else else
{ {
selectingKeyboardPlayerNr++; selectingKeyboardPlayerNr++;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, selectingKeyboardPlayerNr); NameSelections[NameSelection].KeyboardSelection(true, selectingKeyboardPlayerNr);
} }
} }
else else
@@ -205,7 +205,7 @@ namespace Vocaluxe.Screens
//Reset all values //Reset all values
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
} }
break; break;
@@ -216,12 +216,12 @@ namespace Vocaluxe.Screens
//Reset all values //Reset all values
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
} }
else else
{ {
selectingKeyboardPlayerNr = 1; selectingKeyboardPlayerNr = 1;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 1); NameSelections[NameSelection].KeyboardSelection(true, 1);
} }
selectingKeyboardUnendless = false; selectingKeyboardUnendless = false;
break; break;
@@ -232,12 +232,12 @@ namespace Vocaluxe.Screens
//Reset all values //Reset all values
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
} }
else else
{ {
selectingKeyboardPlayerNr = 2; selectingKeyboardPlayerNr = 2;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 2); NameSelections[NameSelection].KeyboardSelection(true, 2);
} }
selectingKeyboardUnendless = false; selectingKeyboardUnendless = false;
break; break;
@@ -248,12 +248,12 @@ namespace Vocaluxe.Screens
//Reset all values //Reset all values
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
} }
else else
{ {
selectingKeyboardPlayerNr = 3; selectingKeyboardPlayerNr = 3;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 3); NameSelections[NameSelection].KeyboardSelection(true, 3);
} }
selectingKeyboardUnendless = false; selectingKeyboardUnendless = false;
break; break;
@@ -264,12 +264,12 @@ namespace Vocaluxe.Screens
//Reset all values //Reset all values
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
} }
else else
{ {
selectingKeyboardPlayerNr = 4; selectingKeyboardPlayerNr = 4;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 4); NameSelections[NameSelection].KeyboardSelection(true, 4);
} }
selectingKeyboardUnendless = false; selectingKeyboardUnendless = false;
break; break;
@@ -280,12 +280,12 @@ namespace Vocaluxe.Screens
//Reset all values //Reset all values
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
} }
else else
{ {
selectingKeyboardPlayerNr = 5; selectingKeyboardPlayerNr = 5;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 5); NameSelections[NameSelection].KeyboardSelection(true, 5);
} }
selectingKeyboardUnendless = false; selectingKeyboardUnendless = false;
break; break;
@@ -296,12 +296,12 @@ namespace Vocaluxe.Screens
//Reset all values //Reset all values
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
} }
else else
{ {
selectingKeyboardPlayerNr = 6; selectingKeyboardPlayerNr = 6;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 6); NameSelections[NameSelection].KeyboardSelection(true, 6);
} }
selectingKeyboardUnendless = false; selectingKeyboardUnendless = false;
break; break;
@@ -311,7 +311,7 @@ namespace Vocaluxe.Screens
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
selectingKeyboardUnendless = false; selectingKeyboardUnendless = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
break; break;
case Keys.Delete: case Keys.Delete:
@@ -323,31 +323,31 @@ namespace Vocaluxe.Screens
CConfig.Players[selectingKeyboardPlayerNr - 1] = String.Empty; CConfig.Players[selectingKeyboardPlayerNr - 1] = String.Empty;
CConfig.SaveConfig(); CConfig.SaveConfig();
//Update texture and name //Update texture and name
Statics[htStatics(StaticPlayerAvatar[selectingKeyboardPlayerNr - 1])].Texture = OriginalPlayerAvatarTextures[selectingKeyboardPlayerNr - 1]; Statics[StaticPlayerAvatar[selectingKeyboardPlayerNr - 1]].Texture = OriginalPlayerAvatarTextures[selectingKeyboardPlayerNr - 1];
Texts[htTexts(TextPlayer[selectingKeyboardPlayerNr - 1])].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + selectingKeyboardPlayerNr.ToString(); Texts[TextPlayer[selectingKeyboardPlayerNr - 1]].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + selectingKeyboardPlayerNr.ToString();
//Update profile-warning //Update profile-warning
CheckPlayers(); CheckPlayers();
//Reset all values //Reset all values
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
//Update Tiles-List //Update Tiles-List
NameSelections[htNameSelections(NameSelection)].UpdateList(); NameSelections[NameSelection].UpdateList();
break; break;
case Keys.F10: case Keys.F10:
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
{ {
if (SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].Selection == 0) if (SelectSlides[SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1]].Selection == 0)
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].Selection = 1; SelectSlides[SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1]].Selection = 1;
else else
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].Selection = 0; SelectSlides[SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1]].Selection = 0;
//Reset all values //Reset all values
selectingKeyboardPlayerNr = 0; selectingKeyboardPlayerNr = 0;
selectingKeyboardActive = false; selectingKeyboardActive = false;
selectingKeyboardUnendless = false; selectingKeyboardUnendless = false;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); NameSelections[NameSelection].KeyboardSelection(false, -1);
SetInteractionToButton(Buttons[htButtons(ButtonStart)]); SetInteractionToButton(Buttons[ButtonStart]);
} }
break; break;
@@ -367,13 +367,13 @@ namespace Vocaluxe.Screens
case Keys.Enter: case Keys.Enter:
if (!processed && Buttons[htButtons(ButtonBack)].Selected) if (!processed && Buttons[ButtonBack].Selected)
{ {
processed = true; processed = true;
CGraphics.FadeTo(EScreens.ScreenSong); CGraphics.FadeTo(EScreens.ScreenSong);
} }
if (!processed /* && Buttons[htButtons(ButtonStart)].Selected */) if (!processed /* && Buttons[ButtonStart].Selected */)
{ {
processed = true; processed = true;
StartSong(); StartSong();
@@ -418,7 +418,7 @@ namespace Vocaluxe.Screens
if (selectingKeyboardPlayerNr > 0 && selectingKeyboardPlayerNr <= CConfig.NumPlayer) if (selectingKeyboardPlayerNr > 0 && selectingKeyboardPlayerNr <= CConfig.NumPlayer)
{ {
selectingKeyboardActive = true; selectingKeyboardActive = true;
NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, selectingKeyboardPlayerNr); NameSelections[NameSelection].KeyboardSelection(true, selectingKeyboardPlayerNr);
} }
} }
@@ -436,17 +436,17 @@ namespace Vocaluxe.Screens
OldMouseX = MouseEvent.X; OldMouseX = MouseEvent.X;
OldMouseY = MouseEvent.Y; OldMouseY = MouseEvent.Y;
//Check if mouse if over tile //Check if mouse if over tile
if (NameSelections[htNameSelections(NameSelection)].isOverTile(MouseEvent)) if (NameSelections[NameSelection].isOverTile(MouseEvent))
{ {
//Get player-number of tile //Get player-number of tile
SelectedPlayerNr = NameSelections[htNameSelections(NameSelection)].TilePlayerNr(MouseEvent); SelectedPlayerNr = NameSelections[NameSelection].TilePlayerNr(MouseEvent);
if (SelectedPlayerNr != -1) if (SelectedPlayerNr != -1)
{ {
//Activate mouse-selecting //Activate mouse-selecting
selectingMouseActive = true; selectingMouseActive = true;
//Update of Drag/Drop-Texture //Update of Drag/Drop-Texture
CStatic SelectedPlayer = NameSelections[htNameSelections(NameSelection)].TilePlayerAvatar(MouseEvent); CStatic SelectedPlayer = NameSelections[NameSelection].TilePlayerAvatar(MouseEvent);
chooseAvatarStatic.Visible = true; chooseAvatarStatic.Visible = true;
chooseAvatarStatic.Rect = SelectedPlayer.Rect; chooseAvatarStatic.Rect = SelectedPlayer.Rect;
chooseAvatarStatic.Rect.Z = CSettings.zNear; chooseAvatarStatic.Rect.Z = CSettings.zNear;
@@ -475,10 +475,10 @@ namespace Vocaluxe.Screens
for (int i = 0; i < StaticPlayer.Length; i++) for (int i = 0; i < StaticPlayer.Length; i++)
{ {
//Check first, if area is "active" //Check first, if area is "active"
if (Statics[htStatics(StaticPlayer[i])].Visible == true) if (Statics[StaticPlayer[i]].Visible == true)
{ {
//Check if Mouse is in area //Check if Mouse is in area
if (CHelper.IsInBounds(Statics[htStatics(StaticPlayer[i])].Rect, MouseEvent)) if (CHelper.IsInBounds(Statics[StaticPlayer[i]].Rect, MouseEvent))
{ {
//Update Game-infos with new player //Update Game-infos with new player
CGame.Player[i].Name = CProfiles.Profiles[SelectedPlayerNr].PlayerName; CGame.Player[i].Name = CProfiles.Profiles[SelectedPlayerNr].PlayerName;
@@ -488,12 +488,12 @@ namespace Vocaluxe.Screens
CConfig.Players[i] = CProfiles.Profiles[SelectedPlayerNr].ProfileFile; CConfig.Players[i] = CProfiles.Profiles[SelectedPlayerNr].ProfileFile;
CConfig.SaveConfig(); CConfig.SaveConfig();
//Update texture and name //Update texture and name
Statics[htStatics(StaticPlayerAvatar[i])].Texture = chooseAvatarStatic.Texture; Statics[StaticPlayerAvatar[i]].Texture = chooseAvatarStatic.Texture;
Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName; Texts[TextPlayer[i]].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName;
//Update profile-warning //Update profile-warning
CheckPlayers(); CheckPlayers();
//Update Tiles-List //Update Tiles-List
NameSelections[htNameSelections(NameSelection)].UpdateList(); NameSelections[NameSelection].UpdateList();
} }
} }
} }
@@ -513,13 +513,13 @@ namespace Vocaluxe.Screens
{ {
bool processed = false; bool processed = false;
if (!processed && Buttons[htButtons(ButtonBack)].Selected) if (!processed && Buttons[ButtonBack].Selected)
{ {
processed = true; processed = true;
CGraphics.FadeTo(EScreens.ScreenSong); CGraphics.FadeTo(EScreens.ScreenSong);
} }
if (!processed && Buttons[htButtons(ButtonStart)].Selected) if (!processed && Buttons[ButtonStart].Selected)
{ {
processed = true; processed = true;
StartSong(); StartSong();
@@ -528,7 +528,7 @@ namespace Vocaluxe.Screens
if (!processed) if (!processed)
UpdatePlayerNumber(); UpdatePlayerNumber();
//Update Tiles-List //Update Tiles-List
NameSelections[htNameSelections(NameSelection)].UpdateList(); NameSelections[NameSelection].UpdateList();
} }
if (MouseEvent.RB) if (MouseEvent.RB)
@@ -538,7 +538,7 @@ namespace Vocaluxe.Screens
//Remove profile-selection //Remove profile-selection
for (int i = 0; i < CConfig.NumPlayer; i++) for (int i = 0; i < CConfig.NumPlayer; i++)
{ {
if (CHelper.IsInBounds(Statics[htStatics(StaticPlayer[i])].Rect, MouseEvent)) if (CHelper.IsInBounds(Statics[StaticPlayer[i]].Rect, MouseEvent))
{ {
CGame.Player[i].ProfileID = -1; CGame.Player[i].ProfileID = -1;
CGame.Player[i].Name = String.Empty; CGame.Player[i].Name = String.Empty;
@@ -547,12 +547,12 @@ namespace Vocaluxe.Screens
CConfig.Players[i] = String.Empty; CConfig.Players[i] = String.Empty;
CConfig.SaveConfig(); CConfig.SaveConfig();
//Update texture and name //Update texture and name
Statics[htStatics(StaticPlayerAvatar[i])].Texture = OriginalPlayerAvatarTextures[i]; Statics[StaticPlayerAvatar[i]].Texture = OriginalPlayerAvatarTextures[i];
Texts[htTexts(TextPlayer[i])].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + (i+1).ToString(); Texts[TextPlayer[i]].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + (i+1).ToString();
//Update profile-warning //Update profile-warning
CheckPlayers(); CheckPlayers();
//Update Tiles-List //Update Tiles-List
NameSelections[htNameSelections(NameSelection)].UpdateList(); NameSelections[NameSelection].UpdateList();
exit = false; exit = false;
} }
} }
@@ -563,10 +563,10 @@ namespace Vocaluxe.Screens
//Check mouse-wheel for scrolling //Check mouse-wheel for scrolling
if (MouseEvent.Wheel != 0) if (MouseEvent.Wheel != 0)
{ {
if (CHelper.IsInBounds(NameSelections[htNameSelections(NameSelection)].Rect, MouseEvent)) if (CHelper.IsInBounds(NameSelections[NameSelection].Rect, MouseEvent))
{ {
int offset = NameSelections[htNameSelections(NameSelection)]._Offset + MouseEvent.Wheel; int offset = NameSelections[NameSelection]._Offset + MouseEvent.Wheel;
NameSelections[htNameSelections(NameSelection)].UpdateList(offset); NameSelections[NameSelection].UpdateList(offset);
} }
} }
return true; return true;
@@ -577,7 +577,7 @@ namespace Vocaluxe.Screens
for (int i = 1; i <= CGame.NumPlayer; i++) for (int i = 1; i <= CGame.NumPlayer; i++)
{ {
CSound.AnalyzeBuffer((i-1)); CSound.AnalyzeBuffer((i-1));
Equalizers[htEqualizer("EqualizerPlayer" + i)].Update(CSound.ToneWeigth((i-1))); Equalizers["EqualizerPlayer" + i].Update(CSound.ToneWeigth((i-1)));
} }
return true; return true;
} }
@@ -587,7 +587,7 @@ namespace Vocaluxe.Screens
base.OnShow(); base.OnShow();
CSound.RecordStart(); CSound.RecordStart();
NameSelections[htNameSelections(NameSelection)].Init(); NameSelections[NameSelection].Init();
UpdateSlides(); UpdateSlides();
UpdatePlayerNumber(); UpdatePlayerNumber();
@@ -599,28 +599,28 @@ namespace Vocaluxe.Screens
//Update texture and name //Update texture and name
if (CConfig.Players[i].Length > 0) if (CConfig.Players[i].Length > 0)
{ {
Statics[htStatics(StaticPlayerAvatar[i])].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture; Statics[StaticPlayerAvatar[i]].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture;
Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName; Texts[TextPlayer[i]].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName;
} }
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
{ {
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Clear(); SelectSlides[SelectSlideDuetPlayer[i]].Clear();
if (i + 1 <= CGame.NumPlayer) if (i + 1 <= CGame.NumPlayer)
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = true; SelectSlides[SelectSlideDuetPlayer[i]].Visible = true;
else else
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = false; SelectSlides[SelectSlideDuetPlayer[i]].Visible = false;
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].AddValue(CGame.GetSong(1).DuetPart1); SelectSlides[SelectSlideDuetPlayer[i]].AddValue(CGame.GetSong(1).DuetPart1);
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].AddValue(CGame.GetSong(1).DuetPart2); SelectSlides[SelectSlideDuetPlayer[i]].AddValue(CGame.GetSong(1).DuetPart2);
if ((i + 1) % 2 == 0) if ((i + 1) % 2 == 0)
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Selection = 1; SelectSlides[SelectSlideDuetPlayer[i]].Selection = 1;
else else
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Selection = 0; SelectSlides[SelectSlideDuetPlayer[i]].Selection = 0;
} }
else else
SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = false; SelectSlides[SelectSlideDuetPlayer[i]].Visible = false;
} }
SetInteractionToButton(Buttons[htButtons(ButtonStart)]); SetInteractionToButton(Buttons[ButtonStart]);
} }
public override void OnClose() public override void OnClose()
@@ -639,7 +639,7 @@ namespace Vocaluxe.Screens
} }
for (int i = 1; i <= CGame.NumPlayer; i++) for (int i = 1; i <= CGame.NumPlayer; i++)
{ {
Equalizers[htEqualizer("EqualizerPlayer" + i)].Draw(); Equalizers["EqualizerPlayer" + i].Draw();
} }
return true; return true;
} }
@@ -664,7 +664,7 @@ namespace Vocaluxe.Screens
} }
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
{ {
CGame.Player[i].LineNr = SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Selection; CGame.Player[i].LineNr = SelectSlides[SelectSlideDuetPlayer[i]].Selection;
} }
} }
@@ -673,40 +673,40 @@ namespace Vocaluxe.Screens
private void UpdateSlides() private void UpdateSlides()
{ {
SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Clear(); SelectSlides[SelectSlidePlayerNumber].Clear();
for (int i = 1; i <= CSettings.MaxNumPlayer; i++) for (int i = 1; i <= CSettings.MaxNumPlayer; i++)
{ {
SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].AddValue(CLanguage.Translate("TR_SCREENNAMES_" + i + "PLAYER")); SelectSlides[SelectSlidePlayerNumber].AddValue(CLanguage.Translate("TR_SCREENNAMES_" + i + "PLAYER"));
} }
SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Selection = CConfig.NumPlayer - 1; SelectSlides[SelectSlidePlayerNumber].Selection = CConfig.NumPlayer - 1;
} }
private void UpdatePlayerNumber() private void UpdatePlayerNumber()
{ {
CConfig.NumPlayer = (int)SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Selection + 1; CConfig.NumPlayer = (int)SelectSlides[SelectSlidePlayerNumber].Selection + 1;
CGame.NumPlayer = (int)SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Selection + 1; CGame.NumPlayer = (int)SelectSlides[SelectSlidePlayerNumber].Selection + 1;
for (int i = 1; i <= CSettings.MaxNumPlayer; i++) for (int i = 1; i <= CSettings.MaxNumPlayer; i++)
{ {
if (i <= CGame.NumPlayer) if (i <= CGame.NumPlayer)
{ {
Statics[htStatics("StaticPlayer" + i)].Visible = true; Statics["StaticPlayer" + i].Visible = true;
Statics[htStatics("StaticPlayerAvatar" + i)].Visible = true; Statics["StaticPlayerAvatar" + i].Visible = true;
Texts[htTexts("TextPlayer" + i)].Visible = true; Texts["TextPlayer" + i].Visible = true;
if (Texts[htTexts("TextPlayer" + i)].Text.Length == 0) if (Texts["TextPlayer" + i].Text.Length == 0)
{ {
Texts[htTexts("TextPlayer" + i)].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i.ToString(); Texts["TextPlayer" + i].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i.ToString();
} }
Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = true; Equalizers["EqualizerPlayer" + i].Visible = true;
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
SelectSlides[htSelectSlides("SelectSlideDuetPlayer" + i)].Visible = true; SelectSlides["SelectSlideDuetPlayer" + i].Visible = true;
} }
else else
{ {
Statics[htStatics("StaticPlayer" + i)].Visible = false; Statics["StaticPlayer" + i].Visible = false;
Statics[htStatics("StaticPlayerAvatar" + i)].Visible = false; Statics["StaticPlayerAvatar" + i].Visible = false;
Texts[htTexts("TextPlayer" + i)].Visible = false; Texts["TextPlayer" + i].Visible = false;
Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = false; Equalizers["EqualizerPlayer" + i].Visible = false;
SelectSlides[htSelectSlides("SelectSlideDuetPlayer" + i)].Visible = false; SelectSlides["SelectSlideDuetPlayer" + i].Visible = false;
} }
} }
CConfig.SaveConfig(); CConfig.SaveConfig();
@@ -726,8 +726,8 @@ namespace Vocaluxe.Screens
} }
if (_PlayerWithoutMicro.Count > 0) if (_PlayerWithoutMicro.Count > 0)
{ {
Statics[htStatics(StaticWarningMics)].Visible = true; Statics[StaticWarningMics].Visible = true;
Texts[htTexts(TextWarningMics)].Visible = true; Texts[TextWarningMics].Visible = true;
if (_PlayerWithoutMicro.Count > 1) if (_PlayerWithoutMicro.Count > 1)
{ {
@@ -748,17 +748,17 @@ namespace Vocaluxe.Screens
} }
} }
Texts[htTexts(TextWarningMics)].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_MICS_PL").Replace("%v", PlayerNums); Texts[TextWarningMics].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_MICS_PL").Replace("%v", PlayerNums);
} }
else else
{ {
Texts[htTexts(TextWarningMics)].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_MICS_SG").Replace("%v", _PlayerWithoutMicro[0].ToString()); Texts[TextWarningMics].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_MICS_SG").Replace("%v", _PlayerWithoutMicro[0].ToString());
} }
} }
else else
{ {
Statics[htStatics(StaticWarningMics)].Visible = false; Statics[StaticWarningMics].Visible = false;
Texts[htTexts(TextWarningMics)].Visible = false; Texts[TextWarningMics].Visible = false;
} }
} }
@@ -775,8 +775,8 @@ namespace Vocaluxe.Screens
if (_PlayerWithoutProfile.Count > 0) if (_PlayerWithoutProfile.Count > 0)
{ {
Statics[htStatics(StaticWarningProfiles)].Visible = true; Statics[StaticWarningProfiles].Visible = true;
Texts[htTexts(TextWarningProfiles)].Visible = true; Texts[TextWarningProfiles].Visible = true;
if (_PlayerWithoutProfile.Count > 1) if (_PlayerWithoutProfile.Count > 1)
{ {
@@ -797,17 +797,17 @@ namespace Vocaluxe.Screens
} }
} }
Texts[htTexts(TextWarningProfiles)].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_PROFILES_PL").Replace("%v", PlayerNums); Texts[TextWarningProfiles].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_PROFILES_PL").Replace("%v", PlayerNums);
} }
else else
{ {
Texts[htTexts(TextWarningProfiles)].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_PROFILES_SG").Replace("%v", _PlayerWithoutProfile[0].ToString()); Texts[TextWarningProfiles].Text = CLanguage.Translate("TR_SCREENNAMES_WARNING_PROFILES_SG").Replace("%v", _PlayerWithoutProfile[0].ToString());
} }
} }
else else
{ {
Statics[htStatics(StaticWarningProfiles)].Visible = false; Statics[StaticWarningProfiles].Visible = false;
Texts[htTexts(TextWarningProfiles)].Visible = false; Texts[TextWarningProfiles].Visible = false;
} }
} }
} }
+12 -12
View File
@@ -57,22 +57,22 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonOptionsGame)].Selected) if (Buttons[ButtonOptionsGame].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsGame); CGraphics.FadeTo(EScreens.ScreenOptionsGame);
if (Buttons[htButtons(ButtonOptionsSound)].Selected) if (Buttons[ButtonOptionsSound].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsSound); CGraphics.FadeTo(EScreens.ScreenOptionsSound);
if (Buttons[htButtons(ButtonOptionsRecord)].Selected) if (Buttons[ButtonOptionsRecord].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsRecord); CGraphics.FadeTo(EScreens.ScreenOptionsRecord);
if (Buttons[htButtons(ButtonOptionsVideo)].Selected) if (Buttons[ButtonOptionsVideo].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsVideo); CGraphics.FadeTo(EScreens.ScreenOptionsVideo);
if (Buttons[htButtons(ButtonOptionsLyrics)].Selected) if (Buttons[ButtonOptionsLyrics].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsLyrics); CGraphics.FadeTo(EScreens.ScreenOptionsLyrics);
if (Buttons[htButtons(ButtonOptionsTheme)].Selected) if (Buttons[ButtonOptionsTheme].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsTheme); CGraphics.FadeTo(EScreens.ScreenOptionsTheme);
break; break;
@@ -87,22 +87,22 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonOptionsGame)].Selected) if (Buttons[ButtonOptionsGame].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsGame); CGraphics.FadeTo(EScreens.ScreenOptionsGame);
if (Buttons[htButtons(ButtonOptionsSound)].Selected) if (Buttons[ButtonOptionsSound].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsSound); CGraphics.FadeTo(EScreens.ScreenOptionsSound);
if (Buttons[htButtons(ButtonOptionsRecord)].Selected) if (Buttons[ButtonOptionsRecord].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsRecord); CGraphics.FadeTo(EScreens.ScreenOptionsRecord);
if (Buttons[htButtons(ButtonOptionsVideo)].Selected) if (Buttons[ButtonOptionsVideo].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsVideo); CGraphics.FadeTo(EScreens.ScreenOptionsVideo);
if (Buttons[htButtons(ButtonOptionsLyrics)].Selected) if (Buttons[ButtonOptionsLyrics].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsLyrics); CGraphics.FadeTo(EScreens.ScreenOptionsLyrics);
if (Buttons[htButtons(ButtonOptionsTheme)].Selected) if (Buttons[ButtonOptionsTheme].Selected)
CGraphics.FadeTo(EScreens.ScreenOptionsTheme); CGraphics.FadeTo(EScreens.ScreenOptionsTheme);
} }
+15 -15
View File
@@ -55,14 +55,14 @@ namespace Vocaluxe.Screens
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideLanguage)].AddValues(_Languages); SelectSlides[SelectSlideLanguage].AddValues(_Languages);
SelectSlides[htSelectSlides(SelectSlideLanguage)].Selection = _CurrentLang; SelectSlides[SelectSlideLanguage].Selection = _CurrentLang;
SelectSlides[htSelectSlides(SelectSlideDebugLevel)].SetValues<EDebugLevel>((int)CConfig.DebugLevel); SelectSlides[SelectSlideDebugLevel].SetValues<EDebugLevel>((int)CConfig.DebugLevel);
SelectSlides[htSelectSlides(SelectSlideSongMenu)].SetValues<ESongMenu>((int)CConfig.SongMenu); SelectSlides[SelectSlideSongMenu].SetValues<ESongMenu>((int)CConfig.SongMenu);
SelectSlides[htSelectSlides(SelectSlideSongSorting)].SetValues<ESongSorting>((int)CConfig.SongSorting); SelectSlides[SelectSlideSongSorting].SetValues<ESongSorting>((int)CConfig.SongSorting);
SelectSlides[htSelectSlides(SelectSlideTabs)].SetValues<EOffOn>((int)CConfig.Tabs); SelectSlides[SelectSlideTabs].SetValues<EOffOn>((int)CConfig.Tabs);
SelectSlides[htSelectSlides(SelectSlideTimerMode)].SetValues<ETimerMode>((int)CConfig.TimerMode); SelectSlides[SelectSlideTimerMode].SetValues<ETimerMode>((int)CConfig.TimerMode);
} }
@@ -90,7 +90,7 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
SaveConfig(); SaveConfig();
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
@@ -122,7 +122,7 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
SaveConfig(); SaveConfig();
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
} }
@@ -143,12 +143,12 @@ namespace Vocaluxe.Screens
private void SaveConfig() private void SaveConfig()
{ {
CConfig.Language = _Languages[SelectSlides[htSelectSlides(SelectSlideLanguage)].Selection]; CConfig.Language = _Languages[SelectSlides[SelectSlideLanguage].Selection];
CConfig.DebugLevel = (EDebugLevel)SelectSlides[htSelectSlides(SelectSlideDebugLevel)].Selection; CConfig.DebugLevel = (EDebugLevel)SelectSlides[SelectSlideDebugLevel].Selection;
CConfig.SongMenu = (ESongMenu)SelectSlides[htSelectSlides(SelectSlideSongMenu)].Selection; CConfig.SongMenu = (ESongMenu)SelectSlides[SelectSlideSongMenu].Selection;
CConfig.SongSorting = (ESongSorting)SelectSlides[htSelectSlides(SelectSlideSongSorting)].Selection; CConfig.SongSorting = (ESongSorting)SelectSlides[SelectSlideSongSorting].Selection;
CConfig.Tabs = (EOffOn)SelectSlides[htSelectSlides(SelectSlideTabs)].Selection; CConfig.Tabs = (EOffOn)SelectSlides[SelectSlideTabs].Selection;
CConfig.TimerMode = (ETimerMode)SelectSlides[htSelectSlides(SelectSlideTimerMode)].Selection; CConfig.TimerMode = (ETimerMode)SelectSlides[SelectSlideTimerMode].Selection;
CConfig.SaveConfig(); CConfig.SaveConfig();
+6 -6
View File
@@ -36,8 +36,8 @@ namespace Vocaluxe.Screens
public override void LoadTheme(string XmlPath) public override void LoadTheme(string XmlPath)
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideLyricStyle)].SetValues<ELyricStyle>((int)CConfig.LyricStyle); SelectSlides[SelectSlideLyricStyle].SetValues<ELyricStyle>((int)CConfig.LyricStyle);
SelectSlides[htSelectSlides(SelectSlideLyricsOnTop)].SetValues<EOffOn>((int)CConfig.LyricsOnTop); SelectSlides[SelectSlideLyricsOnTop].SetValues<EOffOn>((int)CConfig.LyricsOnTop);
} }
public override bool HandleInput(KeyEvent KeyEvent) public override bool HandleInput(KeyEvent KeyEvent)
@@ -64,7 +64,7 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
SaveConfig(); SaveConfig();
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
@@ -95,7 +95,7 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
SaveConfig(); SaveConfig();
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
} }
@@ -116,8 +116,8 @@ namespace Vocaluxe.Screens
private void SaveConfig() private void SaveConfig()
{ {
CConfig.LyricsOnTop = (EOffOn)SelectSlides[htSelectSlides(SelectSlideLyricsOnTop)].Selection; CConfig.LyricsOnTop = (EOffOn)SelectSlides[SelectSlideLyricsOnTop].Selection;
CConfig.LyricStyle = (ELyricStyle)SelectSlides[htSelectSlides(SelectSlideLyricStyle)].Selection; CConfig.LyricStyle = (ELyricStyle)SelectSlides[SelectSlideLyricStyle].Selection;
CConfig.SaveConfig(); CConfig.SaveConfig();
} }
} }
+76 -76
View File
@@ -84,33 +84,33 @@ namespace Vocaluxe.Screens
if (max > 7) if (max > 7)
max = 7; max = 7;
SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].NumVisible = max; SelectSlides[SelectSlideRecordChannel1].NumVisible = max;
SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].NumVisible = max; SelectSlides[SelectSlideRecordChannel2].NumVisible = max;
SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].AddValue(CLanguage.Translate("TR_CONFIG_OFF")); SelectSlides[SelectSlideRecordChannel1].AddValue(CLanguage.Translate("TR_CONFIG_OFF"));
SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].AddValue(CLanguage.Translate("TR_CONFIG_OFF")); SelectSlides[SelectSlideRecordChannel2].AddValue(CLanguage.Translate("TR_CONFIG_OFF"));
for (int i = 1; i <= CSettings.MaxNumPlayer; i++) for (int i = 1; i <= CSettings.MaxNumPlayer; i++)
{ {
SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].AddValue(i.ToString()); SelectSlides[SelectSlideRecordChannel1].AddValue(i.ToString());
SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].AddValue(i.ToString()); SelectSlides[SelectSlideRecordChannel2].AddValue(i.ToString());
} }
for (int i = 0; i < 26; i++) for (int i = 0; i < 26; i++)
{ {
SelectSlides[htSelectSlides(SelectSlideDelay)].AddValue((i * 20).ToString() + " ms"); SelectSlides[SelectSlideDelay].AddValue((i * 20).ToString() + " ms");
} }
ChannelEnergy = new float[StaticEnergyChannel.Length]; ChannelEnergy = new float[StaticEnergyChannel.Length];
for (int i = 0; i < ChannelEnergy.Length; i++) for (int i = 0; i < ChannelEnergy.Length; i++)
{ {
Statics[htStatics(StaticEnergyChannel[i])].Visible = false; Statics[StaticEnergyChannel[i]].Visible = false;
ChannelEnergy[i] = 0f; ChannelEnergy[i] = 0f;
} }
Equalizers[htEqualizer(EqualizerChannel1)].ScreenHandles = true; Equalizers[EqualizerChannel1].ScreenHandles = true;
Equalizers[htEqualizer(EqualizerChannel2)].ScreenHandles = true; Equalizers[EqualizerChannel2].ScreenHandles = true;
} }
public override bool HandleInput(KeyEvent KeyEvent) public override bool HandleInput(KeyEvent KeyEvent)
@@ -137,13 +137,13 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
SaveMicConfig(); SaveMicConfig();
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
} }
if (Buttons[htButtons(ButtonDelayTest)].Selected) if (Buttons[ButtonDelayTest].Selected)
{ {
TestDelay(); TestDelay();
} }
@@ -155,32 +155,32 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Left: case Keys.Left:
if (SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selected) if (SelectSlides[SelectSlideRecordDevices].Selected)
OnDeviceEvent(); OnDeviceEvent();
if (SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selected) if (SelectSlides[SelectSlideRecordInputs].Selected)
OnInputEvent(); OnInputEvent();
if (SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selected || if (SelectSlides[SelectSlideRecordChannel1].Selected ||
SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selected) SelectSlides[SelectSlideRecordChannel2].Selected)
SetMicConfig(); SetMicConfig();
if (SelectSlides[htSelectSlides(SelectSlideDelay)].Selected) if (SelectSlides[SelectSlideDelay].Selected)
SaveDelayConfig(); SaveDelayConfig();
break; break;
case Keys.Right: case Keys.Right:
if (SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selected) if (SelectSlides[SelectSlideRecordDevices].Selected)
OnDeviceEvent(); OnDeviceEvent();
if (SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selected) if (SelectSlides[SelectSlideRecordInputs].Selected)
OnInputEvent(); OnInputEvent();
if (SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selected || if (SelectSlides[SelectSlideRecordChannel1].Selected ||
SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selected) SelectSlides[SelectSlideRecordChannel2].Selected)
SetMicConfig(); SetMicConfig();
if (SelectSlides[htSelectSlides(SelectSlideDelay)].Selected) if (SelectSlides[SelectSlideDelay].Selected)
SaveDelayConfig(); SaveDelayConfig();
break; break;
} }
@@ -200,26 +200,26 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selected) if (SelectSlides[SelectSlideRecordDevices].Selected)
OnDeviceEvent(); OnDeviceEvent();
if (SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selected) if (SelectSlides[SelectSlideRecordInputs].Selected)
OnInputEvent(); OnInputEvent();
if (SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selected || if (SelectSlides[SelectSlideRecordChannel1].Selected ||
SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selected) SelectSlides[SelectSlideRecordChannel2].Selected)
SetMicConfig(); SetMicConfig();
if (SelectSlides[htSelectSlides(SelectSlideDelay)].Selected) if (SelectSlides[SelectSlideDelay].Selected)
SaveDelayConfig(); SaveDelayConfig();
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
SaveMicConfig(); SaveMicConfig();
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
} }
if (Buttons[htButtons(ButtonDelayTest)].Selected) if (Buttons[ButtonDelayTest].Selected)
{ {
TestDelay(); TestDelay();
} }
@@ -250,10 +250,10 @@ namespace Vocaluxe.Screens
{ {
int player = 0; int player = 0;
if (i == 0) if (i == 0)
player = SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selection; player = SelectSlides[SelectSlideRecordChannel1].Selection;
if (i == 1) if (i == 1)
player = SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selection; player = SelectSlides[SelectSlideRecordChannel2].Selection;
if (_DelayTest[i].Timer.ElapsedMilliseconds > MaxDelayTime * 1000f || player == 0) if (_DelayTest[i].Timer.ElapsedMilliseconds > MaxDelayTime * 1000f || player == 0)
{ {
@@ -270,32 +270,32 @@ namespace Vocaluxe.Screens
} }
} }
} }
Texts[htTexts(TextDelayChannel1)].Text = _DelayTest[0].Delay.ToString("000") + " ms"; Texts[TextDelayChannel1].Text = _DelayTest[0].Delay.ToString("000") + " ms";
Texts[htTexts(TextDelayChannel2)].Text = _DelayTest[1].Delay.ToString("000") + " ms"; Texts[TextDelayChannel2].Text = _DelayTest[1].Delay.ToString("000") + " ms";
} }
if (CheckMicConfig()) if (CheckMicConfig())
{ {
ChannelEnergy[0] = 0f; ChannelEnergy[0] = 0f;
int player = SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selection; int player = SelectSlides[SelectSlideRecordChannel1].Selection;
if (player > 0) if (player > 0)
{ {
ChannelEnergy[0] = CSound.RecordGetMaxVolume(player - 1); ChannelEnergy[0] = CSound.RecordGetMaxVolume(player - 1);
Equalizers[htEqualizer(EqualizerChannel1)].Update(CSound.ToneWeigth(player - 1)); Equalizers[EqualizerChannel1].Update(CSound.ToneWeigth(player - 1));
} }
else else
Equalizers[htEqualizer(EqualizerChannel1)].Reset(); Equalizers[EqualizerChannel1].Reset();
ChannelEnergy[1] = 0f; ChannelEnergy[1] = 0f;
player = SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selection; player = SelectSlides[SelectSlideRecordChannel2].Selection;
if (player > 0) if (player > 0)
{ {
ChannelEnergy[1] = CSound.RecordGetMaxVolume(player - 1); ChannelEnergy[1] = CSound.RecordGetMaxVolume(player - 1);
Equalizers[htEqualizer(EqualizerChannel2)].Update(CSound.ToneWeigth(player - 1)); Equalizers[EqualizerChannel2].Update(CSound.ToneWeigth(player - 1));
} }
else else
Equalizers[htEqualizer(EqualizerChannel2)].Reset(); Equalizers[EqualizerChannel2].Reset();
} }
else else
{ {
@@ -303,8 +303,8 @@ namespace Vocaluxe.Screens
{ {
ChannelEnergy[i] = 0f; ChannelEnergy[i] = 0f;
} }
Equalizers[htEqualizer(EqualizerChannel1)].Reset(); Equalizers[EqualizerChannel1].Reset();
Equalizers[htEqualizer(EqualizerChannel2)].Reset(); Equalizers[EqualizerChannel2].Reset();
} }
return true; return true;
@@ -314,8 +314,8 @@ namespace Vocaluxe.Screens
{ {
base.OnShow(); base.OnShow();
SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Clear(); SelectSlides[SelectSlideRecordDevices].Clear();
SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Clear(); SelectSlides[SelectSlideRecordInputs].Clear();
for (int i = 0; i < ChannelEnergy.Length; i++) for (int i = 0; i < ChannelEnergy.Length; i++)
{ {
@@ -334,23 +334,23 @@ namespace Vocaluxe.Screens
for (int dev = 0; dev < _devices.Length; dev++) for (int dev = 0; dev < _devices.Length; dev++)
{ {
SelectSlides[htSelectSlides(SelectSlideRecordDevices)].AddValue(_devices[dev].Name); SelectSlides[SelectSlideRecordDevices].AddValue(_devices[dev].Name);
} }
SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selection = _DeviceNr; SelectSlides[SelectSlideRecordDevices].Selection = _DeviceNr;
for (int inp = 0; inp < _devices[0].Inputs.Count; inp++) for (int inp = 0; inp < _devices[0].Inputs.Count; inp++)
{ {
SelectSlides[htSelectSlides(SelectSlideRecordInputs)].AddValue(_devices[0].Inputs[inp].Name); SelectSlides[SelectSlideRecordInputs].AddValue(_devices[0].Inputs[inp].Name);
} }
SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selection = _InputNr; SelectSlides[SelectSlideRecordInputs].Selection = _InputNr;
UpdateChannels(); UpdateChannels();
} }
SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Visible = (_devices != null); SelectSlides[SelectSlideRecordChannel1].Visible = (_devices != null);
SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Visible = (_devices != null); SelectSlides[SelectSlideRecordChannel2].Visible = (_devices != null);
Statics[htStatics(StaticWarning)].Visible = false; Statics[StaticWarning].Visible = false;
Texts[htTexts(TextWarning)].Visible = false; Texts[TextWarning].Visible = false;
_DelayTest = null; _DelayTest = null;
if (_devices != null) if (_devices != null)
@@ -363,7 +363,7 @@ namespace Vocaluxe.Screens
} }
} }
SelectSlides[htSelectSlides(SelectSlideDelay)].Selection = (int)(CConfig.MicDelay / 20); SelectSlides[SelectSlideDelay].Selection = (int)(CConfig.MicDelay / 20);
_DelayTestRunning = false; _DelayTestRunning = false;
_DelaySound = -1; _DelaySound = -1;
@@ -381,32 +381,32 @@ namespace Vocaluxe.Screens
if (!CheckMicConfig()) if (!CheckMicConfig())
{ {
Statics[htStatics(StaticWarning)].Visible = true; Statics[StaticWarning].Visible = true;
Texts[htTexts(TextWarning)].Visible = true; Texts[TextWarning].Visible = true;
} }
else else
{ {
Statics[htStatics(StaticWarning)].Visible = false; Statics[StaticWarning].Visible = false;
Texts[htTexts(TextWarning)].Visible = false; Texts[TextWarning].Visible = false;
} }
for (int i = 0; i < StaticEnergyChannel.Length; i++) for (int i = 0; i < StaticEnergyChannel.Length; i++)
{ {
if (ChannelEnergy[i] > 0f) if (ChannelEnergy[i] > 0f)
{ {
SRectF rect = new SRectF(Statics[htStatics(StaticEnergyChannel[i])].Rect.X, SRectF rect = new SRectF(Statics[StaticEnergyChannel[i]].Rect.X,
Statics[htStatics(StaticEnergyChannel[i])].Rect.Y, Statics[StaticEnergyChannel[i]].Rect.Y,
Statics[htStatics(StaticEnergyChannel[i])].Rect.W * ChannelEnergy[i], Statics[StaticEnergyChannel[i]].Rect.W * ChannelEnergy[i],
Statics[htStatics(StaticEnergyChannel[i])].Rect.H, Statics[StaticEnergyChannel[i]].Rect.H,
Statics[htStatics(StaticEnergyChannel[i])].Rect.Z); Statics[StaticEnergyChannel[i]].Rect.Z);
CDraw.DrawTexture(Statics[htStatics(StaticEnergyChannel[i])].Texture, Statics[htStatics(StaticEnergyChannel[i])].Rect, CDraw.DrawTexture(Statics[StaticEnergyChannel[i]].Texture, Statics[StaticEnergyChannel[i]].Rect,
new SColorF(1f, 1f, 1f, 1f), rect); new SColorF(1f, 1f, 1f, 1f), rect);
} }
} }
Equalizers[htEqualizer(EqualizerChannel1)].Draw(); Equalizers[EqualizerChannel1].Draw();
Equalizers[htEqualizer(EqualizerChannel2)].Draw(); Equalizers[EqualizerChannel2].Draw();
DrawFG(); DrawFG();
@@ -424,27 +424,27 @@ namespace Vocaluxe.Screens
private void OnDeviceEvent() private void OnDeviceEvent()
{ {
if (SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selection != _DeviceNr) if (SelectSlides[SelectSlideRecordDevices].Selection != _DeviceNr)
{ {
SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Clear(); SelectSlides[SelectSlideRecordInputs].Clear();
_DeviceNr = SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selection; _DeviceNr = SelectSlides[SelectSlideRecordDevices].Selection;
_InputNr = 0; _InputNr = 0;
for (int inp = 0; inp < _devices[_DeviceNr].Inputs.Count; inp++) for (int inp = 0; inp < _devices[_DeviceNr].Inputs.Count; inp++)
{ {
SelectSlides[htSelectSlides(SelectSlideRecordInputs)].AddValue(_devices[_DeviceNr].Inputs[inp].Name); SelectSlides[SelectSlideRecordInputs].AddValue(_devices[_DeviceNr].Inputs[inp].Name);
} }
_InputNr = 0; _InputNr = 0;
SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selection = 0; SelectSlides[SelectSlideRecordInputs].Selection = 0;
UpdateChannels(); UpdateChannels();
} }
} }
private void OnInputEvent() private void OnInputEvent()
{ {
if (SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selection != _InputNr) if (SelectSlides[SelectSlideRecordInputs].Selection != _InputNr)
{ {
_InputNr = SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selection; _InputNr = SelectSlides[SelectSlideRecordInputs].Selection;
UpdateChannels(); UpdateChannels();
} }
@@ -452,7 +452,7 @@ namespace Vocaluxe.Screens
private void SaveDelayConfig() private void SaveDelayConfig()
{ {
CConfig.MicDelay = SelectSlides[htSelectSlides(SelectSlideDelay)].Selection * 20; CConfig.MicDelay = SelectSlides[SelectSlideDelay].Selection * 20;
CConfig.SaveConfig(); CConfig.SaveConfig();
} }
@@ -503,15 +503,15 @@ namespace Vocaluxe.Screens
if (_DeviceNr < 0) if (_DeviceNr < 0)
return; return;
SInput input = _devices[_DeviceNr].Inputs[_InputNr]; SInput input = _devices[_DeviceNr].Inputs[_InputNr];
input.PlayerChannel1 = SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selection; input.PlayerChannel1 = SelectSlides[SelectSlideRecordChannel1].Selection;
input.PlayerChannel2 = SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selection; input.PlayerChannel2 = SelectSlides[SelectSlideRecordChannel2].Selection;
_devices[_DeviceNr].Inputs[_InputNr] = input; _devices[_DeviceNr].Inputs[_InputNr] = input;
} }
private void UpdateChannels() private void UpdateChannels()
{ {
SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selection = _devices[_DeviceNr].Inputs[_InputNr].PlayerChannel1; SelectSlides[SelectSlideRecordChannel1].Selection = _devices[_DeviceNr].Inputs[_InputNr].PlayerChannel1;
SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selection = _devices[_DeviceNr].Inputs[_InputNr].PlayerChannel2; SelectSlides[SelectSlideRecordChannel2].Selection = _devices[_DeviceNr].Inputs[_InputNr].PlayerChannel2;
SaveMicConfig(); SaveMicConfig();
} }
+19 -19
View File
@@ -43,15 +43,15 @@ namespace Vocaluxe.Screens
public override void LoadTheme(string XmlPath) public override void LoadTheme(string XmlPath)
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideBackgroundMusic)].SetValues<EOffOn>((int)CConfig.BackgroundMusic); SelectSlides[SelectSlideBackgroundMusic].SetValues<EOffOn>((int)CConfig.BackgroundMusic);
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100"}); SelectSlides[SelectSlideBackgroundMusicVolume].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100"});
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection = CConfig.BackgroundMusicVolume / 5; SelectSlides[SelectSlideBackgroundMusicVolume].Selection = CConfig.BackgroundMusicVolume / 5;
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].SetValues<EBackgroundMusicSource>((int)CConfig.BackgroundMusicSource); SelectSlides[SelectSlideBackgroundMusicSource].SetValues<EBackgroundMusicSource>((int)CConfig.BackgroundMusicSource);
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].Selection = (int)CConfig.BackgroundMusicSource; SelectSlides[SelectSlideBackgroundMusicSource].Selection = (int)CConfig.BackgroundMusicSource;
SelectSlides[htSelectSlides(SelectSlidePreviewMusicVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" }); SelectSlides[SelectSlidePreviewMusicVolume].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" });
SelectSlides[htSelectSlides(SelectSlidePreviewMusicVolume)].Selection = CConfig.PreviewMusicVolume / 5; SelectSlides[SelectSlidePreviewMusicVolume].Selection = CConfig.PreviewMusicVolume / 5;
SelectSlides[htSelectSlides(SelectSlideGameMusicVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" }); SelectSlides[SelectSlideGameMusicVolume].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" });
SelectSlides[htSelectSlides(SelectSlideGameMusicVolume)].Selection = CConfig.GameMusicVolume / 5; SelectSlides[SelectSlideGameMusicVolume].Selection = CConfig.GameMusicVolume / 5;
} }
@@ -79,7 +79,7 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
SaveConfig(); SaveConfig();
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
@@ -110,7 +110,7 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
SaveConfig(); SaveConfig();
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
} }
@@ -122,7 +122,7 @@ namespace Vocaluxe.Screens
{ {
if (_BackgroundMusicVolume != CConfig.BackgroundMusicVolume) if (_BackgroundMusicVolume != CConfig.BackgroundMusicVolume)
{ {
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection = CConfig.BackgroundMusicVolume / 5; SelectSlides[SelectSlideBackgroundMusicVolume].Selection = CConfig.BackgroundMusicVolume / 5;
} }
return true; return true;
} }
@@ -139,18 +139,18 @@ namespace Vocaluxe.Screens
_BackgroundMusic = CConfig.BackgroundMusic; _BackgroundMusic = CConfig.BackgroundMusic;
_BackgroundMusicVolume = CConfig.BackgroundMusicVolume; _BackgroundMusicVolume = CConfig.BackgroundMusicVolume;
SelectSlides[htSelectSlides(SelectSlideGameMusicVolume)].Selection = CConfig.GameMusicVolume / 5; SelectSlides[SelectSlideGameMusicVolume].Selection = CConfig.GameMusicVolume / 5;
SelectSlides[htSelectSlides(SelectSlidePreviewMusicVolume)].Selection = CConfig.PreviewMusicVolume / 5; SelectSlides[SelectSlidePreviewMusicVolume].Selection = CConfig.PreviewMusicVolume / 5;
} }
private void SaveConfig() private void SaveConfig()
{ {
CConfig.GameMusicVolume = SelectSlides[htSelectSlides(SelectSlideGameMusicVolume)].Selection * 5; CConfig.GameMusicVolume = SelectSlides[SelectSlideGameMusicVolume].Selection * 5;
CConfig.PreviewMusicVolume = SelectSlides[htSelectSlides(SelectSlidePreviewMusicVolume)].Selection * 5; CConfig.PreviewMusicVolume = SelectSlides[SelectSlidePreviewMusicVolume].Selection * 5;
CConfig.SaveConfig(); CConfig.SaveConfig();
EOffOn NewOffOn = (EOffOn)SelectSlides[htSelectSlides(SelectSlideBackgroundMusic)].Selection; EOffOn NewOffOn = (EOffOn)SelectSlides[SelectSlideBackgroundMusic].Selection;
EBackgroundMusicSource NewSource = (EBackgroundMusicSource)SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].Selection; EBackgroundMusicSource NewSource = (EBackgroundMusicSource)SelectSlides[SelectSlideBackgroundMusicSource].Selection;
float NewVolume = SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection * 5; float NewVolume = SelectSlides[SelectSlideBackgroundMusicVolume].Selection * 5;
CBackgroundMusic.CheckAndApplyConfig(NewOffOn, NewSource, NewVolume); CBackgroundMusic.CheckAndApplyConfig(NewOffOn, NewSource, NewVolume);
} }
+30 -30
View File
@@ -58,19 +58,19 @@ namespace Vocaluxe.Screens
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideTheme)].AddValues(CTheme.ThemeNames); SelectSlides[SelectSlideTheme].AddValues(CTheme.ThemeNames);
SelectSlides[htSelectSlides(SelectSlideTheme)].Selection = CTheme.GetThemeIndex(-1); SelectSlides[SelectSlideTheme].Selection = CTheme.GetThemeIndex(-1);
SelectSlides[htSelectSlides(SelectSlideSkin)].AddValues(CTheme.SkinNames); SelectSlides[SelectSlideSkin].AddValues(CTheme.SkinNames);
SelectSlides[htSelectSlides(SelectSlideSkin)].Selection = CTheme.GetSkinIndex(-1); SelectSlides[SelectSlideSkin].Selection = CTheme.GetSkinIndex(-1);
SelectSlides[htSelectSlides(SelectSlideCover)].AddValues(CCover.CoverThemes); SelectSlides[SelectSlideCover].AddValues(CCover.CoverThemes);
SelectSlides[htSelectSlides(SelectSlideCover)].Selection = CCover.GetCoverThemeIndex(); SelectSlides[SelectSlideCover].Selection = CCover.GetCoverThemeIndex();
SelectSlides[htSelectSlides(SelectSlideNoteLines)].SetValues<EOffOn>((int)CConfig.DrawNoteLines); SelectSlides[SelectSlideNoteLines].SetValues<EOffOn>((int)CConfig.DrawNoteLines);
SelectSlides[htSelectSlides(SelectSlideToneHelper)].SetValues<EOffOn>((int)CConfig.DrawToneHelper); SelectSlides[SelectSlideToneHelper].SetValues<EOffOn>((int)CConfig.DrawToneHelper);
SelectSlides[htSelectSlides(SelectSlideTimerLook)].SetValues<ETimerLook>((int)CConfig.TimerLook); SelectSlides[SelectSlideTimerLook].SetValues<ETimerLook>((int)CConfig.TimerLook);
SelectSlides[htSelectSlides(SelectSlideFadeInfo)].SetValues<EFadePlayerInfo>((int)CConfig.FadePlayerInfo); SelectSlides[SelectSlideFadeInfo].SetValues<EFadePlayerInfo>((int)CConfig.FadePlayerInfo);
SelectSlides[htSelectSlides(SelectSlideCoverLoading)].SetValues<ECoverLoading>((int)CConfig.CoverLoading); SelectSlides[SelectSlideCoverLoading].SetValues<ECoverLoading>((int)CConfig.CoverLoading);
} }
public override bool HandleInput(KeyEvent KeyEvent) public override bool HandleInput(KeyEvent KeyEvent)
@@ -96,7 +96,7 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
Close(); Close();
} }
@@ -125,7 +125,7 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
Close(); Close();
} }
@@ -164,18 +164,18 @@ namespace Vocaluxe.Screens
private void SaveConfig() private void SaveConfig()
{ {
CConfig.Theme = CTheme.ThemeNames[SelectSlides[htSelectSlides(SelectSlideTheme)].Selection]; CConfig.Theme = CTheme.ThemeNames[SelectSlides[SelectSlideTheme].Selection];
CConfig.Skin = CTheme.SkinNames[SelectSlides[htSelectSlides(SelectSlideSkin)].Selection]; CConfig.Skin = CTheme.SkinNames[SelectSlides[SelectSlideSkin].Selection];
CConfig.CoverTheme = CCover.CoverThemes[SelectSlides[htSelectSlides(SelectSlideCover)].Selection]; CConfig.CoverTheme = CCover.CoverThemes[SelectSlides[SelectSlideCover].Selection];
CConfig.DrawNoteLines = (EOffOn)SelectSlides[htSelectSlides(SelectSlideNoteLines)].Selection; CConfig.DrawNoteLines = (EOffOn)SelectSlides[SelectSlideNoteLines].Selection;
CConfig.DrawToneHelper = (EOffOn)SelectSlides[htSelectSlides(SelectSlideToneHelper)].Selection; CConfig.DrawToneHelper = (EOffOn)SelectSlides[SelectSlideToneHelper].Selection;
CConfig.TimerLook = (ETimerLook)SelectSlides[htSelectSlides(SelectSlideTimerLook)].Selection; CConfig.TimerLook = (ETimerLook)SelectSlides[SelectSlideTimerLook].Selection;
CConfig.FadePlayerInfo = (EFadePlayerInfo)SelectSlides[htSelectSlides(SelectSlideFadeInfo)].Selection; CConfig.FadePlayerInfo = (EFadePlayerInfo)SelectSlides[SelectSlideFadeInfo].Selection;
CConfig.CoverLoading = (ECoverLoading)SelectSlides[htSelectSlides(SelectSlideCoverLoading)].Selection; CConfig.CoverLoading = (ECoverLoading)SelectSlides[SelectSlideCoverLoading].Selection;
CConfig.SaveConfig(); CConfig.SaveConfig();
if (_OldCoverTheme != SelectSlides[htSelectSlides(SelectSlideCover)].Selection) if (_OldCoverTheme != SelectSlides[SelectSlideCover].Selection)
{ {
CCover.ReloadCover(); CCover.ReloadCover();
CSongs.Filter.SearchString = String.Empty; CSongs.Filter.SearchString = String.Empty;
@@ -183,10 +183,10 @@ namespace Vocaluxe.Screens
CSongs.Categorizer.Tabs = CConfig.Tabs; CSongs.Categorizer.Tabs = CConfig.Tabs;
} }
if (_OldTheme != SelectSlides[htSelectSlides(SelectSlideTheme)].Selection) if (_OldTheme != SelectSlides[SelectSlideTheme].Selection)
{ {
CConfig.Theme = CTheme.ThemeNames[SelectSlides[htSelectSlides(SelectSlideTheme)].Selection]; CConfig.Theme = CTheme.ThemeNames[SelectSlides[SelectSlideTheme].Selection];
_OldTheme = SelectSlides[htSelectSlides(SelectSlideTheme)].Selection; _OldTheme = SelectSlides[SelectSlideTheme].Selection;
CTheme.UnloadSkins(); CTheme.UnloadSkins();
CFonts.UnloadThemeFonts(CConfig.Theme); CFonts.UnloadThemeFonts(CConfig.Theme);
@@ -206,10 +206,10 @@ namespace Vocaluxe.Screens
private void OnChange() private void OnChange()
{ {
if (_OldTheme != SelectSlides[htSelectSlides(SelectSlideTheme)].Selection) if (_OldTheme != SelectSlides[SelectSlideTheme].Selection)
{ {
CConfig.Theme = CTheme.ThemeNames[SelectSlides[htSelectSlides(SelectSlideTheme)].Selection]; CConfig.Theme = CTheme.ThemeNames[SelectSlides[SelectSlideTheme].Selection];
_OldTheme = SelectSlides[htSelectSlides(SelectSlideTheme)].Selection; _OldTheme = SelectSlides[SelectSlideTheme].Selection;
CTheme.UnloadSkins(); CTheme.UnloadSkins();
CFonts.UnloadThemeFonts(CConfig.Theme); CFonts.UnloadThemeFonts(CConfig.Theme);
@@ -229,9 +229,9 @@ namespace Vocaluxe.Screens
return; return;
} }
if (_TempSkin != SelectSlides[htSelectSlides(SelectSlideSkin)].Selection) if (_TempSkin != SelectSlides[SelectSlideSkin].Selection)
{ {
_TempSkin = SelectSlides[htSelectSlides(SelectSlideSkin)].Selection; _TempSkin = SelectSlides[SelectSlideSkin].Selection;
PauseBG(); PauseBG();
CConfig.Skin = CTheme.SkinNames[_TempSkin]; CConfig.Skin = CTheme.SkinNames[_TempSkin];
+46 -46
View File
@@ -51,10 +51,10 @@ namespace Vocaluxe.Screens
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideVideoBackgrounds)].SetValues<EOffOn>((int)CConfig.VideoBackgrounds); SelectSlides[SelectSlideVideoBackgrounds].SetValues<EOffOn>((int)CConfig.VideoBackgrounds);
SelectSlides[htSelectSlides(SelectSlideVideoPreview)].SetValues<EOffOn>((int)CConfig.VideoPreview); SelectSlides[SelectSlideVideoPreview].SetValues<EOffOn>((int)CConfig.VideoPreview);
SelectSlides[htSelectSlides(SelectSlideVideosInSongs)].SetValues<EOffOn>((int)CConfig.VideosInSongs); SelectSlides[SelectSlideVideosInSongs].SetValues<EOffOn>((int)CConfig.VideosInSongs);
SelectSlides[htSelectSlides(SelectSlideVideosToBackground)].SetValues<EOffOn>((int)CConfig.VideosToBackground); SelectSlides[SelectSlideVideosToBackground].SetValues<EOffOn>((int)CConfig.VideosToBackground);
} }
public override bool HandleInput(KeyEvent KeyEvent) public override bool HandleInput(KeyEvent KeyEvent)
@@ -81,7 +81,7 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
SaveConfig(); SaveConfig();
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
@@ -89,17 +89,17 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Left: case Keys.Left:
if (SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selected) if (SelectSlides[SelectSlideWebcamDevices].Selected)
OnDeviceEvent(); OnDeviceEvent();
if (SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selected) if (SelectSlides[SelectSlideWebcamCapabilities].Selected)
OnCapabilitiesEvent(); OnCapabilitiesEvent();
SaveConfig(); SaveConfig();
break; break;
case Keys.Right: case Keys.Right:
if (SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selected) if (SelectSlides[SelectSlideWebcamDevices].Selected)
OnDeviceEvent(); OnDeviceEvent();
if (SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selected) if (SelectSlides[SelectSlideWebcamCapabilities].Selected)
OnCapabilitiesEvent(); OnCapabilitiesEvent();
SaveConfig(); SaveConfig();
break; break;
@@ -120,12 +120,12 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selected) if (SelectSlides[SelectSlideWebcamDevices].Selected)
OnDeviceEvent(); OnDeviceEvent();
if (SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selected) if (SelectSlides[SelectSlideWebcamCapabilities].Selected)
OnCapabilitiesEvent(); OnCapabilitiesEvent();
SaveConfig(); SaveConfig();
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
CGraphics.FadeTo(EScreens.ScreenOptions); CGraphics.FadeTo(EScreens.ScreenOptions);
} }
@@ -136,8 +136,8 @@ namespace Vocaluxe.Screens
public override bool UpdateGame() public override bool UpdateGame()
{ {
CWebcam.GetFrame(ref _WebcamTexture); CWebcam.GetFrame(ref _WebcamTexture);
Statics[htStatics(StaticWebcamOutput)].Texture = _WebcamTexture; Statics[StaticWebcamOutput].Texture = _WebcamTexture;
SelectSlides[htSelectSlides(SelectSlideVideosToBackground)].Selection = (int)CConfig.VideosToBackground; SelectSlides[SelectSlideVideosToBackground].Selection = (int)CConfig.VideosToBackground;
return true; return true;
} }
@@ -157,8 +157,8 @@ namespace Vocaluxe.Screens
public override void OnShow() public override void OnShow()
{ {
base.OnShow(); base.OnShow();
SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Clear(); SelectSlides[SelectSlideWebcamDevices].Clear();
SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Clear(); SelectSlides[SelectSlideWebcamCapabilities].Clear();
_DeviceNr = -1; _DeviceNr = -1;
_CapabilityNr = -1; _CapabilityNr = -1;
@@ -177,18 +177,18 @@ namespace Vocaluxe.Screens
foreach (SWebcamDevice d in devices) foreach (SWebcamDevice d in devices)
{ {
SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].AddValue(d.Name); SelectSlides[SelectSlideWebcamDevices].AddValue(d.Name);
} }
SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection = _DeviceNr; SelectSlides[SelectSlideWebcamDevices].Selection = _DeviceNr;
foreach (SCapabilities c in devices[_DeviceNr].Capabilities) foreach (SCapabilities c in devices[_DeviceNr].Capabilities)
{ {
SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].AddValue(c.Width.ToString() + " x " + c.Height.ToString() + " @ " + c.Framerate.ToString() + " FPS "); SelectSlides[SelectSlideWebcamCapabilities].AddValue(c.Width.ToString() + " x " + c.Height.ToString() + " @ " + c.Framerate.ToString() + " FPS ");
} }
_Config.MonikerString = devices[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].MonikerString; _Config.MonikerString = devices[SelectSlides[SelectSlideWebcamDevices].Selection].MonikerString;
_Config.Width = devices[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Width; _Config.Width = devices[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Width;
_Config.Height = devices[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Height; _Config.Height = devices[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Height;
_Config.Framerate = devices[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Framerate; _Config.Framerate = devices[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Framerate;
CWebcam.Close(); CWebcam.Close();
CWebcam.Select(CConfig.WebcamConfig); CWebcam.Select(CConfig.WebcamConfig);
CWebcam.Start(); CWebcam.Start();
@@ -201,17 +201,17 @@ namespace Vocaluxe.Screens
devices = null; devices = null;
} }
SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Visible = (devices != null && devices.Length > 0); SelectSlides[SelectSlideWebcamDevices].Visible = (devices != null && devices.Length > 0);
SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Visible = (devices != null && devices.Length > 0); SelectSlides[SelectSlideWebcamCapabilities].Visible = (devices != null && devices.Length > 0);
Statics[htStatics(StaticWebcamOutput)].Visible = (devices != null && devices.Length > 0); Statics[StaticWebcamOutput].Visible = (devices != null && devices.Length > 0);
} }
private void SaveConfig() private void SaveConfig()
{ {
CConfig.VideoBackgrounds = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideoBackgrounds)].Selection; CConfig.VideoBackgrounds = (EOffOn)SelectSlides[SelectSlideVideoBackgrounds].Selection;
CConfig.VideoPreview = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideoPreview)].Selection; CConfig.VideoPreview = (EOffOn)SelectSlides[SelectSlideVideoPreview].Selection;
CConfig.VideosInSongs = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideosInSongs)].Selection; CConfig.VideosInSongs = (EOffOn)SelectSlides[SelectSlideVideosInSongs].Selection;
CConfig.VideosToBackground = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideosToBackground)].Selection; CConfig.VideosToBackground = (EOffOn)SelectSlides[SelectSlideVideosToBackground].Selection;
CConfig.WebcamConfig = _Config; CConfig.WebcamConfig = _Config;
CBackgroundMusic.VideoEnabled = true; CBackgroundMusic.VideoEnabled = true;
@@ -221,23 +221,23 @@ namespace Vocaluxe.Screens
private void OnDeviceEvent() private void OnDeviceEvent()
{ {
if (SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection != _DeviceNr) if (SelectSlides[SelectSlideWebcamDevices].Selection != _DeviceNr)
{ {
SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Clear(); SelectSlides[SelectSlideWebcamCapabilities].Clear();
_DeviceNr = SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection; _DeviceNr = SelectSlides[SelectSlideWebcamDevices].Selection;
_CapabilityNr = 0; _CapabilityNr = 0;
SWebcamDevice[] d = CWebcam.GetDevices(); SWebcamDevice[] d = CWebcam.GetDevices();
for (int i = 0; i < d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities.Count; i++) for (int i = 0; i < d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities.Count; i++)
{ {
SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].AddValue(d[_DeviceNr].Capabilities[i].Width.ToString() + " x " + d[_DeviceNr].Capabilities[i].Height.ToString() + " @ " + d[_DeviceNr].Capabilities[i].Framerate.ToString() + "FPS"); SelectSlides[SelectSlideWebcamCapabilities].AddValue(d[_DeviceNr].Capabilities[i].Width.ToString() + " x " + d[_DeviceNr].Capabilities[i].Height.ToString() + " @ " + d[_DeviceNr].Capabilities[i].Framerate.ToString() + "FPS");
} }
SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection = 0; SelectSlides[SelectSlideWebcamCapabilities].Selection = 0;
_Config.MonikerString = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].MonikerString; _Config.MonikerString = d[SelectSlides[SelectSlideWebcamDevices].Selection].MonikerString;
_Config.Width = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Width; _Config.Width = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Width;
_Config.Height = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Height; _Config.Height = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Height;
_Config.Framerate = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Framerate; _Config.Framerate = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Framerate;
CWebcam.Close(); CWebcam.Close();
CWebcam.Select(_Config); CWebcam.Select(_Config);
@@ -247,15 +247,15 @@ namespace Vocaluxe.Screens
private void OnCapabilitiesEvent() private void OnCapabilitiesEvent()
{ {
if (SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection != _CapabilityNr) if (SelectSlides[SelectSlideWebcamCapabilities].Selection != _CapabilityNr)
{ {
_CapabilityNr = SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection; _CapabilityNr = SelectSlides[SelectSlideWebcamCapabilities].Selection;
SWebcamDevice[] d = CWebcam.GetDevices(); SWebcamDevice[] d = CWebcam.GetDevices();
_Config.MonikerString = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].MonikerString; _Config.MonikerString = d[SelectSlides[SelectSlideWebcamDevices].Selection].MonikerString;
_Config.Width = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Width; _Config.Width = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Width;
_Config.Height = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Height; _Config.Height = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Height;
_Config.Framerate = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Framerate; _Config.Framerate = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Framerate;
CWebcam.Close(); CWebcam.Close();
CWebcam.Select(_Config); CWebcam.Select(_Config);
+29 -29
View File
@@ -64,16 +64,16 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonStart)].Selected) if (Buttons[ButtonStart].Selected)
StartPartyMode(); StartPartyMode();
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
CGraphics.FadeTo(EScreens.ScreenMain); CGraphics.FadeTo(EScreens.ScreenMain);
break; break;
case Keys.Left: case Keys.Left:
case Keys.Right: case Keys.Right:
if (SelectSlides[htSelectSlides(SelectSlideModes)].Selected) if (SelectSlides[SelectSlideModes].Selected)
UpdateSelection(); UpdateSelection();
break; break;
} }
@@ -87,13 +87,13 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonStart)].Selected) if (Buttons[ButtonStart].Selected)
StartPartyMode(); StartPartyMode();
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
CGraphics.FadeTo(EScreens.ScreenMain); CGraphics.FadeTo(EScreens.ScreenMain);
if (SelectSlides[htSelectSlides(SelectSlideModes)].Selected) if (SelectSlides[SelectSlideModes].Selected)
UpdateSelection(); UpdateSelection();
} }
@@ -111,15 +111,15 @@ namespace Vocaluxe.Screens
_PartyModeInfos = CParty.GetPartyModeInfos(); _PartyModeInfos = CParty.GetPartyModeInfos();
SelectSlides[htSelectSlides(SelectSlideModes)].Clear(); SelectSlides[SelectSlideModes].Clear();
foreach (SPartyModeInfos info in _PartyModeInfos) foreach (SPartyModeInfos info in _PartyModeInfos)
{ {
SelectSlides[htSelectSlides(SelectSlideModes)].AddValue(info.Name, info.PartyModeID); SelectSlides[SelectSlideModes].AddValue(info.Name, info.PartyModeID);
} }
SelectSlides[htSelectSlides(SelectSlideModes)].Selection = 0; SelectSlides[SelectSlideModes].Selection = 0;
UpdateSelection(); UpdateSelection();
SetInteractionToSelectSlide(SelectSlides[htSelectSlides(SelectSlideModes)]); SetInteractionToSelectSlide(SelectSlides[SelectSlideModes]);
} }
public override bool UpdateGame() public override bool UpdateGame()
@@ -144,49 +144,49 @@ namespace Vocaluxe.Screens
if (_PartyModeInfos.Count == 0) if (_PartyModeInfos.Count == 0)
return; return;
int index = SelectSlides[htSelectSlides(SelectSlideModes)].Selection; int index = SelectSlides[SelectSlideModes].Selection;
if (index >= _PartyModeInfos.Count) if (index >= _PartyModeInfos.Count)
return; return;
//Description //Description
Texts[htTexts(TextDescription)].Text = _PartyModeInfos[index].Description; Texts[TextDescription].Text = _PartyModeInfos[index].Description;
Texts[htTexts(TextDescription)].TranslationID = _PartyModeInfos[index].PartyModeID; Texts[TextDescription].TranslationID = _PartyModeInfos[index].PartyModeID;
//TargetAudience //TargetAudience
Texts[htTexts(TextTargetAudience)].TranslationID = _PartyModeInfos[index].PartyModeID; Texts[TextTargetAudience].TranslationID = _PartyModeInfos[index].PartyModeID;
Texts[htTexts(TextTargetAudience)].Text = _PartyModeInfos[index].TargetAudience; Texts[TextTargetAudience].Text = _PartyModeInfos[index].TargetAudience;
//NumTeams //NumTeams
if (_PartyModeInfos[index].MaxTeams == 0) if (_PartyModeInfos[index].MaxTeams == 0)
Texts[htTexts(TextNumTeams)].Text = "TR_SCREENPARTY_NOTEAMS"; Texts[TextNumTeams].Text = "TR_SCREENPARTY_NOTEAMS";
else if (_PartyModeInfos[index].MaxTeams == _PartyModeInfos[index].MinTeams) else if (_PartyModeInfos[index].MaxTeams == _PartyModeInfos[index].MinTeams)
Texts[htTexts(TextNumTeams)].Text = _PartyModeInfos[index].MaxTeams.ToString(); Texts[TextNumTeams].Text = _PartyModeInfos[index].MaxTeams.ToString();
else if (_PartyModeInfos[index].MaxTeams > _PartyModeInfos[index].MinTeams) else if (_PartyModeInfos[index].MaxTeams > _PartyModeInfos[index].MinTeams)
Texts[htTexts(TextNumTeams)].Text = _PartyModeInfos[index].MinTeams + " - " + _PartyModeInfos[index].MaxTeams; Texts[TextNumTeams].Text = _PartyModeInfos[index].MinTeams + " - " + _PartyModeInfos[index].MaxTeams;
//NumPlayers //NumPlayers
if (_PartyModeInfos[index].MaxPlayers == _PartyModeInfos[index].MinPlayers) if (_PartyModeInfos[index].MaxPlayers == _PartyModeInfos[index].MinPlayers)
Texts[htTexts(TextNumPlayers)].Text = _PartyModeInfos[index].MaxTeams.ToString(); Texts[TextNumPlayers].Text = _PartyModeInfos[index].MaxTeams.ToString();
else if (_PartyModeInfos[index].MaxPlayers > _PartyModeInfos[index].MinPlayers) else if (_PartyModeInfos[index].MaxPlayers > _PartyModeInfos[index].MinPlayers)
Texts[htTexts(TextNumPlayers)].Text = _PartyModeInfos[index].MinPlayers + " - " + _PartyModeInfos[index].MaxPlayers; Texts[TextNumPlayers].Text = _PartyModeInfos[index].MinPlayers + " - " + _PartyModeInfos[index].MaxPlayers;
//Author //Author
Texts[htTexts(TextAuthor)].Text = _PartyModeInfos[index].Author; Texts[TextAuthor].Text = _PartyModeInfos[index].Author;
Texts[htTexts(TextAuthor)].TranslationID = _PartyModeInfos[index].PartyModeID; Texts[TextAuthor].TranslationID = _PartyModeInfos[index].PartyModeID;
//Version //Version
Texts[htTexts(TextVersion)].Text = _PartyModeInfos[index].VersionMajor + "." + _PartyModeInfos[index].VersionMinor; Texts[TextVersion].Text = _PartyModeInfos[index].VersionMajor + "." + _PartyModeInfos[index].VersionMinor;
Texts[htTexts(TextVersion)].TranslationID = _PartyModeInfos[index].PartyModeID; Texts[TextVersion].TranslationID = _PartyModeInfos[index].PartyModeID;
if (!_PartyModeInfos[index].Playable) if (!_PartyModeInfos[index].Playable)
{ {
Buttons[htButtons(ButtonStart)].Visible = false; Buttons[ButtonStart].Visible = false;
Texts[htTexts(TextError)].Visible = true; Texts[TextError].Visible = true;
} }
else else
{ {
Buttons[htButtons(ButtonStart)].Visible = true; Buttons[ButtonStart].Visible = true;
Texts[htTexts(TextError)].Visible = false; Texts[TextError].Visible = false;
} }
} }
@@ -195,7 +195,7 @@ namespace Vocaluxe.Screens
if (_PartyModeInfos.Count == 0) if (_PartyModeInfos.Count == 0)
return; return;
int index = SelectSlides[htSelectSlides(SelectSlideModes)].Selection; int index = SelectSlides[SelectSlideModes].Selection;
if (index >= _PartyModeInfos.Count) if (index >= _PartyModeInfos.Count)
return; return;
+94 -94
View File
@@ -65,16 +65,16 @@ namespace Vocaluxe.Screens
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
Buttons[htButtons(ButtonSaveSnapshot)].Visible = false; Buttons[ButtonSaveSnapshot].Visible = false;
Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false; Buttons[ButtonDiscardSnapshot].Visible = false;
Buttons[htButtons(ButtonTakeSnapshot)].Visible = false; Buttons[ButtonTakeSnapshot].Visible = false;
if (CWebcam.GetDevices().Length > 0) if (CWebcam.GetDevices().Length > 0)
Buttons[htButtons(ButtonWebcam)].Visible = true; Buttons[ButtonWebcam].Visible = true;
else else
Buttons[htButtons(ButtonWebcam)].Visible = false; Buttons[ButtonWebcam].Visible = false;
SelectSlides[htSelectSlides(SelectSlideDifficulty)].SetValues<EGameDifficulty>(0); SelectSlides[SelectSlideDifficulty].SetValues<EGameDifficulty>(0);
SelectSlides[htSelectSlides(SelectSlideGuestProfile)].SetValues<EOffOn>(0); SelectSlides[SelectSlideGuestProfile].SetValues<EOffOn>(0);
SelectSlides[htSelectSlides(SelectSlideActive)].SetValues<EOffOn>(0); SelectSlides[SelectSlideActive].SetValues<EOffOn>(0);
} }
@@ -90,8 +90,8 @@ namespace Vocaluxe.Screens
case EEditMode.None: case EEditMode.None:
break; break;
case EEditMode.PlayerName: case EEditMode.PlayerName:
SelectSlides[htSelectSlides(SelectSlideProfiles)].RenameValue( SelectSlides[SelectSlideProfiles].RenameValue(
CProfiles.AddGetPlayerName(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, KeyEvent.Unicode)); CProfiles.AddGetPlayerName(SelectSlides[SelectSlideProfiles].Selection, KeyEvent.Unicode));
break; break;
default: default:
break; break;
@@ -106,34 +106,34 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
CGraphics.FadeTo(EScreens.ScreenMain); CGraphics.FadeTo(EScreens.ScreenMain);
} else if (Buttons[htButtons(ButtonSave)].Selected) } else if (Buttons[ButtonSave].Selected)
{ {
SaveProfiles(); SaveProfiles();
} else if (Buttons[htButtons(ButtonNew)].Selected) } else if (Buttons[ButtonNew].Selected)
{ {
NewProfile(); NewProfile();
} else if (Buttons[htButtons(ButtonPlayerName)].Selected) } else if (Buttons[ButtonPlayerName].Selected)
{ {
if (CProfiles.NumProfiles > 0 && _EditMode != EEditMode.PlayerName) if (CProfiles.NumProfiles > 0 && _EditMode != EEditMode.PlayerName)
_EditMode = EEditMode.PlayerName; _EditMode = EEditMode.PlayerName;
else else
_EditMode = EEditMode.None; _EditMode = EEditMode.None;
} else if (Buttons[htButtons(ButtonDelete)].Selected) } else if (Buttons[ButtonDelete].Selected)
{ {
DeleteProfile(); DeleteProfile();
} else if (Buttons[htButtons(ButtonWebcam)].Selected && CWebcam.GetDevices().Length > 0) } else if (Buttons[ButtonWebcam].Selected && CWebcam.GetDevices().Length > 0)
{ {
OnWebcam(); OnWebcam();
} else if (Buttons[htButtons(ButtonSaveSnapshot)].Selected && CWebcam.GetDevices().Length > 0) } else if (Buttons[ButtonSaveSnapshot].Selected && CWebcam.GetDevices().Length > 0)
{ {
OnSaveSnapshot(); OnSaveSnapshot();
} else if (Buttons[htButtons(ButtonDiscardSnapshot)].Selected && CWebcam.GetDevices().Length > 0) } else if (Buttons[ButtonDiscardSnapshot].Selected && CWebcam.GetDevices().Length > 0)
{ {
OnDiscardSnapshot(); OnDiscardSnapshot();
} else if (Buttons[htButtons(ButtonTakeSnapshot)].Selected && CWebcam.GetDevices().Length > 0) } else if (Buttons[ButtonTakeSnapshot].Selected && CWebcam.GetDevices().Length > 0)
{ {
OnTakeSnapshot(); OnTakeSnapshot();
} }
@@ -142,8 +142,8 @@ namespace Vocaluxe.Screens
case Keys.Back: case Keys.Back:
if (_EditMode == EEditMode.PlayerName) if (_EditMode == EEditMode.PlayerName)
{ {
SelectSlides[htSelectSlides(SelectSlideProfiles)].RenameValue( SelectSlides[SelectSlideProfiles].RenameValue(
CProfiles.GetDeleteCharInPlayerName(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection)); CProfiles.GetDeleteCharInPlayerName(SelectSlides[SelectSlideProfiles].Selection));
} }
else else
CGraphics.FadeTo(EScreens.ScreenMain); CGraphics.FadeTo(EScreens.ScreenMain);
@@ -153,22 +153,22 @@ namespace Vocaluxe.Screens
DeleteProfile(); DeleteProfile();
break; break;
} }
if (SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selected) if (SelectSlides[SelectSlideDifficulty].Selected)
{ {
CProfiles.SetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, CProfiles.SetDifficulty(SelectSlides[SelectSlideProfiles].Selection,
(EGameDifficulty)SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection); (EGameDifficulty)SelectSlides[SelectSlideDifficulty].Selection);
} else if (SelectSlides[htSelectSlides(SelectSlideAvatars)].Selected) } else if (SelectSlides[SelectSlideAvatars].Selected)
{ {
CProfiles.SetAvatar(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, CProfiles.SetAvatar(SelectSlides[SelectSlideProfiles].Selection,
SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection); SelectSlides[SelectSlideAvatars].Selection);
} else if (SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selected) } else if (SelectSlides[SelectSlideGuestProfile].Selected)
{ {
CProfiles.SetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, CProfiles.SetGuestProfile(SelectSlides[SelectSlideProfiles].Selection,
(EOffOn)SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection); (EOffOn)SelectSlides[SelectSlideGuestProfile].Selection);
} else if (SelectSlides[htSelectSlides(SelectSlideActive)].Selected) } else if (SelectSlides[SelectSlideActive].Selected)
{ {
CProfiles.SetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, CProfiles.SetActive(SelectSlides[SelectSlideProfiles].Selection,
(EOffOn)SelectSlides[htSelectSlides(SelectSlideActive)].Selection); (EOffOn)SelectSlides[SelectSlideActive].Selection);
} }
} }
@@ -182,51 +182,51 @@ namespace Vocaluxe.Screens
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonExit)].Selected) if (Buttons[ButtonExit].Selected)
{ {
CGraphics.FadeTo(EScreens.ScreenMain); CGraphics.FadeTo(EScreens.ScreenMain);
} else if (Buttons[htButtons(ButtonSave)].Selected) } else if (Buttons[ButtonSave].Selected)
{ {
SaveProfiles(); SaveProfiles();
} else if (Buttons[htButtons(ButtonNew)].Selected) } else if (Buttons[ButtonNew].Selected)
{ {
NewProfile(); NewProfile();
} else if (Buttons[htButtons(ButtonDelete)].Selected) { } else if (Buttons[ButtonDelete].Selected) {
DeleteProfile(); DeleteProfile();
} else if (Buttons[htButtons(ButtonPlayerName)].Selected) } else if (Buttons[ButtonPlayerName].Selected)
{ {
if (CProfiles.NumProfiles > 0 && _EditMode != EEditMode.PlayerName) if (CProfiles.NumProfiles > 0 && _EditMode != EEditMode.PlayerName)
_EditMode = EEditMode.PlayerName; _EditMode = EEditMode.PlayerName;
else else
_EditMode = EEditMode.None; _EditMode = EEditMode.None;
} else if (SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selected) } else if (SelectSlides[SelectSlideDifficulty].Selected)
{ {
CProfiles.SetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, CProfiles.SetDifficulty(SelectSlides[SelectSlideProfiles].Selection,
(EGameDifficulty)SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection); (EGameDifficulty)SelectSlides[SelectSlideDifficulty].Selection);
} else if (SelectSlides[htSelectSlides(SelectSlideAvatars)].Selected) } else if (SelectSlides[SelectSlideAvatars].Selected)
{ {
CProfiles.SetAvatar(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, CProfiles.SetAvatar(SelectSlides[SelectSlideProfiles].Selection,
SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection); SelectSlides[SelectSlideAvatars].Selection);
if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.index > 0) if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.index > 0)
OnDiscardSnapshot(); OnDiscardSnapshot();
} else if (SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selected) } else if (SelectSlides[SelectSlideGuestProfile].Selected)
{ {
CProfiles.SetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, CProfiles.SetGuestProfile(SelectSlides[SelectSlideProfiles].Selection,
(EOffOn)SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection); (EOffOn)SelectSlides[SelectSlideGuestProfile].Selection);
} else if (SelectSlides[htSelectSlides(SelectSlideActive)].Selected) } else if (SelectSlides[SelectSlideActive].Selected)
{ {
CProfiles.SetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, CProfiles.SetActive(SelectSlides[SelectSlideProfiles].Selection,
(EOffOn)SelectSlides[htSelectSlides(SelectSlideActive)].Selection); (EOffOn)SelectSlides[SelectSlideActive].Selection);
} else if (Buttons[htButtons(ButtonWebcam)].Selected && CWebcam.GetDevices().Length > 0) } else if (Buttons[ButtonWebcam].Selected && CWebcam.GetDevices().Length > 0)
{ {
OnWebcam(); OnWebcam();
} else if (Buttons[htButtons(ButtonSaveSnapshot)].Selected && CWebcam.GetDevices().Length > 0) } else if (Buttons[ButtonSaveSnapshot].Selected && CWebcam.GetDevices().Length > 0)
{ {
OnSaveSnapshot(); OnSaveSnapshot();
} else if (Buttons[htButtons(ButtonDiscardSnapshot)].Selected && CWebcam.GetDevices().Length > 0) } else if (Buttons[ButtonDiscardSnapshot].Selected && CWebcam.GetDevices().Length > 0)
{ {
OnDiscardSnapshot(); OnDiscardSnapshot();
} else if (Buttons[htButtons(ButtonTakeSnapshot)].Selected && CWebcam.GetDevices().Length > 0) } else if (Buttons[ButtonTakeSnapshot].Selected && CWebcam.GetDevices().Length > 0)
{ {
OnTakeSnapshot(); OnTakeSnapshot();
} }
@@ -241,10 +241,10 @@ namespace Vocaluxe.Screens
private void OnTakeSnapshot() private void OnTakeSnapshot()
{ {
Buttons[htButtons(ButtonSaveSnapshot)].Visible = true; Buttons[ButtonSaveSnapshot].Visible = true;
Buttons[htButtons(ButtonDiscardSnapshot)].Visible = true; Buttons[ButtonDiscardSnapshot].Visible = true;
Buttons[htButtons(ButtonWebcam)].Visible = false; Buttons[ButtonWebcam].Visible = false;
Buttons[htButtons(ButtonTakeSnapshot)].Visible = false; Buttons[ButtonTakeSnapshot].Visible = false;
_Snapshot = CWebcam.GetBitmap(); _Snapshot = CWebcam.GetBitmap();
} }
@@ -253,10 +253,10 @@ namespace Vocaluxe.Screens
CWebcam.Stop(); CWebcam.Stop();
CDraw.RemoveTexture(ref _WebcamTexture); CDraw.RemoveTexture(ref _WebcamTexture);
_Snapshot = null; _Snapshot = null;
Buttons[htButtons(ButtonSaveSnapshot)].Visible = false; Buttons[ButtonSaveSnapshot].Visible = false;
Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false; Buttons[ButtonDiscardSnapshot].Visible = false;
Buttons[htButtons(ButtonTakeSnapshot)].Visible = false; Buttons[ButtonTakeSnapshot].Visible = false;
Buttons[htButtons(ButtonWebcam)].Visible = true; Buttons[ButtonWebcam].Visible = true;
} }
private void OnSaveSnapshot() private void OnSaveSnapshot()
@@ -278,16 +278,16 @@ namespace Vocaluxe.Screens
{ {
if (CProfiles.Avatars[j].FileName == (filename + i + ".png")) if (CProfiles.Avatars[j].FileName == (filename + i + ".png"))
{ {
CProfiles.SetAvatar(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, j); CProfiles.SetAvatar(SelectSlides[SelectSlideProfiles].Selection, j);
break; break;
} }
} }
Buttons[htButtons(ButtonSaveSnapshot)].Visible = false; Buttons[ButtonSaveSnapshot].Visible = false;
Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false; Buttons[ButtonDiscardSnapshot].Visible = false;
Buttons[htButtons(ButtonTakeSnapshot)].Visible = false; Buttons[ButtonTakeSnapshot].Visible = false;
Buttons[htButtons(ButtonWebcam)].Visible = true; Buttons[ButtonWebcam].Visible = true;
} }
private void OnWebcam() private void OnWebcam()
@@ -295,38 +295,38 @@ namespace Vocaluxe.Screens
_Snapshot = null; _Snapshot = null;
CWebcam.Start(); CWebcam.Start();
CWebcam.GetFrame(ref _WebcamTexture); CWebcam.GetFrame(ref _WebcamTexture);
Buttons[htButtons(ButtonSaveSnapshot)].Visible = false; Buttons[ButtonSaveSnapshot].Visible = false;
Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false; Buttons[ButtonDiscardSnapshot].Visible = false;
Buttons[htButtons(ButtonTakeSnapshot)].Visible = true; Buttons[ButtonTakeSnapshot].Visible = true;
Buttons[htButtons(ButtonWebcam)].Visible = false; Buttons[ButtonWebcam].Visible = false;
} }
public override bool UpdateGame() public override bool UpdateGame()
{ {
if (SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection > -1) if (SelectSlides[SelectSlideProfiles].Selection > -1)
{ {
Buttons[htButtons(ButtonPlayerName)].Text.Text = CProfiles.GetPlayerName(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); Buttons[ButtonPlayerName].Text.Text = CProfiles.GetPlayerName(SelectSlides[SelectSlideProfiles].Selection);
if (_EditMode == EEditMode.PlayerName) if (_EditMode == EEditMode.PlayerName)
Buttons[htButtons(ButtonPlayerName)].Text.Text += "|"; Buttons[ButtonPlayerName].Text.Text += "|";
SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection = (int)CProfiles.GetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); SelectSlides[SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(SelectSlides[SelectSlideProfiles].Selection);
SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); SelectSlides[SelectSlideGuestProfile].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[SelectSlideProfiles].Selection);
SelectSlides[htSelectSlides(SelectSlideActive)].Selection = (int)CProfiles.GetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); SelectSlides[SelectSlideActive].Selection = (int)CProfiles.GetActive(SelectSlides[SelectSlideProfiles].Selection);
int avatarNr = CProfiles.GetAvatarNr(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); int avatarNr = CProfiles.GetAvatarNr(SelectSlides[SelectSlideProfiles].Selection);
SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection = avatarNr; SelectSlides[SelectSlideAvatars].Selection = avatarNr;
if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.index > 0) if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.index > 0)
{ {
if(_Snapshot == null) if(_Snapshot == null)
CWebcam.GetFrame(ref _WebcamTexture); CWebcam.GetFrame(ref _WebcamTexture);
Statics[htStatics(StaticAvatar)].Texture = _WebcamTexture; Statics[StaticAvatar].Texture = _WebcamTexture;
RectangleF bounds = new RectangleF(_WebcamTexture.rect.X, _WebcamTexture.rect.Y, _WebcamTexture.rect.W, _WebcamTexture.rect.H); RectangleF bounds = new RectangleF(_WebcamTexture.rect.X, _WebcamTexture.rect.Y, _WebcamTexture.rect.W, _WebcamTexture.rect.H);
RectangleF rect = new RectangleF(0f, 0f, _WebcamTexture.rect.W, _WebcamTexture.rect.H); RectangleF rect = new RectangleF(0f, 0f, _WebcamTexture.rect.W, _WebcamTexture.rect.H);
CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop); CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);
} }
else else
Statics[htStatics(StaticAvatar)].Texture = CProfiles.Avatars[avatarNr].Texture; Statics[StaticAvatar].Texture = CProfiles.Avatars[avatarNr].Texture;
} }
return true; return true;
@@ -364,7 +364,7 @@ namespace Vocaluxe.Screens
private void DeleteProfile() private void DeleteProfile()
{ {
CProfiles.DeleteProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); CProfiles.DeleteProfile(SelectSlides[SelectSlideProfiles].Selection);
LoadProfiles(); LoadProfiles();
UpdateGame(); UpdateGame();
} }
@@ -372,28 +372,28 @@ namespace Vocaluxe.Screens
private void LoadProfiles() private void LoadProfiles()
{ {
_EditMode = EEditMode.None; _EditMode = EEditMode.None;
SelectSlides[htSelectSlides(SelectSlideProfiles)].Clear(); SelectSlides[SelectSlideProfiles].Clear();
for (int i = 0; i < CProfiles.NumProfiles; i++) for (int i = 0; i < CProfiles.NumProfiles; i++)
{ {
SelectSlides[htSelectSlides(SelectSlideProfiles)].AddValue(CProfiles.GetPlayerName(i)); SelectSlides[SelectSlideProfiles].AddValue(CProfiles.GetPlayerName(i));
} }
if (CProfiles.NumProfiles > 0 && CProfiles.NumAvatars > 0) if (CProfiles.NumProfiles > 0 && CProfiles.NumAvatars > 0)
{ {
SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection = (int)CProfiles.GetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); SelectSlides[SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(SelectSlides[SelectSlideProfiles].Selection);
SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); SelectSlides[SelectSlideGuestProfile].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[SelectSlideProfiles].Selection);
SelectSlides[htSelectSlides(SelectSlideActive)].Selection = (int)CProfiles.GetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); SelectSlides[SelectSlideActive].Selection = (int)CProfiles.GetActive(SelectSlides[SelectSlideProfiles].Selection);
SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection = CProfiles.GetAvatarNr(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); SelectSlides[SelectSlideAvatars].Selection = CProfiles.GetAvatarNr(SelectSlides[SelectSlideProfiles].Selection);
} }
} }
private void LoadAvatars() private void LoadAvatars()
{ {
SelectSlides[htSelectSlides(SelectSlideAvatars)].Clear(); SelectSlides[SelectSlideAvatars].Clear();
for (int i = 0; i < CProfiles.NumAvatars; i++) for (int i = 0; i < CProfiles.NumAvatars; i++)
{ {
SelectSlides[htSelectSlides(SelectSlideAvatars)].AddValue(CProfiles.Avatars[i].FileName); SelectSlides[SelectSlideAvatars].AddValue(CProfiles.Avatars[i].FileName);
} }
} }
@@ -402,12 +402,12 @@ namespace Vocaluxe.Screens
_EditMode = EEditMode.None; _EditMode = EEditMode.None;
CProfiles.NewProfile(); CProfiles.NewProfile();
LoadProfiles(); LoadProfiles();
SelectSlides[htSelectSlides(SelectSlideProfiles)].LastValue(); SelectSlides[SelectSlideProfiles].LastValue();
CProfiles.SetAvatar(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, CProfiles.SetAvatar(SelectSlides[SelectSlideProfiles].Selection,
SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection); SelectSlides[SelectSlideAvatars].Selection);
SetInteractionToButton(Buttons[htButtons(ButtonPlayerName)]); SetInteractionToButton(Buttons[ButtonPlayerName]);
_EditMode = EEditMode.PlayerName; _EditMode = EEditMode.PlayerName;
} }
} }
+36 -36
View File
@@ -158,15 +158,15 @@ namespace Vocaluxe.Screens
{ {
StaticPointsBarDrawnPoints[p] = player[p].Points; StaticPointsBarDrawnPoints[p] = player[p].Points;
} }
string direction = (string) ScreenSettings[htScreenSettings(ScreenSettingAnimationDirection)].GetValue(); string direction = (string) ScreenSettings[ScreenSettingAnimationDirection].GetValue();
if (direction.ToLower() == "vertical") if (direction.ToLower() == "vertical")
{ {
Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.W = ((float)StaticPointsBarDrawnPoints[p]) * (Statics[htStatics(StaticPointsBarBG[p, CGame.NumPlayer - 1])].Rect.W / 10000); Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.W = ((float)StaticPointsBarDrawnPoints[p]) * (Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.W / 10000);
} }
else else
{ {
Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.H = ((float)StaticPointsBarDrawnPoints[p]) * (Statics[htStatics(StaticPointsBarBG[p, CGame.NumPlayer - 1])].Rect.H / 10000); Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H = ((float)StaticPointsBarDrawnPoints[p]) * (Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H / 10000);
Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.Y = Statics[htStatics(StaticPointsBarBG[p, CGame.NumPlayer - 1])].Rect.H + Statics[htStatics(StaticPointsBarBG[p, CGame.NumPlayer - 1])].Rect.Y - Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.H; Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.Y = Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H + Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.Y - Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H;
} }
} }
} }
@@ -285,16 +285,16 @@ namespace Vocaluxe.Screens
if (song == null) if (song == null)
return; return;
Texts[htTexts(TextSong)].Text = song.Artist + " - " + song.Title; Texts[TextSong].Text = song.Artist + " - " + song.Title;
if (_Points.NumRounds > 1) if (_Points.NumRounds > 1)
{ {
Texts[htTexts(TextSong)].Text += " (" + _Round + "/" + _Points.NumRounds + ")"; Texts[TextSong].Text += " (" + _Round + "/" + _Points.NumRounds + ")";
} }
player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer); player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer);
} }
else else
{ {
Texts[htTexts(TextSong)].Text = "TR_SCREENSCORE_OVERALLSCORE"; Texts[TextSong].Text = "TR_SCREENSCORE_OVERALLSCORE";
for (int i = 0; i < CGame.NumRounds; i++) for (int i = 0; i < CGame.NumRounds; i++)
{ {
SPlayer[] points = _Points.GetPlayer(i, CGame.NumPlayer); SPlayer[] points = _Points.GetPlayer(i, CGame.NumPlayer);
@@ -320,52 +320,52 @@ namespace Vocaluxe.Screens
if (song != null) if (song != null)
{ {
if (!song.IsDuet) if (!song.IsDuet)
Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Text = player[p].Name; Texts[TextNames[p, CGame.NumPlayer - 1]].Text = player[p].Name;
else else
if (player[p].LineNr == 0 && song.DuetPart1 != "Part 1") if (player[p].LineNr == 0 && song.DuetPart1 != "Part 1")
Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Text = player[p].Name + " (" + song.DuetPart1 + ")"; Texts[TextNames[p, CGame.NumPlayer - 1]].Text = player[p].Name + " (" + song.DuetPart1 + ")";
else if (player[p].LineNr == 1 && song.DuetPart2 != "Part 2") else if (player[p].LineNr == 1 && song.DuetPart2 != "Part 2")
Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Text = player[p].Name + " (" + song.DuetPart2 + ")"; Texts[TextNames[p, CGame.NumPlayer - 1]].Text = player[p].Name + " (" + song.DuetPart2 + ")";
else else
Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Text = player[p].Name; Texts[TextNames[p, CGame.NumPlayer - 1]].Text = player[p].Name;
} }
else else
Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Text = player[p].Name; Texts[TextNames[p, CGame.NumPlayer - 1]].Text = player[p].Name;
if (CGame.NumPlayer < (int)ScreenSettings[htScreenSettings(ScreenSettingShortScore)].GetValue()) if (CGame.NumPlayer < (int)ScreenSettings[ScreenSettingShortScore].GetValue())
Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Text = ((int)Math.Round(player[p].Points)).ToString("0000") + " " + CLanguage.Translate("TR_SCREENSCORE_POINTS"); Texts[TextScores[p, CGame.NumPlayer - 1]].Text = ((int)Math.Round(player[p].Points)).ToString("0000") + " " + CLanguage.Translate("TR_SCREENSCORE_POINTS");
else else
Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Text = ((int)Math.Round(player[p].Points)).ToString("0000"); Texts[TextScores[p, CGame.NumPlayer - 1]].Text = ((int)Math.Round(player[p].Points)).ToString("0000");
if (CGame.NumPlayer < (int)ScreenSettings[htScreenSettings(ScreenSettingShortDifficulty)].GetValue()) if (CGame.NumPlayer < (int)ScreenSettings[ScreenSettingShortDifficulty].GetValue())
Texts[htTexts(TextDifficulty[p, CGame.NumPlayer - 1])].Text = CLanguage.Translate("TR_SCREENSCORE_GAMEDIFFICULTY") + ": " + CLanguage.Translate(player[p].Difficulty.ToString()); Texts[TextDifficulty[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate("TR_SCREENSCORE_GAMEDIFFICULTY") + ": " + CLanguage.Translate(player[p].Difficulty.ToString());
else else
Texts[htTexts(TextDifficulty[p, CGame.NumPlayer - 1])].Text = CLanguage.Translate(player[p].Difficulty.ToString()); Texts[TextDifficulty[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate(player[p].Difficulty.ToString());
if (CGame.NumPlayer < (int)ScreenSettings[htScreenSettings(ScreenSettingShortRating)].GetValue()) if (CGame.NumPlayer < (int)ScreenSettings[ScreenSettingShortRating].GetValue())
Texts[htTexts(TextRatings[p, CGame.NumPlayer - 1])].Text = CLanguage.Translate("TR_SCREENSCORE_RATING") + ": " + CLanguage.Translate(GetRating((int)Math.Round(player[p].Points))); Texts[TextRatings[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate("TR_SCREENSCORE_RATING") + ": " + CLanguage.Translate(GetRating((int)Math.Round(player[p].Points)));
else else
Texts[htTexts(TextRatings[p, CGame.NumPlayer - 1])].Text = CLanguage.Translate(GetRating((int)Math.Round(player[p].Points))); Texts[TextRatings[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate(GetRating((int)Math.Round(player[p].Points)));
StaticPointsBarDrawnPoints[p] = 0.0; StaticPointsBarDrawnPoints[p] = 0.0;
string direction = (string)ScreenSettings[htScreenSettings(ScreenSettingAnimationDirection)].GetValue(); string direction = (string)ScreenSettings[ScreenSettingAnimationDirection].GetValue();
if (direction.ToLower() == "vertical") if (direction.ToLower() == "vertical")
{ {
Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.W = 0; Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.W = 0;
} }
else else
{ {
Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.H = 0; Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H = 0;
Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.Y = Statics[htStatics(StaticPointsBarBG[p, CGame.NumPlayer - 1])].Rect.H + Statics[htStatics(StaticPointsBarBG[p, CGame.NumPlayer - 1])].Rect.Y - Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.H; Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.Y = Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H + Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.Y - Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H;
} }
if (player[p].ProfileID >= 0 && player[p].ProfileID < CProfiles.NumProfiles) if (player[p].ProfileID >= 0 && player[p].ProfileID < CProfiles.NumProfiles)
Statics[htStatics(StaticAvatar[p, CGame.NumPlayer - 1])].Texture = CProfiles.Profiles[player[p].ProfileID].Avatar.Texture; Statics[StaticAvatar[p, CGame.NumPlayer - 1]].Texture = CProfiles.Profiles[player[p].ProfileID].Avatar.Texture;
} }
if (CConfig.ScoreAnimationTime < 1) if (CConfig.ScoreAnimationTime < 1)
{ {
for (int p = 0; p < CGame.NumPlayer; p++) for (int p = 0; p < CGame.NumPlayer; p++)
{ {
Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.H = ((float)player[p].Points) * (Statics[htStatics(StaticPointsBarBG[p, CGame.NumPlayer - 1])].Rect.H / 10000); Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H = ((float)player[p].Points) * (Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H / 10000);
Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.Y = Statics[htStatics(StaticPointsBarBG[p, CGame.NumPlayer - 1])].Rect.H + Statics[htStatics(StaticPointsBarBG[p, CGame.NumPlayer - 1])].Rect.Y - Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.H; Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.Y = Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H + Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.Y - Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.H;
StaticPointsBarDrawnPoints[p] = player[p].Points; StaticPointsBarDrawnPoints[p] = player[p].Points;
} }
} }
@@ -382,15 +382,15 @@ namespace Vocaluxe.Screens
{ {
if (player <= numplayer) if (player <= numplayer)
{ {
Texts[htTexts(TextNames[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); Texts[TextNames[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer);
Texts[htTexts(TextScores[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); Texts[TextScores[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer);
Texts[htTexts(TextRatings[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); Texts[TextRatings[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer);
Texts[htTexts(TextDifficulty[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); Texts[TextDifficulty[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer);
Statics[htStatics(StaticPointsBar[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); Statics[StaticPointsBar[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer);
Statics[htStatics(StaticPointsBarBG[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); Statics[StaticPointsBarBG[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer);
Statics[htStatics(StaticAvatar[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); Statics[StaticAvatar[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer);
Statics[htStatics(StaticAvatar[player, numplayer])].Texture = new STexture(-1); Statics[StaticAvatar[player, numplayer]].Texture = new STexture(-1);
} }
} }
} }
+199 -199
View File
@@ -151,17 +151,17 @@ namespace Vocaluxe.Screens
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
Statics[htStatics(StaticTimeLine)].Visible = false; Statics[StaticTimeLine].Visible = false;
Statics[htStatics(StaticTimeLineExpandedNormal)].Visible = false; Statics[StaticTimeLineExpandedNormal].Visible = false;
Statics[htStatics(StaticTimeLineExpandedHighlighted)].Visible = false; Statics[StaticTimeLineExpandedHighlighted].Visible = false;
Statics[htStatics(StaticPauseBG)].Visible = false; Statics[StaticPauseBG].Visible = false;
Texts[htTexts(TextPause)].Visible = false; Texts[TextPause].Visible = false;
Statics[htStatics(StaticPauseBG)].Visible = false; Statics[StaticPauseBG].Visible = false;
Texts[htTexts(TextPause)].Visible = false; Texts[TextPause].Visible = false;
Buttons[htButtons(ButtonCancel)].Visible = false; Buttons[ButtonCancel].Visible = false;
Buttons[htButtons(ButtonContinue)].Visible = false; Buttons[ButtonContinue].Visible = false;
} }
public override bool HandleInput(KeyEvent KeyEvent) public override bool HandleInput(KeyEvent KeyEvent)
@@ -179,13 +179,13 @@ namespace Vocaluxe.Screens
case Keys.Escape: case Keys.Escape:
TogglePause(); TogglePause();
if (_Pause) if (_Pause)
SetInteractionToButton(Buttons[htButtons(ButtonCancel)]); SetInteractionToButton(Buttons[ButtonCancel]);
break; break;
case Keys.P: case Keys.P:
TogglePause(); TogglePause();
if (_Pause) if (_Pause)
SetInteractionToButton(Buttons[htButtons(ButtonContinue)]); SetInteractionToButton(Buttons[ButtonContinue]);
break; break;
case Keys.T: case Keys.T:
@@ -230,11 +230,11 @@ namespace Vocaluxe.Screens
} }
break; break;
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonContinue)].Selected && _Pause) if (Buttons[ButtonContinue].Selected && _Pause)
TogglePause(); TogglePause();
if (Buttons[htButtons(ButtonCancel)].Selected && _Pause) if (Buttons[ButtonCancel].Selected && _Pause)
Stop(); Stop();
if (Buttons[htButtons(ButtonSkip)].Selected && _Pause) if (Buttons[ButtonSkip].Selected && _Pause)
{ {
LoadNextSong(); LoadNextSong();
TogglePause(); TogglePause();
@@ -278,18 +278,18 @@ namespace Vocaluxe.Screens
{ {
TogglePause(); TogglePause();
if (_Pause) if (_Pause)
SetInteractionToButton(Buttons[htButtons(ButtonContinue)]); SetInteractionToButton(Buttons[ButtonContinue]);
} }
if (MouseEvent.LB && IsMouseOver(MouseEvent) && _Pause) if (MouseEvent.LB && IsMouseOver(MouseEvent) && _Pause)
{ {
if (Buttons[htButtons(ButtonContinue)].Selected && _Pause) if (Buttons[ButtonContinue].Selected && _Pause)
TogglePause(); TogglePause();
if (Buttons[htButtons(ButtonCancel)].Selected && _Pause) if (Buttons[ButtonCancel].Selected && _Pause)
Stop(); Stop();
if (Buttons[htButtons(ButtonSkip)].Selected && _Pause) if (Buttons[ButtonSkip].Selected && _Pause)
{ {
LoadNextSong(); LoadNextSong();
TogglePause(); TogglePause();
@@ -331,48 +331,48 @@ namespace Vocaluxe.Screens
float[] Alpha = CalcFadingAlpha(); float[] Alpha = CalcFadingAlpha();
if (Alpha != null) if (Alpha != null)
{ {
Lyrics[htLyrics(LyricMain)].Alpha = Alpha[0]; Lyrics[LyricMain].Alpha = Alpha[0];
Lyrics[htLyrics(LyricSub)].Alpha = Alpha[1]; Lyrics[LyricSub].Alpha = Alpha[1];
Lyrics[htLyrics(LyricMainTop)].Alpha = Alpha[0]; Lyrics[LyricMainTop].Alpha = Alpha[0];
Lyrics[htLyrics(LyricSubTop)].Alpha = Alpha[1]; Lyrics[LyricSubTop].Alpha = Alpha[1];
Statics[htStatics(StaticLyrics)].Alpha = Alpha[0]; Statics[StaticLyrics].Alpha = Alpha[0];
Statics[htStatics(StaticLyricsTop)].Alpha = Alpha[0]; Statics[StaticLyricsTop].Alpha = Alpha[0];
Statics[htStatics(StaticLyricHelper)].Alpha = Alpha[0]; Statics[StaticLyricHelper].Alpha = Alpha[0];
Statics[htStatics(StaticLyricHelperTop)].Alpha = Alpha[0]; Statics[StaticLyricHelperTop].Alpha = Alpha[0];
for (int p = 0; p < CGame.NumPlayer; p++) for (int p = 0; p < CGame.NumPlayer; p++)
{ {
SingNotes[htSingNotes(SingBars)].SetAlpha(NoteLines[p], Alpha[CGame.Player[p].LineNr * 2]); SingNotes[SingBars].SetAlpha(NoteLines[p], Alpha[CGame.Player[p].LineNr * 2]);
if (CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_INFO || CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_ALL) if (CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_INFO || CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_ALL)
{ {
Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; Statics[StaticAvatars[p, CGame.NumPlayer - 1]].Alpha = Alpha[CGame.Player[p].LineNr * 2];
Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; Texts[TextNames[p, CGame.NumPlayer - 1]].Alpha = Alpha[CGame.Player[p].LineNr * 2];
} }
if (CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_ALL) if (CConfig.FadePlayerInfo == EFadePlayerInfo.TR_CONFIG_FADEPLAYERINFO_ALL)
{ {
Statics[htStatics(StaticScores[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; Statics[StaticScores[p, CGame.NumPlayer - 1]].Alpha = Alpha[CGame.Player[p].LineNr * 2];
Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; Statics[StaticAvatars[p, CGame.NumPlayer - 1]].Alpha = Alpha[CGame.Player[p].LineNr * 2];
Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; Texts[TextNames[p, CGame.NumPlayer - 1]].Alpha = Alpha[CGame.Player[p].LineNr * 2];
Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Alpha = Alpha[CGame.Player[p].LineNr * 2]; Texts[TextScores[p, CGame.NumPlayer - 1]].Alpha = Alpha[CGame.Player[p].LineNr * 2];
} }
} }
if (Alpha.Length > 2) if (Alpha.Length > 2)
{ {
Lyrics[htLyrics(LyricMainDuet)].Alpha = Alpha[0]; Lyrics[LyricMainDuet].Alpha = Alpha[0];
Lyrics[htLyrics(LyricSubDuet)].Alpha = Alpha[1]; Lyrics[LyricSubDuet].Alpha = Alpha[1];
Statics[htStatics(StaticLyricsDuet)].Alpha = Alpha[0]; Statics[StaticLyricsDuet].Alpha = Alpha[0];
Statics[htStatics(StaticLyricHelperDuet)].Alpha = Alpha[0]; Statics[StaticLyricHelperDuet].Alpha = Alpha[0];
Lyrics[htLyrics(LyricMain)].Alpha = Alpha[2]; Lyrics[LyricMain].Alpha = Alpha[2];
Lyrics[htLyrics(LyricSub)].Alpha = Alpha[3]; Lyrics[LyricSub].Alpha = Alpha[3];
Statics[htStatics(StaticLyrics)].Alpha = Alpha[2]; Statics[StaticLyrics].Alpha = Alpha[2];
Statics[htStatics(StaticLyricHelper)].Alpha = Alpha[2]; Statics[StaticLyricHelper].Alpha = Alpha[2];
} }
} }
@@ -381,11 +381,11 @@ namespace Vocaluxe.Screens
{ {
if (CGame.Player[p].Points < 10000) if (CGame.Player[p].Points < 10000)
{ {
Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Text = CGame.Player[p].Points.ToString("0000"); Texts[TextScores[p, CGame.NumPlayer - 1]].Text = CGame.Player[p].Points.ToString("0000");
} }
else else
{ {
Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Text = CGame.Player[p].Points.ToString("00000"); Texts[TextScores[p, CGame.NumPlayer - 1]].Text = CGame.Player[p].Points.ToString("00000");
} }
} }
@@ -419,20 +419,20 @@ namespace Vocaluxe.Screens
_TimeRects.Clear(); _TimeRects.Clear();
SingNotes[htSingNotes(SingBars)].Reset(); SingNotes[SingBars].Reset();
for (int i = 0; i < CSettings.MaxNumPlayer; i++) for (int i = 0; i < CSettings.MaxNumPlayer; i++)
{ {
NoteLines[i] = -1; NoteLines[i] = -1;
} }
for (int i = 0; i < Lyrics.Length; i++) foreach(CLyric lyric in Lyrics)
{ {
Lyrics[i].LyricStyle = CConfig.LyricStyle; lyric.LyricStyle = CConfig.LyricStyle;
} }
for (int p = 0; p < CGame.NumPlayer; p++) for (int p = 0; p < CGame.NumPlayer; p++)
{ {
Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Aspect = EAspect.Crop; Statics[StaticAvatars[p, CGame.NumPlayer - 1]].Aspect = EAspect.Crop;
} }
SetVisibility(); SetVisibility();
@@ -496,37 +496,37 @@ namespace Vocaluxe.Screens
switch (CConfig.TimerLook) switch (CConfig.TimerLook)
{ {
case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL: case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL:
CDraw.DrawTexture(Statics[htStatics(StaticTimeLine)].Texture, Statics[htStatics(StaticTimeLine)].Rect, new SColorF(1, 1, 1, 1), _TimeLineRect); CDraw.DrawTexture(Statics[StaticTimeLine].Texture, Statics[StaticTimeLine].Rect, new SColorF(1, 1, 1, 1), _TimeLineRect);
break; break;
case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED: case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED:
for (int i = 0; i < _TimeRects.Count; i++) for (int i = 0; i < _TimeRects.Count; i++)
{ {
CDraw.DrawTexture(_TimeRects[i].rect.Texture, Statics[htStatics(StaticTimeLine)].Rect, _TimeRects[i].rect.Color, _TimeRects[i].rect.Rect); CDraw.DrawTexture(_TimeRects[i].rect.Texture, Statics[StaticTimeLine].Rect, _TimeRects[i].rect.Color, _TimeRects[i].rect.Rect);
} }
break; break;
} }
Lyrics[htLyrics(LyricSub)].Draw(-100); Lyrics[LyricSub].Draw(-100);
Lyrics[htLyrics(LyricMain)].Draw(CGame.Beat); Lyrics[LyricMain].Draw(CGame.Beat);
Lyrics[htLyrics(LyricSubDuet)].Draw(-100); Lyrics[LyricSubDuet].Draw(-100);
Lyrics[htLyrics(LyricMainDuet)].Draw(CGame.Beat); Lyrics[LyricMainDuet].Draw(CGame.Beat);
Lyrics[htLyrics(LyricSubTop)].Draw(-100); Lyrics[LyricSubTop].Draw(-100);
Lyrics[htLyrics(LyricMainTop)].Draw(CGame.Beat); Lyrics[LyricMainTop].Draw(CGame.Beat);
for (int i = 0; i < CGame.NumPlayer; i++) for (int i = 0; i < CGame.NumPlayer; i++)
{ {
SingNotes[htSingNotes(SingBars)].Draw(NoteLines[i], CGame.Player[i].SingLine, i); SingNotes[SingBars].Draw(NoteLines[i], CGame.Player[i].SingLine, i);
} }
DrawLyricHelper(); DrawLyricHelper();
if (_Pause) if (_Pause)
{ {
Statics[htStatics(StaticPauseBG)].ForceDraw(); Statics[StaticPauseBG].ForceDraw();
Texts[htTexts(TextPause)].ForceDraw(); Texts[TextPause].ForceDraw();
foreach (CButton button in Buttons) foreach (CButton button in Buttons)
button.Draw(); button.Draw();
@@ -562,15 +562,15 @@ namespace Vocaluxe.Screens
} }
CDraw.RemoveTexture(ref _Background); CDraw.RemoveTexture(ref _Background);
Lyrics[htLyrics(LyricMain)].Clear(); Lyrics[LyricMain].Clear();
Lyrics[htLyrics(LyricSub)].Clear(); Lyrics[LyricSub].Clear();
Lyrics[htLyrics(LyricMainDuet)].Clear(); Lyrics[LyricMainDuet].Clear();
Lyrics[htLyrics(LyricSubDuet)].Clear(); Lyrics[LyricSubDuet].Clear();
Lyrics[htLyrics(LyricMainTop)].Clear(); Lyrics[LyricMainTop].Clear();
Lyrics[htLyrics(LyricSubTop)].Clear(); Lyrics[LyricSubTop].Clear();
Texts[htTexts(TextSongName)].Text = String.Empty; Texts[TextSongName].Text = String.Empty;
Texts[htTexts(TextDuetName1)].Text = String.Empty; Texts[TextDuetName1].Text = String.Empty;
Texts[htTexts(TextDuetName2)].Text = String.Empty; Texts[TextDuetName2].Text = String.Empty;
GC.Collect(); GC.Collect();
} }
@@ -601,7 +601,7 @@ namespace Vocaluxe.Screens
int rounds = CGame.GetNumSongs(); int rounds = CGame.GetNumSongs();
if (rounds > 1) if (rounds > 1)
songname += " (" + CGame.RoundNr + "/" + rounds.ToString() + ")"; songname += " (" + CGame.RoundNr + "/" + rounds.ToString() + ")";
Texts[htTexts(TextSongName)].Text = songname; Texts[TextSongName].Text = songname;
_CurrentStream = CSound.Load(song.GetMP3(), true); _CurrentStream = CSound.Load(song.GetMP3(), true);
CSound.SetStreamVolumeMax(_CurrentStream, CConfig.GameMusicVolume); CSound.SetStreamVolumeMax(_CurrentStream, CConfig.GameMusicVolume);
@@ -635,13 +635,13 @@ namespace Vocaluxe.Screens
if (song.BackgroundFileName.Length > 0) if (song.BackgroundFileName.Length > 0)
_Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName)); _Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName));
SingNotes[htSingNotes(SingBars)].Reset(); SingNotes[SingBars].Reset();
if (song.IsDuet) if (song.IsDuet)
{ {
Texts[htTexts(TextDuetName1)].Text = song.DuetPart1; Texts[TextDuetName1].Text = song.DuetPart1;
Texts[htTexts(TextDuetName2)].Text = song.DuetPart2; Texts[TextDuetName2].Text = song.DuetPart2;
//More than one song: Player is not assigned to line by user //More than one song: Player is not assigned to line by user
//Otherwise, this is done by CScreenNames //Otherwise, this is done by CScreenNames
if (CGame.GetNumSongs() > 1) if (CGame.GetNumSongs() > 1)
@@ -667,18 +667,18 @@ namespace Vocaluxe.Screens
for (int p = 0; p < CGame.NumPlayer; p++) for (int p = 0; p < CGame.NumPlayer; p++)
{ {
NoteLines[p] = SingNotes[htSingNotes(SingBars)].AddPlayer( NoteLines[p] = SingNotes[SingBars].AddPlayer(
SingNotes[htSingNotes(SingBars)].BarPos[p, CGame.NumPlayer - 1], SingNotes[SingBars].BarPos[p, CGame.NumPlayer - 1],
CTheme.GetPlayerColor(p + 1), CTheme.GetPlayerColor(p + 1),
p); p);
} }
/* /*
case 4: case 4:
NoteLines[0] = SingNotes[htSingNotes(SingBars)].AddPlayer(new SRectF(35f, 100f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[0]); NoteLines[0] = SingNotes[SingBars].AddPlayer(new SRectF(35f, 100f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[0]);
NoteLines[1] = SingNotes[htSingNotes(SingBars)].AddPlayer(new SRectF(35f, 350f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[1]); NoteLines[1] = SingNotes[SingBars].AddPlayer(new SRectF(35f, 350f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[1]);
NoteLines[2] = SingNotes[htSingNotes(SingBars)].AddPlayer(new SRectF(640f, 100f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[2]); NoteLines[2] = SingNotes[SingBars].AddPlayer(new SRectF(640f, 100f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[2]);
NoteLines[3] = SingNotes[htSingNotes(SingBars)].AddPlayer(new SRectF(640f, 350f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[3]); NoteLines[3] = SingNotes[SingBars].AddPlayer(new SRectF(640f, 350f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[3]);
break; break;
*/ */
@@ -700,22 +700,22 @@ namespace Vocaluxe.Screens
private void SetDuetLyricsVisibility(bool isDuet) private void SetDuetLyricsVisibility(bool isDuet)
{ {
Statics[htStatics(StaticLyricsDuet)].Visible = isDuet; Statics[StaticLyricsDuet].Visible = isDuet;
Lyrics[htLyrics(LyricMainDuet)].Visible = isDuet; Lyrics[LyricMainDuet].Visible = isDuet;
Lyrics[htLyrics(LyricSubDuet)].Visible = isDuet; Lyrics[LyricSubDuet].Visible = isDuet;
if (isDuet) if (isDuet)
{ {
Lyrics[htLyrics(LyricMainTop)].Visible = false; Lyrics[LyricMainTop].Visible = false;
Lyrics[htLyrics(LyricSubTop)].Visible = false; Lyrics[LyricSubTop].Visible = false;
Statics[htStatics(StaticLyricsTop)].Visible = false; Statics[StaticLyricsTop].Visible = false;
} }
else else
{ {
bool LyricsOnTop = (CGame.NumPlayer != 1) && CConfig.LyricsOnTop == EOffOn.TR_CONFIG_ON; bool LyricsOnTop = (CGame.NumPlayer != 1) && CConfig.LyricsOnTop == EOffOn.TR_CONFIG_ON;
Lyrics[htLyrics(LyricMainTop)].Visible = LyricsOnTop; Lyrics[LyricMainTop].Visible = LyricsOnTop;
Lyrics[htLyrics(LyricSubTop)].Visible = LyricsOnTop; Lyrics[LyricSubTop].Visible = LyricsOnTop;
Statics[htStatics(StaticLyricsTop)].Visible = LyricsOnTop; Statics[StaticLyricsTop].Visible = LyricsOnTop;
} }
} }
@@ -796,54 +796,54 @@ namespace Vocaluxe.Screens
for (int j = 0; j < CGame.NumPlayer; j++) for (int j = 0; j < CGame.NumPlayer; j++)
{ {
if (CGame.Player[j].LineNr == i) if (CGame.Player[j].LineNr == i)
SingNotes[htSingNotes(SingBars)].AddLine(NoteLines[j], line, nr, j); SingNotes[SingBars].AddLine(NoteLines[j], line, nr, j);
} }
if (i == 0 && !song.IsDuet || i == 1 && song.IsDuet) if (i == 0 && !song.IsDuet || i == 1 && song.IsDuet)
{ {
Lyrics[htLyrics(LyricMain)].SetLine(line[nr]); Lyrics[LyricMain].SetLine(line[nr]);
Lyrics[htLyrics(LyricMainTop)].SetLine(line[nr]); Lyrics[LyricMainTop].SetLine(line[nr]);
_TimeToFirstNote = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - line[nr].StartBeat, song.BPM); _TimeToFirstNote = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - line[nr].StartBeat, song.BPM);
_RemainingTimeToFirstNote = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - CGame.GetBeatFromTime(_CurrentTime, song.BPM, song.Gap), song.BPM); _RemainingTimeToFirstNote = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - CGame.GetBeatFromTime(_CurrentTime, song.BPM, song.Gap), song.BPM);
if (line.Length >= nr + 2) if (line.Length >= nr + 2)
{ {
Lyrics[htLyrics(LyricSub)].SetLine(line[nr + 1]); Lyrics[LyricSub].SetLine(line[nr + 1]);
Lyrics[htLyrics(LyricSubTop)].SetLine(line[nr + 1]); Lyrics[LyricSubTop].SetLine(line[nr + 1]);
} }
else else
{ {
Lyrics[htLyrics(LyricSub)].Clear(); Lyrics[LyricSub].Clear();
Lyrics[htLyrics(LyricSubTop)].Clear(); Lyrics[LyricSubTop].Clear();
} }
} }
if (i == 0 && song.IsDuet) if (i == 0 && song.IsDuet)
{ {
Lyrics[htLyrics(LyricMainDuet)].SetLine(line[nr]); Lyrics[LyricMainDuet].SetLine(line[nr]);
_TimeToFirstNoteDuet = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - line[nr].StartBeat, song.BPM); _TimeToFirstNoteDuet = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - line[nr].StartBeat, song.BPM);
_RemainingTimeToFirstNoteDuet = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - CGame.GetBeatFromTime(_CurrentTime, song.BPM, song.Gap), song.BPM); _RemainingTimeToFirstNoteDuet = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - CGame.GetBeatFromTime(_CurrentTime, song.BPM, song.Gap), song.BPM);
if (line.Length >= nr + 2) if (line.Length >= nr + 2)
Lyrics[htLyrics(LyricSubDuet)].SetLine(line[nr + 1]); Lyrics[LyricSubDuet].SetLine(line[nr + 1]);
else else
Lyrics[htLyrics(LyricSubDuet)].Clear(); Lyrics[LyricSubDuet].Clear();
} }
} }
else else
{ {
if (i == 0 && !song.IsDuet || i == 1 && song.IsDuet) if (i == 0 && !song.IsDuet || i == 1 && song.IsDuet)
{ {
Lyrics[htLyrics(LyricMain)].Clear(); Lyrics[LyricMain].Clear();
Lyrics[htLyrics(LyricSub)].Clear(); Lyrics[LyricSub].Clear();
Lyrics[htLyrics(LyricMainTop)].Clear(); Lyrics[LyricMainTop].Clear();
Lyrics[htLyrics(LyricSubTop)].Clear(); Lyrics[LyricSubTop].Clear();
_TimeToFirstNote = 0f; _TimeToFirstNote = 0f;
} }
if (i == 0 && song.IsDuet) if (i == 0 && song.IsDuet)
{ {
Lyrics[htLyrics(LyricMainDuet)].Clear(); Lyrics[LyricMainDuet].Clear();
Lyrics[htLyrics(LyricSubDuet)].Clear(); Lyrics[LyricSubDuet].Clear();
_TimeToFirstNoteDuet = 0f; _TimeToFirstNoteDuet = 0f;
} }
} }
@@ -855,18 +855,18 @@ namespace Vocaluxe.Screens
_Pause = !_Pause; _Pause = !_Pause;
if (_Pause) if (_Pause)
{ {
Buttons[htButtons(ButtonCancel)].Visible = true; Buttons[ButtonCancel].Visible = true;
Buttons[htButtons(ButtonContinue)].Visible = true; Buttons[ButtonContinue].Visible = true;
if (CGame.NumRounds > CGame.RoundNr && CGame.NumRounds > 1) if (CGame.NumRounds > CGame.RoundNr && CGame.NumRounds > 1)
Buttons[htButtons(ButtonSkip)].Visible = true; Buttons[ButtonSkip].Visible = true;
else else
Buttons[htButtons(ButtonSkip)].Visible = false; Buttons[ButtonSkip].Visible = false;
CSound.Pause(_CurrentStream); CSound.Pause(_CurrentStream);
}else }else
{ {
Buttons[htButtons(ButtonCancel)].Visible = false; Buttons[ButtonCancel].Visible = false;
Buttons[htButtons(ButtonContinue)].Visible = false; Buttons[ButtonContinue].Visible = false;
Buttons[htButtons(ButtonSkip)].Visible = false; Buttons[ButtonSkip].Visible = false;
CSound.Play(_CurrentStream); CSound.Play(_CurrentStream);
CWebcam.Start(); CWebcam.Start();
} }
@@ -918,17 +918,17 @@ namespace Vocaluxe.Screens
private void SetVisibility() private void SetVisibility()
{ {
Statics[htStatics(StaticLyricsDuet)].Visible = false; Statics[StaticLyricsDuet].Visible = false;
Statics[htStatics(StaticLyricHelper)].Visible = false; Statics[StaticLyricHelper].Visible = false;
Statics[htStatics(StaticLyricHelperDuet)].Visible = false; Statics[StaticLyricHelperDuet].Visible = false;
Statics[htStatics(StaticLyricHelperTop)].Visible = false; Statics[StaticLyricHelperTop].Visible = false;
Lyrics[htLyrics(LyricMainDuet)].Visible = false; Lyrics[LyricMainDuet].Visible = false;
Lyrics[htLyrics(LyricSubDuet)].Visible = false; Lyrics[LyricSubDuet].Visible = false;
Statics[htStatics(StaticSongText)].Visible = false; Statics[StaticSongText].Visible = false;
Texts[htTexts(TextSongName)].Visible = false; Texts[TextSongName].Visible = false;
Texts[htTexts(TextDuetName1)].Visible = false; Texts[TextDuetName1].Visible = false;
Texts[htTexts(TextDuetName2)].Visible = false; Texts[TextDuetName2].Visible = false;
for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++) for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++)
{ {
@@ -936,33 +936,33 @@ namespace Vocaluxe.Screens
{ {
if (player <= numplayer) if (player <= numplayer)
{ {
Texts[htTexts(TextScores[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); Texts[TextScores[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer);
Texts[htTexts(TextNames[player, numplayer])].Visible = ((numplayer + 1 == CGame.NumPlayer) Texts[TextNames[player, numplayer]].Visible = ((numplayer + 1 == CGame.NumPlayer)
&& (CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH || CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_NAME)); && (CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH || CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_NAME));
Statics[htStatics(StaticScores[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); Statics[StaticScores[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer);
Statics[htStatics(StaticAvatars[player, numplayer])].Visible = ((numplayer + 1 == CGame.NumPlayer) Statics[StaticAvatars[player, numplayer]].Visible = ((numplayer + 1 == CGame.NumPlayer)
&& (CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH || CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_AVATAR)); && (CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_BOTH || CConfig.PlayerInfo == EPlayerInfo.TR_CONFIG_PLAYERINFO_AVATAR));
} }
} }
} }
Lyrics[htLyrics(LyricMain)].Alpha = 0f; Lyrics[LyricMain].Alpha = 0f;
Lyrics[htLyrics(LyricSub)].Alpha = 0f; Lyrics[LyricSub].Alpha = 0f;
Lyrics[htLyrics(LyricMainTop)].Alpha = 0f; Lyrics[LyricMainTop].Alpha = 0f;
Lyrics[htLyrics(LyricSubTop)].Alpha = 0f; Lyrics[LyricSubTop].Alpha = 0f;
Statics[htStatics(StaticLyrics)].Alpha = 0f; Statics[StaticLyrics].Alpha = 0f;
Statics[htStatics(StaticLyricsTop)].Alpha = 0f; Statics[StaticLyricsTop].Alpha = 0f;
Statics[htStatics(StaticLyricHelper)].Alpha = 0f; Statics[StaticLyricHelper].Alpha = 0f;
Statics[htStatics(StaticLyricHelperTop)].Alpha = 0f; Statics[StaticLyricHelperTop].Alpha = 0f;
Lyrics[htLyrics(LyricMainDuet)].Alpha = 0f; Lyrics[LyricMainDuet].Alpha = 0f;
Lyrics[htLyrics(LyricSubDuet)].Alpha = 0f; Lyrics[LyricSubDuet].Alpha = 0f;
Statics[htStatics(StaticLyricsDuet)].Alpha = 0f; Statics[StaticLyricsDuet].Alpha = 0f;
Statics[htStatics(StaticLyricHelperDuet)].Alpha = 0f; Statics[StaticLyricHelperDuet].Alpha = 0f;
} }
@@ -992,28 +992,28 @@ namespace Vocaluxe.Screens
if (time > totaltime) if (time > totaltime)
time = totaltime; time = totaltime;
SRectF Rect = Statics[htStatics(StaticLyricHelper)].Rect; SRectF Rect = Statics[StaticLyricHelper].Rect;
SColorF Color = new SColorF( SColorF Color = new SColorF(
Statics[htStatics(StaticLyricHelper)].Color.R, Statics[StaticLyricHelper].Color.R,
Statics[htStatics(StaticLyricHelper)].Color.G, Statics[StaticLyricHelper].Color.G,
Statics[htStatics(StaticLyricHelper)].Color.B, Statics[StaticLyricHelper].Color.B,
Statics[htStatics(StaticLyricHelper)].Color.A * Statics[htStatics(StaticLyricHelper)].Alpha * alpha); Statics[StaticLyricHelper].Color.A * Statics[StaticLyricHelper].Alpha * alpha);
float distance = Lyrics[htLyrics(LyricMain)].GetCurrentLyricPosX() - Rect.X - Rect.W; float distance = Lyrics[LyricMain].GetCurrentLyricPosX() - Rect.X - Rect.W;
CDraw.DrawTexture(Statics[htStatics(StaticLyricHelper)].Texture, CDraw.DrawTexture(Statics[StaticLyricHelper].Texture,
new SRectF(Rect.X + distance * (1f - time / totaltime), Rect.Y, Rect.W, Rect.H, Rect.Z), Color); new SRectF(Rect.X + distance * (1f - time / totaltime), Rect.Y, Rect.W, Rect.H, Rect.Z), Color);
if (Statics[htStatics(StaticLyricsTop)].Visible) if (Statics[StaticLyricsTop].Visible)
{ {
Rect = Statics[htStatics(StaticLyricHelperTop)].Rect; Rect = Statics[StaticLyricHelperTop].Rect;
Color = new SColorF( Color = new SColorF(
Statics[htStatics(StaticLyricHelperTop)].Color.R, Statics[StaticLyricHelperTop].Color.R,
Statics[htStatics(StaticLyricHelperTop)].Color.G, Statics[StaticLyricHelperTop].Color.G,
Statics[htStatics(StaticLyricHelperTop)].Color.B, Statics[StaticLyricHelperTop].Color.B,
Statics[htStatics(StaticLyricHelperTop)].Color.A * Statics[htStatics(StaticLyricHelper)].Alpha * alpha); Statics[StaticLyricHelperTop].Color.A * Statics[StaticLyricHelper].Alpha * alpha);
distance = Lyrics[htLyrics(LyricMainTop)].GetCurrentLyricPosX() - Rect.X - Rect.W; distance = Lyrics[LyricMainTop].GetCurrentLyricPosX() - Rect.X - Rect.W;
CDraw.DrawTexture(Statics[htStatics(StaticLyricHelperTop)].Texture, CDraw.DrawTexture(Statics[StaticLyricHelperTop].Texture,
new SRectF(Rect.X + distance * (1f - time / totaltime), Rect.Y, Rect.W, Rect.H, Rect.Z), Color); new SRectF(Rect.X + distance * (1f - time / totaltime), Rect.Y, Rect.W, Rect.H, Rect.Z), Color);
} }
} }
@@ -1031,16 +1031,16 @@ namespace Vocaluxe.Screens
if (time > totaltime) if (time > totaltime)
time = totaltime; time = totaltime;
SRectF Rect = Statics[htStatics(StaticLyricHelperDuet)].Rect; SRectF Rect = Statics[StaticLyricHelperDuet].Rect;
SColorF Color = new SColorF( SColorF Color = new SColorF(
Statics[htStatics(StaticLyricHelperDuet)].Color.R, Statics[StaticLyricHelperDuet].Color.R,
Statics[htStatics(StaticLyricHelperDuet)].Color.G, Statics[StaticLyricHelperDuet].Color.G,
Statics[htStatics(StaticLyricHelperDuet)].Color.B, Statics[StaticLyricHelperDuet].Color.B,
Statics[htStatics(StaticLyricHelperDuet)].Color.A * Statics[htStatics(StaticLyricHelperDuet)].Alpha * alpha); Statics[StaticLyricHelperDuet].Color.A * Statics[StaticLyricHelperDuet].Alpha * alpha);
float distance = Lyrics[htLyrics(LyricMainDuet)].GetCurrentLyricPosX() - Rect.X - Rect.W; float distance = Lyrics[LyricMainDuet].GetCurrentLyricPosX() - Rect.X - Rect.W;
CDraw.DrawTexture(Statics[htStatics(StaticLyricHelperDuet)].Texture, CDraw.DrawTexture(Statics[StaticLyricHelperDuet].Texture,
new SRectF(Rect.X + distance * (1f - time / totaltime), Rect.Y, Rect.W, Rect.H, Rect.Z), new SRectF(Rect.X + distance * (1f - time / totaltime), Rect.Y, Rect.W, Rect.H, Rect.Z),
Color); Color);
} }
@@ -1157,36 +1157,36 @@ namespace Vocaluxe.Screens
private void UpdateSongText() private void UpdateSongText()
{ {
if (_TimerSongText.IsRunning && !Lyrics[htLyrics(LyricMainDuet)].Visible && !Lyrics[htLyrics(LyricMainTop)].Visible) if (_TimerSongText.IsRunning && !Lyrics[LyricMainDuet].Visible && !Lyrics[LyricMainTop].Visible)
{ {
float t = _TimerSongText.ElapsedMilliseconds / 1000f; float t = _TimerSongText.ElapsedMilliseconds / 1000f;
if (t < 10f) if (t < 10f)
{ {
Statics[htStatics(StaticSongText)].Visible = true; Statics[StaticSongText].Visible = true;
Texts[htTexts(TextSongName)].Visible = true; Texts[TextSongName].Visible = true;
if (t < 7f) if (t < 7f)
{ {
Statics[htStatics(StaticSongText)].Color.A = 1f; Statics[StaticSongText].Color.A = 1f;
Texts[htTexts(TextSongName)].Color.A = 1f; Texts[TextSongName].Color.A = 1f;
} }
else else
{ {
Statics[htStatics(StaticSongText)].Color.A = (3f - (t - 7f)) / 3f; Statics[StaticSongText].Color.A = (3f - (t - 7f)) / 3f;
Texts[htTexts(TextSongName)].Color.A = (3f - (t - 7f)) / 3f; Texts[TextSongName].Color.A = (3f - (t - 7f)) / 3f;
} }
} }
else else
{ {
Statics[htStatics(StaticSongText)].Visible = false; Statics[StaticSongText].Visible = false;
Texts[htTexts(TextSongName)].Visible = false; Texts[TextSongName].Visible = false;
_TimerSongText.Stop(); _TimerSongText.Stop();
} }
} }
else else
{ {
Statics[htStatics(StaticSongText)].Visible = false; Statics[StaticSongText].Visible = false;
Texts[htTexts(TextSongName)].Visible = false; Texts[TextSongName].Visible = false;
} }
} }
@@ -1200,32 +1200,32 @@ namespace Vocaluxe.Screens
float t = _TimerDuetText1.ElapsedMilliseconds / 1000f; float t = _TimerDuetText1.ElapsedMilliseconds / 1000f;
if (t < 10f) if (t < 10f)
{ {
Texts[htTexts(TextDuetName1)].Visible = true; Texts[TextDuetName1].Visible = true;
if (t < 3f) if (t < 3f)
{ {
Texts[htTexts(TextDuetName1)].Color.A = (3f - (3f - t)) / 3f; Texts[TextDuetName1].Color.A = (3f - (3f - t)) / 3f;
} }
else if (t < 7f) else if (t < 7f)
{ {
Texts[htTexts(TextDuetName1)].Color.A = 1f; Texts[TextDuetName1].Color.A = 1f;
} }
else else
{ {
Texts[htTexts(TextDuetName1)].Color.A = (3f - (t - 7f)) / 3f; Texts[TextDuetName1].Color.A = (3f - (t - 7f)) / 3f;
} }
} }
else else
{ {
Texts[htTexts(TextDuetName1)].Visible = false; Texts[TextDuetName1].Visible = false;
_TimerDuetText1.Stop(); _TimerDuetText1.Stop();
} }
} }
else if (!_TimerDuetText1.IsRunning && _TimerDuetText1.ElapsedMilliseconds == 0 && Lyrics[htLyrics(LyricMainDuet)].Alpha > 0 && CGame.GetSong().IsDuet) else if (!_TimerDuetText1.IsRunning && _TimerDuetText1.ElapsedMilliseconds == 0 && Lyrics[LyricMainDuet].Alpha > 0 && CGame.GetSong().IsDuet)
_TimerDuetText1.Start(); _TimerDuetText1.Start();
else else
{ {
Texts[htTexts(TextDuetName1)].Visible = false; Texts[TextDuetName1].Visible = false;
} }
//Timer for second duet-part //Timer for second duet-part
if (_TimerDuetText2.IsRunning) if (_TimerDuetText2.IsRunning)
@@ -1233,32 +1233,32 @@ namespace Vocaluxe.Screens
float t = _TimerDuetText2.ElapsedMilliseconds / 1000f; float t = _TimerDuetText2.ElapsedMilliseconds / 1000f;
if (t < 10f) if (t < 10f)
{ {
Texts[htTexts(TextDuetName2)].Visible = true; Texts[TextDuetName2].Visible = true;
if (t < 3f) if (t < 3f)
{ {
Texts[htTexts(TextDuetName2)].Color.A = (3f - (3f - t)) / 3f; Texts[TextDuetName2].Color.A = (3f - (3f - t)) / 3f;
} }
else if (t < 7f) else if (t < 7f)
{ {
Texts[htTexts(TextDuetName2)].Color.A = 1f; Texts[TextDuetName2].Color.A = 1f;
} }
else else
{ {
Texts[htTexts(TextDuetName2)].Color.A = (3f - (t - 7f)) / 3f; Texts[TextDuetName2].Color.A = (3f - (t - 7f)) / 3f;
} }
} }
else else
{ {
Texts[htTexts(TextDuetName2)].Visible = false; Texts[TextDuetName2].Visible = false;
_TimerDuetText2.Stop(); _TimerDuetText2.Stop();
} }
} }
else if (!_TimerDuetText2.IsRunning && _TimerDuetText2.ElapsedMilliseconds == 0 && Lyrics[htLyrics(LyricMain)].Alpha > 0 && CGame.GetSong().IsDuet) else if (!_TimerDuetText2.IsRunning && _TimerDuetText2.ElapsedMilliseconds == 0 && Lyrics[LyricMain].Alpha > 0 && CGame.GetSong().IsDuet)
_TimerDuetText2.Start(); _TimerDuetText2.Start();
else else
{ {
Texts[htTexts(TextDuetName2)].Visible = false; Texts[TextDuetName2].Visible = false;
} }
} }
} }
@@ -1286,19 +1286,19 @@ namespace Vocaluxe.Screens
case ETimerMode.TR_CONFIG_TIMERMODE_CURRENT: case ETimerMode.TR_CONFIG_TIMERMODE_CURRENT:
int min = (int)Math.Floor(CurrentTime / 60f); int min = (int)Math.Floor(CurrentTime / 60f);
int sec = (int)(CurrentTime - min * 60f); int sec = (int)(CurrentTime - min * 60f);
Texts[htTexts(TextTime)].Text = min.ToString("00") + ":" + sec.ToString("00"); Texts[TextTime].Text = min.ToString("00") + ":" + sec.ToString("00");
break; break;
case ETimerMode.TR_CONFIG_TIMERMODE_REMAINING: case ETimerMode.TR_CONFIG_TIMERMODE_REMAINING:
min = (int)Math.Floor(RemainingTime / 60f); min = (int)Math.Floor(RemainingTime / 60f);
sec = (int)(RemainingTime - min * 60f); sec = (int)(RemainingTime - min * 60f);
Texts[htTexts(TextTime)].Text = "-" + min.ToString("00") + ":" + sec.ToString("00"); Texts[TextTime].Text = "-" + min.ToString("00") + ":" + sec.ToString("00");
break; break;
case ETimerMode.TR_CONFIG_TIMERMODE_TOTAL: case ETimerMode.TR_CONFIG_TIMERMODE_TOTAL:
min = (int)Math.Floor(TotalTime / 60f); min = (int)Math.Floor(TotalTime / 60f);
sec = (int)(TotalTime - min * 60f); sec = (int)(TotalTime - min * 60f);
Texts[htTexts(TextTime)].Text = "#" + min.ToString("00") + ":" + sec.ToString("00"); Texts[TextTime].Text = "#" + min.ToString("00") + ":" + sec.ToString("00");
break; break;
} }
@@ -1306,44 +1306,44 @@ namespace Vocaluxe.Screens
switch (CConfig.TimerLook) switch (CConfig.TimerLook)
{ {
case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL: case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL:
_TimeLineRect.W = Statics[htStatics(StaticTimeLine)].Rect.W * (CurrentTime / TotalTime); _TimeLineRect.W = Statics[StaticTimeLine].Rect.W * (CurrentTime / TotalTime);
break; break;
case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED: case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED:
CStatic stat = Statics[htStatics(StaticTimeLine)]; CStatic stat = Statics[StaticTimeLine];
int CurrentBeat = CGame.CurrentBeat; int CurrentBeat = CGame.CurrentBeat;
for (int i = 0; i < _TimeRects.Count; i++) for (int i = 0; i < _TimeRects.Count; i++)
{ {
if (CurrentBeat >= _TimeRects[i].startBeat && CurrentBeat <= _TimeRects[i].endBeat) if (CurrentBeat >= _TimeRects[i].startBeat && CurrentBeat <= _TimeRects[i].endBeat)
{ {
_TimeRects[i].rect.Texture = Statics[htStatics(StaticTimeLineExpandedHighlighted)].Texture; _TimeRects[i].rect.Texture = Statics[StaticTimeLineExpandedHighlighted].Texture;
_TimeRects[i].rect.Color = Statics[htStatics(StaticTimeLineExpandedHighlighted)].Color; _TimeRects[i].rect.Color = Statics[StaticTimeLineExpandedHighlighted].Color;
} }
else else
{ {
_TimeRects[i].rect.Texture = Statics[htStatics(StaticTimeLineExpandedNormal)].Texture; _TimeRects[i].rect.Texture = Statics[StaticTimeLineExpandedNormal].Texture;
_TimeRects[i].rect.Color = Statics[htStatics(StaticTimeLineExpandedNormal)].Color; _TimeRects[i].rect.Color = Statics[StaticTimeLineExpandedNormal].Color;
} }
} }
Statics[htStatics(StaticTimePointer)].Rect.X = stat.Rect.X + stat.Rect.W * (CurrentTime / TotalTime); Statics[StaticTimePointer].Rect.X = stat.Rect.X + stat.Rect.W * (CurrentTime / TotalTime);
break; break;
} }
} }
private void PrepareTimeLine() private void PrepareTimeLine()
{ {
CStatic stat = Statics[htStatics(StaticTimeLine)]; CStatic stat = Statics[StaticTimeLine];
switch (CConfig.TimerLook) switch (CConfig.TimerLook)
{ {
case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL: case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL:
_TimeLineRect = new SRectF(stat.Rect.X, stat.Rect.Y, 0f, stat.Rect.H, stat.Rect.Z); _TimeLineRect = new SRectF(stat.Rect.X, stat.Rect.Y, 0f, stat.Rect.H, stat.Rect.Z);
Statics[htStatics(StaticTimePointer)].Visible = false; Statics[StaticTimePointer].Visible = false;
break; break;
case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED: case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED:
_TimeRects.Clear(); _TimeRects.Clear();
Statics[htStatics(StaticTimePointer)].Visible = true; Statics[StaticTimePointer].Visible = true;
CSong song = CGame.GetSong(); CSong song = CGame.GetSong();
@@ -1394,11 +1394,11 @@ namespace Vocaluxe.Screens
{ {
if (CGame.Player[i].ProfileID > -1) if (CGame.Player[i].ProfileID > -1)
{ {
Statics[htStatics(StaticAvatars[i, CGame.NumPlayer - 1])].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture; Statics[StaticAvatars[i, CGame.NumPlayer - 1]].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture;
} }
else else
{ {
Statics[htStatics(StaticAvatars[i, CGame.NumPlayer - 1])].Visible = false; Statics[StaticAvatars[i, CGame.NumPlayer - 1]].Visible = false;
} }
} }
} }
@@ -1409,11 +1409,11 @@ namespace Vocaluxe.Screens
{ {
if (CGame.Player[i].ProfileID > -1) if (CGame.Player[i].ProfileID > -1)
{ {
Texts[htTexts(TextNames[i, CGame.NumPlayer - 1])].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName; Texts[TextNames[i, CGame.NumPlayer - 1]].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName;
} }
else else
{ {
Texts[htTexts(TextNames[i, CGame.NumPlayer - 1])].Visible = false; Texts[TextNames[i, CGame.NumPlayer - 1]].Visible = false;
} }
} }
} }
+214 -214
View File
@@ -131,11 +131,11 @@ namespace Vocaluxe.Screens
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
Playlists[htPlaylists(Playlist)].Visible = false; Playlists[Playlist].Visible = false;
DragAndDropCover = GetNewStatic(); DragAndDropCover = GetNewStatic();
Playlists[htPlaylists(Playlist)].Init(); Playlists[Playlist].Init();
_AvailableGameModes.Clear(); _AvailableGameModes.Clear();
@@ -150,7 +150,7 @@ namespace Vocaluxe.Screens
if (_PlaylistActive) if (_PlaylistActive)
{ {
Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent); Playlists[Playlist].HandleInput(KeyEvent);
return true; return true;
} }
@@ -168,7 +168,7 @@ namespace Vocaluxe.Screens
} }
else else
{ {
SongMenus[htSongMenus(SongMenu)].HandleInput(ref KeyEvent, _sso); SongMenus[SongMenu].HandleInput(ref KeyEvent, _sso);
UpdatePartyModeOptions(); UpdatePartyModeOptions();
if (KeyEvent.Handled) if (KeyEvent.Handled)
@@ -194,21 +194,21 @@ namespace Vocaluxe.Screens
{ {
if (i < _sso.Selection.NumJokers.Length) if (i < _sso.Selection.NumJokers.Length)
{ {
if (Buttons[htButtons(ButtonsJoker[i])].Selected) if (Buttons[ButtonsJoker[i]].Selected)
{ {
SelectNextRandom(i); SelectNextRandom(i);
return true; return true;
} }
} }
} }
if (Buttons[htButtons(ButtonStart)].Selected) if (Buttons[ButtonStart].Selected)
{ {
HandlePartySongSelection(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); HandlePartySongSelection(SongMenus[SongMenu].GetSelectedSong());
} }
} }
if (CSongs.NumVisibleSongs > 0 && !_sso.Selection.PartyMode) if (CSongs.NumVisibleSongs > 0 && !_sso.Selection.PartyMode)
{ {
if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive) if (SongMenus[SongMenu].GetSelectedSong() != -1 && !_SongOptionsActive)
{ {
if (!_sso.Selection.PartyMode) if (!_sso.Selection.PartyMode)
ToggleSongOptions(ESongOptionsView.Song); ToggleSongOptions(ESongOptionsView.Song);
@@ -217,11 +217,11 @@ namespace Vocaluxe.Screens
break; break;
case Keys.Tab: case Keys.Tab:
if (Playlists[htPlaylists(Playlist)].Visible) if (Playlists[Playlist].Visible)
{ {
_PlaylistActive = !_PlaylistActive; _PlaylistActive = !_PlaylistActive;
Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; Playlists[Playlist].Selected = _PlaylistActive;
SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); SongMenus[SongMenu].SetActive(!_PlaylistActive);
} }
break; break;
@@ -273,7 +273,7 @@ namespace Vocaluxe.Screens
case Keys.S: case Keys.S:
if (KeyEvent.Mod == EModifier.Ctrl && CSongs.NumVisibleSongs > 0 && !_sso.Selection.PartyMode) if (KeyEvent.Mod == EModifier.Ctrl && CSongs.NumVisibleSongs > 0 && !_sso.Selection.PartyMode)
StartMedleySong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); StartMedleySong(SongMenus[SongMenu].GetSelectedSong());
break; break;
case Keys.D1: case Keys.D1:
@@ -308,51 +308,51 @@ namespace Vocaluxe.Screens
switch (KeyEvent.Key) switch (KeyEvent.Key)
{ {
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonOptionsClose)].Selected) if (Buttons[ButtonOptionsClose].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
} }
else if (Buttons[htButtons(ButtonOptionsSing)].Selected) else if (Buttons[ButtonOptionsSing].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); StartSong(SongMenus[SongMenu].GetSelectedSong());
} }
else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) else if (Buttons[ButtonOptionsPlaylist].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
OpenAndAddPlaylistAction(); OpenAndAddPlaylistAction();
} }
else if (Buttons[htButtons(ButtonOptionsRandom)].Selected) else if (Buttons[ButtonOptionsRandom].Selected)
{ {
if (CSongs.IsInCategory) if (CSongs.IsInCategory)
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); SongMenus[SongMenu].SetSelectedSong(CSongs.GetRandomSong());
else else
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory()); SongMenus[SongMenu].SetSelectedCategory(CSongs.GetRandomCategory());
} }
else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected) else if (Buttons[ButtonOptionsSingAll].Selected)
{ {
StartRandomAllSongs(); StartRandomAllSongs();
} }
else if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected) else if (Buttons[ButtonOptionsSingAllVisible].Selected)
{ {
StartRandomVisibleSongs(); StartRandomVisibleSongs();
} }
else if (Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Selected) else if (Buttons[ButtonOptionsOpenSelectedItem].Selected)
{ {
_HandleSelectButton(); _HandleSelectButton();
} }
else if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selected) else if (SelectSlides[SelectSlideOptionsPlaylistOpen].Selected)
{ {
OpenPlaylistAction(); OpenPlaylistAction();
} }
else if (Buttons[htButtons(ButtonOptionsRandomMedley)].Selected) else if (Buttons[ButtonOptionsRandomMedley].Selected)
{ {
ToggleSongOptions(ESongOptionsView.Medley); ToggleSongOptions(ESongOptionsView.Medley);
} }
else if (Buttons[htButtons(ButtonOptionsStartMedley)].Selected) else if (Buttons[ButtonOptionsStartMedley].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartRandomMedley(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Selection + 1, !CSongs.IsInCategory); StartRandomMedley(SelectSlides[SelectSlideOptionsNumMedleySongs].Selection + 1, !CSongs.IsInCategory);
} }
break; break;
@@ -396,24 +396,24 @@ namespace Vocaluxe.Screens
OldMousePosX = MouseEvent.X; OldMousePosX = MouseEvent.X;
OldMousePosY = MouseEvent.Y; OldMousePosY = MouseEvent.Y;
if (Playlists[htPlaylists(Playlist)].Visible && Playlists[htPlaylists(Playlist)].IsMouseOver(MouseEvent)) if (Playlists[Playlist].Visible && Playlists[Playlist].IsMouseOver(MouseEvent))
{ {
_PlaylistActive = true; _PlaylistActive = true;
Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; Playlists[Playlist].Selected = _PlaylistActive;
SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); SongMenus[SongMenu].SetActive(!_PlaylistActive);
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
} }
else if (CHelper.IsInBounds(SongMenus[htSongMenus(SongMenu)].Rect, MouseEvent.X, MouseEvent.Y)) else if (CHelper.IsInBounds(SongMenus[SongMenu].Rect, MouseEvent.X, MouseEvent.Y))
{ {
_PlaylistActive = false; _PlaylistActive = false;
Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; Playlists[Playlist].Selected = _PlaylistActive;
SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); SongMenus[SongMenu].SetActive(!_PlaylistActive);
} }
if (Playlists[htPlaylists(Playlist)].Visible && _PlaylistActive) if (Playlists[Playlist].Visible && _PlaylistActive)
{ {
if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent)) if (Playlists[Playlist].HandleMouse(MouseEvent))
{ {
return true; return true;
} }
@@ -452,15 +452,15 @@ namespace Vocaluxe.Screens
{ {
//TODO: Causes Bug if you select a song (e.g. with Select random song) and double click a normal button. //TODO: Causes Bug if you select a song (e.g. with Select random song) and double click a normal button.
//E.g. clicking to fast on Select random song starts the next random song. is this OK? //E.g. clicking to fast on Select random song starts the next random song. is this OK?
if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1) if (CSongs.NumVisibleSongs > 0 && SongMenus[SongMenu].GetActualSelection() != -1)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartVisibleSong(SongMenus[htSongMenus(SongMenu)].GetActualSelection()); StartVisibleSong(SongMenus[SongMenu].GetActualSelection());
return true; return true;
} }
} }
SongMenus[htSongMenus(SongMenu)].HandleMouse(ref MouseEvent, _sso); SongMenus[SongMenu].HandleMouse(ref MouseEvent, _sso);
UpdatePartyModeOptions(); UpdatePartyModeOptions();
if (MouseEvent.Handled) if (MouseEvent.Handled)
@@ -470,80 +470,80 @@ namespace Vocaluxe.Screens
{ {
if (IsMouseOver(MouseEvent)) if (IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonOpenOptions)].Selected) if (Buttons[ButtonOpenOptions].Selected)
{ {
ToggleSongOptions(ESongOptionsView.General); ToggleSongOptions(ESongOptionsView.General);
return true; return true;
} else if (Buttons[htButtons(ButtonOptionsClose)].Selected) } else if (Buttons[ButtonOptionsClose].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
return true; return true;
} else if (Buttons[htButtons(ButtonOptionsSing)].Selected) } else if (Buttons[ButtonOptionsSing].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); StartSong(SongMenus[SongMenu].GetSelectedSong());
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) else if (Buttons[ButtonOptionsPlaylist].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
OpenAndAddPlaylistAction(); OpenAndAddPlaylistAction();
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsRandom)].Selected) else if (Buttons[ButtonOptionsRandom].Selected)
{ {
if (CSongs.IsInCategory) if (CSongs.IsInCategory)
{ {
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); SongMenus[SongMenu].SetSelectedSong(CSongs.GetRandomSong());
return true; return true;
} }
} }
else if (Buttons[htButtons(ButtonOptionsRandomCategory)].Selected) else if (Buttons[ButtonOptionsRandomCategory].Selected)
{ {
if (!CSongs.IsInCategory) if (!CSongs.IsInCategory)
{ {
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory()); SongMenus[SongMenu].SetSelectedCategory(CSongs.GetRandomCategory());
return true; return true;
} }
} }
else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected) else if (Buttons[ButtonOptionsSingAll].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartRandomAllSongs(); StartRandomAllSongs();
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected) else if (Buttons[ButtonOptionsSingAllVisible].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartRandomVisibleSongs(); StartRandomVisibleSongs();
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Selected) else if (Buttons[ButtonOptionsOpenSelectedItem].Selected)
{ {
_HandleSelectButton(); _HandleSelectButton();
return true; return true;
} }
else if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].ValueSelected) else if (SelectSlides[SelectSlideOptionsPlaylistOpen].ValueSelected)
{ {
OpenPlaylistAction(); OpenPlaylistAction();
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsRandomMedley)].Selected) else if (Buttons[ButtonOptionsRandomMedley].Selected)
{ {
ToggleSongOptions(ESongOptionsView.Medley); ToggleSongOptions(ESongOptionsView.Medley);
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsStartMedley)].Selected) else if (Buttons[ButtonOptionsStartMedley].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartRandomMedley(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Selection + 1, !CSongs.IsInCategory); StartRandomMedley(SelectSlides[SelectSlideOptionsNumMedleySongs].Selection + 1, !CSongs.IsInCategory);
return true; return true;
} }
else if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null) else if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null)
{ {
if (Buttons[htButtons(ButtonStart)].Selected) if (Buttons[ButtonStart].Selected)
{ {
HandlePartySongSelection(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); HandlePartySongSelection(SongMenus[SongMenu].GetSelectedSong());
return true; return true;
} }
@@ -551,7 +551,7 @@ namespace Vocaluxe.Screens
{ {
if (i < _sso.Selection.NumJokers.Length) if (i < _sso.Selection.NumJokers.Length)
{ {
if (Buttons[htButtons(ButtonsJoker[i])].Selected) if (Buttons[ButtonsJoker[i]].Selected)
{ {
SelectNextRandom(i); SelectNextRandom(i);
return true; return true;
@@ -561,9 +561,9 @@ namespace Vocaluxe.Screens
} }
} }
if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1 && !_sso.Selection.PartyMode) if (CSongs.NumVisibleSongs > 0 && SongMenus[SongMenu].GetActualSelection() != -1 && !_sso.Selection.PartyMode)
{ {
if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive) if (SongMenus[SongMenu].GetSelectedSong() != -1 && !_SongOptionsActive)
{ {
ToggleSongOptions(ESongOptionsView.Song); ToggleSongOptions(ESongOptionsView.Song);
return true; return true;
@@ -578,11 +578,11 @@ namespace Vocaluxe.Screens
if (MouseEvent.LBH) if (MouseEvent.LBH)
{ {
if (!DragAndDropActive && Playlists[htPlaylists(Playlist)].Visible && CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1) if (!DragAndDropActive && Playlists[Playlist].Visible && CSongs.NumVisibleSongs > 0 && SongMenus[SongMenu].GetActualSelection() != -1)
{ {
DragAndDropCover = SongMenus[htSongMenus(SongMenu)].GetSelectedSongCover(); DragAndDropCover = SongMenus[SongMenu].GetSelectedSongCover();
DragAndDropCover.Rect.Z = CSettings.zNear; DragAndDropCover.Rect.Z = CSettings.zNear;
Playlists[htPlaylists(Playlist)].DragAndDropSongID = CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetActualSelection()].ID; Playlists[Playlist].DragAndDropSongID = CSongs.VisibleSongs[SongMenus[SongMenu].GetActualSelection()].ID;
DragAndDropActive = true; DragAndDropActive = true;
return true; return true;
} }
@@ -592,7 +592,7 @@ namespace Vocaluxe.Screens
if (!MouseEvent.LBH && DragAndDropActive) if (!MouseEvent.LBH && DragAndDropActive)
{ {
DragAndDropActive = false; DragAndDropActive = false;
Playlists[htPlaylists(Playlist)].DragAndDropSongID = -1; Playlists[Playlist].DragAndDropSongID = -1;
return true; return true;
} }
@@ -608,7 +608,7 @@ namespace Vocaluxe.Screens
else if(_sso.Selection.CategoryChangeAllowed) else if(_sso.Selection.CategoryChangeAllowed)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
SongMenus[htSongMenus(SongMenu)].EnterCurrentCategory(); SongMenus[SongMenu].EnterCurrentCategory();
} }
} }
@@ -625,7 +625,7 @@ namespace Vocaluxe.Screens
_SearchText = _sso.Sorting.SearchString; _SearchText = _sso.Sorting.SearchString;
CGame.EnterNormalGame(); CGame.EnterNormalGame();
SongMenus[htSongMenus(SongMenu)].OnShow(); SongMenus[SongMenu].OnShow();
if (_sso.Selection.PartyMode) if (_sso.Selection.PartyMode)
_PlaylistActive = false; _PlaylistActive = false;
@@ -633,56 +633,56 @@ namespace Vocaluxe.Screens
if (_sso.Selection.PartyMode) if (_sso.Selection.PartyMode)
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); SongMenus[SongMenu].SetActive(!_PlaylistActive);
SongMenus[htSongMenus(SongMenu)].SetSmallView(Playlists[htPlaylists(Playlist)].Visible); SongMenus[SongMenu].SetSmallView(Playlists[Playlist].Visible);
if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != -1) if (Playlists[Playlist].ActivePlaylistID != -1)
Playlists[htPlaylists(Playlist)].LoadPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); Playlists[Playlist].LoadPlaylist(Playlists[Playlist].ActivePlaylistID);
DragAndDropActive = false; DragAndDropActive = false;
Playlists[htPlaylists(Playlist)].DragAndDropSongID = -1; Playlists[Playlist].DragAndDropSongID = -1;
UpdateGame(); UpdateGame();
} }
public override bool UpdateGame() public override bool UpdateGame()
{ {
if (SongMenus[htSongMenus(SongMenu)].IsSmallView()) if (SongMenus[SongMenu].IsSmallView())
CheckPlaylist(); CheckPlaylist();
Texts[htTexts(TextCategory)].Text = CSongs.GetCurrentCategoryName(); Texts[TextCategory].Text = CSongs.GetCurrentCategoryName();
if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF)
CBackgroundMusic.Disabled = true; CBackgroundMusic.Disabled = true;
else else
CBackgroundMusic.Disabled = false; CBackgroundMusic.Disabled = false;
int song = SongMenus[htSongMenus(SongMenu)].GetActualSelection(); int song = SongMenus[SongMenu].GetActualSelection();
if ((CSongs.Category >= 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) && song >= 0 && song < CSongs.VisibleSongs.Length) if ((CSongs.Category >= 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) && song >= 0 && song < CSongs.VisibleSongs.Length)
{ {
Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title; Texts[TextSelection].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title;
} }
else if (!CSongs.IsInCategory && song >= 0 && song < CSongs.Categories.Length) else if (!CSongs.IsInCategory && song >= 0 && song < CSongs.Categories.Length)
{ {
Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name; Texts[TextSelection].Text = CSongs.Categories[song].Name;
} }
else else
Texts[htTexts(TextSelection)].Text = String.Empty; Texts[TextSelection].Text = String.Empty;
Texts[htTexts(TextSearchBar)].Text = _SearchText; Texts[TextSearchBar].Text = _SearchText;
if (_SearchActive) if (_SearchActive)
{ {
Texts[htTexts(TextSearchBar)].Text += '|'; Texts[TextSearchBar].Text += '|';
Texts[htTexts(TextSearchBar)].Visible = true; Texts[TextSearchBar].Visible = true;
Texts[htTexts(TextSearchBarTitle)].Visible = true; Texts[TextSearchBarTitle].Visible = true;
Statics[htStatics(StaticSearchBar)].Visible = true; Statics[StaticSearchBar].Visible = true;
} }
else else
{ {
Texts[htTexts(TextSearchBar)].Visible = false; Texts[TextSearchBar].Visible = false;
Texts[htTexts(TextSearchBarTitle)].Visible = false; Texts[TextSearchBarTitle].Visible = false;
Statics[htStatics(StaticSearchBar)].Visible = false; Statics[StaticSearchBar].Visible = false;
} }
UpdatePartyModeOptions(); UpdatePartyModeOptions();
@@ -704,12 +704,12 @@ namespace Vocaluxe.Screens
{ {
base.OnClose(); base.OnClose();
CBackgroundMusic.Disabled = false; CBackgroundMusic.Disabled = false;
SongMenus[htSongMenus(SongMenu)].OnHide(); SongMenus[SongMenu].OnHide();
} }
public override void ApplyVolume() public override void ApplyVolume()
{ {
SongMenus[htSongMenus(SongMenu)].ApplyVolume(CConfig.PreviewMusicVolume); SongMenus[SongMenu].ApplyVolume(CConfig.PreviewMusicVolume);
} }
private void HandlePartySongSelection(int SongNr) private void HandlePartySongSelection(int SongNr)
@@ -738,12 +738,12 @@ namespace Vocaluxe.Screens
SelectNextRandomSong(); SelectNextRandomSong();
if (_sso.Selection.SongIndex != -1) if (_sso.Selection.SongIndex != -1)
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(_sso.Selection.SongIndex); SongMenus[SongMenu].SetSelectedSong(_sso.Selection.SongIndex);
} }
if (SelectedSongID != SongMenus[htSongMenus(SongMenu)].GetSelectedSong() && CSongs.Category > -1) if (SelectedSongID != SongMenus[SongMenu].GetSelectedSong() && CSongs.Category > -1)
{ {
SelectedSongID = SongMenus[htSongMenus(SongMenu)].GetSelectedSong(); SelectedSongID = SongMenus[SongMenu].GetSelectedSong();
CParty.OnSongChange(SelectedSongID, ref _sso); CParty.OnSongChange(SelectedSongID, ref _sso);
} }
@@ -760,55 +760,55 @@ namespace Vocaluxe.Screens
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
} }
SongMenus[htSongMenus(SongMenu)].Update(_sso); SongMenus[SongMenu].Update(_sso);
if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null) if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null)
{ {
Buttons[htButtons(ButtonStart)].Visible = true; Buttons[ButtonStart].Visible = true;
if (!SongMenus[htSongMenus(SongMenu)].IsSmallView()) if (!SongMenus[SongMenu].IsSmallView())
SongMenus[htSongMenus(SongMenu)].SetSmallView(true); SongMenus[SongMenu].SetSmallView(true);
for (int i = 0; i < CMain.Settings.GetMaxNumPlayer(); i++) for (int i = 0; i < CMain.Settings.GetMaxNumPlayer(); i++)
{ {
if (i < _sso.Selection.NumJokers.Length) if (i < _sso.Selection.NumJokers.Length)
{ {
Buttons[htButtons(ButtonsJoker[i])].Visible = true; Buttons[ButtonsJoker[i]].Visible = true;
Buttons[htButtons(ButtonsJoker[i])].Text.Text = _sso.Selection.NumJokers[i].ToString(); Buttons[ButtonsJoker[i]].Text.Text = _sso.Selection.NumJokers[i].ToString();
Texts[htTexts(TextsPlayer[i])].Visible = true; Texts[TextsPlayer[i]].Visible = true;
bool NameExists = false; bool NameExists = false;
if (_sso.Selection.TeamNames != null) if (_sso.Selection.TeamNames != null)
{ {
if (_sso.Selection.TeamNames.Length > i) if (_sso.Selection.TeamNames.Length > i)
{ {
Texts[htTexts(TextsPlayer[i])].Text = _sso.Selection.TeamNames[i]; Texts[TextsPlayer[i]].Text = _sso.Selection.TeamNames[i];
NameExists = true; NameExists = true;
} }
} }
if (!NameExists) if (!NameExists)
Texts[htTexts(TextsPlayer[i])].Text = i.ToString(); Texts[TextsPlayer[i]].Text = i.ToString();
} }
else else
{ {
Buttons[htButtons(ButtonsJoker[i])].Visible = false; Buttons[ButtonsJoker[i]].Visible = false;
Texts[htTexts(TextsPlayer[i])].Visible = false; Texts[TextsPlayer[i]].Visible = false;
} }
} }
} }
else else
{ {
if (_sso.Selection.PartyMode && SongMenus[htSongMenus(SongMenu)].IsSmallView()) if (_sso.Selection.PartyMode && SongMenus[SongMenu].IsSmallView())
SongMenus[htSongMenus(SongMenu)].SetSmallView(false); SongMenus[SongMenu].SetSmallView(false);
for (int i = 0; i < CMain.Settings.GetMaxNumPlayer(); i++) for (int i = 0; i < CMain.Settings.GetMaxNumPlayer(); i++)
{ {
Buttons[htButtons(ButtonsJoker[i])].Visible = false; Buttons[ButtonsJoker[i]].Visible = false;
Texts[htTexts(TextsPlayer[i])].Visible = false; Texts[TextsPlayer[i]].Visible = false;
} }
Buttons[htButtons(ButtonStart)].Visible = false; Buttons[ButtonStart].Visible = false;
} }
} }
@@ -817,9 +817,9 @@ namespace Vocaluxe.Screens
if ((CSongs.Category >= 0) && (SongNr >= 0)) if ((CSongs.Category >= 0) && (SongNr >= 0))
{ {
EGameMode gm; EGameMode gm;
if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) if (_AvailableGameModes.Count >= SelectSlides[SelectSlideOptionsMode].Selection)
{ {
gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; gm = _AvailableGameModes[SelectSlides[SelectSlideOptionsMode].Selection];
} }
else else
{ {
@@ -1001,7 +1001,7 @@ namespace Vocaluxe.Screens
if (CSongs.IsInCategory) if (CSongs.IsInCategory)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); SongMenus[SongMenu].SetSelectedSong(CSongs.GetRandomSong());
return true; return true;
} }
return false; return false;
@@ -1012,7 +1012,7 @@ namespace Vocaluxe.Screens
if (!CSongs.IsInCategory) if (!CSongs.IsInCategory)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory()); SongMenus[SongMenu].SetSelectedCategory(CSongs.GetRandomCategory());
return true; return true;
} }
return false; return false;
@@ -1021,7 +1021,7 @@ namespace Vocaluxe.Screens
private void JumpTo(char Letter) private void JumpTo(char Letter)
{ {
int start = 0; int start = 0;
int curSelected = SongMenus[htSongMenus(SongMenu)].GetActualSelection(); int curSelected = SongMenus[SongMenu].GetActualSelection();
if (CSongs.IsInCategory) if (CSongs.IsInCategory)
{ {
//TODO: Check and use sorting method //TODO: Check and use sorting method
@@ -1037,7 +1037,7 @@ namespace Vocaluxe.Screens
if (visibleID < 0 && start > 1) if (visibleID < 0 && start > 1)
visibleID = Array.FindIndex<CSong>(Songs, 0, start - 1, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase)); visibleID = Array.FindIndex<CSong>(Songs, 0, start - 1, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID > -1) if (visibleID > -1)
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(visibleID); SongMenus[SongMenu].SetSelectedSong(visibleID);
} }
else else
{ {
@@ -1049,7 +1049,7 @@ namespace Vocaluxe.Screens
if (visibleID < 0 && start > 1) if (visibleID < 0 && start > 1)
visibleID = Array.FindIndex<CCategory>(Categories, 0, start - 1, element => element.Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase)); visibleID = Array.FindIndex<CCategory>(Categories, 0, start - 1, element => element.Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID > -1) if (visibleID > -1)
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(visibleID); SongMenus[SongMenu].SetSelectedCategory(visibleID);
} }
} }
@@ -1062,7 +1062,7 @@ namespace Vocaluxe.Screens
bool refresh = false; bool refresh = false;
_SearchText = NewFilterString; _SearchText = NewFilterString;
int SongIndex = SongMenus[htSongMenus(SongMenu)].GetSelectedSong(); int SongIndex = SongMenus[SongMenu].GetSelectedSong();
int SongID = -1; int SongID = -1;
if (SongIndex != -1 && CSongs.NumVisibleSongs > 0 && CSongs.NumVisibleSongs > SongIndex) if (SongIndex != -1 && CSongs.NumVisibleSongs > 0 && CSongs.NumVisibleSongs > SongIndex)
{ {
@@ -1087,30 +1087,30 @@ namespace Vocaluxe.Screens
refresh = true; refresh = true;
if (refresh) if (refresh)
SongMenus[htSongMenus(SongMenu)].OnHide(); SongMenus[SongMenu].OnHide();
SongMenus[htSongMenus(SongMenu)].OnShow(); SongMenus[SongMenu].OnShow();
} }
private void ToggleSongOptions(ESongOptionsView view) private void ToggleSongOptions(ESongOptionsView view)
{ {
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; SelectSlides[SelectSlideOptionsMode].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false; SelectSlides[SelectSlideOptionsPlaylistAdd].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false; SelectSlides[SelectSlideOptionsPlaylistOpen].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Visible = false; SelectSlides[SelectSlideOptionsNumMedleySongs].Visible = false;
Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[ButtonOptionsClose].Visible = false;
Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[ButtonOptionsSing].Visible = false;
Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; Buttons[ButtonOptionsPlaylist].Visible = false;
Buttons[htButtons(ButtonOptionsRandom)].Visible = false; Buttons[ButtonOptionsRandom].Visible = false;
Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = false; Buttons[ButtonOptionsRandomCategory].Visible = false;
Buttons[htButtons(ButtonOptionsSingAll)].Visible = false; Buttons[ButtonOptionsSingAll].Visible = false;
Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false; Buttons[ButtonOptionsSingAllVisible].Visible = false;
Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Visible = false; Buttons[ButtonOptionsOpenSelectedItem].Visible = false;
Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = false; Buttons[ButtonOptionsRandomMedley].Visible = false;
Buttons[htButtons(ButtonOptionsStartMedley)].Visible = false; Buttons[ButtonOptionsStartMedley].Visible = false;
Texts[htTexts(TextOptionsTitle)].Visible = false; Texts[TextOptionsTitle].Visible = false;
Statics[htStatics(StaticOptionsBG)].Visible = false; Statics[StaticOptionsBG].Visible = false;
Buttons[htButtons(ButtonOpenOptions)].Visible = true; Buttons[ButtonOpenOptions].Visible = true;
_SongOptionsActive = view != ESongOptionsView.None; _SongOptionsActive = view != ESongOptionsView.None;
@@ -1119,10 +1119,10 @@ namespace Vocaluxe.Screens
//Has to be done here otherwhise changed playlist names will not appear until OnShow is called! //Has to be done here otherwhise changed playlist names will not appear until OnShow is called!
UpdatePlaylistNames(); UpdatePlaylistNames();
Texts[htTexts(TextOptionsTitle)].Visible = true; Texts[TextOptionsTitle].Visible = true;
Buttons[htButtons(ButtonOptionsClose)].Visible = true; Buttons[ButtonOptionsClose].Visible = true;
Statics[htStatics(StaticOptionsBG)].Visible = true; Statics[StaticOptionsBG].Visible = true;
Buttons[htButtons(ButtonOpenOptions)].Visible = false; Buttons[ButtonOpenOptions].Visible = false;
if (view == ESongOptionsView.Song) if (view == ESongOptionsView.Song)
_ShowSongOptionsSong(); _ShowSongOptionsSong();
else if (view == ESongOptionsView.General) else if (view == ESongOptionsView.General)
@@ -1136,92 +1136,92 @@ namespace Vocaluxe.Screens
{ {
EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL; EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL;
if (_AvailableGameModes.Count > 0) if (_AvailableGameModes.Count > 0)
LastMode = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; LastMode = _AvailableGameModes[SelectSlides[SelectSlideOptionsMode].Selection];
SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); SetInteractionToButton(Buttons[ButtonOptionsSing]);
_AvailableGameModes.Clear(); _AvailableGameModes.Clear();
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear(); SelectSlides[SelectSlideOptionsMode].Clear();
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) if (CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].IsDuet)
{ {
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_DUET)); SelectSlides[SelectSlideOptionsMode].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_DUET));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_DUET); _AvailableGameModes.Add(EGameMode.TR_GAMEMODE_DUET);
} }
else else
{ {
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_NORMAL)); SelectSlides[SelectSlideOptionsMode].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_NORMAL));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_NORMAL); _AvailableGameModes.Add(EGameMode.TR_GAMEMODE_NORMAL);
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_SHORTSONG)); SelectSlides[SelectSlideOptionsMode].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_SHORTSONG));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_SHORTSONG); _AvailableGameModes.Add(EGameMode.TR_GAMEMODE_SHORTSONG);
} }
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].Medley.Source != EMedleySource.None) if (CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].Medley.Source != EMedleySource.None)
{ {
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_MEDLEY)); SelectSlides[SelectSlideOptionsMode].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_MEDLEY));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_MEDLEY); _AvailableGameModes.Add(EGameMode.TR_GAMEMODE_MEDLEY);
} }
//Set SelectSlide-Selection to last selected game-mode if possible //Set SelectSlide-Selection to last selected game-mode if possible
for (int i = 0; i < _AvailableGameModes.Count; i++) for (int i = 0; i < _AvailableGameModes.Count; i++)
{ {
if (_AvailableGameModes[i] == LastMode) if (_AvailableGameModes[i] == LastMode)
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].SetSelectionByValueIndex(i); SelectSlides[SelectSlideOptionsMode].SetSelectionByValueIndex(i);
} }
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; SelectSlides[SelectSlideOptionsMode].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = true; SelectSlides[SelectSlideOptionsPlaylistAdd].Visible = true;
Buttons[htButtons(ButtonOptionsSing)].Visible = true; Buttons[ButtonOptionsSing].Visible = true;
Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true; Buttons[ButtonOptionsPlaylist].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); SetInteractionToButton(Buttons[ButtonOptionsSing]);
} }
private void _ShowSongOptionsGeneral() private void _ShowSongOptionsGeneral()
{ {
if (CSongs.IsInCategory) if (CSongs.IsInCategory)
{ {
Buttons[htButtons(ButtonOptionsRandom)].Visible = true; Buttons[ButtonOptionsRandom].Visible = true;
Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = true; Buttons[ButtonOptionsSingAllVisible].Visible = true;
} }
else else
Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = true; Buttons[ButtonOptionsRandomCategory].Visible = true;
Buttons[htButtons(ButtonOptionsSingAll)].Visible = true; Buttons[ButtonOptionsSingAll].Visible = true;
Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = true; Buttons[ButtonOptionsRandomMedley].Visible = true;
Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Visible = true; Buttons[ButtonOptionsOpenSelectedItem].Visible = true;
if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues > 0) if (SelectSlides[SelectSlideOptionsPlaylistOpen].NumValues > 0)
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = true; SelectSlides[SelectSlideOptionsPlaylistOpen].Visible = true;
if (Buttons[htButtons(ButtonOptionsRandom)].Visible) if (Buttons[ButtonOptionsRandom].Visible)
SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandom)]); SetInteractionToButton(Buttons[ButtonOptionsRandom]);
else else
SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandomCategory)]); SetInteractionToButton(Buttons[ButtonOptionsRandomCategory]);
} }
private void _ShowSongOptionsMedley() private void _ShowSongOptionsMedley()
{ {
Buttons[htButtons(ButtonOptionsStartMedley)].Visible = true; Buttons[ButtonOptionsStartMedley].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Visible = true; SelectSlides[SelectSlideOptionsNumMedleySongs].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Clear(); SelectSlides[SelectSlideOptionsNumMedleySongs].Clear();
if (CSongs.IsInCategory) if (CSongs.IsInCategory)
{ {
for (int i = 1; i <= CSongs.VisibleSongs.Length; i++) for (int i = 1; i <= CSongs.VisibleSongs.Length; i++)
{ {
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].AddValue(i.ToString()); SelectSlides[SelectSlideOptionsNumMedleySongs].AddValue(i.ToString());
} }
} }
else else
{ {
for (int i = 1; i <= CSongs.AllSongs.Length; i++) for (int i = 1; i <= CSongs.AllSongs.Length; i++)
{ {
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].AddValue(i.ToString()); SelectSlides[SelectSlideOptionsNumMedleySongs].AddValue(i.ToString());
} }
} }
if (SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].NumValues >= 5) if (SelectSlides[SelectSlideOptionsNumMedleySongs].NumValues >= 5)
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].SetSelectionByValueIndex(4); SelectSlides[SelectSlideOptionsNumMedleySongs].SetSelectionByValueIndex(4);
else else
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].SetSelectionByValueIndex(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].NumValues - 1); SelectSlides[SelectSlideOptionsNumMedleySongs].SetSelectionByValueIndex(SelectSlides[SelectSlideOptionsNumMedleySongs].NumValues - 1);
SetInteractionToButton(Buttons[htButtons(ButtonOptionsStartMedley)]); SetInteractionToButton(Buttons[ButtonOptionsStartMedley]);
} }
#region Playlist Actions #region Playlist Actions
public void CheckPlaylist() public void CheckPlaylist()
{ {
if (Playlists[htPlaylists(Playlist)].ActivePlaylistID == -1 && _PlaylistActive) if (Playlists[Playlist].ActivePlaylistID == -1 && _PlaylistActive)
ClosePlaylist(); ClosePlaylist();
} }
@@ -1229,101 +1229,101 @@ namespace Vocaluxe.Screens
{ {
if (CPlaylists.Playlists.Length > PlaylistID && PlaylistID > -1) if (CPlaylists.Playlists.Length > PlaylistID && PlaylistID > -1)
{ {
Playlists[htPlaylists(Playlist)].LoadPlaylist(PlaylistID); Playlists[Playlist].LoadPlaylist(PlaylistID);
SongMenus[htSongMenus(SongMenu)].SetSmallView(true); SongMenus[SongMenu].SetSmallView(true);
Playlists[htPlaylists(Playlist)].Visible = true; Playlists[Playlist].Visible = true;
} }
} }
private void ClosePlaylist() private void ClosePlaylist()
{ {
if (Playlists[htPlaylists(Playlist)].Visible || _PlaylistActive) if (Playlists[Playlist].Visible || _PlaylistActive)
{ {
SongMenus[htSongMenus(SongMenu)].SetSmallView(false); SongMenus[SongMenu].SetSmallView(false);
_PlaylistActive = false; _PlaylistActive = false;
Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; Playlists[Playlist].Selected = _PlaylistActive;
SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); SongMenus[SongMenu].SetActive(!_PlaylistActive);
Playlists[htPlaylists(Playlist)].ClosePlaylist(); Playlists[Playlist].ClosePlaylist();
} }
} }
private void UpdatePlaylistNames() private void UpdatePlaylistNames()
{ {
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Clear(); SelectSlides[SelectSlideOptionsPlaylistAdd].Clear();
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValue("TR_SCREENSONG_NEWPLAYLIST"); SelectSlides[SelectSlideOptionsPlaylistAdd].AddValue("TR_SCREENSONG_NEWPLAYLIST");
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValues(CPlaylists.PlaylistNames); SelectSlides[SelectSlideOptionsPlaylistAdd].AddValues(CPlaylists.PlaylistNames);
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Clear(); SelectSlides[SelectSlideOptionsPlaylistOpen].Clear();
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].AddValues(CPlaylists.PlaylistNames); SelectSlides[SelectSlideOptionsPlaylistOpen].AddValues(CPlaylists.PlaylistNames);
} }
private void OpenPlaylistAction() private void OpenPlaylistAction()
{ {
//Open a playlist //Open a playlist
if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection)) if (Playlists[Playlist].ActivePlaylistID != (SelectSlides[SelectSlideOptionsPlaylistOpen].Selection))
{ {
Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selection; Playlists[Playlist].ActivePlaylistID = SelectSlides[SelectSlideOptionsPlaylistOpen].Selection;
SetSelectSlidePlaylistToCurrentPlaylist(); SetSelectSlidePlaylistToCurrentPlaylist();
//Open playlist //Open playlist
OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); OpenPlaylist(Playlists[Playlist].ActivePlaylistID);
} }
} }
private void OpenAndAddPlaylistAction() private void OpenAndAddPlaylistAction()
{ {
//Open an existing playlist and add song //Open an existing playlist and add song
if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1) && (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1) != -1) if (Playlists[Playlist].ActivePlaylistID != (SelectSlides[SelectSlideOptionsPlaylistAdd].Selection - 1) && (SelectSlides[SelectSlideOptionsPlaylistAdd].Selection - 1) != -1)
{ {
//Check selected game-mode //Check selected game-mode
EGameMode gm; EGameMode gm;
if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) if (_AvailableGameModes.Count >= SelectSlides[SelectSlideOptionsMode].Selection)
gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; gm = _AvailableGameModes[SelectSlides[SelectSlideOptionsMode].Selection];
else else
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) if (CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].IsDuet)
gm = EGameMode.TR_GAMEMODE_DUET; gm = EGameMode.TR_GAMEMODE_DUET;
else else
gm = EGameMode.TR_GAMEMODE_NORMAL; gm = EGameMode.TR_GAMEMODE_NORMAL;
//Check if Playlist really exists //Check if Playlist really exists
if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1 >= 0) if (SelectSlides[SelectSlideOptionsPlaylistAdd].Selection - 1 >= 0)
{ {
Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1; Playlists[Playlist].ActivePlaylistID = SelectSlides[SelectSlideOptionsPlaylistAdd].Selection - 1;
//Add song to playlist //Add song to playlist
CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); CPlaylists.Playlists[Playlists[Playlist].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].ID, gm);
//Open playlist //Open playlist
OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); OpenPlaylist(Playlists[Playlist].ActivePlaylistID);
SetSelectSlidePlaylistToCurrentPlaylist(); SetSelectSlidePlaylistToCurrentPlaylist();
Playlists[htPlaylists(Playlist)].ScrollToBottom(); Playlists[Playlist].ScrollToBottom();
} }
} }
//Create a new playlist and add song //Create a new playlist and add song
else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection - 1) == -1) else if ((SelectSlides[SelectSlideOptionsPlaylistAdd].Selection - 1) == -1)
{ {
//Check selected game-mode //Check selected game-mode
EGameMode gm; EGameMode gm;
if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) if (_AvailableGameModes.Count >= SelectSlides[SelectSlideOptionsMode].Selection)
gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; gm = _AvailableGameModes[SelectSlides[SelectSlideOptionsMode].Selection];
else else
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) if (CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].IsDuet)
gm = EGameMode.TR_GAMEMODE_DUET; gm = EGameMode.TR_GAMEMODE_DUET;
else else
gm = EGameMode.TR_GAMEMODE_NORMAL; gm = EGameMode.TR_GAMEMODE_NORMAL;
//Create new playlist //Create new playlist
Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); Playlists[Playlist].ActivePlaylistID = CPlaylists.NewPlaylist();
//Add song to playlist //Add song to playlist
CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); CPlaylists.Playlists[Playlists[Playlist].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].ID, gm);
//Open playlist //Open playlist
OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); OpenPlaylist(Playlists[Playlist].ActivePlaylistID);
//Add new playlist to select-slide //Add new playlist to select-slide
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); SelectSlides[SelectSlideOptionsPlaylistAdd].AddValue(CPlaylists.Playlists[Playlists[Playlist].ActivePlaylistID].PlaylistName);
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); SelectSlides[SelectSlideOptionsPlaylistOpen].AddValue(CPlaylists.Playlists[Playlists[Playlist].ActivePlaylistID].PlaylistName);
SetSelectSlidePlaylistToCurrentPlaylist(); SetSelectSlidePlaylistToCurrentPlaylist();
@@ -1333,25 +1333,25 @@ namespace Vocaluxe.Screens
{ {
//Check selected game-mode //Check selected game-mode
EGameMode gm; EGameMode gm;
if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) if (_AvailableGameModes.Count >= SelectSlides[SelectSlideOptionsMode].Selection)
gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; gm = _AvailableGameModes[SelectSlides[SelectSlideOptionsMode].Selection];
else else
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) if (CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].IsDuet)
gm = EGameMode.TR_GAMEMODE_DUET; gm = EGameMode.TR_GAMEMODE_DUET;
else else
gm = EGameMode.TR_GAMEMODE_NORMAL; gm = EGameMode.TR_GAMEMODE_NORMAL;
CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); CPlaylists.Playlists[Playlists[Playlist].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].ID, gm);
Playlists[htPlaylists(Playlist)].UpdatePlaylist(); Playlists[Playlist].UpdatePlaylist();
Playlists[htPlaylists(Playlist)].ScrollToBottom(); Playlists[Playlist].ScrollToBottom();
} }
} }
private void SetSelectSlidePlaylistToCurrentPlaylist() private void SetSelectSlidePlaylistToCurrentPlaylist()
{ {
if (Playlists[htPlaylists(Playlist)].ActivePlaylistID > -1) if (Playlists[Playlist].ActivePlaylistID > -1)
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection = Playlists[htPlaylists(Playlist)].ActivePlaylistID + 1; SelectSlides[SelectSlideOptionsPlaylistAdd].Selection = Playlists[Playlist].ActivePlaylistID + 1;
else else
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection = 0; SelectSlides[SelectSlideOptionsPlaylistAdd].Selection = 0;
} }
#endregion Playlist Actions #endregion Playlist Actions
} }
+222 -604
View File
File diff suppressed because it is too large. Load diff