diff --git a/.gitignore b/.gitignore index 7afc1fe5..9d4f0d80 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,16 @@ Output/Songs *.log /Output/Playlists/*.xml +/Output/x64/gstreamer/GstreamerHelper.dll +*.tlog +*.suo +*.obj +*.lastbuildstate +*.pch +*.idb +*.exp + +*.ilk +*.lib +*.opensdf +*.sdf diff --git a/Output/x64/gstreamer/GstreamerHelper.dll b/Output/x64/gstreamer/GstreamerHelper.dll deleted file mode 100644 index c647f7a1..00000000 Binary files a/Output/x64/gstreamer/GstreamerHelper.dll and /dev/null differ diff --git a/PartyModes/PartyModeChallenge/PartyScreenChallengeConfig.cs b/PartyModes/PartyModeChallenge/PartyScreenChallengeConfig.cs index 83d6b218..61910470 100644 --- a/PartyModes/PartyModeChallenge/PartyScreenChallengeConfig.cs +++ b/PartyModes/PartyModeChallenge/PartyScreenChallengeConfig.cs @@ -88,10 +88,10 @@ namespace Vocaluxe.PartyModes case Keys.Enter: UpdateSlides(); - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); break; @@ -114,10 +114,10 @@ namespace Vocaluxe.PartyModes if (MouseEvent.LB && IsMouseOver(MouseEvent)) { UpdateSlides(); - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); } @@ -161,12 +161,12 @@ namespace Vocaluxe.PartyModes private void RebuildSlides() { // build num player slide (min player ... max player); - SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Clear(); + SelectSlides[SelectSlideNumPlayers].Clear(); 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(); SetRoundSteps(); @@ -177,9 +177,9 @@ namespace Vocaluxe.PartyModes { int player = Data.ScreenConfig.NumPlayer; int mics = Data.ScreenConfig.NumPlayerAtOnce; - Data.ScreenConfig.NumPlayer = SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Selection + _PartyMode.GetMinPlayer(); - Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[htSelectSlides(SelectSlideNumMics)].Selection + _PartyMode.GetMinPlayer(); - Data.ScreenConfig.NumRounds = (SelectSlides[htSelectSlides(SelectSlideNumRounds)].Selection + 1) * _RoundSteps; + Data.ScreenConfig.NumPlayer = SelectSlides[SelectSlideNumPlayers].Selection + _PartyMode.GetMinPlayer(); + Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[SelectSlideNumMics].Selection + _PartyMode.GetMinPlayer(); + Data.ScreenConfig.NumRounds = (SelectSlides[SelectSlideNumRounds].Selection + 1) * _RoundSteps; UpdateMicsAtOnce(); SetRoundSteps(); @@ -208,23 +208,23 @@ namespace Vocaluxe.PartyModes Data.ScreenConfig.NumPlayerAtOnce = MaxNum; // build mics at once slide - SelectSlides[htSelectSlides(SelectSlideNumMics)].Clear(); + SelectSlides[SelectSlideNumMics].Clear(); 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() { // build num rounds slide - SelectSlides[htSelectSlides(SelectSlideNumRounds)].Clear(); + SelectSlides[SelectSlideNumRounds].Clear(); 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() diff --git a/PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs b/PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs index c6593ca7..9a36b657 100644 --- a/PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs +++ b/PartyModes/PartyModeChallenge/PartyScreenChallengeMain.cs @@ -104,9 +104,9 @@ namespace Vocaluxe.PartyModes for (int i = 0; i < _PartyMode.GetMaxPlayer(); i++) { - NextPlayerTexts.Add(GetNewText(Texts[htTexts(TextNextPlayer)])); + NextPlayerTexts.Add(GetNewText(Texts[TextNextPlayer])); AddText(NextPlayerTexts[NextPlayerTexts.Count - 1]); - NextPlayerStatics.Add(GetNewStatic(Statics[htStatics(StaticNextPlayer)])); + NextPlayerStatics.Add(GetNewStatic(Statics[StaticNextPlayer])); AddStatic(NextPlayerStatics[NextPlayerStatics.Count - 1]); } } @@ -153,26 +153,26 @@ namespace Vocaluxe.PartyModes case Keys.Enter: if (!ExitPopupVisible) { - if (Buttons[htButtons(ButtonNextRound)].Selected) + if (Buttons[ButtonNextRound].Selected) NextRound(); - if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) + if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1) Back(); - if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) + if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1) ShowPopup(true); - if (Buttons[htButtons(ButtonPlayerScrollUp)].Selected) + if (Buttons[ButtonPlayerScrollUp].Selected) ScrollPlayerTable(-1); - if (Buttons[htButtons(ButtonPlayerScrollDown)].Selected) + if (Buttons[ButtonPlayerScrollDown].Selected) ScrollPlayerTable(1); - if (Buttons[htButtons(ButtonRoundsScrollUp)].Selected) + if (Buttons[ButtonRoundsScrollUp].Selected) ScrollRoundsTable(-1); - if (Buttons[htButtons(ButtonRoundsScrollDown)].Selected) + if (Buttons[ButtonRoundsScrollDown].Selected) ScrollRoundsTable(1); } else { - if (Buttons[htButtons(ButtonPopupYes)].Selected) + if (Buttons[ButtonPopupYes].Selected) EndParty(); - if (Buttons[htButtons(ButtonPopupNo)].Selected) + if (Buttons[ButtonPopupNo].Selected) ShowPopup(false); } break; @@ -189,26 +189,26 @@ namespace Vocaluxe.PartyModes { if (!ExitPopupVisible) { - if (Buttons[htButtons(ButtonNextRound)].Selected) + if (Buttons[ButtonNextRound].Selected) NextRound(); - if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) + if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1) Back(); - if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) + if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1) ShowPopup(true); - if (Buttons[htButtons(ButtonPlayerScrollUp)].Selected) + if (Buttons[ButtonPlayerScrollUp].Selected) ScrollPlayerTable(-1); - if (Buttons[htButtons(ButtonPlayerScrollDown)].Selected) + if (Buttons[ButtonPlayerScrollDown].Selected) ScrollPlayerTable(1); - if (Buttons[htButtons(ButtonRoundsScrollUp)].Selected) + if (Buttons[ButtonRoundsScrollUp].Selected) ScrollRoundsTable(-1); - if (Buttons[htButtons(ButtonRoundsScrollDown)].Selected) + if (Buttons[ButtonRoundsScrollDown].Selected) ScrollRoundsTable(1); } else { - if (Buttons[htButtons(ButtonPopupYes)].Selected) + if (Buttons[ButtonPopupYes].Selected) EndParty(); - if (Buttons[htButtons(ButtonPopupNo)].Selected) + if (Buttons[ButtonPopupNo].Selected) ShowPopup(false); } } @@ -253,29 +253,29 @@ namespace Vocaluxe.PartyModes if (GameState.CurrentRoundNr == 1) { - Buttons[htButtons(ButtonBack)].Visible = true; - Buttons[htButtons(ButtonExit)].Visible = false; + Buttons[ButtonBack].Visible = true; + Buttons[ButtonExit].Visible = false; } else { - Buttons[htButtons(ButtonBack)].Visible = false; - Buttons[htButtons(ButtonExit)].Visible = true; + Buttons[ButtonBack].Visible = false; + Buttons[ButtonExit].Visible = true; } if (GameState.CurrentRoundNr <= GameState.Combs.Count) { - Buttons[htButtons(ButtonNextRound)].Visible = true; - Texts[htTexts(TextFinishMessage)].Visible = false; - Texts[htTexts(TextFinishPlayerWin)].Visible = false; - SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); + Buttons[ButtonNextRound].Visible = true; + Texts[TextFinishMessage].Visible = false; + Texts[TextFinishPlayerWin].Visible = false; + SetInteractionToButton(Buttons[ButtonNextRound]); } else { - Buttons[htButtons(ButtonNextRound)].Visible = false; - Texts[htTexts(TextFinishMessage)].Visible = true; - Texts[htTexts(TextFinishPlayerWin)].Visible = true; - Texts[htTexts(TextFinishPlayerWin)].Text = GetPlayerWinString(); - SetInteractionToButton(Buttons[htButtons(ButtonExit)]); + Buttons[ButtonNextRound].Visible = false; + Texts[TextFinishMessage].Visible = true; + Texts[TextFinishPlayerWin].Visible = true; + Texts[TextFinishPlayerWin].Text = GetPlayerWinString(); + SetInteractionToButton(Buttons[ButtonExit]); } ShowPopup(false); @@ -313,13 +313,13 @@ namespace Vocaluxe.PartyModes { ExitPopupVisible = Visible; - Statics[htStatics(StaticPopupBG)].Visible = ExitPopupVisible; - Texts[htTexts(TextPopupReallyExit)].Visible = ExitPopupVisible; - Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible; - Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible; + Statics[StaticPopupBG].Visible = ExitPopupVisible; + Texts[TextPopupReallyExit].Visible = ExitPopupVisible; + Buttons[ButtonPopupYes].Visible = ExitPopupVisible; + Buttons[ButtonPopupNo].Visible = ExitPopupVisible; if (ExitPopupVisible) - SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]); + SetInteractionToButton(Buttons[ButtonPopupNo]); } private void Back() @@ -331,7 +331,7 @@ namespace Vocaluxe.PartyModes 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 text_y = 550; for (int i = 0; i < GameState.NumPlayerAtOnce; i++) @@ -341,11 +341,11 @@ namespace Vocaluxe.PartyModes NextPlayerStatics[i].Rect.Y = static_y; NextPlayerStatics[i].Visible = true; //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].Visible = true; - x += Statics[htStatics(StaticNextPlayer)].Rect.W + 15; + x += Statics[StaticNextPlayer].Rect.W + 15; } for (int i = GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++) { @@ -358,7 +358,7 @@ namespace Vocaluxe.PartyModes { if (GameState.CurrentRoundNr <= GameState.Combs.Count) { - Texts[htTexts(TextNextPlayerMessage)].Visible = true; + Texts[TextNextPlayerMessage].Visible = true; SProfile[] profiles = CBase.Profiles.GetProfiles(); for (int i = 0; i < GameState.NumPlayerAtOnce; i++) { @@ -370,7 +370,7 @@ namespace Vocaluxe.PartyModes } else { - Texts[htTexts(TextNextPlayerMessage)].Visible = false; + Texts[TextNextPlayerMessage].Visible = false; for (int i = 0; i < GameState.NumPlayerAtOnce; i++) { NextPlayerStatics[i].Visible = false; @@ -394,7 +394,7 @@ namespace Vocaluxe.PartyModes for (int round = 0; round < RoundsTable.Count; round++) { //Round-number - CText text = GetNewText(Texts[htTexts(TextRoundNumber)]); + CText text = GetNewText(Texts[TextRoundNumber]); AddText(text); RoundsTable[round].Number = text; for (int row = 0; row < 2; row++) @@ -402,11 +402,11 @@ namespace Vocaluxe.PartyModes for (int column = 0; column < 3; column++) { //Player - text = GetNewText(Texts[htTexts(TextRoundPlayer)]); + text = GetNewText(Texts[TextRoundPlayer]); AddText(text); RoundsTable[round].TextPlayer.Add(text); //Score - text = GetNewText(Texts[htTexts(TextRoundScore)]); + text = GetNewText(Texts[TextRoundScore]); AddText(text); RoundsTable[round].TextScores.Add(text); } @@ -427,14 +427,14 @@ namespace Vocaluxe.PartyModes if (NumRoundsVisible > GameState.Combs.Count) NumRoundsVisible = GameState.Combs.Count; - float x = Texts[htTexts(TextRoundNumber)].X; - float y = Texts[htTexts(TextRoundNumber)].Y; + float x = Texts[TextRoundNumber].X; + float y = Texts[TextRoundNumber].Y; RoundsTableScrollArea.X = x; 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 for (int round = 0; round < RoundsTable.Count; round++) @@ -455,8 +455,8 @@ namespace Vocaluxe.PartyModes for (int column = row * NumPlayerInOneRow; column < num; column++) { //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 maxw = ((CBase.Settings.GetRenderW() - Texts[htTexts(TextRoundNumber)].X - 20) / NumPlayerInThisRow) / 2 - 5; + float _x = x + 15 + (CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) + ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2; + float maxw = ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2 - 5; RoundsTable[round].TextPlayer[column].X = _x; RoundsTable[round].TextPlayer[column].Y = y; RoundsTable[round].TextPlayer[column].MaxWidth = maxw; @@ -510,19 +510,19 @@ namespace Vocaluxe.PartyModes } } - Buttons[htButtons(ButtonRoundsScrollUp)].Visible = RoundsTableOffset > 0; - Buttons[htButtons(ButtonRoundsScrollDown)].Visible = GameState.Combs.Count - NumRoundsVisible - RoundsTableOffset > 0; + Buttons[ButtonRoundsScrollUp].Visible = RoundsTableOffset > 0; + Buttons[ButtonRoundsScrollDown].Visible = GameState.Combs.Count - NumRoundsVisible - RoundsTableOffset > 0; } private void BuildPlayerTable() { PlayerTableScrollArea = new SRectF(); - PlayerTableScrollArea.X = Texts[htTexts(TextPosition)].X; - PlayerTableScrollArea.Y = Texts[htTexts(TextPosition)].Y; - PlayerTableScrollArea.W = Texts[htTexts(TextGamePoints)].X - Texts[htTexts(TextPosition)].X; + PlayerTableScrollArea.X = Texts[TextPosition].X; + PlayerTableScrollArea.Y = Texts[TextPosition].Y; + PlayerTableScrollArea.W = Texts[TextGamePoints].X - Texts[TextPosition].X; PlayerTable = new List(); - float delta = Texts[htTexts(TextPosition)].Height * 1.2f; + float delta = Texts[TextPosition].Height * 1.2f; float h = 0; @@ -530,12 +530,12 @@ namespace Vocaluxe.PartyModes { TableRow row = new TableRow(); - row.Pos = GetNewText(Texts[htTexts(TextPosition)]); - row.Name = GetNewText(Texts[htTexts(TextPlayerName)]); - row.Rounds = GetNewText(Texts[htTexts(TextNumPlayed)]); - row.Won = GetNewText(Texts[htTexts(TextWon)]); - row.SingPoints = GetNewText(Texts[htTexts(TextSingPoints)]); - row.GamePoints = GetNewText(Texts[htTexts(TextGamePoints)]); + row.Pos = GetNewText(Texts[TextPosition]); + row.Name = GetNewText(Texts[TextPlayerName]); + row.Rounds = GetNewText(Texts[TextNumPlayed]); + row.Won = GetNewText(Texts[TextWon]); + row.SingPoints = GetNewText(Texts[TextSingPoints]); + row.GamePoints = GetNewText(Texts[TextGamePoints]); row.Pos.Y += delta * (i + 1); row.Name.Y += delta * (i + 1); @@ -602,8 +602,8 @@ namespace Vocaluxe.PartyModes } } - Buttons[htButtons(ButtonPlayerScrollUp)].Visible = PlayerTableOffset > 0; - Buttons[htButtons(ButtonPlayerScrollDown)].Visible = GameState.ProfileIDs.Count - NumPlayerVisible - PlayerTableOffset > 0; + Buttons[ButtonPlayerScrollUp].Visible = PlayerTableOffset > 0; + Buttons[ButtonPlayerScrollDown].Visible = GameState.ProfileIDs.Count - NumPlayerVisible - PlayerTableOffset > 0; } private void ScrollPlayerTable(int Offset) diff --git a/PartyModes/PartyModeChallenge/PartyScreenChallengeNames.cs b/PartyModes/PartyModeChallenge/PartyScreenChallengeNames.cs index 5089b80c..13c1c902 100644 --- a/PartyModes/PartyModeChallenge/PartyScreenChallengeNames.cs +++ b/PartyModes/PartyModeChallenge/PartyScreenChallengeNames.cs @@ -131,10 +131,10 @@ namespace Vocaluxe.PartyModes break; case Keys.Enter: - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); if (!OnAdd()) @@ -238,10 +238,10 @@ namespace Vocaluxe.PartyModes if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); if (!OnAdd()) @@ -293,13 +293,13 @@ namespace Vocaluxe.PartyModes private void AddButtonPlayerDestination() { - Buttons[htButtons(ButtonPlayerDestination)].Visible = false; + Buttons[ButtonPlayerDestination].Visible = false; PlayerDestinationButtons = new List(); int row = 0; int column = 0; for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++) { - CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerDestination)]); + CButton b = GetNewButton(Buttons[ButtonPlayerDestination]); b.Rect.X = PlayerDestinationButtonsFirstX + column * (b.Rect.W + PlayerDestinationButtonsSpaceH); b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW); PlayerDestinationButtons.Add(b); @@ -317,13 +317,13 @@ namespace Vocaluxe.PartyModes private void AddButtonPlayerChoose() { - Buttons[htButtons(ButtonPlayerChoose)].Visible = false; + Buttons[ButtonPlayerChoose].Visible = false; PlayerChooseButtons = new List(); int row = 0; int column = 0; for (int i = 1; i <= PlayerChooseButtonsNumH * PlayerChooseButtonsNumW; i++) { - CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerChoose)]); + CButton b = GetNewButton(Buttons[ButtonPlayerChoose]); b.Rect.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH); b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW); CPlayerChooseButton pcb = new CPlayerChooseButton(); @@ -379,10 +379,10 @@ namespace Vocaluxe.PartyModes { PlayerChooseButtons[i].ProfileID = -1; PlayerChooseButtons[i].Button.Text.Text = String.Empty; - PlayerChooseButtons[i].Button.Texture = Buttons[htButtons(ButtonPlayerChoose)].Texture; - PlayerChooseButtons[i].Button.STexture = Buttons[htButtons(ButtonPlayerChoose)].STexture; - PlayerChooseButtons[i].Button.Color = Buttons[htButtons(ButtonPlayerChoose)].Color; - PlayerChooseButtons[i].Button.SColor = Buttons[htButtons(ButtonPlayerChoose)].SColor; + PlayerChooseButtons[i].Button.Texture = Buttons[ButtonPlayerChoose].Texture; + PlayerChooseButtons[i].Button.STexture = Buttons[ButtonPlayerChoose].STexture; + PlayerChooseButtons[i].Button.Color = Buttons[ButtonPlayerChoose].Color; + PlayerChooseButtons[i].Button.SColor = Buttons[ButtonPlayerChoose].SColor; PlayerChooseButtons[i].Button.Enabled = false; } } @@ -448,10 +448,10 @@ namespace Vocaluxe.PartyModes } else { - PlayerDestinationButtons[i].Color = Buttons[htButtons(ButtonPlayerDestination)].Color; - PlayerDestinationButtons[i].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor; - PlayerDestinationButtons[i].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture; - PlayerDestinationButtons[i].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture; + PlayerDestinationButtons[i].Color = Buttons[ButtonPlayerDestination].Color; + PlayerDestinationButtons[i].SColor = Buttons[ButtonPlayerDestination].SColor; + PlayerDestinationButtons[i].Texture = Buttons[ButtonPlayerDestination].Texture; + PlayerDestinationButtons[i].STexture = Buttons[ButtonPlayerDestination].STexture; PlayerDestinationButtons[i].Text.Text = String.Empty; PlayerDestinationButtons[i].Enabled = false; } @@ -462,11 +462,11 @@ namespace Vocaluxe.PartyModes { if (Data.ScreenNames.ProfileIDs.Count == NumPlayer) { - Buttons[htButtons(ButtonNext)].Visible = true; - SetInteractionToButton(Buttons[htButtons(ButtonNext)]); + Buttons[ButtonNext].Visible = true; + SetInteractionToButton(Buttons[ButtonNext]); } else - Buttons[htButtons(ButtonNext)].Visible = false; + Buttons[ButtonNext].Visible = false; } private bool OnAdd() diff --git a/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeConfig.cs b/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeConfig.cs index 83d6b218..61910470 100644 --- a/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeConfig.cs +++ b/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeConfig.cs @@ -88,10 +88,10 @@ namespace Vocaluxe.PartyModes case Keys.Enter: UpdateSlides(); - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); break; @@ -114,10 +114,10 @@ namespace Vocaluxe.PartyModes if (MouseEvent.LB && IsMouseOver(MouseEvent)) { UpdateSlides(); - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); } @@ -161,12 +161,12 @@ namespace Vocaluxe.PartyModes private void RebuildSlides() { // build num player slide (min player ... max player); - SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Clear(); + SelectSlides[SelectSlideNumPlayers].Clear(); 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(); SetRoundSteps(); @@ -177,9 +177,9 @@ namespace Vocaluxe.PartyModes { int player = Data.ScreenConfig.NumPlayer; int mics = Data.ScreenConfig.NumPlayerAtOnce; - Data.ScreenConfig.NumPlayer = SelectSlides[htSelectSlides(SelectSlideNumPlayers)].Selection + _PartyMode.GetMinPlayer(); - Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[htSelectSlides(SelectSlideNumMics)].Selection + _PartyMode.GetMinPlayer(); - Data.ScreenConfig.NumRounds = (SelectSlides[htSelectSlides(SelectSlideNumRounds)].Selection + 1) * _RoundSteps; + Data.ScreenConfig.NumPlayer = SelectSlides[SelectSlideNumPlayers].Selection + _PartyMode.GetMinPlayer(); + Data.ScreenConfig.NumPlayerAtOnce = SelectSlides[SelectSlideNumMics].Selection + _PartyMode.GetMinPlayer(); + Data.ScreenConfig.NumRounds = (SelectSlides[SelectSlideNumRounds].Selection + 1) * _RoundSteps; UpdateMicsAtOnce(); SetRoundSteps(); @@ -208,23 +208,23 @@ namespace Vocaluxe.PartyModes Data.ScreenConfig.NumPlayerAtOnce = MaxNum; // build mics at once slide - SelectSlides[htSelectSlides(SelectSlideNumMics)].Clear(); + SelectSlides[SelectSlideNumMics].Clear(); 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() { // build num rounds slide - SelectSlides[htSelectSlides(SelectSlideNumRounds)].Clear(); + SelectSlides[SelectSlideNumRounds].Clear(); 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() diff --git a/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeMain.cs b/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeMain.cs index c6593ca7..9a36b657 100644 --- a/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeMain.cs +++ b/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeMain.cs @@ -104,9 +104,9 @@ namespace Vocaluxe.PartyModes for (int i = 0; i < _PartyMode.GetMaxPlayer(); i++) { - NextPlayerTexts.Add(GetNewText(Texts[htTexts(TextNextPlayer)])); + NextPlayerTexts.Add(GetNewText(Texts[TextNextPlayer])); AddText(NextPlayerTexts[NextPlayerTexts.Count - 1]); - NextPlayerStatics.Add(GetNewStatic(Statics[htStatics(StaticNextPlayer)])); + NextPlayerStatics.Add(GetNewStatic(Statics[StaticNextPlayer])); AddStatic(NextPlayerStatics[NextPlayerStatics.Count - 1]); } } @@ -153,26 +153,26 @@ namespace Vocaluxe.PartyModes case Keys.Enter: if (!ExitPopupVisible) { - if (Buttons[htButtons(ButtonNextRound)].Selected) + if (Buttons[ButtonNextRound].Selected) NextRound(); - if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) + if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1) Back(); - if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) + if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1) ShowPopup(true); - if (Buttons[htButtons(ButtonPlayerScrollUp)].Selected) + if (Buttons[ButtonPlayerScrollUp].Selected) ScrollPlayerTable(-1); - if (Buttons[htButtons(ButtonPlayerScrollDown)].Selected) + if (Buttons[ButtonPlayerScrollDown].Selected) ScrollPlayerTable(1); - if (Buttons[htButtons(ButtonRoundsScrollUp)].Selected) + if (Buttons[ButtonRoundsScrollUp].Selected) ScrollRoundsTable(-1); - if (Buttons[htButtons(ButtonRoundsScrollDown)].Selected) + if (Buttons[ButtonRoundsScrollDown].Selected) ScrollRoundsTable(1); } else { - if (Buttons[htButtons(ButtonPopupYes)].Selected) + if (Buttons[ButtonPopupYes].Selected) EndParty(); - if (Buttons[htButtons(ButtonPopupNo)].Selected) + if (Buttons[ButtonPopupNo].Selected) ShowPopup(false); } break; @@ -189,26 +189,26 @@ namespace Vocaluxe.PartyModes { if (!ExitPopupVisible) { - if (Buttons[htButtons(ButtonNextRound)].Selected) + if (Buttons[ButtonNextRound].Selected) NextRound(); - if (Buttons[htButtons(ButtonBack)].Selected && GameState.CurrentRoundNr == 1) + if (Buttons[ButtonBack].Selected && GameState.CurrentRoundNr == 1) Back(); - if (Buttons[htButtons(ButtonExit)].Selected && GameState.CurrentRoundNr > 1) + if (Buttons[ButtonExit].Selected && GameState.CurrentRoundNr > 1) ShowPopup(true); - if (Buttons[htButtons(ButtonPlayerScrollUp)].Selected) + if (Buttons[ButtonPlayerScrollUp].Selected) ScrollPlayerTable(-1); - if (Buttons[htButtons(ButtonPlayerScrollDown)].Selected) + if (Buttons[ButtonPlayerScrollDown].Selected) ScrollPlayerTable(1); - if (Buttons[htButtons(ButtonRoundsScrollUp)].Selected) + if (Buttons[ButtonRoundsScrollUp].Selected) ScrollRoundsTable(-1); - if (Buttons[htButtons(ButtonRoundsScrollDown)].Selected) + if (Buttons[ButtonRoundsScrollDown].Selected) ScrollRoundsTable(1); } else { - if (Buttons[htButtons(ButtonPopupYes)].Selected) + if (Buttons[ButtonPopupYes].Selected) EndParty(); - if (Buttons[htButtons(ButtonPopupNo)].Selected) + if (Buttons[ButtonPopupNo].Selected) ShowPopup(false); } } @@ -253,29 +253,29 @@ namespace Vocaluxe.PartyModes if (GameState.CurrentRoundNr == 1) { - Buttons[htButtons(ButtonBack)].Visible = true; - Buttons[htButtons(ButtonExit)].Visible = false; + Buttons[ButtonBack].Visible = true; + Buttons[ButtonExit].Visible = false; } else { - Buttons[htButtons(ButtonBack)].Visible = false; - Buttons[htButtons(ButtonExit)].Visible = true; + Buttons[ButtonBack].Visible = false; + Buttons[ButtonExit].Visible = true; } if (GameState.CurrentRoundNr <= GameState.Combs.Count) { - Buttons[htButtons(ButtonNextRound)].Visible = true; - Texts[htTexts(TextFinishMessage)].Visible = false; - Texts[htTexts(TextFinishPlayerWin)].Visible = false; - SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); + Buttons[ButtonNextRound].Visible = true; + Texts[TextFinishMessage].Visible = false; + Texts[TextFinishPlayerWin].Visible = false; + SetInteractionToButton(Buttons[ButtonNextRound]); } else { - Buttons[htButtons(ButtonNextRound)].Visible = false; - Texts[htTexts(TextFinishMessage)].Visible = true; - Texts[htTexts(TextFinishPlayerWin)].Visible = true; - Texts[htTexts(TextFinishPlayerWin)].Text = GetPlayerWinString(); - SetInteractionToButton(Buttons[htButtons(ButtonExit)]); + Buttons[ButtonNextRound].Visible = false; + Texts[TextFinishMessage].Visible = true; + Texts[TextFinishPlayerWin].Visible = true; + Texts[TextFinishPlayerWin].Text = GetPlayerWinString(); + SetInteractionToButton(Buttons[ButtonExit]); } ShowPopup(false); @@ -313,13 +313,13 @@ namespace Vocaluxe.PartyModes { ExitPopupVisible = Visible; - Statics[htStatics(StaticPopupBG)].Visible = ExitPopupVisible; - Texts[htTexts(TextPopupReallyExit)].Visible = ExitPopupVisible; - Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible; - Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible; + Statics[StaticPopupBG].Visible = ExitPopupVisible; + Texts[TextPopupReallyExit].Visible = ExitPopupVisible; + Buttons[ButtonPopupYes].Visible = ExitPopupVisible; + Buttons[ButtonPopupNo].Visible = ExitPopupVisible; if (ExitPopupVisible) - SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]); + SetInteractionToButton(Buttons[ButtonPopupNo]); } private void Back() @@ -331,7 +331,7 @@ namespace Vocaluxe.PartyModes 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 text_y = 550; for (int i = 0; i < GameState.NumPlayerAtOnce; i++) @@ -341,11 +341,11 @@ namespace Vocaluxe.PartyModes NextPlayerStatics[i].Rect.Y = static_y; NextPlayerStatics[i].Visible = true; //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].Visible = true; - x += Statics[htStatics(StaticNextPlayer)].Rect.W + 15; + x += Statics[StaticNextPlayer].Rect.W + 15; } for (int i = GameState.NumPlayerAtOnce; i < _PartyMode.GetMaxPlayer(); i++) { @@ -358,7 +358,7 @@ namespace Vocaluxe.PartyModes { if (GameState.CurrentRoundNr <= GameState.Combs.Count) { - Texts[htTexts(TextNextPlayerMessage)].Visible = true; + Texts[TextNextPlayerMessage].Visible = true; SProfile[] profiles = CBase.Profiles.GetProfiles(); for (int i = 0; i < GameState.NumPlayerAtOnce; i++) { @@ -370,7 +370,7 @@ namespace Vocaluxe.PartyModes } else { - Texts[htTexts(TextNextPlayerMessage)].Visible = false; + Texts[TextNextPlayerMessage].Visible = false; for (int i = 0; i < GameState.NumPlayerAtOnce; i++) { NextPlayerStatics[i].Visible = false; @@ -394,7 +394,7 @@ namespace Vocaluxe.PartyModes for (int round = 0; round < RoundsTable.Count; round++) { //Round-number - CText text = GetNewText(Texts[htTexts(TextRoundNumber)]); + CText text = GetNewText(Texts[TextRoundNumber]); AddText(text); RoundsTable[round].Number = text; for (int row = 0; row < 2; row++) @@ -402,11 +402,11 @@ namespace Vocaluxe.PartyModes for (int column = 0; column < 3; column++) { //Player - text = GetNewText(Texts[htTexts(TextRoundPlayer)]); + text = GetNewText(Texts[TextRoundPlayer]); AddText(text); RoundsTable[round].TextPlayer.Add(text); //Score - text = GetNewText(Texts[htTexts(TextRoundScore)]); + text = GetNewText(Texts[TextRoundScore]); AddText(text); RoundsTable[round].TextScores.Add(text); } @@ -427,14 +427,14 @@ namespace Vocaluxe.PartyModes if (NumRoundsVisible > GameState.Combs.Count) NumRoundsVisible = GameState.Combs.Count; - float x = Texts[htTexts(TextRoundNumber)].X; - float y = Texts[htTexts(TextRoundNumber)].Y; + float x = Texts[TextRoundNumber].X; + float y = Texts[TextRoundNumber].Y; RoundsTableScrollArea.X = x; 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 for (int round = 0; round < RoundsTable.Count; round++) @@ -455,8 +455,8 @@ namespace Vocaluxe.PartyModes for (int column = row * NumPlayerInOneRow; column < num; column++) { //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 maxw = ((CBase.Settings.GetRenderW() - Texts[htTexts(TextRoundNumber)].X - 20) / NumPlayerInThisRow) / 2 - 5; + float _x = x + 15 + (CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow * (column - row * NumPlayerInOneRow) + ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2; + float maxw = ((CBase.Settings.GetRenderW() - Texts[TextRoundNumber].X - 20) / NumPlayerInThisRow) / 2 - 5; RoundsTable[round].TextPlayer[column].X = _x; RoundsTable[round].TextPlayer[column].Y = y; RoundsTable[round].TextPlayer[column].MaxWidth = maxw; @@ -510,19 +510,19 @@ namespace Vocaluxe.PartyModes } } - Buttons[htButtons(ButtonRoundsScrollUp)].Visible = RoundsTableOffset > 0; - Buttons[htButtons(ButtonRoundsScrollDown)].Visible = GameState.Combs.Count - NumRoundsVisible - RoundsTableOffset > 0; + Buttons[ButtonRoundsScrollUp].Visible = RoundsTableOffset > 0; + Buttons[ButtonRoundsScrollDown].Visible = GameState.Combs.Count - NumRoundsVisible - RoundsTableOffset > 0; } private void BuildPlayerTable() { PlayerTableScrollArea = new SRectF(); - PlayerTableScrollArea.X = Texts[htTexts(TextPosition)].X; - PlayerTableScrollArea.Y = Texts[htTexts(TextPosition)].Y; - PlayerTableScrollArea.W = Texts[htTexts(TextGamePoints)].X - Texts[htTexts(TextPosition)].X; + PlayerTableScrollArea.X = Texts[TextPosition].X; + PlayerTableScrollArea.Y = Texts[TextPosition].Y; + PlayerTableScrollArea.W = Texts[TextGamePoints].X - Texts[TextPosition].X; PlayerTable = new List(); - float delta = Texts[htTexts(TextPosition)].Height * 1.2f; + float delta = Texts[TextPosition].Height * 1.2f; float h = 0; @@ -530,12 +530,12 @@ namespace Vocaluxe.PartyModes { TableRow row = new TableRow(); - row.Pos = GetNewText(Texts[htTexts(TextPosition)]); - row.Name = GetNewText(Texts[htTexts(TextPlayerName)]); - row.Rounds = GetNewText(Texts[htTexts(TextNumPlayed)]); - row.Won = GetNewText(Texts[htTexts(TextWon)]); - row.SingPoints = GetNewText(Texts[htTexts(TextSingPoints)]); - row.GamePoints = GetNewText(Texts[htTexts(TextGamePoints)]); + row.Pos = GetNewText(Texts[TextPosition]); + row.Name = GetNewText(Texts[TextPlayerName]); + row.Rounds = GetNewText(Texts[TextNumPlayed]); + row.Won = GetNewText(Texts[TextWon]); + row.SingPoints = GetNewText(Texts[TextSingPoints]); + row.GamePoints = GetNewText(Texts[TextGamePoints]); row.Pos.Y += delta * (i + 1); row.Name.Y += delta * (i + 1); @@ -602,8 +602,8 @@ namespace Vocaluxe.PartyModes } } - Buttons[htButtons(ButtonPlayerScrollUp)].Visible = PlayerTableOffset > 0; - Buttons[htButtons(ButtonPlayerScrollDown)].Visible = GameState.ProfileIDs.Count - NumPlayerVisible - PlayerTableOffset > 0; + Buttons[ButtonPlayerScrollUp].Visible = PlayerTableOffset > 0; + Buttons[ButtonPlayerScrollDown].Visible = GameState.ProfileIDs.Count - NumPlayerVisible - PlayerTableOffset > 0; } private void ScrollPlayerTable(int Offset) diff --git a/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeNames.cs b/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeNames.cs index 5089b80c..13c1c902 100644 --- a/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeNames.cs +++ b/PartyModes/PartyModeChallengeMedley/PartyScreenChallengeNames.cs @@ -131,10 +131,10 @@ namespace Vocaluxe.PartyModes break; case Keys.Enter: - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); if (!OnAdd()) @@ -238,10 +238,10 @@ namespace Vocaluxe.PartyModes if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); if (!OnAdd()) @@ -293,13 +293,13 @@ namespace Vocaluxe.PartyModes private void AddButtonPlayerDestination() { - Buttons[htButtons(ButtonPlayerDestination)].Visible = false; + Buttons[ButtonPlayerDestination].Visible = false; PlayerDestinationButtons = new List(); int row = 0; int column = 0; for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++) { - CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerDestination)]); + CButton b = GetNewButton(Buttons[ButtonPlayerDestination]); b.Rect.X = PlayerDestinationButtonsFirstX + column * (b.Rect.W + PlayerDestinationButtonsSpaceH); b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW); PlayerDestinationButtons.Add(b); @@ -317,13 +317,13 @@ namespace Vocaluxe.PartyModes private void AddButtonPlayerChoose() { - Buttons[htButtons(ButtonPlayerChoose)].Visible = false; + Buttons[ButtonPlayerChoose].Visible = false; PlayerChooseButtons = new List(); int row = 0; int column = 0; for (int i = 1; i <= PlayerChooseButtonsNumH * PlayerChooseButtonsNumW; i++) { - CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerChoose)]); + CButton b = GetNewButton(Buttons[ButtonPlayerChoose]); b.Rect.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH); b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW); CPlayerChooseButton pcb = new CPlayerChooseButton(); @@ -379,10 +379,10 @@ namespace Vocaluxe.PartyModes { PlayerChooseButtons[i].ProfileID = -1; PlayerChooseButtons[i].Button.Text.Text = String.Empty; - PlayerChooseButtons[i].Button.Texture = Buttons[htButtons(ButtonPlayerChoose)].Texture; - PlayerChooseButtons[i].Button.STexture = Buttons[htButtons(ButtonPlayerChoose)].STexture; - PlayerChooseButtons[i].Button.Color = Buttons[htButtons(ButtonPlayerChoose)].Color; - PlayerChooseButtons[i].Button.SColor = Buttons[htButtons(ButtonPlayerChoose)].SColor; + PlayerChooseButtons[i].Button.Texture = Buttons[ButtonPlayerChoose].Texture; + PlayerChooseButtons[i].Button.STexture = Buttons[ButtonPlayerChoose].STexture; + PlayerChooseButtons[i].Button.Color = Buttons[ButtonPlayerChoose].Color; + PlayerChooseButtons[i].Button.SColor = Buttons[ButtonPlayerChoose].SColor; PlayerChooseButtons[i].Button.Enabled = false; } } @@ -448,10 +448,10 @@ namespace Vocaluxe.PartyModes } else { - PlayerDestinationButtons[i].Color = Buttons[htButtons(ButtonPlayerDestination)].Color; - PlayerDestinationButtons[i].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor; - PlayerDestinationButtons[i].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture; - PlayerDestinationButtons[i].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture; + PlayerDestinationButtons[i].Color = Buttons[ButtonPlayerDestination].Color; + PlayerDestinationButtons[i].SColor = Buttons[ButtonPlayerDestination].SColor; + PlayerDestinationButtons[i].Texture = Buttons[ButtonPlayerDestination].Texture; + PlayerDestinationButtons[i].STexture = Buttons[ButtonPlayerDestination].STexture; PlayerDestinationButtons[i].Text.Text = String.Empty; PlayerDestinationButtons[i].Enabled = false; } @@ -462,11 +462,11 @@ namespace Vocaluxe.PartyModes { if (Data.ScreenNames.ProfileIDs.Count == NumPlayer) { - Buttons[htButtons(ButtonNext)].Visible = true; - SetInteractionToButton(Buttons[htButtons(ButtonNext)]); + Buttons[ButtonNext].Visible = true; + SetInteractionToButton(Buttons[ButtonNext]); } else - Buttons[htButtons(ButtonNext)].Visible = false; + Buttons[ButtonNext].Visible = false; } private bool OnAdd() diff --git a/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeConfig.cs b/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeConfig.cs index 925d10f5..bad59f10 100644 --- a/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeConfig.cs +++ b/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeConfig.cs @@ -98,10 +98,10 @@ namespace Vocaluxe.PartyModes case Keys.Enter: UpdateSlides(); - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); break; @@ -124,10 +124,10 @@ namespace Vocaluxe.PartyModes if (MouseEvent.LB && IsMouseOver(MouseEvent)) { UpdateSlides(); - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); } @@ -152,7 +152,7 @@ namespace Vocaluxe.PartyModes public override bool UpdateGame() { - Buttons[htButtons(ButtonNext)].Visible = ConfigOk; + Buttons[ButtonNext].Visible = ConfigOk; return true; } @@ -170,78 +170,78 @@ namespace Vocaluxe.PartyModes private void FillSlides() { // 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++) { - 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++) { - 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[htSelectSlides(SelectSlideNumFields)].AddValue("9"); - SelectSlides[htSelectSlides(SelectSlideNumFields)].AddValue("16"); - SelectSlides[htSelectSlides(SelectSlideNumFields)].AddValue("25"); + SelectSlides[SelectSlideNumFields].Clear(); + SelectSlides[SelectSlideNumFields].AddValue("9"); + SelectSlides[SelectSlideNumFields].AddValue("16"); + SelectSlides[SelectSlideNumFields].AddValue("25"); if (Data.ScreenConfig.NumFields == 9) - SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection = 0; + SelectSlides[SelectSlideNumFields].Selection = 0; else if (Data.ScreenConfig.NumFields == 16) - SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection = 1; + SelectSlides[SelectSlideNumFields].Selection = 1; else if (Data.ScreenConfig.NumFields == 25) - SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection = 2; + SelectSlides[SelectSlideNumFields].Selection = 2; - SelectSlides[htSelectSlides(SelectSlideSongSource)].Clear(); - SelectSlides[htSelectSlides(SelectSlideSongSource)].SetValues((int)Data.ScreenConfig.SongSource); + SelectSlides[SelectSlideSongSource].Clear(); + SelectSlides[SelectSlideSongSource].SetValues((int)Data.ScreenConfig.SongSource); string[] _Playlists = CBase.Playlist.GetPlaylistNames(); - SelectSlides[htSelectSlides(SelectSlidePlaylist)].Clear(); + SelectSlides[SelectSlidePlaylist].Clear(); for (int i = 0; i < _Playlists.Length; i++) { 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[htSelectSlides(SelectSlidePlaylist)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST; + SelectSlides[SelectSlidePlaylist].Selection = Data.ScreenConfig.PlaylistID; + SelectSlides[SelectSlidePlaylist].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST; string[] _Categories = new string[CBase.Songs.GetNumCategories()]; for (int i = 0; i < CBase.Songs.GetNumCategories(); i++ ) { _Categories[i] = CBase.Songs.GetCategory(i).Name; } - SelectSlides[htSelectSlides(SelectSlideCategory)].Clear(); + SelectSlides[SelectSlideCategory].Clear(); for (int i = 0; i < _Categories.Length; i++) { 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[htSelectSlides(SelectSlideCategory)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY; + SelectSlides[SelectSlideCategory].Selection = Data.ScreenConfig.CategoryID; + SelectSlides[SelectSlideCategory].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY; - SelectSlides[htSelectSlides(SelectSlideGameMode)].Visible = true; - SelectSlides[htSelectSlides(SelectSlideGameMode)].SetValues((int)Data.ScreenConfig.GameMode); + SelectSlides[SelectSlideGameMode].Visible = true; + SelectSlides[SelectSlideGameMode].SetValues((int)Data.ScreenConfig.GameMode); } private void UpdateSlides() { - Data.ScreenConfig.NumPlayerTeam1 = SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam1)].Selection + (_PartyMode.GetMinPlayer()/2); - Data.ScreenConfig.NumPlayerTeam2 = SelectSlides[htSelectSlides(SelectSlideNumPlayerTeam2)].Selection + (_PartyMode.GetMinPlayer()/2); + Data.ScreenConfig.NumPlayerTeam1 = SelectSlides[SelectSlideNumPlayerTeam1].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; - else if (SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection == 1) + else if (SelectSlides[SelectSlideNumFields].Selection == 1) Data.ScreenConfig.NumFields = 16; - else if (SelectSlides[htSelectSlides(SelectSlideNumFields)].Selection == 2) + else if (SelectSlides[SelectSlideNumFields].Selection == 2) Data.ScreenConfig.NumFields = 25; - Data.ScreenConfig.SongSource = (ESongSource)SelectSlides[htSelectSlides(SelectSlideSongSource)].Selection; - Data.ScreenConfig.PlaylistID = SelectSlides[htSelectSlides(SelectSlidePlaylist)].Selection; - Data.ScreenConfig.CategoryID = SelectSlides[htSelectSlides(SelectSlideCategory)].Selection; - Data.ScreenConfig.GameMode = (EPartyGameMode)SelectSlides[htSelectSlides(SelectSlideGameMode)].Selection; + Data.ScreenConfig.SongSource = (ESongSource)SelectSlides[SelectSlideSongSource].Selection; + Data.ScreenConfig.PlaylistID = SelectSlides[SelectSlidePlaylist].Selection; + Data.ScreenConfig.CategoryID = SelectSlides[SelectSlideCategory].Selection; + Data.ScreenConfig.GameMode = (EPartyGameMode)SelectSlides[SelectSlideGameMode].Selection; EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL; @@ -328,8 +328,8 @@ namespace Vocaluxe.PartyModes else ConfigOk = false; } - SelectSlides[htSelectSlides(SelectSlideCategory)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY; - SelectSlides[htSelectSlides(SelectSlidePlaylist)].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST; + SelectSlides[SelectSlideCategory].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_CATEGORY; + SelectSlides[SelectSlidePlaylist].Visible = Data.ScreenConfig.SongSource == ESongSource.TR_PLAYLIST; } private void Back() diff --git a/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeMain.cs b/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeMain.cs index d4e1d117..c8a5c5fa 100644 --- a/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeMain.cs +++ b/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeMain.cs @@ -103,7 +103,7 @@ namespace Vocaluxe.PartyModes base.LoadTheme(XmlPath); CreateFields(); - Buttons[htButtons(ButtonField)].Visible = false; + Buttons[ButtonField].Visible = false; } public override void DataToScreen(object ReceivedData) @@ -150,11 +150,11 @@ namespace Vocaluxe.PartyModes case Keys.Enter: if (!ExitPopupVisible) { - if (Buttons[htButtons(ButtonNextRound)].Selected) + if (Buttons[ButtonNextRound].Selected) NextRound(); - if (Buttons[htButtons(ButtonBack)].Selected && GameData.CurrentRoundNr == 1 && Status != EStatus.FieldSelected) + if (Buttons[ButtonBack].Selected && GameData.CurrentRoundNr == 1 && Status != EStatus.FieldSelected) 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); else if (Status == EStatus.None) EndParty(); @@ -181,21 +181,21 @@ namespace Vocaluxe.PartyModes } if (Status == EStatus.FieldSelected) { - if (Buttons[htButtons(ButtonJokerRandomT1)].Selected) + if (Buttons[ButtonJokerRandomT1].Selected) UseJoker(0, 0); - if (Buttons[htButtons(ButtonJokerRandomT2)].Selected) + if (Buttons[ButtonJokerRandomT2].Selected) UseJoker(1, 0); - if (Buttons[htButtons(ButtonJokerRetryT1)].Selected) + if (Buttons[ButtonJokerRetryT1].Selected) UseJoker(0, 1); - if (Buttons[htButtons(ButtonJokerRetryT2)].Selected) + if (Buttons[ButtonJokerRetryT2].Selected) UseJoker(1, 1); } } else { - if (Buttons[htButtons(ButtonPopupYes)].Selected) + if (Buttons[ButtonPopupYes].Selected) EndParty(); - if (Buttons[htButtons(ButtonPopupNo)].Selected) + if (Buttons[ButtonPopupNo].Selected) ShowPopup(false); } break; @@ -212,11 +212,11 @@ namespace Vocaluxe.PartyModes { if (!ExitPopupVisible) { - if (Buttons[htButtons(ButtonNextRound)].Selected) + if (Buttons[ButtonNextRound].Selected) NextRound(); - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) if (Status == EStatus.None) EndParty(); else @@ -244,22 +244,22 @@ namespace Vocaluxe.PartyModes } if(Status == EStatus.FieldSelected) { - if (Buttons[htButtons(ButtonJokerRandomT1)].Selected) + if (Buttons[ButtonJokerRandomT1].Selected) UseJoker(0, 0); - if (Buttons[htButtons(ButtonJokerRandomT2)].Selected) + if (Buttons[ButtonJokerRandomT2].Selected) UseJoker(1, 0); - if (Buttons[htButtons(ButtonJokerRetryT1)].Selected) + if (Buttons[ButtonJokerRetryT1].Selected) UseJoker(0, 1); - if (Buttons[htButtons(ButtonJokerRetryT2)].Selected) + if (Buttons[ButtonJokerRetryT2].Selected) UseJoker(1, 1); } } else { - if (Buttons[htButtons(ButtonPopupYes)].Selected) + if (Buttons[ButtonPopupYes].Selected) EndParty(); - if (Buttons[htButtons(ButtonPopupNo)].Selected) + if (Buttons[ButtonPopupNo].Selected) ShowPopup(false); } } @@ -294,15 +294,15 @@ namespace Vocaluxe.PartyModes { BuildWinnerPossibilities(); SelectedField = -1; - Buttons[htButtons(ButtonBack)].Visible = true; - Buttons[htButtons(ButtonExit)].Visible = false; - SetInteractionToButton(Buttons[htButtons(ButtonBack)]); + Buttons[ButtonBack].Visible = true; + Buttons[ButtonExit].Visible = false; + SetInteractionToButton(Buttons[ButtonBack]); } else { - Buttons[htButtons(ButtonBack)].Visible = false; - Buttons[htButtons(ButtonExit)].Visible = true; - SetInteractionToButton(Buttons[htButtons(ButtonExit)]); + Buttons[ButtonBack].Visible = false; + Buttons[ButtonExit].Visible = true; + SetInteractionToButton(Buttons[ButtonExit]); } Status = EStatus.FieldChoosing; @@ -314,36 +314,36 @@ namespace Vocaluxe.PartyModes if (GameData.CurrentRoundNr <= GameData.NumFields && Winner == 0) { UpdateTeamChoosingMessage(); - Texts[htTexts(TextNextPlayerT1)].Visible = false; - Texts[htTexts(TextNextPlayerT2)].Visible = false; - Texts[htTexts(TextNextPlayerNameT1)].Visible = false; - Texts[htTexts(TextNextPlayerNameT2)].Visible = false; - Statics[htStatics(StaticAvatarT1)].Visible = false; - Statics[htStatics(StaticAvatarT2)].Visible = false; - Buttons[htButtons(ButtonJokerRandomT1)].Visible = false; - Buttons[htButtons(ButtonJokerRandomT2)].Visible = false; - Buttons[htButtons(ButtonJokerRetryT1)].Visible = false; - Buttons[htButtons(ButtonJokerRetryT2)].Visible = false; - Buttons[htButtons(ButtonNextRound)].Visible = false; - Texts[htTexts(TextFinishMessage)].Visible = false; + Texts[TextNextPlayerT1].Visible = false; + Texts[TextNextPlayerT2].Visible = false; + Texts[TextNextPlayerNameT1].Visible = false; + Texts[TextNextPlayerNameT2].Visible = false; + Statics[StaticAvatarT1].Visible = false; + Statics[StaticAvatarT2].Visible = false; + Buttons[ButtonJokerRandomT1].Visible = false; + Buttons[ButtonJokerRandomT2].Visible = false; + Buttons[ButtonJokerRetryT1].Visible = false; + Buttons[ButtonJokerRetryT2].Visible = false; + Buttons[ButtonNextRound].Visible = false; + Texts[TextFinishMessage].Visible = false; } else { Status = EStatus.None; - Buttons[htButtons(ButtonNextRound)].Visible = false; - Texts[htTexts(TextFinishMessage)].Visible = true; - Texts[htTexts(TextTeamChoosing)].Visible = false; + Buttons[ButtonNextRound].Visible = false; + Texts[TextFinishMessage].Visible = true; + Texts[TextTeamChoosing].Visible = false; if (Winner > 0) { - Texts[htTexts(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].Color = CBase.Theme.GetPlayerColor(Winner); + Texts[TextFinishMessage].Text = CBase.Language.Translate("TR_SCREENMAIN_WINNER", _PartyModeID) + " " + CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + Winner; } else { - Texts[htTexts(TextFinishMessage)].Color = new SColorF(1, 1, 1, 1); - Texts[htTexts(TextFinishMessage)].Text = CBase.Language.Translate("TR_SCREENMAIN_NOWINNER", _PartyModeID); + Texts[TextFinishMessage].Color = new SColorF(1, 1, 1, 1); + Texts[TextFinishMessage].Text = CBase.Language.Translate("TR_SCREENMAIN_NOWINNER", _PartyModeID); } - SetInteractionToButton(Buttons[htButtons(ButtonExit)]); + SetInteractionToButton(Buttons[ButtonExit]); } ShowPopup(false); @@ -372,7 +372,7 @@ namespace Vocaluxe.PartyModes for (int i = 0; i < 25; i++) { Field f = new Field(); - f.Button = GetNewButton(Buttons[htButtons(ButtonField)]); + f.Button = GetNewButton(Buttons[ButtonField]); f.Button.Visible = false; f.Content = new Round(); AddButton(f.Button); @@ -429,9 +429,9 @@ namespace Vocaluxe.PartyModes for (int i = 0; i < GameData.Rounds.Count; i++) { Fields[i].Button.Enabled = true; - Fields[i].Button.Texture = Buttons[htButtons(ButtonField)].Texture; - Fields[i].Button.Color = Buttons[htButtons(ButtonField)].Color; - Fields[i].Button.SColor = Buttons[htButtons(ButtonField)].SColor; + Fields[i].Button.Texture = Buttons[ButtonField].Texture; + Fields[i].Button.Color = Buttons[ButtonField].Color; + Fields[i].Button.SColor = Buttons[ButtonField].SColor; Fields[i].Content = GameData.Rounds[i]; if (Fields[i].Content.Finished) { @@ -500,25 +500,25 @@ namespace Vocaluxe.PartyModes GameData.Rounds[SelectedField].SingerTeam2 = SingerTeam2; UpdateFieldContents(); - Texts[htTexts(TextNextPlayerT1)].Visible = true; - Texts[htTexts(TextNextPlayerT2)].Visible = true; - Texts[htTexts(TextNextPlayerNameT1)].Visible = true; - Texts[htTexts(TextNextPlayerNameT2)].Visible = true; + Texts[TextNextPlayerT1].Visible = true; + Texts[TextNextPlayerT2].Visible = true; + Texts[TextNextPlayerNameT1].Visible = true; + Texts[TextNextPlayerNameT2].Visible = true; SProfile[] profiles = CBase.Profiles.GetProfiles(); - Texts[htTexts(TextNextPlayerNameT1)].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName; - Texts[htTexts(TextNextPlayerNameT2)].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName; - Statics[htStatics(StaticAvatarT1)].Visible = true; - Statics[htStatics(StaticAvatarT2)].Visible = true; - Statics[htStatics(StaticAvatarT1)].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture; - Statics[htStatics(StaticAvatarT2)].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture; + Texts[TextNextPlayerNameT1].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName; + Texts[TextNextPlayerNameT2].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName; + Statics[StaticAvatarT1].Visible = true; + Statics[StaticAvatarT2].Visible = true; + Statics[StaticAvatarT1].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture; + Statics[StaticAvatarT2].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture; UpdateJokerButtons(); - Buttons[htButtons(ButtonNextRound)].Visible = true; - Buttons[htButtons(ButtonExit)].Visible = true; - Buttons[htButtons(ButtonBack)].Visible = false; + Buttons[ButtonNextRound].Visible = true; + Buttons[ButtonExit].Visible = true; + Buttons[ButtonBack].Visible = false; - SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); + SetInteractionToButton(Buttons[ButtonNextRound]); } private void FieldSelectedAgain() @@ -539,25 +539,25 @@ namespace Vocaluxe.PartyModes GameData.Rounds[SelectedField].SingerTeam2 = GameData.Rounds[OldSelectedField].SingerTeam2; UpdateFieldContents(); - Texts[htTexts(TextNextPlayerT1)].Visible = true; - Texts[htTexts(TextNextPlayerT2)].Visible = true; - Texts[htTexts(TextNextPlayerNameT1)].Visible = true; - Texts[htTexts(TextNextPlayerNameT2)].Visible = true; + Texts[TextNextPlayerT1].Visible = true; + Texts[TextNextPlayerT2].Visible = true; + Texts[TextNextPlayerNameT1].Visible = true; + Texts[TextNextPlayerNameT2].Visible = true; SProfile[] profiles = CBase.Profiles.GetProfiles(); - Texts[htTexts(TextNextPlayerNameT1)].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName; - Texts[htTexts(TextNextPlayerNameT2)].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName; - Statics[htStatics(StaticAvatarT1)].Visible = true; - Statics[htStatics(StaticAvatarT2)].Visible = true; - Statics[htStatics(StaticAvatarT1)].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture; - Statics[htStatics(StaticAvatarT2)].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture; + Texts[TextNextPlayerNameT1].Text = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].PlayerName; + Texts[TextNextPlayerNameT2].Text = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].PlayerName; + Statics[StaticAvatarT1].Visible = true; + Statics[StaticAvatarT2].Visible = true; + Statics[StaticAvatarT1].Texture = profiles[GameData.ProfileIDsTeam1[GameData.Rounds[SelectedField].SingerTeam1]].Avatar.Texture; + Statics[StaticAvatarT2].Texture = profiles[GameData.ProfileIDsTeam2[GameData.Rounds[SelectedField].SingerTeam2]].Avatar.Texture; UpdateJokerButtons(); - Buttons[htButtons(ButtonNextRound)].Visible = true; - Buttons[htButtons(ButtonExit)].Visible = true; - Buttons[htButtons(ButtonBack)].Visible = false; + Buttons[ButtonNextRound].Visible = true; + Buttons[ButtonExit].Visible = true; + Buttons[ButtonBack].Visible = false; - SetInteractionToButton(Buttons[htButtons(ButtonNextRound)]); + SetInteractionToButton(Buttons[ButtonNextRound]); } private void UseJoker(int TeamNr, int JokerNum) @@ -595,28 +595,28 @@ namespace Vocaluxe.PartyModes private void UpdateTeamChoosingMessage() { - Texts[htTexts(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].Color = CBase.Theme.GetPlayerColor(GameData.Team + 1); + Texts[TextTeamChoosing].Text = CBase.Language.Translate("TR_TEAM", _PartyModeID) + " " + (GameData.Team + 1) + "! " + CBase.Language.Translate("TR_SCREENMAIN_TEAM_CHOOSE", _PartyModeID); if (Status == EStatus.JokerRetry || Status == EStatus.FieldChoosing) - Texts[htTexts(TextTeamChoosing)].Visible = true; + Texts[TextTeamChoosing].Visible = true; else - Texts[htTexts(TextTeamChoosing)].Visible = false; + Texts[TextTeamChoosing].Visible = false; } private void UpdateJokerButtons() { - Buttons[htButtons(ButtonJokerRandomT1)].Visible = true; - Buttons[htButtons(ButtonJokerRandomT2)].Visible = true; - Buttons[htButtons(ButtonJokerRandomT1)].Text.Text = GameData.NumJokerRandom[0].ToString(); - Buttons[htButtons(ButtonJokerRandomT2)].Text.Text = GameData.NumJokerRandom[1].ToString(); - Buttons[htButtons(ButtonJokerRandomT1)].Enabled = GameData.NumJokerRandom[0] > 0; - Buttons[htButtons(ButtonJokerRandomT2)].Enabled = GameData.NumJokerRandom[1] > 0; - Buttons[htButtons(ButtonJokerRetryT1)].Visible = true; - Buttons[htButtons(ButtonJokerRetryT2)].Visible = true; - Buttons[htButtons(ButtonJokerRetryT1)].Text.Text = GameData.NumJokerRetry[0].ToString(); - Buttons[htButtons(ButtonJokerRetryT2)].Text.Text = GameData.NumJokerRetry[1].ToString(); - Buttons[htButtons(ButtonJokerRetryT1)].Enabled = GameData.NumJokerRetry[0] > 0; - Buttons[htButtons(ButtonJokerRetryT2)].Enabled = GameData.NumJokerRetry[1] > 0; + Buttons[ButtonJokerRandomT1].Visible = true; + Buttons[ButtonJokerRandomT2].Visible = true; + Buttons[ButtonJokerRandomT1].Text.Text = GameData.NumJokerRandom[0].ToString(); + Buttons[ButtonJokerRandomT2].Text.Text = GameData.NumJokerRandom[1].ToString(); + Buttons[ButtonJokerRandomT1].Enabled = GameData.NumJokerRandom[0] > 0; + Buttons[ButtonJokerRandomT2].Enabled = GameData.NumJokerRandom[1] > 0; + Buttons[ButtonJokerRetryT1].Visible = true; + Buttons[ButtonJokerRetryT2].Visible = true; + Buttons[ButtonJokerRetryT1].Text.Text = GameData.NumJokerRetry[0].ToString(); + Buttons[ButtonJokerRetryT2].Text.Text = GameData.NumJokerRetry[1].ToString(); + Buttons[ButtonJokerRetryT1].Enabled = GameData.NumJokerRetry[0] > 0; + Buttons[ButtonJokerRetryT2].Enabled = GameData.NumJokerRetry[1] > 0; } private void NextRound() @@ -642,13 +642,13 @@ namespace Vocaluxe.PartyModes { ExitPopupVisible = Visible; - Statics[htStatics(StaticPopupBG)].Visible = ExitPopupVisible; - Texts[htTexts(TextPopupReallyExit)].Visible = ExitPopupVisible; - Buttons[htButtons(ButtonPopupYes)].Visible = ExitPopupVisible; - Buttons[htButtons(ButtonPopupNo)].Visible = ExitPopupVisible; + Statics[StaticPopupBG].Visible = ExitPopupVisible; + Texts[TextPopupReallyExit].Visible = ExitPopupVisible; + Buttons[ButtonPopupYes].Visible = ExitPopupVisible; + Buttons[ButtonPopupNo].Visible = ExitPopupVisible; if (ExitPopupVisible) - SetInteractionToButton(Buttons[htButtons(ButtonPopupNo)]); + SetInteractionToButton(Buttons[ButtonPopupNo]); } private void Back() diff --git a/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeNames.cs b/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeNames.cs index 7edfec94..c095028a 100644 --- a/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeNames.cs +++ b/PartyModes/PartyModeTicTacToe/PartyScreenTicTacToeNames.cs @@ -144,16 +144,16 @@ namespace Vocaluxe.PartyModes break; case Keys.Enter: - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); - if (Buttons[htButtons(ButtonPlayerChooseScrollUp)].Selected) + if (Buttons[ButtonPlayerChooseScrollUp].Selected) Scroll(-1); - if (Buttons[htButtons(ButtonPlayerChooseScrollDown)].Selected) + if (Buttons[ButtonPlayerChooseScrollDown].Selected) Scroll(1); if (!OnAdd()) @@ -277,16 +277,16 @@ namespace Vocaluxe.PartyModes if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonBack)].Selected) + if (Buttons[ButtonBack].Selected) Back(); - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) Next(); - if (Buttons[htButtons(ButtonPlayerChooseScrollUp)].Selected) + if (Buttons[ButtonPlayerChooseScrollUp].Selected) Scroll(-1); - if (Buttons[htButtons(ButtonPlayerChooseScrollDown)].Selected) + if (Buttons[ButtonPlayerChooseScrollDown].Selected) Scroll(1); } @@ -354,13 +354,13 @@ namespace Vocaluxe.PartyModes private void AddButtonPlayerDestination() { - Buttons[htButtons(ButtonPlayerDestination)].Visible = false; + Buttons[ButtonPlayerDestination].Visible = false; PlayerDestinationButtons = new List(); int row = 0; int column = 0; for (int i = 1; i <= _PartyMode.GetMaxPlayer(); i++) { - CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerDestination)]); + CButton b = GetNewButton(Buttons[ButtonPlayerDestination]); b.Rect.X = PlayerDestinationButtonsFirstX + column * (b.Rect.W + PlayerDestinationButtonsSpaceH); b.Rect.Y = PlayerDestinationButtonsFirstY + row * (b.Rect.H + PlayerDestinationButtonsSpaceW); PlayerDestinationButtons.Add(b); @@ -378,13 +378,13 @@ namespace Vocaluxe.PartyModes private void AddButtonPlayerChoose() { - Buttons[htButtons(ButtonPlayerChoose)].Visible = false; + Buttons[ButtonPlayerChoose].Visible = false; PlayerChooseButtons = new List(); int row = 0; int column = 0; for (int i = 1; i <= PlayerChooseButtonsNumH * PlayerChooseButtonsNumW; i++) { - CButton b = GetNewButton(Buttons[htButtons(ButtonPlayerChoose)]); + CButton b = GetNewButton(Buttons[ButtonPlayerChoose]); b.Rect.X = PlayerChooseButtonsFirstX + column * (b.Rect.W + PlayerChooseButtonsSpaceH); b.Rect.Y = PlayerChooseButtonsFirstY + row * (b.Rect.H + PlayerChooseButtonsSpaceW); CPlayerChooseButton pcb = new CPlayerChooseButton(); @@ -414,8 +414,8 @@ namespace Vocaluxe.PartyModes { UpdateButtonPlayerChoose(PlayerChooseButtonsOffset); } - Buttons[htButtons(ButtonPlayerChooseScrollUp)].Enabled = PlayerChooseButtonsOffset > 0; - Buttons[htButtons(ButtonPlayerChooseScrollDown)].Enabled = PlayerChooseButtonsVisibleProfiles.Count > PlayerChooseButtons.Count + PlayerChooseButtonsOffset * PlayerChooseButtonsNumH; + Buttons[ButtonPlayerChooseScrollUp].Enabled = PlayerChooseButtonsOffset > 0; + Buttons[ButtonPlayerChooseScrollDown].Enabled = PlayerChooseButtonsVisibleProfiles.Count > PlayerChooseButtons.Count + PlayerChooseButtonsOffset * PlayerChooseButtonsNumH; } private void UpdateButtonPlayerChoose(int Offset) @@ -442,10 +442,10 @@ namespace Vocaluxe.PartyModes { PlayerChooseButtons[i].ProfileID = -1; PlayerChooseButtons[i].Button.Text.Text = String.Empty; - PlayerChooseButtons[i].Button.Texture = Buttons[htButtons(ButtonPlayerChoose)].Texture; - PlayerChooseButtons[i].Button.STexture = Buttons[htButtons(ButtonPlayerChoose)].STexture; - PlayerChooseButtons[i].Button.Color = Buttons[htButtons(ButtonPlayerChoose)].Color; - PlayerChooseButtons[i].Button.SColor = Buttons[htButtons(ButtonPlayerChoose)].SColor; + PlayerChooseButtons[i].Button.Texture = Buttons[ButtonPlayerChoose].Texture; + PlayerChooseButtons[i].Button.STexture = Buttons[ButtonPlayerChoose].STexture; + PlayerChooseButtons[i].Button.Color = Buttons[ButtonPlayerChoose].Color; + PlayerChooseButtons[i].Button.SColor = Buttons[ButtonPlayerChoose].SColor; PlayerChooseButtons[i].Button.Enabled = false; } } @@ -534,10 +534,10 @@ namespace Vocaluxe.PartyModes } else { - PlayerDestinationButtons[i].Color = Buttons[htButtons(ButtonPlayerDestination)].Color; - PlayerDestinationButtons[i].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor; - PlayerDestinationButtons[i].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture; - PlayerDestinationButtons[i].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture; + PlayerDestinationButtons[i].Color = Buttons[ButtonPlayerDestination].Color; + PlayerDestinationButtons[i].SColor = Buttons[ButtonPlayerDestination].SColor; + PlayerDestinationButtons[i].Texture = Buttons[ButtonPlayerDestination].Texture; + PlayerDestinationButtons[i].STexture = Buttons[ButtonPlayerDestination].STexture; PlayerDestinationButtons[i].Text.Text = String.Empty; PlayerDestinationButtons[i].Enabled = false; } @@ -558,10 +558,10 @@ namespace Vocaluxe.PartyModes } else { - PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Color = Buttons[htButtons(ButtonPlayerDestination)].Color; - PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].SColor = Buttons[htButtons(ButtonPlayerDestination)].SColor; - PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Texture = Buttons[htButtons(ButtonPlayerDestination)].Texture; - PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].STexture = Buttons[htButtons(ButtonPlayerDestination)].STexture; + PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Color = Buttons[ButtonPlayerDestination].Color; + PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].SColor = Buttons[ButtonPlayerDestination].SColor; + PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Texture = Buttons[ButtonPlayerDestination].Texture; + PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].STexture = Buttons[ButtonPlayerDestination].STexture; PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Text.Text = String.Empty; PlayerDestinationButtons[i + PlayerDestinationButtonsNumH].Enabled = false; } @@ -572,11 +572,11 @@ namespace Vocaluxe.PartyModes { if (Data.ScreenNames.ProfileIDsTeam1.Count == NumPlayerTeam1 && Data.ScreenNames.ProfileIDsTeam2.Count == NumPlayerTeam2) { - Buttons[htButtons(ButtonNext)].Visible = true; - SetInteractionToButton(Buttons[htButtons(ButtonNext)]); + Buttons[ButtonNext].Visible = true; + SetInteractionToButton(Buttons[ButtonNext]); } else - Buttons[htButtons(ButtonNext)].Visible = false; + Buttons[ButtonNext].Visible = false; } private bool OnAdd() diff --git a/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs b/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs index 72c59faf..13f5b04f 100644 --- a/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs +++ b/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs @@ -42,7 +42,7 @@ namespace Vocaluxe.Lib.Video i = CGstreamerVideoWrapper.LoadVideo(u.AbsoluteUri); return i; } - catch (Exception e) { } + catch (Exception) { } return i; } diff --git a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs index 495b9cdf..1e10751e 100644 --- a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs +++ b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs @@ -104,7 +104,7 @@ namespace Vocaluxe.Screens { base.LoadTheme(XmlPath); - _ScreenArea = Statics[htStatics(StaticBG)].Rect; + _ScreenArea = Statics[StaticBG].Rect; } public override bool HandleInput(KeyEvent KeyEvent) @@ -124,21 +124,21 @@ namespace Vocaluxe.Screens return false; case Keys.Enter: - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) CBackgroundMusic.Next(); - if (Buttons[htButtons(ButtonPrevious)].Selected) + if (Buttons[ButtonPrevious].Selected) CBackgroundMusic.Previous(); - if (Buttons[htButtons(ButtonPlay)].Selected) + if (Buttons[ButtonPlay].Selected) CBackgroundMusic.Play(); - if (Buttons[htButtons(ButtonPause)].Selected) + if (Buttons[ButtonPause].Selected) CBackgroundMusic.Pause(); - if (Buttons[htButtons(ButtonRepeat)].Selected) + if (Buttons[ButtonRepeat].Selected) CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong; - if (Buttons[htButtons(ButtonShowVideo)].Selected) + if (Buttons[ButtonShowVideo].Selected) VideoPreview = !VideoPreview; - if (Buttons[htButtons(ButtonSing)].Selected) + if (Buttons[ButtonSing].Selected) StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet); - if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected) + if (Buttons[ButtonToBackgroundVideo].Selected) VideoBackground = !VideoBackground; break; } @@ -152,21 +152,21 @@ namespace Vocaluxe.Screens base.HandleMouse(MouseEvent); if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonNext)].Selected) + if (Buttons[ButtonNext].Selected) CBackgroundMusic.Next(); - if (Buttons[htButtons(ButtonPrevious)].Selected) + if (Buttons[ButtonPrevious].Selected) CBackgroundMusic.Previous(); - if (Buttons[htButtons(ButtonPlay)].Selected) + if (Buttons[ButtonPlay].Selected) CBackgroundMusic.Play(); - if (Buttons[htButtons(ButtonPause)].Selected) + if (Buttons[ButtonPause].Selected) CBackgroundMusic.Pause(); - if (Buttons[htButtons(ButtonRepeat)].Selected) + if (Buttons[ButtonRepeat].Selected) CBackgroundMusic.RepeatSong = !CBackgroundMusic.RepeatSong; - if (Buttons[htButtons(ButtonShowVideo)].Selected) + if (Buttons[ButtonShowVideo].Selected) VideoPreview = !VideoPreview; - if (Buttons[htButtons(ButtonSing)].Selected) + if (Buttons[ButtonSing].Selected) StartSong(CBackgroundMusic.SongID, CBackgroundMusic.Duet); - if (Buttons[htButtons(ButtonToBackgroundVideo)].Selected) + if (Buttons[ButtonToBackgroundVideo].Selected) VideoBackground = !VideoBackground; } else if (MouseEvent.LB) { @@ -183,11 +183,11 @@ namespace Vocaluxe.Screens public override bool UpdateGame() { - Statics[htStatics(StaticCover)].Visible = !_VideoPreview || !CBackgroundMusic.SongHasVideo; - Buttons[htButtons(ButtonToBackgroundVideo)].Pressed = VideoBackground; - Buttons[htButtons(ButtonShowVideo)].Pressed = _VideoPreview; - Buttons[htButtons(ButtonRepeat)].Pressed = CBackgroundMusic.RepeatSong; - Buttons[htButtons(ButtonSing)].Visible = CBackgroundMusic.CanSing && CParty.CurrentPartyModeID == -1; + Statics[StaticCover].Visible = !_VideoPreview || !CBackgroundMusic.SongHasVideo; + Buttons[ButtonToBackgroundVideo].Pressed = VideoBackground; + Buttons[ButtonShowVideo].Pressed = _VideoPreview; + Buttons[ButtonRepeat].Pressed = CBackgroundMusic.RepeatSong; + Buttons[ButtonSing].Visible = CBackgroundMusic.CanSing && CParty.CurrentPartyModeID == -1; return true; } @@ -200,12 +200,12 @@ namespace Vocaluxe.Screens { if (!_Active) return false; - Statics[htStatics(StaticCover)].Texture = CBackgroundMusic.Cover; + Statics[StaticCover].Texture = CBackgroundMusic.Cover; if (CBackgroundMusic.VideoEnabled && VideoPreview && CBackgroundMusic.SongHasVideo) - CDraw.DrawTexture(Statics[htStatics(StaticCover)], CBackgroundMusic.GetVideoTexture(), EAspect.Crop); - Buttons[htButtons(ButtonPause)].Visible = CBackgroundMusic.Playing; - Buttons[htButtons(ButtonPlay)].Visible = !CBackgroundMusic.Playing; - Texts[htTexts(TextCurrentSong)].Text = CBackgroundMusic.ArtistAndTitle; + CDraw.DrawTexture(Statics[StaticCover], CBackgroundMusic.GetVideoTexture(), EAspect.Crop); + Buttons[ButtonPause].Visible = CBackgroundMusic.Playing; + Buttons[ButtonPlay].Visible = !CBackgroundMusic.Playing; + Texts[TextCurrentSong].Text = CBackgroundMusic.ArtistAndTitle; return base.Draw(); } diff --git a/Vocaluxe/Screens/CPopupScreenVolumeControl.cs b/Vocaluxe/Screens/CPopupScreenVolumeControl.cs index 19ef40d9..2256acb1 100644 --- a/Vocaluxe/Screens/CPopupScreenVolumeControl.cs +++ b/Vocaluxe/Screens/CPopupScreenVolumeControl.cs @@ -42,8 +42,8 @@ namespace Vocaluxe.Screens { base.LoadTheme(XmlPath); - _ScreenArea = Statics[htStatics(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" }); + _ScreenArea = Statics[StaticBG].Rect; + 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) @@ -62,19 +62,19 @@ namespace Vocaluxe.Screens } else if (MouseEvent.Wheel > 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent)) { - if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel >= 0) - SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel; - else if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel < 0) - SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = 0; + if (SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel >= 0) + SelectSlides[SelectSlideVolume].Selection = SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel; + else if (SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel < 0) + SelectSlides[SelectSlideVolume].Selection = 0; SaveConfig(); return true; } else if (MouseEvent.Wheel < 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent)) { - if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel < SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues) - SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel; - else if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel >= SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues) - SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues - 1; + if (SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel < SelectSlides[SelectSlideVolume].NumValues) + SelectSlides[SelectSlideVolume].Selection = SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel; + else if (SelectSlides[SelectSlideVolume].Selection - MouseEvent.Wheel >= SelectSlides[SelectSlideVolume].NumValues) + SelectSlides[SelectSlideVolume].Selection = SelectSlides[SelectSlideVolume].NumValues - 1; SaveConfig(); return true; } @@ -111,20 +111,20 @@ namespace Vocaluxe.Screens { case EScreens.ScreenSong: if (CSongs.IsInCategory) - CConfig.PreviewMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5; + CConfig.PreviewMusicVolume = SelectSlides[SelectSlideVolume].Selection * 5; else { - CConfig.BackgroundMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5; + CConfig.BackgroundMusicVolume = SelectSlides[SelectSlideVolume].Selection * 5; CBackgroundMusic.ApplyVolume(); } break; case EScreens.ScreenSing: - CConfig.GameMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5; + CConfig.GameMusicVolume = SelectSlides[SelectSlideVolume].Selection * 5; break; default: - CConfig.BackgroundMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5; + CConfig.BackgroundMusicVolume = SelectSlides[SelectSlideVolume].Selection * 5; CBackgroundMusic.ApplyVolume(); break; } @@ -137,17 +137,17 @@ namespace Vocaluxe.Screens { case EScreens.ScreenSong: if(CSongs.IsInCategory) - SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = (int)(CConfig.PreviewMusicVolume / 5); + SelectSlides[SelectSlideVolume].Selection = (int)(CConfig.PreviewMusicVolume / 5); else - SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = ((int)CConfig.BackgroundMusicVolume / 5); + SelectSlides[SelectSlideVolume].Selection = ((int)CConfig.BackgroundMusicVolume / 5); break; case EScreens.ScreenSing: - SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = ((int)CConfig.GameMusicVolume / 5); + SelectSlides[SelectSlideVolume].Selection = ((int)CConfig.GameMusicVolume / 5); break; default: - SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = ((int)CConfig.BackgroundMusicVolume / 5); + SelectSlides[SelectSlideVolume].Selection = ((int)CConfig.BackgroundMusicVolume / 5); break; } } diff --git a/Vocaluxe/Screens/CScreenHighscore.cs b/Vocaluxe/Screens/CScreenHighscore.cs index fff28659..33a84e39 100644 --- a/Vocaluxe/Screens/CScreenHighscore.cs +++ b/Vocaluxe/Screens/CScreenHighscore.cs @@ -160,38 +160,38 @@ namespace Vocaluxe.Screens { if (_Pos + p < _Scores[_Round].Count) { - Texts[htTexts(TextNumber[p])].Visible = true; - Texts[htTexts(TextName[p])].Visible = true; - Texts[htTexts(TextScore[p])].Visible = true; - Texts[htTexts(TextDate[p])].Visible = true; + Texts[TextNumber[p]].Visible = true; + Texts[TextName[p]].Visible = true; + Texts[TextScore[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; name += " [" + CLanguage.Translate(Enum.GetName(typeof(EGameDifficulty), _Scores[_Round][_Pos + p].Difficulty)) + "]"; if (_IsDuet) 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[htTexts(TextDate[p])].Text = _Scores[_Round][_Pos + p].Date; + Texts[TextScore[p]].Text = _Scores[_Round][_Pos + p].Score.ToString("00000"); + Texts[TextDate[p]].Text = _Scores[_Round][_Pos + p].Date; if (isNewEntry(_Scores[_Round][_Pos + p].ID) == true) { - ParticleEffects[htParticleEffects(ParticleEffectNew[p])].Visible = true; + ParticleEffects[ParticleEffectNew[p]].Visible = true; } else { - ParticleEffects[htParticleEffects(ParticleEffectNew[p])].Visible = false; + ParticleEffects[ParticleEffectNew[p]].Visible = false; } } else { - Texts[htTexts(TextNumber[p])].Visible = false; - Texts[htTexts(TextName[p])].Visible = false; - Texts[htTexts(TextScore[p])].Visible = false; - Texts[htTexts(TextDate[p])].Visible = false; - ParticleEffects[htParticleEffects(ParticleEffectNew[p])].Visible = false; + Texts[TextNumber[p]].Visible = false; + Texts[TextName[p]].Visible = false; + Texts[TextScore[p]].Visible = false; + Texts[TextDate[p]].Visible = false; + ParticleEffects[ParticleEffectNew[p]].Visible = false; } } return true; @@ -275,33 +275,33 @@ namespace Vocaluxe.Screens if (song == null) return; - Texts[htTexts(TextSongName)].Text = song.Artist + " - " + song.Title; + Texts[TextSongName].Text = song.Artist + " - " + song.Title; if (points.NumRounds > 1) { - Texts[htTexts(TextSongName)].Text += " (" + (_Round+1) + "/" + points.NumRounds + ")"; + Texts[TextSongName].Text += " (" + (_Round+1) + "/" + points.NumRounds + ")"; } switch (CGame.GetGameMode(_Round)) { case EGameMode.TR_GAMEMODE_NORMAL: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; + Texts[TextSongMode].Text = "TR_GAMEMODE_NORMAL"; break; case EGameMode.TR_GAMEMODE_MEDLEY: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_MEDLEY"; + Texts[TextSongMode].Text = "TR_GAMEMODE_MEDLEY"; break; case EGameMode.TR_GAMEMODE_DUET: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_DUET"; + Texts[TextSongMode].Text = "TR_GAMEMODE_DUET"; _IsDuet = true; break; case EGameMode.TR_GAMEMODE_SHORTSONG: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_SHORTSONG"; + Texts[TextSongMode].Text = "TR_GAMEMODE_SHORTSONG"; break; default: - Texts[htTexts(TextSongMode)].Text = "TR_GAMEMODE_NORMAL"; + Texts[TextSongMode].Text = "TR_GAMEMODE_NORMAL"; break; } diff --git a/Vocaluxe/Screens/CScreenLoad.cs b/Vocaluxe/Screens/CScreenLoad.cs index 6b83f4fb..8569ab59 100644 --- a/Vocaluxe/Screens/CScreenLoad.cs +++ b/Vocaluxe/Screens/CScreenLoad.cs @@ -106,7 +106,7 @@ namespace Vocaluxe.Screens _SongLoaderThread = new Thread(new ThreadStart(CSongs.LoadSongs)); _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_LOADED") + ")"; @@ -175,7 +175,7 @@ namespace Vocaluxe.Screens if (CSettings.GameState == EGameState.Normal) CGraphics.FadeTo(EScreens.ScreenMain); - Texts[htTexts(TextStatus)].Text = + Texts[TextStatus].Text = CLanguage.Translate("TR_SCREENLOAD_TOTAL") + ": " + CSongs.NumAllSongs.ToString() + " " + CLanguage.Translate("TR_SCREENLOAD_SONGS") + " (" + CSongs.NumSongsWithCoverLoaded + " " + CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")"; diff --git a/Vocaluxe/Screens/CScreenMain.cs b/Vocaluxe/Screens/CScreenMain.cs index 79f31142..4278b878 100644 --- a/Vocaluxe/Screens/CScreenMain.cs +++ b/Vocaluxe/Screens/CScreenMain.cs @@ -74,22 +74,22 @@ namespace Vocaluxe.Screens break; case Keys.Enter: - if (Buttons[htButtons(ButtonSing)].Selected) + if (Buttons[ButtonSing].Selected) { CParty.SetNormalGameMode(); CGraphics.FadeTo(EScreens.ScreenSong); } - if (Buttons[htButtons(ButtonParty)].Selected) + if (Buttons[ButtonParty].Selected) CGraphics.FadeTo(EScreens.ScreenParty); - if (Buttons[htButtons(ButtonOptions)].Selected) + if (Buttons[ButtonOptions].Selected) CGraphics.FadeTo(EScreens.ScreenOptions); - if (Buttons[htButtons(ButtonProfiles)].Selected) + if (Buttons[ButtonProfiles].Selected) CGraphics.FadeTo(EScreens.ScreenProfiles); - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) return false; break; @@ -104,22 +104,22 @@ namespace Vocaluxe.Screens if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonSing)].Selected) + if (Buttons[ButtonSing].Selected) { CParty.SetNormalGameMode(); CGraphics.FadeTo(EScreens.ScreenSong); } - if (Buttons[htButtons(ButtonParty)].Selected) + if (Buttons[ButtonParty].Selected) CGraphics.FadeTo(EScreens.ScreenParty); - if (Buttons[htButtons(ButtonOptions)].Selected) + if (Buttons[ButtonOptions].Selected) CGraphics.FadeTo(EScreens.ScreenOptions); - if (Buttons[htButtons(ButtonProfiles)].Selected) + if (Buttons[ButtonProfiles].Selected) CGraphics.FadeTo(EScreens.ScreenProfiles); - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) return false; } diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 1767dd95..269cb060 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -107,12 +107,12 @@ namespace Vocaluxe.Screens 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++) { - Equalizers[htEqualizer("EqualizerPlayer" + i)].ScreenHandles = true; + Equalizers["EqualizerPlayer" + i].ScreenHandles = true; } } @@ -123,20 +123,20 @@ namespace Vocaluxe.Screens case Keys.Add: if (CConfig.NumPlayer + 1 <= CSettings.MaxNumPlayer) { - SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Selection = CConfig.NumPlayer; + SelectSlides[SelectSlidePlayerNumber].Selection = CConfig.NumPlayer; UpdatePlayerNumber(); //Update Tiles-List - NameSelections[htNameSelections(NameSelection)].UpdateList(); + NameSelections[NameSelection].UpdateList(); } break; case Keys.Subtract: if (CConfig.NumPlayer - 1 > 0) { - SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Selection = CConfig.NumPlayer - 2; + SelectSlides[SelectSlidePlayerNumber].Selection = CConfig.NumPlayer - 2; UpdatePlayerNumber(); //Update Tiles-List - NameSelections[htNameSelections(NameSelection)].UpdateList(); + NameSelections[NameSelection].UpdateList(); } break; @@ -152,7 +152,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr++; else selectingKeyboardPlayerNr = 1; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, selectingKeyboardPlayerNr); + NameSelections[NameSelection].KeyboardSelection(true, selectingKeyboardPlayerNr); } break; } @@ -160,14 +160,14 @@ namespace Vocaluxe.Screens if (selectingKeyboardActive) { //Handle left/right/up/down - NameSelections[htNameSelections(NameSelection)].HandleInput(KeyEvent); + NameSelections[NameSelection].HandleInput(KeyEvent); switch (KeyEvent.Key) { case Keys.Enter: //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 CGame.Player[selectingKeyboardPlayerNr-1].Name = CProfiles.Profiles[SelectedPlayerNr].PlayerName; 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.SaveConfig(); //Update texture and name - Statics[htStatics(StaticPlayerAvatar[selectingKeyboardPlayerNr-1])].Texture = CProfiles.Profiles[SelectedPlayerNr].Avatar.Texture; - Texts[htTexts(TextPlayer[selectingKeyboardPlayerNr-1])].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName; + Statics[StaticPlayerAvatar[selectingKeyboardPlayerNr-1]].Texture = CProfiles.Profiles[SelectedPlayerNr].Avatar.Texture; + Texts[TextPlayer[selectingKeyboardPlayerNr-1]].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName; //Update profile-warning CheckPlayers(); //Update Tiles-List - NameSelections[htNameSelections(NameSelection)].UpdateList(); - SetInteractionToButton(Buttons[htButtons(ButtonStart)]); + NameSelections[NameSelection].UpdateList(); + SetInteractionToButton(Buttons[ButtonStart]); } //Started selecting with 'P' if (selectingKeyboardUnendless) @@ -192,12 +192,12 @@ namespace Vocaluxe.Screens //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + NameSelections[NameSelection].KeyboardSelection(false, -1); } else { selectingKeyboardPlayerNr++; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, selectingKeyboardPlayerNr); + NameSelections[NameSelection].KeyboardSelection(true, selectingKeyboardPlayerNr); } } else @@ -205,7 +205,7 @@ namespace Vocaluxe.Screens //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + NameSelections[NameSelection].KeyboardSelection(false, -1); } break; @@ -216,12 +216,12 @@ namespace Vocaluxe.Screens //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + NameSelections[NameSelection].KeyboardSelection(false, -1); } else { selectingKeyboardPlayerNr = 1; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 1); + NameSelections[NameSelection].KeyboardSelection(true, 1); } selectingKeyboardUnendless = false; break; @@ -232,12 +232,12 @@ namespace Vocaluxe.Screens //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + NameSelections[NameSelection].KeyboardSelection(false, -1); } else { selectingKeyboardPlayerNr = 2; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 2); + NameSelections[NameSelection].KeyboardSelection(true, 2); } selectingKeyboardUnendless = false; break; @@ -248,12 +248,12 @@ namespace Vocaluxe.Screens //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + NameSelections[NameSelection].KeyboardSelection(false, -1); } else { selectingKeyboardPlayerNr = 3; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 3); + NameSelections[NameSelection].KeyboardSelection(true, 3); } selectingKeyboardUnendless = false; break; @@ -264,12 +264,12 @@ namespace Vocaluxe.Screens //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + NameSelections[NameSelection].KeyboardSelection(false, -1); } else { selectingKeyboardPlayerNr = 4; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 4); + NameSelections[NameSelection].KeyboardSelection(true, 4); } selectingKeyboardUnendless = false; break; @@ -280,12 +280,12 @@ namespace Vocaluxe.Screens //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + NameSelections[NameSelection].KeyboardSelection(false, -1); } else { selectingKeyboardPlayerNr = 5; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 5); + NameSelections[NameSelection].KeyboardSelection(true, 5); } selectingKeyboardUnendless = false; break; @@ -296,12 +296,12 @@ namespace Vocaluxe.Screens //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + NameSelections[NameSelection].KeyboardSelection(false, -1); } else { selectingKeyboardPlayerNr = 6; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, 6); + NameSelections[NameSelection].KeyboardSelection(true, 6); } selectingKeyboardUnendless = false; break; @@ -311,7 +311,7 @@ namespace Vocaluxe.Screens selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; selectingKeyboardUnendless = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + NameSelections[NameSelection].KeyboardSelection(false, -1); break; case Keys.Delete: @@ -323,31 +323,31 @@ namespace Vocaluxe.Screens CConfig.Players[selectingKeyboardPlayerNr - 1] = String.Empty; CConfig.SaveConfig(); //Update texture and name - Statics[htStatics(StaticPlayerAvatar[selectingKeyboardPlayerNr - 1])].Texture = OriginalPlayerAvatarTextures[selectingKeyboardPlayerNr - 1]; - Texts[htTexts(TextPlayer[selectingKeyboardPlayerNr - 1])].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + selectingKeyboardPlayerNr.ToString(); + Statics[StaticPlayerAvatar[selectingKeyboardPlayerNr - 1]].Texture = OriginalPlayerAvatarTextures[selectingKeyboardPlayerNr - 1]; + Texts[TextPlayer[selectingKeyboardPlayerNr - 1]].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + selectingKeyboardPlayerNr.ToString(); //Update profile-warning CheckPlayers(); //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); + NameSelections[NameSelection].KeyboardSelection(false, -1); //Update Tiles-List - NameSelections[htNameSelections(NameSelection)].UpdateList(); + NameSelections[NameSelection].UpdateList(); break; case Keys.F10: if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) { - if (SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].Selection == 0) - SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].Selection = 1; + if (SelectSlides[SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1]].Selection == 0) + SelectSlides[SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1]].Selection = 1; else - SelectSlides[htSelectSlides(SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1])].Selection = 0; + SelectSlides[SelectSlideDuetPlayer[selectingKeyboardPlayerNr - 1]].Selection = 0; //Reset all values selectingKeyboardPlayerNr = 0; selectingKeyboardActive = false; selectingKeyboardUnendless = false; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(false, -1); - SetInteractionToButton(Buttons[htButtons(ButtonStart)]); + NameSelections[NameSelection].KeyboardSelection(false, -1); + SetInteractionToButton(Buttons[ButtonStart]); } break; @@ -367,13 +367,13 @@ namespace Vocaluxe.Screens case Keys.Enter: - if (!processed && Buttons[htButtons(ButtonBack)].Selected) + if (!processed && Buttons[ButtonBack].Selected) { processed = true; CGraphics.FadeTo(EScreens.ScreenSong); } - if (!processed /* && Buttons[htButtons(ButtonStart)].Selected */) + if (!processed /* && Buttons[ButtonStart].Selected */) { processed = true; StartSong(); @@ -418,7 +418,7 @@ namespace Vocaluxe.Screens if (selectingKeyboardPlayerNr > 0 && selectingKeyboardPlayerNr <= CConfig.NumPlayer) { selectingKeyboardActive = true; - NameSelections[htNameSelections(NameSelection)].KeyboardSelection(true, selectingKeyboardPlayerNr); + NameSelections[NameSelection].KeyboardSelection(true, selectingKeyboardPlayerNr); } } @@ -436,17 +436,17 @@ namespace Vocaluxe.Screens OldMouseX = MouseEvent.X; OldMouseY = MouseEvent.Y; //Check if mouse if over tile - if (NameSelections[htNameSelections(NameSelection)].isOverTile(MouseEvent)) + if (NameSelections[NameSelection].isOverTile(MouseEvent)) { //Get player-number of tile - SelectedPlayerNr = NameSelections[htNameSelections(NameSelection)].TilePlayerNr(MouseEvent); + SelectedPlayerNr = NameSelections[NameSelection].TilePlayerNr(MouseEvent); if (SelectedPlayerNr != -1) { //Activate mouse-selecting selectingMouseActive = true; //Update of Drag/Drop-Texture - CStatic SelectedPlayer = NameSelections[htNameSelections(NameSelection)].TilePlayerAvatar(MouseEvent); + CStatic SelectedPlayer = NameSelections[NameSelection].TilePlayerAvatar(MouseEvent); chooseAvatarStatic.Visible = true; chooseAvatarStatic.Rect = SelectedPlayer.Rect; chooseAvatarStatic.Rect.Z = CSettings.zNear; @@ -475,10 +475,10 @@ namespace Vocaluxe.Screens for (int i = 0; i < StaticPlayer.Length; i++) { //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 - if (CHelper.IsInBounds(Statics[htStatics(StaticPlayer[i])].Rect, MouseEvent)) + if (CHelper.IsInBounds(Statics[StaticPlayer[i]].Rect, MouseEvent)) { //Update Game-infos with new player CGame.Player[i].Name = CProfiles.Profiles[SelectedPlayerNr].PlayerName; @@ -488,12 +488,12 @@ namespace Vocaluxe.Screens CConfig.Players[i] = CProfiles.Profiles[SelectedPlayerNr].ProfileFile; CConfig.SaveConfig(); //Update texture and name - Statics[htStatics(StaticPlayerAvatar[i])].Texture = chooseAvatarStatic.Texture; - Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName; + Statics[StaticPlayerAvatar[i]].Texture = chooseAvatarStatic.Texture; + Texts[TextPlayer[i]].Text = CProfiles.Profiles[SelectedPlayerNr].PlayerName; //Update profile-warning CheckPlayers(); //Update Tiles-List - NameSelections[htNameSelections(NameSelection)].UpdateList(); + NameSelections[NameSelection].UpdateList(); } } } @@ -513,13 +513,13 @@ namespace Vocaluxe.Screens { bool processed = false; - if (!processed && Buttons[htButtons(ButtonBack)].Selected) + if (!processed && Buttons[ButtonBack].Selected) { processed = true; CGraphics.FadeTo(EScreens.ScreenSong); } - if (!processed && Buttons[htButtons(ButtonStart)].Selected) + if (!processed && Buttons[ButtonStart].Selected) { processed = true; StartSong(); @@ -528,7 +528,7 @@ namespace Vocaluxe.Screens if (!processed) UpdatePlayerNumber(); //Update Tiles-List - NameSelections[htNameSelections(NameSelection)].UpdateList(); + NameSelections[NameSelection].UpdateList(); } if (MouseEvent.RB) @@ -538,7 +538,7 @@ namespace Vocaluxe.Screens //Remove profile-selection 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].Name = String.Empty; @@ -547,12 +547,12 @@ namespace Vocaluxe.Screens CConfig.Players[i] = String.Empty; CConfig.SaveConfig(); //Update texture and name - Statics[htStatics(StaticPlayerAvatar[i])].Texture = OriginalPlayerAvatarTextures[i]; - Texts[htTexts(TextPlayer[i])].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + (i+1).ToString(); + Statics[StaticPlayerAvatar[i]].Texture = OriginalPlayerAvatarTextures[i]; + Texts[TextPlayer[i]].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + (i+1).ToString(); //Update profile-warning CheckPlayers(); //Update Tiles-List - NameSelections[htNameSelections(NameSelection)].UpdateList(); + NameSelections[NameSelection].UpdateList(); exit = false; } } @@ -563,10 +563,10 @@ namespace Vocaluxe.Screens //Check mouse-wheel for scrolling 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; - NameSelections[htNameSelections(NameSelection)].UpdateList(offset); + int offset = NameSelections[NameSelection]._Offset + MouseEvent.Wheel; + NameSelections[NameSelection].UpdateList(offset); } } return true; @@ -577,7 +577,7 @@ namespace Vocaluxe.Screens for (int i = 1; i <= CGame.NumPlayer; i++) { CSound.AnalyzeBuffer((i-1)); - Equalizers[htEqualizer("EqualizerPlayer" + i)].Update(CSound.ToneWeigth((i-1))); + Equalizers["EqualizerPlayer" + i].Update(CSound.ToneWeigth((i-1))); } return true; } @@ -587,7 +587,7 @@ namespace Vocaluxe.Screens base.OnShow(); CSound.RecordStart(); - NameSelections[htNameSelections(NameSelection)].Init(); + NameSelections[NameSelection].Init(); UpdateSlides(); UpdatePlayerNumber(); @@ -599,28 +599,28 @@ namespace Vocaluxe.Screens //Update texture and name if (CConfig.Players[i].Length > 0) { - Statics[htStatics(StaticPlayerAvatar[i])].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture; - Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName; + Statics[StaticPlayerAvatar[i]].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture; + Texts[TextPlayer[i]].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName; } if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet) { - SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Clear(); + SelectSlides[SelectSlideDuetPlayer[i]].Clear(); if (i + 1 <= CGame.NumPlayer) - SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = true; + SelectSlides[SelectSlideDuetPlayer[i]].Visible = true; else - SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = false; - SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].AddValue(CGame.GetSong(1).DuetPart1); - SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].AddValue(CGame.GetSong(1).DuetPart2); + SelectSlides[SelectSlideDuetPlayer[i]].Visible = false; + SelectSlides[SelectSlideDuetPlayer[i]].AddValue(CGame.GetSong(1).DuetPart1); + SelectSlides[SelectSlideDuetPlayer[i]].AddValue(CGame.GetSong(1).DuetPart2); if ((i + 1) % 2 == 0) - SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Selection = 1; + SelectSlides[SelectSlideDuetPlayer[i]].Selection = 1; else - SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Selection = 0; + SelectSlides[SelectSlideDuetPlayer[i]].Selection = 0; } else - SelectSlides[htSelectSlides(SelectSlideDuetPlayer[i])].Visible = false; + SelectSlides[SelectSlideDuetPlayer[i]].Visible = false; } - SetInteractionToButton(Buttons[htButtons(ButtonStart)]); + SetInteractionToButton(Buttons[ButtonStart]); } public override void OnClose() @@ -639,7 +639,7 @@ namespace Vocaluxe.Screens } for (int i = 1; i <= CGame.NumPlayer; i++) { - Equalizers[htEqualizer("EqualizerPlayer" + i)].Draw(); + Equalizers["EqualizerPlayer" + i].Draw(); } return true; } @@ -664,7 +664,7 @@ namespace Vocaluxe.Screens } 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() { - SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Clear(); + SelectSlides[SelectSlidePlayerNumber].Clear(); 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() { - CConfig.NumPlayer = (int)SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Selection + 1; - CGame.NumPlayer = (int)SelectSlides[htSelectSlides(SelectSlidePlayerNumber)].Selection + 1; + CConfig.NumPlayer = (int)SelectSlides[SelectSlidePlayerNumber].Selection + 1; + CGame.NumPlayer = (int)SelectSlides[SelectSlidePlayerNumber].Selection + 1; for (int i = 1; i <= CSettings.MaxNumPlayer; i++) { if (i <= CGame.NumPlayer) { - Statics[htStatics("StaticPlayer" + i)].Visible = true; - Statics[htStatics("StaticPlayerAvatar" + i)].Visible = true; - Texts[htTexts("TextPlayer" + i)].Visible = true; - if (Texts[htTexts("TextPlayer" + i)].Text.Length == 0) + Statics["StaticPlayer" + i].Visible = true; + Statics["StaticPlayerAvatar" + i].Visible = true; + Texts["TextPlayer" + i].Visible = true; + 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) - SelectSlides[htSelectSlides("SelectSlideDuetPlayer" + i)].Visible = true; + SelectSlides["SelectSlideDuetPlayer" + i].Visible = true; } else { - Statics[htStatics("StaticPlayer" + i)].Visible = false; - Statics[htStatics("StaticPlayerAvatar" + i)].Visible = false; - Texts[htTexts("TextPlayer" + i)].Visible = false; - Equalizers[htEqualizer("EqualizerPlayer" + i)].Visible = false; - SelectSlides[htSelectSlides("SelectSlideDuetPlayer" + i)].Visible = false; + Statics["StaticPlayer" + i].Visible = false; + Statics["StaticPlayerAvatar" + i].Visible = false; + Texts["TextPlayer" + i].Visible = false; + Equalizers["EqualizerPlayer" + i].Visible = false; + SelectSlides["SelectSlideDuetPlayer" + i].Visible = false; } } CConfig.SaveConfig(); @@ -726,8 +726,8 @@ namespace Vocaluxe.Screens } if (_PlayerWithoutMicro.Count > 0) { - Statics[htStatics(StaticWarningMics)].Visible = true; - Texts[htTexts(TextWarningMics)].Visible = true; + Statics[StaticWarningMics].Visible = true; + Texts[TextWarningMics].Visible = true; 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 { - 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 { - Statics[htStatics(StaticWarningMics)].Visible = false; - Texts[htTexts(TextWarningMics)].Visible = false; + Statics[StaticWarningMics].Visible = false; + Texts[TextWarningMics].Visible = false; } } @@ -775,8 +775,8 @@ namespace Vocaluxe.Screens if (_PlayerWithoutProfile.Count > 0) { - Statics[htStatics(StaticWarningProfiles)].Visible = true; - Texts[htTexts(TextWarningProfiles)].Visible = true; + Statics[StaticWarningProfiles].Visible = true; + Texts[TextWarningProfiles].Visible = true; 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 { - 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 { - Statics[htStatics(StaticWarningProfiles)].Visible = false; - Texts[htTexts(TextWarningProfiles)].Visible = false; + Statics[StaticWarningProfiles].Visible = false; + Texts[TextWarningProfiles].Visible = false; } } } diff --git a/Vocaluxe/Screens/CScreenOptions.cs b/Vocaluxe/Screens/CScreenOptions.cs index 755a03c3..addb4a58 100644 --- a/Vocaluxe/Screens/CScreenOptions.cs +++ b/Vocaluxe/Screens/CScreenOptions.cs @@ -57,22 +57,22 @@ namespace Vocaluxe.Screens break; case Keys.Enter: - if (Buttons[htButtons(ButtonOptionsGame)].Selected) + if (Buttons[ButtonOptionsGame].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsGame); - if (Buttons[htButtons(ButtonOptionsSound)].Selected) + if (Buttons[ButtonOptionsSound].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsSound); - if (Buttons[htButtons(ButtonOptionsRecord)].Selected) + if (Buttons[ButtonOptionsRecord].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsRecord); - if (Buttons[htButtons(ButtonOptionsVideo)].Selected) + if (Buttons[ButtonOptionsVideo].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsVideo); - if (Buttons[htButtons(ButtonOptionsLyrics)].Selected) + if (Buttons[ButtonOptionsLyrics].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsLyrics); - if (Buttons[htButtons(ButtonOptionsTheme)].Selected) + if (Buttons[ButtonOptionsTheme].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsTheme); break; @@ -87,22 +87,22 @@ namespace Vocaluxe.Screens if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonOptionsGame)].Selected) + if (Buttons[ButtonOptionsGame].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsGame); - if (Buttons[htButtons(ButtonOptionsSound)].Selected) + if (Buttons[ButtonOptionsSound].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsSound); - if (Buttons[htButtons(ButtonOptionsRecord)].Selected) + if (Buttons[ButtonOptionsRecord].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsRecord); - if (Buttons[htButtons(ButtonOptionsVideo)].Selected) + if (Buttons[ButtonOptionsVideo].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsVideo); - if (Buttons[htButtons(ButtonOptionsLyrics)].Selected) + if (Buttons[ButtonOptionsLyrics].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsLyrics); - if (Buttons[htButtons(ButtonOptionsTheme)].Selected) + if (Buttons[ButtonOptionsTheme].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsTheme); } diff --git a/Vocaluxe/Screens/CScreenOptionsGame.cs b/Vocaluxe/Screens/CScreenOptionsGame.cs index 3bb48d0d..1dd242d4 100644 --- a/Vocaluxe/Screens/CScreenOptionsGame.cs +++ b/Vocaluxe/Screens/CScreenOptionsGame.cs @@ -55,14 +55,14 @@ namespace Vocaluxe.Screens { base.LoadTheme(XmlPath); - SelectSlides[htSelectSlides(SelectSlideLanguage)].AddValues(_Languages); - SelectSlides[htSelectSlides(SelectSlideLanguage)].Selection = _CurrentLang; + SelectSlides[SelectSlideLanguage].AddValues(_Languages); + SelectSlides[SelectSlideLanguage].Selection = _CurrentLang; - SelectSlides[htSelectSlides(SelectSlideDebugLevel)].SetValues((int)CConfig.DebugLevel); - SelectSlides[htSelectSlides(SelectSlideSongMenu)].SetValues((int)CConfig.SongMenu); - SelectSlides[htSelectSlides(SelectSlideSongSorting)].SetValues((int)CConfig.SongSorting); - SelectSlides[htSelectSlides(SelectSlideTabs)].SetValues((int)CConfig.Tabs); - SelectSlides[htSelectSlides(SelectSlideTimerMode)].SetValues((int)CConfig.TimerMode); + SelectSlides[SelectSlideDebugLevel].SetValues((int)CConfig.DebugLevel); + SelectSlides[SelectSlideSongMenu].SetValues((int)CConfig.SongMenu); + SelectSlides[SelectSlideSongSorting].SetValues((int)CConfig.SongSorting); + SelectSlides[SelectSlideTabs].SetValues((int)CConfig.Tabs); + SelectSlides[SelectSlideTimerMode].SetValues((int)CConfig.TimerMode); } @@ -90,7 +90,7 @@ namespace Vocaluxe.Screens break; case Keys.Enter: - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { SaveConfig(); CGraphics.FadeTo(EScreens.ScreenOptions); @@ -122,7 +122,7 @@ namespace Vocaluxe.Screens if (MouseEvent.LB && IsMouseOver(MouseEvent)) { SaveConfig(); - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { CGraphics.FadeTo(EScreens.ScreenOptions); } @@ -143,12 +143,12 @@ namespace Vocaluxe.Screens private void SaveConfig() { - CConfig.Language = _Languages[SelectSlides[htSelectSlides(SelectSlideLanguage)].Selection]; - CConfig.DebugLevel = (EDebugLevel)SelectSlides[htSelectSlides(SelectSlideDebugLevel)].Selection; - CConfig.SongMenu = (ESongMenu)SelectSlides[htSelectSlides(SelectSlideSongMenu)].Selection; - CConfig.SongSorting = (ESongSorting)SelectSlides[htSelectSlides(SelectSlideSongSorting)].Selection; - CConfig.Tabs = (EOffOn)SelectSlides[htSelectSlides(SelectSlideTabs)].Selection; - CConfig.TimerMode = (ETimerMode)SelectSlides[htSelectSlides(SelectSlideTimerMode)].Selection; + CConfig.Language = _Languages[SelectSlides[SelectSlideLanguage].Selection]; + CConfig.DebugLevel = (EDebugLevel)SelectSlides[SelectSlideDebugLevel].Selection; + CConfig.SongMenu = (ESongMenu)SelectSlides[SelectSlideSongMenu].Selection; + CConfig.SongSorting = (ESongSorting)SelectSlides[SelectSlideSongSorting].Selection; + CConfig.Tabs = (EOffOn)SelectSlides[SelectSlideTabs].Selection; + CConfig.TimerMode = (ETimerMode)SelectSlides[SelectSlideTimerMode].Selection; CConfig.SaveConfig(); diff --git a/Vocaluxe/Screens/CScreenOptionsLyrics.cs b/Vocaluxe/Screens/CScreenOptionsLyrics.cs index 302ec76d..81257172 100644 --- a/Vocaluxe/Screens/CScreenOptionsLyrics.cs +++ b/Vocaluxe/Screens/CScreenOptionsLyrics.cs @@ -36,8 +36,8 @@ namespace Vocaluxe.Screens public override void LoadTheme(string XmlPath) { base.LoadTheme(XmlPath); - SelectSlides[htSelectSlides(SelectSlideLyricStyle)].SetValues((int)CConfig.LyricStyle); - SelectSlides[htSelectSlides(SelectSlideLyricsOnTop)].SetValues((int)CConfig.LyricsOnTop); + SelectSlides[SelectSlideLyricStyle].SetValues((int)CConfig.LyricStyle); + SelectSlides[SelectSlideLyricsOnTop].SetValues((int)CConfig.LyricsOnTop); } public override bool HandleInput(KeyEvent KeyEvent) @@ -64,7 +64,7 @@ namespace Vocaluxe.Screens break; case Keys.Enter: - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { SaveConfig(); CGraphics.FadeTo(EScreens.ScreenOptions); @@ -95,7 +95,7 @@ namespace Vocaluxe.Screens if (MouseEvent.LB && IsMouseOver(MouseEvent)) { SaveConfig(); - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { CGraphics.FadeTo(EScreens.ScreenOptions); } @@ -116,8 +116,8 @@ namespace Vocaluxe.Screens private void SaveConfig() { - CConfig.LyricsOnTop = (EOffOn)SelectSlides[htSelectSlides(SelectSlideLyricsOnTop)].Selection; - CConfig.LyricStyle = (ELyricStyle)SelectSlides[htSelectSlides(SelectSlideLyricStyle)].Selection; + CConfig.LyricsOnTop = (EOffOn)SelectSlides[SelectSlideLyricsOnTop].Selection; + CConfig.LyricStyle = (ELyricStyle)SelectSlides[SelectSlideLyricStyle].Selection; CConfig.SaveConfig(); } } diff --git a/Vocaluxe/Screens/CScreenOptionsRecord.cs b/Vocaluxe/Screens/CScreenOptionsRecord.cs index 3f06c4dc..8a8bfca9 100644 --- a/Vocaluxe/Screens/CScreenOptionsRecord.cs +++ b/Vocaluxe/Screens/CScreenOptionsRecord.cs @@ -84,33 +84,33 @@ namespace Vocaluxe.Screens if (max > 7) max = 7; - SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].NumVisible = max; - SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].NumVisible = max; + SelectSlides[SelectSlideRecordChannel1].NumVisible = max; + SelectSlides[SelectSlideRecordChannel2].NumVisible = max; - SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].AddValue(CLanguage.Translate("TR_CONFIG_OFF")); - SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].AddValue(CLanguage.Translate("TR_CONFIG_OFF")); + SelectSlides[SelectSlideRecordChannel1].AddValue(CLanguage.Translate("TR_CONFIG_OFF")); + SelectSlides[SelectSlideRecordChannel2].AddValue(CLanguage.Translate("TR_CONFIG_OFF")); for (int i = 1; i <= CSettings.MaxNumPlayer; i++) { - SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].AddValue(i.ToString()); - SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].AddValue(i.ToString()); + SelectSlides[SelectSlideRecordChannel1].AddValue(i.ToString()); + SelectSlides[SelectSlideRecordChannel2].AddValue(i.ToString()); } 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]; for (int i = 0; i < ChannelEnergy.Length; i++) { - Statics[htStatics(StaticEnergyChannel[i])].Visible = false; + Statics[StaticEnergyChannel[i]].Visible = false; ChannelEnergy[i] = 0f; } - Equalizers[htEqualizer(EqualizerChannel1)].ScreenHandles = true; - Equalizers[htEqualizer(EqualizerChannel2)].ScreenHandles = true; + Equalizers[EqualizerChannel1].ScreenHandles = true; + Equalizers[EqualizerChannel2].ScreenHandles = true; } public override bool HandleInput(KeyEvent KeyEvent) @@ -137,13 +137,13 @@ namespace Vocaluxe.Screens break; case Keys.Enter: - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { SaveMicConfig(); CGraphics.FadeTo(EScreens.ScreenOptions); } - if (Buttons[htButtons(ButtonDelayTest)].Selected) + if (Buttons[ButtonDelayTest].Selected) { TestDelay(); } @@ -155,32 +155,32 @@ namespace Vocaluxe.Screens break; case Keys.Left: - if (SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selected) + if (SelectSlides[SelectSlideRecordDevices].Selected) OnDeviceEvent(); - if (SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selected) + if (SelectSlides[SelectSlideRecordInputs].Selected) OnInputEvent(); - if (SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selected || - SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selected) + if (SelectSlides[SelectSlideRecordChannel1].Selected || + SelectSlides[SelectSlideRecordChannel2].Selected) SetMicConfig(); - if (SelectSlides[htSelectSlides(SelectSlideDelay)].Selected) + if (SelectSlides[SelectSlideDelay].Selected) SaveDelayConfig(); break; case Keys.Right: - if (SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selected) + if (SelectSlides[SelectSlideRecordDevices].Selected) OnDeviceEvent(); - if (SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selected) + if (SelectSlides[SelectSlideRecordInputs].Selected) OnInputEvent(); - if (SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selected || - SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selected) + if (SelectSlides[SelectSlideRecordChannel1].Selected || + SelectSlides[SelectSlideRecordChannel2].Selected) SetMicConfig(); - if (SelectSlides[htSelectSlides(SelectSlideDelay)].Selected) + if (SelectSlides[SelectSlideDelay].Selected) SaveDelayConfig(); break; } @@ -200,26 +200,26 @@ namespace Vocaluxe.Screens if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selected) + if (SelectSlides[SelectSlideRecordDevices].Selected) OnDeviceEvent(); - if (SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selected) + if (SelectSlides[SelectSlideRecordInputs].Selected) OnInputEvent(); - if (SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selected || - SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selected) + if (SelectSlides[SelectSlideRecordChannel1].Selected || + SelectSlides[SelectSlideRecordChannel2].Selected) SetMicConfig(); - if (SelectSlides[htSelectSlides(SelectSlideDelay)].Selected) + if (SelectSlides[SelectSlideDelay].Selected) SaveDelayConfig(); - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { SaveMicConfig(); CGraphics.FadeTo(EScreens.ScreenOptions); } - if (Buttons[htButtons(ButtonDelayTest)].Selected) + if (Buttons[ButtonDelayTest].Selected) { TestDelay(); } @@ -250,10 +250,10 @@ namespace Vocaluxe.Screens { int player = 0; if (i == 0) - player = SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selection; + player = SelectSlides[SelectSlideRecordChannel1].Selection; if (i == 1) - player = SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selection; + player = SelectSlides[SelectSlideRecordChannel2].Selection; 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[htTexts(TextDelayChannel2)].Text = _DelayTest[1].Delay.ToString("000") + " ms"; + Texts[TextDelayChannel1].Text = _DelayTest[0].Delay.ToString("000") + " ms"; + Texts[TextDelayChannel2].Text = _DelayTest[1].Delay.ToString("000") + " ms"; } if (CheckMicConfig()) { ChannelEnergy[0] = 0f; - int player = SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selection; + int player = SelectSlides[SelectSlideRecordChannel1].Selection; if (player > 0) { ChannelEnergy[0] = CSound.RecordGetMaxVolume(player - 1); - Equalizers[htEqualizer(EqualizerChannel1)].Update(CSound.ToneWeigth(player - 1)); + Equalizers[EqualizerChannel1].Update(CSound.ToneWeigth(player - 1)); } else - Equalizers[htEqualizer(EqualizerChannel1)].Reset(); + Equalizers[EqualizerChannel1].Reset(); ChannelEnergy[1] = 0f; - player = SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selection; + player = SelectSlides[SelectSlideRecordChannel2].Selection; if (player > 0) { ChannelEnergy[1] = CSound.RecordGetMaxVolume(player - 1); - Equalizers[htEqualizer(EqualizerChannel2)].Update(CSound.ToneWeigth(player - 1)); + Equalizers[EqualizerChannel2].Update(CSound.ToneWeigth(player - 1)); } else - Equalizers[htEqualizer(EqualizerChannel2)].Reset(); + Equalizers[EqualizerChannel2].Reset(); } else { @@ -303,8 +303,8 @@ namespace Vocaluxe.Screens { ChannelEnergy[i] = 0f; } - Equalizers[htEqualizer(EqualizerChannel1)].Reset(); - Equalizers[htEqualizer(EqualizerChannel2)].Reset(); + Equalizers[EqualizerChannel1].Reset(); + Equalizers[EqualizerChannel2].Reset(); } return true; @@ -314,8 +314,8 @@ namespace Vocaluxe.Screens { base.OnShow(); - SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Clear(); - SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Clear(); + SelectSlides[SelectSlideRecordDevices].Clear(); + SelectSlides[SelectSlideRecordInputs].Clear(); for (int i = 0; i < ChannelEnergy.Length; i++) { @@ -334,23 +334,23 @@ namespace Vocaluxe.Screens 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++) { - 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(); } - SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Visible = (_devices != null); - SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Visible = (_devices != null); + SelectSlides[SelectSlideRecordChannel1].Visible = (_devices != null); + SelectSlides[SelectSlideRecordChannel2].Visible = (_devices != null); - Statics[htStatics(StaticWarning)].Visible = false; - Texts[htTexts(TextWarning)].Visible = false; + Statics[StaticWarning].Visible = false; + Texts[TextWarning].Visible = false; _DelayTest = 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; _DelaySound = -1; @@ -381,32 +381,32 @@ namespace Vocaluxe.Screens if (!CheckMicConfig()) { - Statics[htStatics(StaticWarning)].Visible = true; - Texts[htTexts(TextWarning)].Visible = true; + Statics[StaticWarning].Visible = true; + Texts[TextWarning].Visible = true; } else { - Statics[htStatics(StaticWarning)].Visible = false; - Texts[htTexts(TextWarning)].Visible = false; + Statics[StaticWarning].Visible = false; + Texts[TextWarning].Visible = false; } for (int i = 0; i < StaticEnergyChannel.Length; i++) { if (ChannelEnergy[i] > 0f) { - SRectF rect = new SRectF(Statics[htStatics(StaticEnergyChannel[i])].Rect.X, - Statics[htStatics(StaticEnergyChannel[i])].Rect.Y, - Statics[htStatics(StaticEnergyChannel[i])].Rect.W * ChannelEnergy[i], - Statics[htStatics(StaticEnergyChannel[i])].Rect.H, - Statics[htStatics(StaticEnergyChannel[i])].Rect.Z); + SRectF rect = new SRectF(Statics[StaticEnergyChannel[i]].Rect.X, + Statics[StaticEnergyChannel[i]].Rect.Y, + Statics[StaticEnergyChannel[i]].Rect.W * ChannelEnergy[i], + Statics[StaticEnergyChannel[i]].Rect.H, + 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); } } - Equalizers[htEqualizer(EqualizerChannel1)].Draw(); - Equalizers[htEqualizer(EqualizerChannel2)].Draw(); + Equalizers[EqualizerChannel1].Draw(); + Equalizers[EqualizerChannel2].Draw(); DrawFG(); @@ -424,27 +424,27 @@ namespace Vocaluxe.Screens private void OnDeviceEvent() { - if (SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selection != _DeviceNr) + if (SelectSlides[SelectSlideRecordDevices].Selection != _DeviceNr) { - SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Clear(); - _DeviceNr = SelectSlides[htSelectSlides(SelectSlideRecordDevices)].Selection; + SelectSlides[SelectSlideRecordInputs].Clear(); + _DeviceNr = SelectSlides[SelectSlideRecordDevices].Selection; _InputNr = 0; 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; - SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selection = 0; + SelectSlides[SelectSlideRecordInputs].Selection = 0; UpdateChannels(); } } private void OnInputEvent() { - if (SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selection != _InputNr) + if (SelectSlides[SelectSlideRecordInputs].Selection != _InputNr) { - _InputNr = SelectSlides[htSelectSlides(SelectSlideRecordInputs)].Selection; + _InputNr = SelectSlides[SelectSlideRecordInputs].Selection; UpdateChannels(); } @@ -452,7 +452,7 @@ namespace Vocaluxe.Screens private void SaveDelayConfig() { - CConfig.MicDelay = SelectSlides[htSelectSlides(SelectSlideDelay)].Selection * 20; + CConfig.MicDelay = SelectSlides[SelectSlideDelay].Selection * 20; CConfig.SaveConfig(); } @@ -503,15 +503,15 @@ namespace Vocaluxe.Screens if (_DeviceNr < 0) return; SInput input = _devices[_DeviceNr].Inputs[_InputNr]; - input.PlayerChannel1 = SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selection; - input.PlayerChannel2 = SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selection; + input.PlayerChannel1 = SelectSlides[SelectSlideRecordChannel1].Selection; + input.PlayerChannel2 = SelectSlides[SelectSlideRecordChannel2].Selection; _devices[_DeviceNr].Inputs[_InputNr] = input; } private void UpdateChannels() { - SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].Selection = _devices[_DeviceNr].Inputs[_InputNr].PlayerChannel1; - SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].Selection = _devices[_DeviceNr].Inputs[_InputNr].PlayerChannel2; + SelectSlides[SelectSlideRecordChannel1].Selection = _devices[_DeviceNr].Inputs[_InputNr].PlayerChannel1; + SelectSlides[SelectSlideRecordChannel2].Selection = _devices[_DeviceNr].Inputs[_InputNr].PlayerChannel2; SaveMicConfig(); } diff --git a/Vocaluxe/Screens/CScreenOptionsSound.cs b/Vocaluxe/Screens/CScreenOptionsSound.cs index e4d3ac44..414bcbd1 100644 --- a/Vocaluxe/Screens/CScreenOptionsSound.cs +++ b/Vocaluxe/Screens/CScreenOptionsSound.cs @@ -43,15 +43,15 @@ namespace Vocaluxe.Screens public override void LoadTheme(string XmlPath) { base.LoadTheme(XmlPath); - SelectSlides[htSelectSlides(SelectSlideBackgroundMusic)].SetValues((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[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection = CConfig.BackgroundMusicVolume / 5; - SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].SetValues((int)CConfig.BackgroundMusicSource); - SelectSlides[htSelectSlides(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[htSelectSlides(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[htSelectSlides(SelectSlideGameMusicVolume)].Selection = CConfig.GameMusicVolume / 5; + SelectSlides[SelectSlideBackgroundMusic].SetValues((int)CConfig.BackgroundMusic); + 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[SelectSlideBackgroundMusicVolume].Selection = CConfig.BackgroundMusicVolume / 5; + SelectSlides[SelectSlideBackgroundMusicSource].SetValues((int)CConfig.BackgroundMusicSource); + SelectSlides[SelectSlideBackgroundMusicSource].Selection = (int)CConfig.BackgroundMusicSource; + 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[SelectSlidePreviewMusicVolume].Selection = CConfig.PreviewMusicVolume / 5; + 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[SelectSlideGameMusicVolume].Selection = CConfig.GameMusicVolume / 5; } @@ -79,7 +79,7 @@ namespace Vocaluxe.Screens break; case Keys.Enter: - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { SaveConfig(); CGraphics.FadeTo(EScreens.ScreenOptions); @@ -110,7 +110,7 @@ namespace Vocaluxe.Screens if (MouseEvent.LB && IsMouseOver(MouseEvent)) { SaveConfig(); - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { CGraphics.FadeTo(EScreens.ScreenOptions); } @@ -122,7 +122,7 @@ namespace Vocaluxe.Screens { if (_BackgroundMusicVolume != CConfig.BackgroundMusicVolume) { - SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection = CConfig.BackgroundMusicVolume / 5; + SelectSlides[SelectSlideBackgroundMusicVolume].Selection = CConfig.BackgroundMusicVolume / 5; } return true; } @@ -139,18 +139,18 @@ namespace Vocaluxe.Screens _BackgroundMusic = CConfig.BackgroundMusic; _BackgroundMusicVolume = CConfig.BackgroundMusicVolume; - SelectSlides[htSelectSlides(SelectSlideGameMusicVolume)].Selection = CConfig.GameMusicVolume / 5; - SelectSlides[htSelectSlides(SelectSlidePreviewMusicVolume)].Selection = CConfig.PreviewMusicVolume / 5; + SelectSlides[SelectSlideGameMusicVolume].Selection = CConfig.GameMusicVolume / 5; + SelectSlides[SelectSlidePreviewMusicVolume].Selection = CConfig.PreviewMusicVolume / 5; } private void SaveConfig() { - CConfig.GameMusicVolume = SelectSlides[htSelectSlides(SelectSlideGameMusicVolume)].Selection * 5; - CConfig.PreviewMusicVolume = SelectSlides[htSelectSlides(SelectSlidePreviewMusicVolume)].Selection * 5; + CConfig.GameMusicVolume = SelectSlides[SelectSlideGameMusicVolume].Selection * 5; + CConfig.PreviewMusicVolume = SelectSlides[SelectSlidePreviewMusicVolume].Selection * 5; CConfig.SaveConfig(); - EOffOn NewOffOn = (EOffOn)SelectSlides[htSelectSlides(SelectSlideBackgroundMusic)].Selection; - EBackgroundMusicSource NewSource = (EBackgroundMusicSource)SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].Selection; - float NewVolume = SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection * 5; + EOffOn NewOffOn = (EOffOn)SelectSlides[SelectSlideBackgroundMusic].Selection; + EBackgroundMusicSource NewSource = (EBackgroundMusicSource)SelectSlides[SelectSlideBackgroundMusicSource].Selection; + float NewVolume = SelectSlides[SelectSlideBackgroundMusicVolume].Selection * 5; CBackgroundMusic.CheckAndApplyConfig(NewOffOn, NewSource, NewVolume); } diff --git a/Vocaluxe/Screens/CScreenOptionsTheme.cs b/Vocaluxe/Screens/CScreenOptionsTheme.cs index 57d41052..d696a646 100644 --- a/Vocaluxe/Screens/CScreenOptionsTheme.cs +++ b/Vocaluxe/Screens/CScreenOptionsTheme.cs @@ -58,19 +58,19 @@ namespace Vocaluxe.Screens { base.LoadTheme(XmlPath); - SelectSlides[htSelectSlides(SelectSlideTheme)].AddValues(CTheme.ThemeNames); - SelectSlides[htSelectSlides(SelectSlideTheme)].Selection = CTheme.GetThemeIndex(-1); + SelectSlides[SelectSlideTheme].AddValues(CTheme.ThemeNames); + SelectSlides[SelectSlideTheme].Selection = CTheme.GetThemeIndex(-1); - SelectSlides[htSelectSlides(SelectSlideSkin)].AddValues(CTheme.SkinNames); - SelectSlides[htSelectSlides(SelectSlideSkin)].Selection = CTheme.GetSkinIndex(-1); + SelectSlides[SelectSlideSkin].AddValues(CTheme.SkinNames); + SelectSlides[SelectSlideSkin].Selection = CTheme.GetSkinIndex(-1); - SelectSlides[htSelectSlides(SelectSlideCover)].AddValues(CCover.CoverThemes); - SelectSlides[htSelectSlides(SelectSlideCover)].Selection = CCover.GetCoverThemeIndex(); - SelectSlides[htSelectSlides(SelectSlideNoteLines)].SetValues((int)CConfig.DrawNoteLines); - SelectSlides[htSelectSlides(SelectSlideToneHelper)].SetValues((int)CConfig.DrawToneHelper); - SelectSlides[htSelectSlides(SelectSlideTimerLook)].SetValues((int)CConfig.TimerLook); - SelectSlides[htSelectSlides(SelectSlideFadeInfo)].SetValues((int)CConfig.FadePlayerInfo); - SelectSlides[htSelectSlides(SelectSlideCoverLoading)].SetValues((int)CConfig.CoverLoading); + SelectSlides[SelectSlideCover].AddValues(CCover.CoverThemes); + SelectSlides[SelectSlideCover].Selection = CCover.GetCoverThemeIndex(); + SelectSlides[SelectSlideNoteLines].SetValues((int)CConfig.DrawNoteLines); + SelectSlides[SelectSlideToneHelper].SetValues((int)CConfig.DrawToneHelper); + SelectSlides[SelectSlideTimerLook].SetValues((int)CConfig.TimerLook); + SelectSlides[SelectSlideFadeInfo].SetValues((int)CConfig.FadePlayerInfo); + SelectSlides[SelectSlideCoverLoading].SetValues((int)CConfig.CoverLoading); } public override bool HandleInput(KeyEvent KeyEvent) @@ -96,7 +96,7 @@ namespace Vocaluxe.Screens break; case Keys.Enter: - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { Close(); } @@ -125,7 +125,7 @@ namespace Vocaluxe.Screens if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { Close(); } @@ -164,18 +164,18 @@ namespace Vocaluxe.Screens private void SaveConfig() { - CConfig.Theme = CTheme.ThemeNames[SelectSlides[htSelectSlides(SelectSlideTheme)].Selection]; - CConfig.Skin = CTheme.SkinNames[SelectSlides[htSelectSlides(SelectSlideSkin)].Selection]; - CConfig.CoverTheme = CCover.CoverThemes[SelectSlides[htSelectSlides(SelectSlideCover)].Selection]; - CConfig.DrawNoteLines = (EOffOn)SelectSlides[htSelectSlides(SelectSlideNoteLines)].Selection; - CConfig.DrawToneHelper = (EOffOn)SelectSlides[htSelectSlides(SelectSlideToneHelper)].Selection; - CConfig.TimerLook = (ETimerLook)SelectSlides[htSelectSlides(SelectSlideTimerLook)].Selection; - CConfig.FadePlayerInfo = (EFadePlayerInfo)SelectSlides[htSelectSlides(SelectSlideFadeInfo)].Selection; - CConfig.CoverLoading = (ECoverLoading)SelectSlides[htSelectSlides(SelectSlideCoverLoading)].Selection; + CConfig.Theme = CTheme.ThemeNames[SelectSlides[SelectSlideTheme].Selection]; + CConfig.Skin = CTheme.SkinNames[SelectSlides[SelectSlideSkin].Selection]; + CConfig.CoverTheme = CCover.CoverThemes[SelectSlides[SelectSlideCover].Selection]; + CConfig.DrawNoteLines = (EOffOn)SelectSlides[SelectSlideNoteLines].Selection; + CConfig.DrawToneHelper = (EOffOn)SelectSlides[SelectSlideToneHelper].Selection; + CConfig.TimerLook = (ETimerLook)SelectSlides[SelectSlideTimerLook].Selection; + CConfig.FadePlayerInfo = (EFadePlayerInfo)SelectSlides[SelectSlideFadeInfo].Selection; + CConfig.CoverLoading = (ECoverLoading)SelectSlides[SelectSlideCoverLoading].Selection; CConfig.SaveConfig(); - if (_OldCoverTheme != SelectSlides[htSelectSlides(SelectSlideCover)].Selection) + if (_OldCoverTheme != SelectSlides[SelectSlideCover].Selection) { CCover.ReloadCover(); CSongs.Filter.SearchString = String.Empty; @@ -183,10 +183,10 @@ namespace Vocaluxe.Screens CSongs.Categorizer.Tabs = CConfig.Tabs; } - if (_OldTheme != SelectSlides[htSelectSlides(SelectSlideTheme)].Selection) + if (_OldTheme != SelectSlides[SelectSlideTheme].Selection) { - CConfig.Theme = CTheme.ThemeNames[SelectSlides[htSelectSlides(SelectSlideTheme)].Selection]; - _OldTheme = SelectSlides[htSelectSlides(SelectSlideTheme)].Selection; + CConfig.Theme = CTheme.ThemeNames[SelectSlides[SelectSlideTheme].Selection]; + _OldTheme = SelectSlides[SelectSlideTheme].Selection; CTheme.UnloadSkins(); CFonts.UnloadThemeFonts(CConfig.Theme); @@ -206,10 +206,10 @@ namespace Vocaluxe.Screens private void OnChange() { - if (_OldTheme != SelectSlides[htSelectSlides(SelectSlideTheme)].Selection) + if (_OldTheme != SelectSlides[SelectSlideTheme].Selection) { - CConfig.Theme = CTheme.ThemeNames[SelectSlides[htSelectSlides(SelectSlideTheme)].Selection]; - _OldTheme = SelectSlides[htSelectSlides(SelectSlideTheme)].Selection; + CConfig.Theme = CTheme.ThemeNames[SelectSlides[SelectSlideTheme].Selection]; + _OldTheme = SelectSlides[SelectSlideTheme].Selection; CTheme.UnloadSkins(); CFonts.UnloadThemeFonts(CConfig.Theme); @@ -229,9 +229,9 @@ namespace Vocaluxe.Screens return; } - if (_TempSkin != SelectSlides[htSelectSlides(SelectSlideSkin)].Selection) + if (_TempSkin != SelectSlides[SelectSlideSkin].Selection) { - _TempSkin = SelectSlides[htSelectSlides(SelectSlideSkin)].Selection; + _TempSkin = SelectSlides[SelectSlideSkin].Selection; PauseBG(); CConfig.Skin = CTheme.SkinNames[_TempSkin]; diff --git a/Vocaluxe/Screens/CScreenOptionsVideo.cs b/Vocaluxe/Screens/CScreenOptionsVideo.cs index e45d25e5..9744e8cf 100644 --- a/Vocaluxe/Screens/CScreenOptionsVideo.cs +++ b/Vocaluxe/Screens/CScreenOptionsVideo.cs @@ -51,10 +51,10 @@ namespace Vocaluxe.Screens { base.LoadTheme(XmlPath); - SelectSlides[htSelectSlides(SelectSlideVideoBackgrounds)].SetValues((int)CConfig.VideoBackgrounds); - SelectSlides[htSelectSlides(SelectSlideVideoPreview)].SetValues((int)CConfig.VideoPreview); - SelectSlides[htSelectSlides(SelectSlideVideosInSongs)].SetValues((int)CConfig.VideosInSongs); - SelectSlides[htSelectSlides(SelectSlideVideosToBackground)].SetValues((int)CConfig.VideosToBackground); + SelectSlides[SelectSlideVideoBackgrounds].SetValues((int)CConfig.VideoBackgrounds); + SelectSlides[SelectSlideVideoPreview].SetValues((int)CConfig.VideoPreview); + SelectSlides[SelectSlideVideosInSongs].SetValues((int)CConfig.VideosInSongs); + SelectSlides[SelectSlideVideosToBackground].SetValues((int)CConfig.VideosToBackground); } public override bool HandleInput(KeyEvent KeyEvent) @@ -81,7 +81,7 @@ namespace Vocaluxe.Screens break; case Keys.Enter: - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { SaveConfig(); CGraphics.FadeTo(EScreens.ScreenOptions); @@ -89,17 +89,17 @@ namespace Vocaluxe.Screens break; case Keys.Left: - if (SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selected) + if (SelectSlides[SelectSlideWebcamDevices].Selected) OnDeviceEvent(); - if (SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selected) + if (SelectSlides[SelectSlideWebcamCapabilities].Selected) OnCapabilitiesEvent(); SaveConfig(); break; case Keys.Right: - if (SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selected) + if (SelectSlides[SelectSlideWebcamDevices].Selected) OnDeviceEvent(); - if (SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selected) + if (SelectSlides[SelectSlideWebcamCapabilities].Selected) OnCapabilitiesEvent(); SaveConfig(); break; @@ -120,12 +120,12 @@ namespace Vocaluxe.Screens if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selected) + if (SelectSlides[SelectSlideWebcamDevices].Selected) OnDeviceEvent(); - if (SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selected) + if (SelectSlides[SelectSlideWebcamCapabilities].Selected) OnCapabilitiesEvent(); SaveConfig(); - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { CGraphics.FadeTo(EScreens.ScreenOptions); } @@ -136,8 +136,8 @@ namespace Vocaluxe.Screens public override bool UpdateGame() { CWebcam.GetFrame(ref _WebcamTexture); - Statics[htStatics(StaticWebcamOutput)].Texture = _WebcamTexture; - SelectSlides[htSelectSlides(SelectSlideVideosToBackground)].Selection = (int)CConfig.VideosToBackground; + Statics[StaticWebcamOutput].Texture = _WebcamTexture; + SelectSlides[SelectSlideVideosToBackground].Selection = (int)CConfig.VideosToBackground; return true; } @@ -157,8 +157,8 @@ namespace Vocaluxe.Screens public override void OnShow() { base.OnShow(); - SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Clear(); - SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Clear(); + SelectSlides[SelectSlideWebcamDevices].Clear(); + SelectSlides[SelectSlideWebcamCapabilities].Clear(); _DeviceNr = -1; _CapabilityNr = -1; @@ -177,18 +177,18 @@ namespace Vocaluxe.Screens 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) { - 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.Width = devices[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Width; - _Config.Height = devices[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Height; - _Config.Framerate = devices[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Framerate; + _Config.MonikerString = devices[SelectSlides[SelectSlideWebcamDevices].Selection].MonikerString; + _Config.Width = devices[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Width; + _Config.Height = devices[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Height; + _Config.Framerate = devices[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Framerate; CWebcam.Close(); CWebcam.Select(CConfig.WebcamConfig); CWebcam.Start(); @@ -201,17 +201,17 @@ namespace Vocaluxe.Screens devices = null; } - SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Visible = (devices != null && devices.Length > 0); - SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Visible = (devices != null && devices.Length > 0); - Statics[htStatics(StaticWebcamOutput)].Visible = (devices != null && devices.Length > 0); + SelectSlides[SelectSlideWebcamDevices].Visible = (devices != null && devices.Length > 0); + SelectSlides[SelectSlideWebcamCapabilities].Visible = (devices != null && devices.Length > 0); + Statics[StaticWebcamOutput].Visible = (devices != null && devices.Length > 0); } private void SaveConfig() { - CConfig.VideoBackgrounds = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideoBackgrounds)].Selection; - CConfig.VideoPreview = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideoPreview)].Selection; - CConfig.VideosInSongs = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideosInSongs)].Selection; - CConfig.VideosToBackground = (EOffOn)SelectSlides[htSelectSlides(SelectSlideVideosToBackground)].Selection; + CConfig.VideoBackgrounds = (EOffOn)SelectSlides[SelectSlideVideoBackgrounds].Selection; + CConfig.VideoPreview = (EOffOn)SelectSlides[SelectSlideVideoPreview].Selection; + CConfig.VideosInSongs = (EOffOn)SelectSlides[SelectSlideVideosInSongs].Selection; + CConfig.VideosToBackground = (EOffOn)SelectSlides[SelectSlideVideosToBackground].Selection; CConfig.WebcamConfig = _Config; CBackgroundMusic.VideoEnabled = true; @@ -221,23 +221,23 @@ namespace Vocaluxe.Screens private void OnDeviceEvent() { - if (SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection != _DeviceNr) + if (SelectSlides[SelectSlideWebcamDevices].Selection != _DeviceNr) { - SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Clear(); - _DeviceNr = SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection; + SelectSlides[SelectSlideWebcamCapabilities].Clear(); + _DeviceNr = SelectSlides[SelectSlideWebcamDevices].Selection; _CapabilityNr = 0; 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.Width = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Width; - _Config.Height = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Height; - _Config.Framerate = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Framerate; + _Config.MonikerString = d[SelectSlides[SelectSlideWebcamDevices].Selection].MonikerString; + _Config.Width = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Width; + _Config.Height = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Height; + _Config.Framerate = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Framerate; CWebcam.Close(); CWebcam.Select(_Config); @@ -247,15 +247,15 @@ namespace Vocaluxe.Screens 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(); - _Config.MonikerString = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].MonikerString; - _Config.Width = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Width; - _Config.Height = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Height; - _Config.Framerate = d[SelectSlides[htSelectSlides(SelectSlideWebcamDevices)].Selection].Capabilities[SelectSlides[htSelectSlides(SelectSlideWebcamCapabilities)].Selection].Framerate; + _Config.MonikerString = d[SelectSlides[SelectSlideWebcamDevices].Selection].MonikerString; + _Config.Width = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Width; + _Config.Height = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Height; + _Config.Framerate = d[SelectSlides[SelectSlideWebcamDevices].Selection].Capabilities[SelectSlides[SelectSlideWebcamCapabilities].Selection].Framerate; CWebcam.Close(); CWebcam.Select(_Config); diff --git a/Vocaluxe/Screens/CScreenParty.cs b/Vocaluxe/Screens/CScreenParty.cs index eef3558d..55d2a17c 100644 --- a/Vocaluxe/Screens/CScreenParty.cs +++ b/Vocaluxe/Screens/CScreenParty.cs @@ -64,16 +64,16 @@ namespace Vocaluxe.Screens break; case Keys.Enter: - if (Buttons[htButtons(ButtonStart)].Selected) + if (Buttons[ButtonStart].Selected) StartPartyMode(); - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) CGraphics.FadeTo(EScreens.ScreenMain); break; case Keys.Left: case Keys.Right: - if (SelectSlides[htSelectSlides(SelectSlideModes)].Selected) + if (SelectSlides[SelectSlideModes].Selected) UpdateSelection(); break; } @@ -87,13 +87,13 @@ namespace Vocaluxe.Screens if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonStart)].Selected) + if (Buttons[ButtonStart].Selected) StartPartyMode(); - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) CGraphics.FadeTo(EScreens.ScreenMain); - if (SelectSlides[htSelectSlides(SelectSlideModes)].Selected) + if (SelectSlides[SelectSlideModes].Selected) UpdateSelection(); } @@ -111,15 +111,15 @@ namespace Vocaluxe.Screens _PartyModeInfos = CParty.GetPartyModeInfos(); - SelectSlides[htSelectSlides(SelectSlideModes)].Clear(); + SelectSlides[SelectSlideModes].Clear(); 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(); - SetInteractionToSelectSlide(SelectSlides[htSelectSlides(SelectSlideModes)]); + SetInteractionToSelectSlide(SelectSlides[SelectSlideModes]); } public override bool UpdateGame() @@ -144,49 +144,49 @@ namespace Vocaluxe.Screens if (_PartyModeInfos.Count == 0) return; - int index = SelectSlides[htSelectSlides(SelectSlideModes)].Selection; + int index = SelectSlides[SelectSlideModes].Selection; if (index >= _PartyModeInfos.Count) return; //Description - Texts[htTexts(TextDescription)].Text = _PartyModeInfos[index].Description; - Texts[htTexts(TextDescription)].TranslationID = _PartyModeInfos[index].PartyModeID; + Texts[TextDescription].Text = _PartyModeInfos[index].Description; + Texts[TextDescription].TranslationID = _PartyModeInfos[index].PartyModeID; //TargetAudience - Texts[htTexts(TextTargetAudience)].TranslationID = _PartyModeInfos[index].PartyModeID; - Texts[htTexts(TextTargetAudience)].Text = _PartyModeInfos[index].TargetAudience; + Texts[TextTargetAudience].TranslationID = _PartyModeInfos[index].PartyModeID; + Texts[TextTargetAudience].Text = _PartyModeInfos[index].TargetAudience; //NumTeams 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) - Texts[htTexts(TextNumTeams)].Text = _PartyModeInfos[index].MaxTeams.ToString(); + Texts[TextNumTeams].Text = _PartyModeInfos[index].MaxTeams.ToString(); 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 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) - Texts[htTexts(TextNumPlayers)].Text = _PartyModeInfos[index].MinPlayers + " - " + _PartyModeInfos[index].MaxPlayers; + Texts[TextNumPlayers].Text = _PartyModeInfos[index].MinPlayers + " - " + _PartyModeInfos[index].MaxPlayers; //Author - Texts[htTexts(TextAuthor)].Text = _PartyModeInfos[index].Author; - Texts[htTexts(TextAuthor)].TranslationID = _PartyModeInfos[index].PartyModeID; + Texts[TextAuthor].Text = _PartyModeInfos[index].Author; + Texts[TextAuthor].TranslationID = _PartyModeInfos[index].PartyModeID; //Version - Texts[htTexts(TextVersion)].Text = _PartyModeInfos[index].VersionMajor + "." + _PartyModeInfos[index].VersionMinor; - Texts[htTexts(TextVersion)].TranslationID = _PartyModeInfos[index].PartyModeID; + Texts[TextVersion].Text = _PartyModeInfos[index].VersionMajor + "." + _PartyModeInfos[index].VersionMinor; + Texts[TextVersion].TranslationID = _PartyModeInfos[index].PartyModeID; if (!_PartyModeInfos[index].Playable) { - Buttons[htButtons(ButtonStart)].Visible = false; - Texts[htTexts(TextError)].Visible = true; + Buttons[ButtonStart].Visible = false; + Texts[TextError].Visible = true; } else { - Buttons[htButtons(ButtonStart)].Visible = true; - Texts[htTexts(TextError)].Visible = false; + Buttons[ButtonStart].Visible = true; + Texts[TextError].Visible = false; } } @@ -195,7 +195,7 @@ namespace Vocaluxe.Screens if (_PartyModeInfos.Count == 0) return; - int index = SelectSlides[htSelectSlides(SelectSlideModes)].Selection; + int index = SelectSlides[SelectSlideModes].Selection; if (index >= _PartyModeInfos.Count) return; diff --git a/Vocaluxe/Screens/CScreenProfiles.cs b/Vocaluxe/Screens/CScreenProfiles.cs index a5ed50ea..e030efee 100644 --- a/Vocaluxe/Screens/CScreenProfiles.cs +++ b/Vocaluxe/Screens/CScreenProfiles.cs @@ -65,16 +65,16 @@ namespace Vocaluxe.Screens { base.LoadTheme(XmlPath); - Buttons[htButtons(ButtonSaveSnapshot)].Visible = false; - Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false; - Buttons[htButtons(ButtonTakeSnapshot)].Visible = false; + Buttons[ButtonSaveSnapshot].Visible = false; + Buttons[ButtonDiscardSnapshot].Visible = false; + Buttons[ButtonTakeSnapshot].Visible = false; if (CWebcam.GetDevices().Length > 0) - Buttons[htButtons(ButtonWebcam)].Visible = true; + Buttons[ButtonWebcam].Visible = true; else - Buttons[htButtons(ButtonWebcam)].Visible = false; - SelectSlides[htSelectSlides(SelectSlideDifficulty)].SetValues(0); - SelectSlides[htSelectSlides(SelectSlideGuestProfile)].SetValues(0); - SelectSlides[htSelectSlides(SelectSlideActive)].SetValues(0); + Buttons[ButtonWebcam].Visible = false; + SelectSlides[SelectSlideDifficulty].SetValues(0); + SelectSlides[SelectSlideGuestProfile].SetValues(0); + SelectSlides[SelectSlideActive].SetValues(0); } @@ -90,8 +90,8 @@ namespace Vocaluxe.Screens case EEditMode.None: break; case EEditMode.PlayerName: - SelectSlides[htSelectSlides(SelectSlideProfiles)].RenameValue( - CProfiles.AddGetPlayerName(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, KeyEvent.Unicode)); + SelectSlides[SelectSlideProfiles].RenameValue( + CProfiles.AddGetPlayerName(SelectSlides[SelectSlideProfiles].Selection, KeyEvent.Unicode)); break; default: break; @@ -106,34 +106,34 @@ namespace Vocaluxe.Screens break; case Keys.Enter: - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { CGraphics.FadeTo(EScreens.ScreenMain); - } else if (Buttons[htButtons(ButtonSave)].Selected) + } else if (Buttons[ButtonSave].Selected) { SaveProfiles(); - } else if (Buttons[htButtons(ButtonNew)].Selected) + } else if (Buttons[ButtonNew].Selected) { NewProfile(); - } else if (Buttons[htButtons(ButtonPlayerName)].Selected) + } else if (Buttons[ButtonPlayerName].Selected) { if (CProfiles.NumProfiles > 0 && _EditMode != EEditMode.PlayerName) _EditMode = EEditMode.PlayerName; else _EditMode = EEditMode.None; - } else if (Buttons[htButtons(ButtonDelete)].Selected) + } else if (Buttons[ButtonDelete].Selected) { DeleteProfile(); - } else if (Buttons[htButtons(ButtonWebcam)].Selected && CWebcam.GetDevices().Length > 0) + } else if (Buttons[ButtonWebcam].Selected && CWebcam.GetDevices().Length > 0) { OnWebcam(); - } else if (Buttons[htButtons(ButtonSaveSnapshot)].Selected && CWebcam.GetDevices().Length > 0) + } else if (Buttons[ButtonSaveSnapshot].Selected && CWebcam.GetDevices().Length > 0) { OnSaveSnapshot(); - } else if (Buttons[htButtons(ButtonDiscardSnapshot)].Selected && CWebcam.GetDevices().Length > 0) + } else if (Buttons[ButtonDiscardSnapshot].Selected && CWebcam.GetDevices().Length > 0) { OnDiscardSnapshot(); - } else if (Buttons[htButtons(ButtonTakeSnapshot)].Selected && CWebcam.GetDevices().Length > 0) + } else if (Buttons[ButtonTakeSnapshot].Selected && CWebcam.GetDevices().Length > 0) { OnTakeSnapshot(); } @@ -142,8 +142,8 @@ namespace Vocaluxe.Screens case Keys.Back: if (_EditMode == EEditMode.PlayerName) { - SelectSlides[htSelectSlides(SelectSlideProfiles)].RenameValue( - CProfiles.GetDeleteCharInPlayerName(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection)); + SelectSlides[SelectSlideProfiles].RenameValue( + CProfiles.GetDeleteCharInPlayerName(SelectSlides[SelectSlideProfiles].Selection)); } else CGraphics.FadeTo(EScreens.ScreenMain); @@ -153,22 +153,22 @@ namespace Vocaluxe.Screens DeleteProfile(); break; } - if (SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selected) + if (SelectSlides[SelectSlideDifficulty].Selected) { - CProfiles.SetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, - (EGameDifficulty)SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection); - } else if (SelectSlides[htSelectSlides(SelectSlideAvatars)].Selected) + CProfiles.SetDifficulty(SelectSlides[SelectSlideProfiles].Selection, + (EGameDifficulty)SelectSlides[SelectSlideDifficulty].Selection); + } else if (SelectSlides[SelectSlideAvatars].Selected) { - CProfiles.SetAvatar(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, - SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection); - } else if (SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selected) + CProfiles.SetAvatar(SelectSlides[SelectSlideProfiles].Selection, + SelectSlides[SelectSlideAvatars].Selection); + } else if (SelectSlides[SelectSlideGuestProfile].Selected) { - CProfiles.SetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, - (EOffOn)SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection); - } else if (SelectSlides[htSelectSlides(SelectSlideActive)].Selected) + CProfiles.SetGuestProfile(SelectSlides[SelectSlideProfiles].Selection, + (EOffOn)SelectSlides[SelectSlideGuestProfile].Selection); + } else if (SelectSlides[SelectSlideActive].Selected) { - CProfiles.SetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, - (EOffOn)SelectSlides[htSelectSlides(SelectSlideActive)].Selection); + CProfiles.SetActive(SelectSlides[SelectSlideProfiles].Selection, + (EOffOn)SelectSlides[SelectSlideActive].Selection); } } @@ -182,51 +182,51 @@ namespace Vocaluxe.Screens if (MouseEvent.LB && IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonExit)].Selected) + if (Buttons[ButtonExit].Selected) { CGraphics.FadeTo(EScreens.ScreenMain); - } else if (Buttons[htButtons(ButtonSave)].Selected) + } else if (Buttons[ButtonSave].Selected) { SaveProfiles(); - } else if (Buttons[htButtons(ButtonNew)].Selected) + } else if (Buttons[ButtonNew].Selected) { NewProfile(); - } else if (Buttons[htButtons(ButtonDelete)].Selected) { + } else if (Buttons[ButtonDelete].Selected) { DeleteProfile(); - } else if (Buttons[htButtons(ButtonPlayerName)].Selected) + } else if (Buttons[ButtonPlayerName].Selected) { if (CProfiles.NumProfiles > 0 && _EditMode != EEditMode.PlayerName) _EditMode = EEditMode.PlayerName; else _EditMode = EEditMode.None; - } else if (SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selected) + } else if (SelectSlides[SelectSlideDifficulty].Selected) { - CProfiles.SetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, - (EGameDifficulty)SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection); - } else if (SelectSlides[htSelectSlides(SelectSlideAvatars)].Selected) + CProfiles.SetDifficulty(SelectSlides[SelectSlideProfiles].Selection, + (EGameDifficulty)SelectSlides[SelectSlideDifficulty].Selection); + } else if (SelectSlides[SelectSlideAvatars].Selected) { - CProfiles.SetAvatar(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, - SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection); + CProfiles.SetAvatar(SelectSlides[SelectSlideProfiles].Selection, + SelectSlides[SelectSlideAvatars].Selection); if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.index > 0) OnDiscardSnapshot(); - } else if (SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selected) + } else if (SelectSlides[SelectSlideGuestProfile].Selected) { - CProfiles.SetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, - (EOffOn)SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection); - } else if (SelectSlides[htSelectSlides(SelectSlideActive)].Selected) + CProfiles.SetGuestProfile(SelectSlides[SelectSlideProfiles].Selection, + (EOffOn)SelectSlides[SelectSlideGuestProfile].Selection); + } else if (SelectSlides[SelectSlideActive].Selected) { - CProfiles.SetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, - (EOffOn)SelectSlides[htSelectSlides(SelectSlideActive)].Selection); - } else if (Buttons[htButtons(ButtonWebcam)].Selected && CWebcam.GetDevices().Length > 0) + CProfiles.SetActive(SelectSlides[SelectSlideProfiles].Selection, + (EOffOn)SelectSlides[SelectSlideActive].Selection); + } else if (Buttons[ButtonWebcam].Selected && CWebcam.GetDevices().Length > 0) { OnWebcam(); - } else if (Buttons[htButtons(ButtonSaveSnapshot)].Selected && CWebcam.GetDevices().Length > 0) + } else if (Buttons[ButtonSaveSnapshot].Selected && CWebcam.GetDevices().Length > 0) { OnSaveSnapshot(); - } else if (Buttons[htButtons(ButtonDiscardSnapshot)].Selected && CWebcam.GetDevices().Length > 0) + } else if (Buttons[ButtonDiscardSnapshot].Selected && CWebcam.GetDevices().Length > 0) { OnDiscardSnapshot(); - } else if (Buttons[htButtons(ButtonTakeSnapshot)].Selected && CWebcam.GetDevices().Length > 0) + } else if (Buttons[ButtonTakeSnapshot].Selected && CWebcam.GetDevices().Length > 0) { OnTakeSnapshot(); } @@ -241,10 +241,10 @@ namespace Vocaluxe.Screens private void OnTakeSnapshot() { - Buttons[htButtons(ButtonSaveSnapshot)].Visible = true; - Buttons[htButtons(ButtonDiscardSnapshot)].Visible = true; - Buttons[htButtons(ButtonWebcam)].Visible = false; - Buttons[htButtons(ButtonTakeSnapshot)].Visible = false; + Buttons[ButtonSaveSnapshot].Visible = true; + Buttons[ButtonDiscardSnapshot].Visible = true; + Buttons[ButtonWebcam].Visible = false; + Buttons[ButtonTakeSnapshot].Visible = false; _Snapshot = CWebcam.GetBitmap(); } @@ -253,10 +253,10 @@ namespace Vocaluxe.Screens CWebcam.Stop(); CDraw.RemoveTexture(ref _WebcamTexture); _Snapshot = null; - Buttons[htButtons(ButtonSaveSnapshot)].Visible = false; - Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false; - Buttons[htButtons(ButtonTakeSnapshot)].Visible = false; - Buttons[htButtons(ButtonWebcam)].Visible = true; + Buttons[ButtonSaveSnapshot].Visible = false; + Buttons[ButtonDiscardSnapshot].Visible = false; + Buttons[ButtonTakeSnapshot].Visible = false; + Buttons[ButtonWebcam].Visible = true; } private void OnSaveSnapshot() @@ -278,16 +278,16 @@ namespace Vocaluxe.Screens { if (CProfiles.Avatars[j].FileName == (filename + i + ".png")) { - CProfiles.SetAvatar(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, j); + CProfiles.SetAvatar(SelectSlides[SelectSlideProfiles].Selection, j); break; } } - Buttons[htButtons(ButtonSaveSnapshot)].Visible = false; - Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false; - Buttons[htButtons(ButtonTakeSnapshot)].Visible = false; - Buttons[htButtons(ButtonWebcam)].Visible = true; + Buttons[ButtonSaveSnapshot].Visible = false; + Buttons[ButtonDiscardSnapshot].Visible = false; + Buttons[ButtonTakeSnapshot].Visible = false; + Buttons[ButtonWebcam].Visible = true; } private void OnWebcam() @@ -295,38 +295,38 @@ namespace Vocaluxe.Screens _Snapshot = null; CWebcam.Start(); CWebcam.GetFrame(ref _WebcamTexture); - Buttons[htButtons(ButtonSaveSnapshot)].Visible = false; - Buttons[htButtons(ButtonDiscardSnapshot)].Visible = false; - Buttons[htButtons(ButtonTakeSnapshot)].Visible = true; - Buttons[htButtons(ButtonWebcam)].Visible = false; + Buttons[ButtonSaveSnapshot].Visible = false; + Buttons[ButtonDiscardSnapshot].Visible = false; + Buttons[ButtonTakeSnapshot].Visible = true; + Buttons[ButtonWebcam].Visible = false; } 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) - Buttons[htButtons(ButtonPlayerName)].Text.Text += "|"; + Buttons[ButtonPlayerName].Text.Text += "|"; - SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection = (int)CProfiles.GetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); - SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); - SelectSlides[htSelectSlides(SelectSlideActive)].Selection = (int)CProfiles.GetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); + SelectSlides[SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(SelectSlides[SelectSlideProfiles].Selection); + SelectSlides[SelectSlideGuestProfile].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[SelectSlideProfiles].Selection); + SelectSlides[SelectSlideActive].Selection = (int)CProfiles.GetActive(SelectSlides[SelectSlideProfiles].Selection); - int avatarNr = CProfiles.GetAvatarNr(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); - SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection = avatarNr; + int avatarNr = CProfiles.GetAvatarNr(SelectSlides[SelectSlideProfiles].Selection); + SelectSlides[SelectSlideAvatars].Selection = avatarNr; if (CWebcam.GetDevices().Length > 0 && _WebcamTexture.index > 0) { if(_Snapshot == null) 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 rect = new RectangleF(0f, 0f, _WebcamTexture.rect.W, _WebcamTexture.rect.H); CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop); } else - Statics[htStatics(StaticAvatar)].Texture = CProfiles.Avatars[avatarNr].Texture; + Statics[StaticAvatar].Texture = CProfiles.Avatars[avatarNr].Texture; } return true; @@ -364,7 +364,7 @@ namespace Vocaluxe.Screens private void DeleteProfile() { - CProfiles.DeleteProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); + CProfiles.DeleteProfile(SelectSlides[SelectSlideProfiles].Selection); LoadProfiles(); UpdateGame(); } @@ -372,28 +372,28 @@ namespace Vocaluxe.Screens private void LoadProfiles() { _EditMode = EEditMode.None; - SelectSlides[htSelectSlides(SelectSlideProfiles)].Clear(); + SelectSlides[SelectSlideProfiles].Clear(); 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) { - SelectSlides[htSelectSlides(SelectSlideDifficulty)].Selection = (int)CProfiles.GetDifficulty(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); - SelectSlides[htSelectSlides(SelectSlideGuestProfile)].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); - SelectSlides[htSelectSlides(SelectSlideActive)].Selection = (int)CProfiles.GetActive(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); - SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection = CProfiles.GetAvatarNr(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection); + SelectSlides[SelectSlideDifficulty].Selection = (int)CProfiles.GetDifficulty(SelectSlides[SelectSlideProfiles].Selection); + SelectSlides[SelectSlideGuestProfile].Selection = (int)CProfiles.GetGuestProfile(SelectSlides[SelectSlideProfiles].Selection); + SelectSlides[SelectSlideActive].Selection = (int)CProfiles.GetActive(SelectSlides[SelectSlideProfiles].Selection); + SelectSlides[SelectSlideAvatars].Selection = CProfiles.GetAvatarNr(SelectSlides[SelectSlideProfiles].Selection); } } private void LoadAvatars() { - SelectSlides[htSelectSlides(SelectSlideAvatars)].Clear(); + SelectSlides[SelectSlideAvatars].Clear(); 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; CProfiles.NewProfile(); LoadProfiles(); - SelectSlides[htSelectSlides(SelectSlideProfiles)].LastValue(); + SelectSlides[SelectSlideProfiles].LastValue(); - CProfiles.SetAvatar(SelectSlides[htSelectSlides(SelectSlideProfiles)].Selection, - SelectSlides[htSelectSlides(SelectSlideAvatars)].Selection); + CProfiles.SetAvatar(SelectSlides[SelectSlideProfiles].Selection, + SelectSlides[SelectSlideAvatars].Selection); - SetInteractionToButton(Buttons[htButtons(ButtonPlayerName)]); + SetInteractionToButton(Buttons[ButtonPlayerName]); _EditMode = EEditMode.PlayerName; } } diff --git a/Vocaluxe/Screens/CScreenScore.cs b/Vocaluxe/Screens/CScreenScore.cs index 3e8abc60..2ab40aec 100644 --- a/Vocaluxe/Screens/CScreenScore.cs +++ b/Vocaluxe/Screens/CScreenScore.cs @@ -158,15 +158,15 @@ namespace Vocaluxe.Screens { StaticPointsBarDrawnPoints[p] = player[p].Points; } - string direction = (string) ScreenSettings[htScreenSettings(ScreenSettingAnimationDirection)].GetValue(); + string direction = (string) ScreenSettings[ScreenSettingAnimationDirection].GetValue(); 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 { - Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.H = ((float)StaticPointsBarDrawnPoints[p]) * (Statics[htStatics(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.H = ((float)StaticPointsBarDrawnPoints[p]) * (Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H / 10000); + 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) return; - Texts[htTexts(TextSong)].Text = song.Artist + " - " + song.Title; + Texts[TextSong].Text = song.Artist + " - " + song.Title; if (_Points.NumRounds > 1) { - Texts[htTexts(TextSong)].Text += " (" + _Round + "/" + _Points.NumRounds + ")"; + Texts[TextSong].Text += " (" + _Round + "/" + _Points.NumRounds + ")"; } player = _Points.GetPlayer(_Round - 1, CGame.NumPlayer); } else { - Texts[htTexts(TextSong)].Text = "TR_SCREENSCORE_OVERALLSCORE"; + Texts[TextSong].Text = "TR_SCREENSCORE_OVERALLSCORE"; for (int i = 0; i < CGame.NumRounds; i++) { SPlayer[] points = _Points.GetPlayer(i, CGame.NumPlayer); @@ -320,52 +320,52 @@ namespace Vocaluxe.Screens if (song != null) { 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 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") - 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 - Texts[htTexts(TextNames[p, CGame.NumPlayer - 1])].Text = player[p].Name; + Texts[TextNames[p, CGame.NumPlayer - 1]].Text = player[p].Name; } 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()) - Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Text = ((int)Math.Round(player[p].Points)).ToString("0000") + " " + CLanguage.Translate("TR_SCREENSCORE_POINTS"); + if (CGame.NumPlayer < (int)ScreenSettings[ScreenSettingShortScore].GetValue()) + Texts[TextScores[p, CGame.NumPlayer - 1]].Text = ((int)Math.Round(player[p].Points)).ToString("0000") + " " + CLanguage.Translate("TR_SCREENSCORE_POINTS"); else - Texts[htTexts(TextScores[p, CGame.NumPlayer - 1])].Text = ((int)Math.Round(player[p].Points)).ToString("0000"); - if (CGame.NumPlayer < (int)ScreenSettings[htScreenSettings(ScreenSettingShortDifficulty)].GetValue()) - Texts[htTexts(TextDifficulty[p, CGame.NumPlayer - 1])].Text = CLanguage.Translate("TR_SCREENSCORE_GAMEDIFFICULTY") + ": " + CLanguage.Translate(player[p].Difficulty.ToString()); + Texts[TextScores[p, CGame.NumPlayer - 1]].Text = ((int)Math.Round(player[p].Points)).ToString("0000"); + if (CGame.NumPlayer < (int)ScreenSettings[ScreenSettingShortDifficulty].GetValue()) + Texts[TextDifficulty[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate("TR_SCREENSCORE_GAMEDIFFICULTY") + ": " + CLanguage.Translate(player[p].Difficulty.ToString()); else - Texts[htTexts(TextDifficulty[p, CGame.NumPlayer - 1])].Text = CLanguage.Translate(player[p].Difficulty.ToString()); - if (CGame.NumPlayer < (int)ScreenSettings[htScreenSettings(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[TextDifficulty[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate(player[p].Difficulty.ToString()); + if (CGame.NumPlayer < (int)ScreenSettings[ScreenSettingShortRating].GetValue()) + Texts[TextRatings[p, CGame.NumPlayer - 1]].Text = CLanguage.Translate("TR_SCREENSCORE_RATING") + ": " + CLanguage.Translate(GetRating((int)Math.Round(player[p].Points))); 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; - string direction = (string)ScreenSettings[htScreenSettings(ScreenSettingAnimationDirection)].GetValue(); + string direction = (string)ScreenSettings[ScreenSettingAnimationDirection].GetValue(); if (direction.ToLower() == "vertical") { - Statics[htStatics(StaticPointsBar[p, CGame.NumPlayer - 1])].Rect.W = 0; + Statics[StaticPointsBar[p, CGame.NumPlayer - 1]].Rect.W = 0; } else { - Statics[htStatics(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.H = 0; + 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) - 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) { 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[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.H = ((float)player[p].Points) * (Statics[StaticPointsBarBG[p, CGame.NumPlayer - 1]].Rect.H / 10000); + 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; } } @@ -382,15 +382,15 @@ namespace Vocaluxe.Screens { if (player <= numplayer) { - Texts[htTexts(TextNames[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); - Texts[htTexts(TextScores[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); - Texts[htTexts(TextRatings[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); - Texts[htTexts(TextDifficulty[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); - Statics[htStatics(StaticPointsBar[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); - Statics[htStatics(StaticPointsBarBG[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); - Statics[htStatics(StaticAvatar[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); + Texts[TextNames[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer); + Texts[TextScores[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer); + Texts[TextRatings[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer); + Texts[TextDifficulty[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer); + Statics[StaticPointsBar[player, numplayer]].Visible = (numplayer + 1 == CGame.NumPlayer); + Statics[StaticPointsBarBG[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); } } } diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 2c45861e..626b8c3b 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -151,17 +151,17 @@ namespace Vocaluxe.Screens { base.LoadTheme(XmlPath); - Statics[htStatics(StaticTimeLine)].Visible = false; - Statics[htStatics(StaticTimeLineExpandedNormal)].Visible = false; - Statics[htStatics(StaticTimeLineExpandedHighlighted)].Visible = false; - Statics[htStatics(StaticPauseBG)].Visible = false; - Texts[htTexts(TextPause)].Visible = false; + Statics[StaticTimeLine].Visible = false; + Statics[StaticTimeLineExpandedNormal].Visible = false; + Statics[StaticTimeLineExpandedHighlighted].Visible = false; + Statics[StaticPauseBG].Visible = false; + Texts[TextPause].Visible = false; - Statics[htStatics(StaticPauseBG)].Visible = false; - Texts[htTexts(TextPause)].Visible = false; + Statics[StaticPauseBG].Visible = false; + Texts[TextPause].Visible = false; - Buttons[htButtons(ButtonCancel)].Visible = false; - Buttons[htButtons(ButtonContinue)].Visible = false; + Buttons[ButtonCancel].Visible = false; + Buttons[ButtonContinue].Visible = false; } public override bool HandleInput(KeyEvent KeyEvent) @@ -179,13 +179,13 @@ namespace Vocaluxe.Screens case Keys.Escape: TogglePause(); if (_Pause) - SetInteractionToButton(Buttons[htButtons(ButtonCancel)]); + SetInteractionToButton(Buttons[ButtonCancel]); break; case Keys.P: TogglePause(); if (_Pause) - SetInteractionToButton(Buttons[htButtons(ButtonContinue)]); + SetInteractionToButton(Buttons[ButtonContinue]); break; case Keys.T: @@ -230,11 +230,11 @@ namespace Vocaluxe.Screens } break; case Keys.Enter: - if (Buttons[htButtons(ButtonContinue)].Selected && _Pause) + if (Buttons[ButtonContinue].Selected && _Pause) TogglePause(); - if (Buttons[htButtons(ButtonCancel)].Selected && _Pause) + if (Buttons[ButtonCancel].Selected && _Pause) Stop(); - if (Buttons[htButtons(ButtonSkip)].Selected && _Pause) + if (Buttons[ButtonSkip].Selected && _Pause) { LoadNextSong(); TogglePause(); @@ -278,18 +278,18 @@ namespace Vocaluxe.Screens { TogglePause(); if (_Pause) - SetInteractionToButton(Buttons[htButtons(ButtonContinue)]); + SetInteractionToButton(Buttons[ButtonContinue]); } if (MouseEvent.LB && IsMouseOver(MouseEvent) && _Pause) { - if (Buttons[htButtons(ButtonContinue)].Selected && _Pause) + if (Buttons[ButtonContinue].Selected && _Pause) TogglePause(); - if (Buttons[htButtons(ButtonCancel)].Selected && _Pause) + if (Buttons[ButtonCancel].Selected && _Pause) Stop(); - if (Buttons[htButtons(ButtonSkip)].Selected && _Pause) + if (Buttons[ButtonSkip].Selected && _Pause) { LoadNextSong(); TogglePause(); @@ -331,48 +331,48 @@ namespace Vocaluxe.Screens float[] Alpha = CalcFadingAlpha(); if (Alpha != null) { - Lyrics[htLyrics(LyricMain)].Alpha = Alpha[0]; - Lyrics[htLyrics(LyricSub)].Alpha = Alpha[1]; + Lyrics[LyricMain].Alpha = Alpha[0]; + Lyrics[LyricSub].Alpha = Alpha[1]; - Lyrics[htLyrics(LyricMainTop)].Alpha = Alpha[0]; - Lyrics[htLyrics(LyricSubTop)].Alpha = Alpha[1]; + Lyrics[LyricMainTop].Alpha = Alpha[0]; + Lyrics[LyricSubTop].Alpha = Alpha[1]; - Statics[htStatics(StaticLyrics)].Alpha = Alpha[0]; - Statics[htStatics(StaticLyricsTop)].Alpha = Alpha[0]; + Statics[StaticLyrics].Alpha = Alpha[0]; + Statics[StaticLyricsTop].Alpha = Alpha[0]; - Statics[htStatics(StaticLyricHelper)].Alpha = Alpha[0]; - Statics[htStatics(StaticLyricHelperTop)].Alpha = Alpha[0]; + Statics[StaticLyricHelper].Alpha = Alpha[0]; + Statics[StaticLyricHelperTop].Alpha = Alpha[0]; 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) { - Statics[htStatics(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]; + Statics[StaticAvatars[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) { - Statics[htStatics(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]; - Texts[htTexts(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]; + Statics[StaticScores[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[TextNames[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) { - Lyrics[htLyrics(LyricMainDuet)].Alpha = Alpha[0]; - Lyrics[htLyrics(LyricSubDuet)].Alpha = Alpha[1]; + Lyrics[LyricMainDuet].Alpha = Alpha[0]; + Lyrics[LyricSubDuet].Alpha = Alpha[1]; - Statics[htStatics(StaticLyricsDuet)].Alpha = Alpha[0]; - Statics[htStatics(StaticLyricHelperDuet)].Alpha = Alpha[0]; + Statics[StaticLyricsDuet].Alpha = Alpha[0]; + Statics[StaticLyricHelperDuet].Alpha = Alpha[0]; - Lyrics[htLyrics(LyricMain)].Alpha = Alpha[2]; - Lyrics[htLyrics(LyricSub)].Alpha = Alpha[3]; + Lyrics[LyricMain].Alpha = Alpha[2]; + Lyrics[LyricSub].Alpha = Alpha[3]; - Statics[htStatics(StaticLyrics)].Alpha = Alpha[2]; - Statics[htStatics(StaticLyricHelper)].Alpha = Alpha[2]; + Statics[StaticLyrics].Alpha = Alpha[2]; + Statics[StaticLyricHelper].Alpha = Alpha[2]; } } @@ -381,11 +381,11 @@ namespace Vocaluxe.Screens { 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 { - 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(); - SingNotes[htSingNotes(SingBars)].Reset(); + SingNotes[SingBars].Reset(); for (int i = 0; i < CSettings.MaxNumPlayer; i++) { 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++) { - Statics[htStatics(StaticAvatars[p, CGame.NumPlayer - 1])].Aspect = EAspect.Crop; + Statics[StaticAvatars[p, CGame.NumPlayer - 1]].Aspect = EAspect.Crop; } SetVisibility(); @@ -496,37 +496,37 @@ namespace Vocaluxe.Screens switch (CConfig.TimerLook) { 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; case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED: 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; } - Lyrics[htLyrics(LyricSub)].Draw(-100); - Lyrics[htLyrics(LyricMain)].Draw(CGame.Beat); + Lyrics[LyricSub].Draw(-100); + Lyrics[LyricMain].Draw(CGame.Beat); - Lyrics[htLyrics(LyricSubDuet)].Draw(-100); - Lyrics[htLyrics(LyricMainDuet)].Draw(CGame.Beat); + Lyrics[LyricSubDuet].Draw(-100); + Lyrics[LyricMainDuet].Draw(CGame.Beat); - Lyrics[htLyrics(LyricSubTop)].Draw(-100); - Lyrics[htLyrics(LyricMainTop)].Draw(CGame.Beat); + Lyrics[LyricSubTop].Draw(-100); + Lyrics[LyricMainTop].Draw(CGame.Beat); 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(); if (_Pause) { - Statics[htStatics(StaticPauseBG)].ForceDraw(); - Texts[htTexts(TextPause)].ForceDraw(); + Statics[StaticPauseBG].ForceDraw(); + Texts[TextPause].ForceDraw(); foreach (CButton button in Buttons) button.Draw(); @@ -562,15 +562,15 @@ namespace Vocaluxe.Screens } CDraw.RemoveTexture(ref _Background); - Lyrics[htLyrics(LyricMain)].Clear(); - Lyrics[htLyrics(LyricSub)].Clear(); - Lyrics[htLyrics(LyricMainDuet)].Clear(); - Lyrics[htLyrics(LyricSubDuet)].Clear(); - Lyrics[htLyrics(LyricMainTop)].Clear(); - Lyrics[htLyrics(LyricSubTop)].Clear(); - Texts[htTexts(TextSongName)].Text = String.Empty; - Texts[htTexts(TextDuetName1)].Text = String.Empty; - Texts[htTexts(TextDuetName2)].Text = String.Empty; + Lyrics[LyricMain].Clear(); + Lyrics[LyricSub].Clear(); + Lyrics[LyricMainDuet].Clear(); + Lyrics[LyricSubDuet].Clear(); + Lyrics[LyricMainTop].Clear(); + Lyrics[LyricSubTop].Clear(); + Texts[TextSongName].Text = String.Empty; + Texts[TextDuetName1].Text = String.Empty; + Texts[TextDuetName2].Text = String.Empty; GC.Collect(); } @@ -601,7 +601,7 @@ namespace Vocaluxe.Screens int rounds = CGame.GetNumSongs(); if (rounds > 1) songname += " (" + CGame.RoundNr + "/" + rounds.ToString() + ")"; - Texts[htTexts(TextSongName)].Text = songname; + Texts[TextSongName].Text = songname; _CurrentStream = CSound.Load(song.GetMP3(), true); CSound.SetStreamVolumeMax(_CurrentStream, CConfig.GameMusicVolume); @@ -635,13 +635,13 @@ namespace Vocaluxe.Screens if (song.BackgroundFileName.Length > 0) _Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName)); - SingNotes[htSingNotes(SingBars)].Reset(); + SingNotes[SingBars].Reset(); if (song.IsDuet) { - Texts[htTexts(TextDuetName1)].Text = song.DuetPart1; - Texts[htTexts(TextDuetName2)].Text = song.DuetPart2; + Texts[TextDuetName1].Text = song.DuetPart1; + Texts[TextDuetName2].Text = song.DuetPart2; //More than one song: Player is not assigned to line by user //Otherwise, this is done by CScreenNames if (CGame.GetNumSongs() > 1) @@ -667,18 +667,18 @@ namespace Vocaluxe.Screens for (int p = 0; p < CGame.NumPlayer; p++) { - NoteLines[p] = SingNotes[htSingNotes(SingBars)].AddPlayer( - SingNotes[htSingNotes(SingBars)].BarPos[p, CGame.NumPlayer - 1], + NoteLines[p] = SingNotes[SingBars].AddPlayer( + SingNotes[SingBars].BarPos[p, CGame.NumPlayer - 1], CTheme.GetPlayerColor(p + 1), p); } /* case 4: - NoteLines[0] = SingNotes[htSingNotes(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[2] = SingNotes[htSingNotes(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[0] = SingNotes[SingBars].AddPlayer(new SRectF(35f, 100f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[0]); + NoteLines[1] = SingNotes[SingBars].AddPlayer(new SRectF(35f, 350f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[1]); + NoteLines[2] = SingNotes[SingBars].AddPlayer(new SRectF(640f, 100f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[2]); + NoteLines[3] = SingNotes[SingBars].AddPlayer(new SRectF(640f, 350f, 590f, 200f, -0.5f), CTheme.ThemeColors.Player[3]); break; */ @@ -700,22 +700,22 @@ namespace Vocaluxe.Screens private void SetDuetLyricsVisibility(bool isDuet) { - Statics[htStatics(StaticLyricsDuet)].Visible = isDuet; - Lyrics[htLyrics(LyricMainDuet)].Visible = isDuet; - Lyrics[htLyrics(LyricSubDuet)].Visible = isDuet; + Statics[StaticLyricsDuet].Visible = isDuet; + Lyrics[LyricMainDuet].Visible = isDuet; + Lyrics[LyricSubDuet].Visible = isDuet; if (isDuet) { - Lyrics[htLyrics(LyricMainTop)].Visible = false; - Lyrics[htLyrics(LyricSubTop)].Visible = false; - Statics[htStatics(StaticLyricsTop)].Visible = false; + Lyrics[LyricMainTop].Visible = false; + Lyrics[LyricSubTop].Visible = false; + Statics[StaticLyricsTop].Visible = false; } else { bool LyricsOnTop = (CGame.NumPlayer != 1) && CConfig.LyricsOnTop == EOffOn.TR_CONFIG_ON; - Lyrics[htLyrics(LyricMainTop)].Visible = LyricsOnTop; - Lyrics[htLyrics(LyricSubTop)].Visible = LyricsOnTop; - Statics[htStatics(StaticLyricsTop)].Visible = LyricsOnTop; + Lyrics[LyricMainTop].Visible = LyricsOnTop; + Lyrics[LyricSubTop].Visible = LyricsOnTop; + Statics[StaticLyricsTop].Visible = LyricsOnTop; } } @@ -796,54 +796,54 @@ namespace Vocaluxe.Screens for (int j = 0; j < CGame.NumPlayer; j++) { 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) { - Lyrics[htLyrics(LyricMain)].SetLine(line[nr]); - Lyrics[htLyrics(LyricMainTop)].SetLine(line[nr]); + Lyrics[LyricMain].SetLine(line[nr]); + Lyrics[LyricMainTop].SetLine(line[nr]); _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); if (line.Length >= nr + 2) { - Lyrics[htLyrics(LyricSub)].SetLine(line[nr + 1]); - Lyrics[htLyrics(LyricSubTop)].SetLine(line[nr + 1]); + Lyrics[LyricSub].SetLine(line[nr + 1]); + Lyrics[LyricSubTop].SetLine(line[nr + 1]); } else { - Lyrics[htLyrics(LyricSub)].Clear(); - Lyrics[htLyrics(LyricSubTop)].Clear(); + Lyrics[LyricSub].Clear(); + Lyrics[LyricSubTop].Clear(); } } 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); _RemainingTimeToFirstNoteDuet = CGame.GetTimeFromBeats(line[nr].FirstNoteBeat - CGame.GetBeatFromTime(_CurrentTime, song.BPM, song.Gap), song.BPM); if (line.Length >= nr + 2) - Lyrics[htLyrics(LyricSubDuet)].SetLine(line[nr + 1]); + Lyrics[LyricSubDuet].SetLine(line[nr + 1]); else - Lyrics[htLyrics(LyricSubDuet)].Clear(); + Lyrics[LyricSubDuet].Clear(); } } else { if (i == 0 && !song.IsDuet || i == 1 && song.IsDuet) { - Lyrics[htLyrics(LyricMain)].Clear(); - Lyrics[htLyrics(LyricSub)].Clear(); - Lyrics[htLyrics(LyricMainTop)].Clear(); - Lyrics[htLyrics(LyricSubTop)].Clear(); + Lyrics[LyricMain].Clear(); + Lyrics[LyricSub].Clear(); + Lyrics[LyricMainTop].Clear(); + Lyrics[LyricSubTop].Clear(); _TimeToFirstNote = 0f; } if (i == 0 && song.IsDuet) { - Lyrics[htLyrics(LyricMainDuet)].Clear(); - Lyrics[htLyrics(LyricSubDuet)].Clear(); + Lyrics[LyricMainDuet].Clear(); + Lyrics[LyricSubDuet].Clear(); _TimeToFirstNoteDuet = 0f; } } @@ -855,18 +855,18 @@ namespace Vocaluxe.Screens _Pause = !_Pause; if (_Pause) { - Buttons[htButtons(ButtonCancel)].Visible = true; - Buttons[htButtons(ButtonContinue)].Visible = true; + Buttons[ButtonCancel].Visible = true; + Buttons[ButtonContinue].Visible = true; if (CGame.NumRounds > CGame.RoundNr && CGame.NumRounds > 1) - Buttons[htButtons(ButtonSkip)].Visible = true; + Buttons[ButtonSkip].Visible = true; else - Buttons[htButtons(ButtonSkip)].Visible = false; + Buttons[ButtonSkip].Visible = false; CSound.Pause(_CurrentStream); }else { - Buttons[htButtons(ButtonCancel)].Visible = false; - Buttons[htButtons(ButtonContinue)].Visible = false; - Buttons[htButtons(ButtonSkip)].Visible = false; + Buttons[ButtonCancel].Visible = false; + Buttons[ButtonContinue].Visible = false; + Buttons[ButtonSkip].Visible = false; CSound.Play(_CurrentStream); CWebcam.Start(); } @@ -918,17 +918,17 @@ namespace Vocaluxe.Screens private void SetVisibility() { - Statics[htStatics(StaticLyricsDuet)].Visible = false; - Statics[htStatics(StaticLyricHelper)].Visible = false; - Statics[htStatics(StaticLyricHelperDuet)].Visible = false; - Statics[htStatics(StaticLyricHelperTop)].Visible = false; - Lyrics[htLyrics(LyricMainDuet)].Visible = false; - Lyrics[htLyrics(LyricSubDuet)].Visible = false; + Statics[StaticLyricsDuet].Visible = false; + Statics[StaticLyricHelper].Visible = false; + Statics[StaticLyricHelperDuet].Visible = false; + Statics[StaticLyricHelperTop].Visible = false; + Lyrics[LyricMainDuet].Visible = false; + Lyrics[LyricSubDuet].Visible = false; - Statics[htStatics(StaticSongText)].Visible = false; - Texts[htTexts(TextSongName)].Visible = false; - Texts[htTexts(TextDuetName1)].Visible = false; - Texts[htTexts(TextDuetName2)].Visible = false; + Statics[StaticSongText].Visible = false; + Texts[TextSongName].Visible = false; + Texts[TextDuetName1].Visible = false; + Texts[TextDuetName2].Visible = false; for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++) { @@ -936,33 +936,33 @@ namespace Vocaluxe.Screens { if (player <= numplayer) { - Texts[htTexts(TextScores[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); - Texts[htTexts(TextNames[player, numplayer])].Visible = ((numplayer + 1 == CGame.NumPlayer) + Texts[TextScores[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)); - Statics[htStatics(StaticScores[player, numplayer])].Visible = (numplayer + 1 == CGame.NumPlayer); - Statics[htStatics(StaticAvatars[player, numplayer])].Visible = ((numplayer + 1 == CGame.NumPlayer) + Statics[StaticScores[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)); } } } - Lyrics[htLyrics(LyricMain)].Alpha = 0f; - Lyrics[htLyrics(LyricSub)].Alpha = 0f; + Lyrics[LyricMain].Alpha = 0f; + Lyrics[LyricSub].Alpha = 0f; - Lyrics[htLyrics(LyricMainTop)].Alpha = 0f; - Lyrics[htLyrics(LyricSubTop)].Alpha = 0f; + Lyrics[LyricMainTop].Alpha = 0f; + Lyrics[LyricSubTop].Alpha = 0f; - Statics[htStatics(StaticLyrics)].Alpha = 0f; - Statics[htStatics(StaticLyricsTop)].Alpha = 0f; + Statics[StaticLyrics].Alpha = 0f; + Statics[StaticLyricsTop].Alpha = 0f; - Statics[htStatics(StaticLyricHelper)].Alpha = 0f; - Statics[htStatics(StaticLyricHelperTop)].Alpha = 0f; + Statics[StaticLyricHelper].Alpha = 0f; + Statics[StaticLyricHelperTop].Alpha = 0f; - Lyrics[htLyrics(LyricMainDuet)].Alpha = 0f; - Lyrics[htLyrics(LyricSubDuet)].Alpha = 0f; + Lyrics[LyricMainDuet].Alpha = 0f; + Lyrics[LyricSubDuet].Alpha = 0f; - Statics[htStatics(StaticLyricsDuet)].Alpha = 0f; - Statics[htStatics(StaticLyricHelperDuet)].Alpha = 0f; + Statics[StaticLyricsDuet].Alpha = 0f; + Statics[StaticLyricHelperDuet].Alpha = 0f; } @@ -992,28 +992,28 @@ namespace Vocaluxe.Screens if (time > totaltime) time = totaltime; - SRectF Rect = Statics[htStatics(StaticLyricHelper)].Rect; + SRectF Rect = Statics[StaticLyricHelper].Rect; SColorF Color = new SColorF( - Statics[htStatics(StaticLyricHelper)].Color.R, - Statics[htStatics(StaticLyricHelper)].Color.G, - Statics[htStatics(StaticLyricHelper)].Color.B, - Statics[htStatics(StaticLyricHelper)].Color.A * Statics[htStatics(StaticLyricHelper)].Alpha * alpha); + Statics[StaticLyricHelper].Color.R, + Statics[StaticLyricHelper].Color.G, + Statics[StaticLyricHelper].Color.B, + Statics[StaticLyricHelper].Color.A * Statics[StaticLyricHelper].Alpha * alpha); - float distance = Lyrics[htLyrics(LyricMain)].GetCurrentLyricPosX() - Rect.X - Rect.W; - CDraw.DrawTexture(Statics[htStatics(StaticLyricHelper)].Texture, + float distance = Lyrics[LyricMain].GetCurrentLyricPosX() - Rect.X - Rect.W; + CDraw.DrawTexture(Statics[StaticLyricHelper].Texture, 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( - Statics[htStatics(StaticLyricHelperTop)].Color.R, - Statics[htStatics(StaticLyricHelperTop)].Color.G, - Statics[htStatics(StaticLyricHelperTop)].Color.B, - Statics[htStatics(StaticLyricHelperTop)].Color.A * Statics[htStatics(StaticLyricHelper)].Alpha * alpha); + Statics[StaticLyricHelperTop].Color.R, + Statics[StaticLyricHelperTop].Color.G, + Statics[StaticLyricHelperTop].Color.B, + Statics[StaticLyricHelperTop].Color.A * Statics[StaticLyricHelper].Alpha * alpha); - distance = Lyrics[htLyrics(LyricMainTop)].GetCurrentLyricPosX() - Rect.X - Rect.W; - CDraw.DrawTexture(Statics[htStatics(StaticLyricHelperTop)].Texture, + distance = Lyrics[LyricMainTop].GetCurrentLyricPosX() - Rect.X - Rect.W; + CDraw.DrawTexture(Statics[StaticLyricHelperTop].Texture, 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) time = totaltime; - SRectF Rect = Statics[htStatics(StaticLyricHelperDuet)].Rect; + SRectF Rect = Statics[StaticLyricHelperDuet].Rect; SColorF Color = new SColorF( - Statics[htStatics(StaticLyricHelperDuet)].Color.R, - Statics[htStatics(StaticLyricHelperDuet)].Color.G, - Statics[htStatics(StaticLyricHelperDuet)].Color.B, - Statics[htStatics(StaticLyricHelperDuet)].Color.A * Statics[htStatics(StaticLyricHelperDuet)].Alpha * alpha); + Statics[StaticLyricHelperDuet].Color.R, + Statics[StaticLyricHelperDuet].Color.G, + Statics[StaticLyricHelperDuet].Color.B, + Statics[StaticLyricHelperDuet].Color.A * Statics[StaticLyricHelperDuet].Alpha * alpha); - float distance = Lyrics[htLyrics(LyricMainDuet)].GetCurrentLyricPosX() - Rect.X - Rect.W; - CDraw.DrawTexture(Statics[htStatics(StaticLyricHelperDuet)].Texture, + float distance = Lyrics[LyricMainDuet].GetCurrentLyricPosX() - Rect.X - Rect.W; + CDraw.DrawTexture(Statics[StaticLyricHelperDuet].Texture, new SRectF(Rect.X + distance * (1f - time / totaltime), Rect.Y, Rect.W, Rect.H, Rect.Z), Color); } @@ -1157,36 +1157,36 @@ namespace Vocaluxe.Screens 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; if (t < 10f) { - Statics[htStatics(StaticSongText)].Visible = true; - Texts[htTexts(TextSongName)].Visible = true; + Statics[StaticSongText].Visible = true; + Texts[TextSongName].Visible = true; if (t < 7f) { - Statics[htStatics(StaticSongText)].Color.A = 1f; - Texts[htTexts(TextSongName)].Color.A = 1f; + Statics[StaticSongText].Color.A = 1f; + Texts[TextSongName].Color.A = 1f; } else { - Statics[htStatics(StaticSongText)].Color.A = (3f - (t - 7f)) / 3f; - Texts[htTexts(TextSongName)].Color.A = (3f - (t - 7f)) / 3f; + Statics[StaticSongText].Color.A = (3f - (t - 7f)) / 3f; + Texts[TextSongName].Color.A = (3f - (t - 7f)) / 3f; } } else { - Statics[htStatics(StaticSongText)].Visible = false; - Texts[htTexts(TextSongName)].Visible = false; + Statics[StaticSongText].Visible = false; + Texts[TextSongName].Visible = false; _TimerSongText.Stop(); } } else { - Statics[htStatics(StaticSongText)].Visible = false; - Texts[htTexts(TextSongName)].Visible = false; + Statics[StaticSongText].Visible = false; + Texts[TextSongName].Visible = false; } } @@ -1200,32 +1200,32 @@ namespace Vocaluxe.Screens float t = _TimerDuetText1.ElapsedMilliseconds / 1000f; if (t < 10f) { - Texts[htTexts(TextDuetName1)].Visible = true; + Texts[TextDuetName1].Visible = true; if (t < 3f) { - Texts[htTexts(TextDuetName1)].Color.A = (3f - (3f - t)) / 3f; + Texts[TextDuetName1].Color.A = (3f - (3f - t)) / 3f; } else if (t < 7f) { - Texts[htTexts(TextDuetName1)].Color.A = 1f; + Texts[TextDuetName1].Color.A = 1f; } else { - Texts[htTexts(TextDuetName1)].Color.A = (3f - (t - 7f)) / 3f; + Texts[TextDuetName1].Color.A = (3f - (t - 7f)) / 3f; } } else { - Texts[htTexts(TextDuetName1)].Visible = false; + Texts[TextDuetName1].Visible = false; _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(); else { - Texts[htTexts(TextDuetName1)].Visible = false; + Texts[TextDuetName1].Visible = false; } //Timer for second duet-part if (_TimerDuetText2.IsRunning) @@ -1233,32 +1233,32 @@ namespace Vocaluxe.Screens float t = _TimerDuetText2.ElapsedMilliseconds / 1000f; if (t < 10f) { - Texts[htTexts(TextDuetName2)].Visible = true; + Texts[TextDuetName2].Visible = true; if (t < 3f) { - Texts[htTexts(TextDuetName2)].Color.A = (3f - (3f - t)) / 3f; + Texts[TextDuetName2].Color.A = (3f - (3f - t)) / 3f; } else if (t < 7f) { - Texts[htTexts(TextDuetName2)].Color.A = 1f; + Texts[TextDuetName2].Color.A = 1f; } else { - Texts[htTexts(TextDuetName2)].Color.A = (3f - (t - 7f)) / 3f; + Texts[TextDuetName2].Color.A = (3f - (t - 7f)) / 3f; } } else { - Texts[htTexts(TextDuetName2)].Visible = false; + Texts[TextDuetName2].Visible = false; _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(); else { - Texts[htTexts(TextDuetName2)].Visible = false; + Texts[TextDuetName2].Visible = false; } } } @@ -1286,19 +1286,19 @@ namespace Vocaluxe.Screens case ETimerMode.TR_CONFIG_TIMERMODE_CURRENT: int min = (int)Math.Floor(CurrentTime / 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; case ETimerMode.TR_CONFIG_TIMERMODE_REMAINING: min = (int)Math.Floor(RemainingTime / 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; case ETimerMode.TR_CONFIG_TIMERMODE_TOTAL: min = (int)Math.Floor(TotalTime / 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; } @@ -1306,44 +1306,44 @@ namespace Vocaluxe.Screens switch (CConfig.TimerLook) { case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL: - _TimeLineRect.W = Statics[htStatics(StaticTimeLine)].Rect.W * (CurrentTime / TotalTime); + _TimeLineRect.W = Statics[StaticTimeLine].Rect.W * (CurrentTime / TotalTime); break; case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED: - CStatic stat = Statics[htStatics(StaticTimeLine)]; + CStatic stat = Statics[StaticTimeLine]; int CurrentBeat = CGame.CurrentBeat; for (int i = 0; i < _TimeRects.Count; i++) { if (CurrentBeat >= _TimeRects[i].startBeat && CurrentBeat <= _TimeRects[i].endBeat) { - _TimeRects[i].rect.Texture = Statics[htStatics(StaticTimeLineExpandedHighlighted)].Texture; - _TimeRects[i].rect.Color = Statics[htStatics(StaticTimeLineExpandedHighlighted)].Color; + _TimeRects[i].rect.Texture = Statics[StaticTimeLineExpandedHighlighted].Texture; + _TimeRects[i].rect.Color = Statics[StaticTimeLineExpandedHighlighted].Color; } else { - _TimeRects[i].rect.Texture = Statics[htStatics(StaticTimeLineExpandedNormal)].Texture; - _TimeRects[i].rect.Color = Statics[htStatics(StaticTimeLineExpandedNormal)].Color; + _TimeRects[i].rect.Texture = Statics[StaticTimeLineExpandedNormal].Texture; + _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; } } private void PrepareTimeLine() { - CStatic stat = Statics[htStatics(StaticTimeLine)]; + CStatic stat = Statics[StaticTimeLine]; switch (CConfig.TimerLook) { case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL: _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; case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED: _TimeRects.Clear(); - Statics[htStatics(StaticTimePointer)].Visible = true; + Statics[StaticTimePointer].Visible = true; CSong song = CGame.GetSong(); @@ -1394,11 +1394,11 @@ namespace Vocaluxe.Screens { 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 { - 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) { - 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 { - Texts[htTexts(TextNames[i, CGame.NumPlayer - 1])].Visible = false; + Texts[TextNames[i, CGame.NumPlayer - 1]].Visible = false; } } } diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 914afbc1..ee58cd9d 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -131,11 +131,11 @@ namespace Vocaluxe.Screens { base.LoadTheme(XmlPath); ToggleSongOptions(ESongOptionsView.None); - Playlists[htPlaylists(Playlist)].Visible = false; + Playlists[Playlist].Visible = false; DragAndDropCover = GetNewStatic(); - Playlists[htPlaylists(Playlist)].Init(); + Playlists[Playlist].Init(); _AvailableGameModes.Clear(); @@ -150,7 +150,7 @@ namespace Vocaluxe.Screens if (_PlaylistActive) { - Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent); + Playlists[Playlist].HandleInput(KeyEvent); return true; } @@ -168,7 +168,7 @@ namespace Vocaluxe.Screens } else { - SongMenus[htSongMenus(SongMenu)].HandleInput(ref KeyEvent, _sso); + SongMenus[SongMenu].HandleInput(ref KeyEvent, _sso); UpdatePartyModeOptions(); if (KeyEvent.Handled) @@ -194,21 +194,21 @@ namespace Vocaluxe.Screens { if (i < _sso.Selection.NumJokers.Length) { - if (Buttons[htButtons(ButtonsJoker[i])].Selected) + if (Buttons[ButtonsJoker[i]].Selected) { SelectNextRandom(i); 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 (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive) + if (SongMenus[SongMenu].GetSelectedSong() != -1 && !_SongOptionsActive) { if (!_sso.Selection.PartyMode) ToggleSongOptions(ESongOptionsView.Song); @@ -217,11 +217,11 @@ namespace Vocaluxe.Screens break; case Keys.Tab: - if (Playlists[htPlaylists(Playlist)].Visible) + if (Playlists[Playlist].Visible) { _PlaylistActive = !_PlaylistActive; - Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; - SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + Playlists[Playlist].Selected = _PlaylistActive; + SongMenus[SongMenu].SetActive(!_PlaylistActive); } break; @@ -273,7 +273,7 @@ namespace Vocaluxe.Screens case Keys.S: if (KeyEvent.Mod == EModifier.Ctrl && CSongs.NumVisibleSongs > 0 && !_sso.Selection.PartyMode) - StartMedleySong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); + StartMedleySong(SongMenus[SongMenu].GetSelectedSong()); break; case Keys.D1: @@ -308,51 +308,51 @@ namespace Vocaluxe.Screens switch (KeyEvent.Key) { case Keys.Enter: - if (Buttons[htButtons(ButtonOptionsClose)].Selected) + if (Buttons[ButtonOptionsClose].Selected) { ToggleSongOptions(ESongOptionsView.None); } - else if (Buttons[htButtons(ButtonOptionsSing)].Selected) + else if (Buttons[ButtonOptionsSing].Selected) { 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); OpenAndAddPlaylistAction(); } - else if (Buttons[htButtons(ButtonOptionsRandom)].Selected) + else if (Buttons[ButtonOptionsRandom].Selected) { if (CSongs.IsInCategory) - SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); + SongMenus[SongMenu].SetSelectedSong(CSongs.GetRandomSong()); else - SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory()); + SongMenus[SongMenu].SetSelectedCategory(CSongs.GetRandomCategory()); } - else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected) + else if (Buttons[ButtonOptionsSingAll].Selected) { StartRandomAllSongs(); } - else if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected) + else if (Buttons[ButtonOptionsSingAllVisible].Selected) { StartRandomVisibleSongs(); } - else if (Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Selected) + else if (Buttons[ButtonOptionsOpenSelectedItem].Selected) { _HandleSelectButton(); } - else if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selected) + else if (SelectSlides[SelectSlideOptionsPlaylistOpen].Selected) { OpenPlaylistAction(); } - else if (Buttons[htButtons(ButtonOptionsRandomMedley)].Selected) + else if (Buttons[ButtonOptionsRandomMedley].Selected) { ToggleSongOptions(ESongOptionsView.Medley); } - else if (Buttons[htButtons(ButtonOptionsStartMedley)].Selected) + else if (Buttons[ButtonOptionsStartMedley].Selected) { ToggleSongOptions(ESongOptionsView.None); - StartRandomMedley(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Selection + 1, !CSongs.IsInCategory); + StartRandomMedley(SelectSlides[SelectSlideOptionsNumMedleySongs].Selection + 1, !CSongs.IsInCategory); } break; @@ -396,24 +396,24 @@ namespace Vocaluxe.Screens OldMousePosX = MouseEvent.X; OldMousePosY = MouseEvent.Y; - if (Playlists[htPlaylists(Playlist)].Visible && Playlists[htPlaylists(Playlist)].IsMouseOver(MouseEvent)) + if (Playlists[Playlist].Visible && Playlists[Playlist].IsMouseOver(MouseEvent)) { _PlaylistActive = true; - Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; - SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + Playlists[Playlist].Selected = _PlaylistActive; + SongMenus[SongMenu].SetActive(!_PlaylistActive); 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; - Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; - SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); + Playlists[Playlist].Selected = _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; } @@ -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. //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); - StartVisibleSong(SongMenus[htSongMenus(SongMenu)].GetActualSelection()); + StartVisibleSong(SongMenus[SongMenu].GetActualSelection()); return true; } } - SongMenus[htSongMenus(SongMenu)].HandleMouse(ref MouseEvent, _sso); + SongMenus[SongMenu].HandleMouse(ref MouseEvent, _sso); UpdatePartyModeOptions(); if (MouseEvent.Handled) @@ -470,80 +470,80 @@ namespace Vocaluxe.Screens { if (IsMouseOver(MouseEvent)) { - if (Buttons[htButtons(ButtonOpenOptions)].Selected) + if (Buttons[ButtonOpenOptions].Selected) { ToggleSongOptions(ESongOptionsView.General); return true; - } else if (Buttons[htButtons(ButtonOptionsClose)].Selected) + } else if (Buttons[ButtonOptionsClose].Selected) { ToggleSongOptions(ESongOptionsView.None); return true; - } else if (Buttons[htButtons(ButtonOptionsSing)].Selected) + } else if (Buttons[ButtonOptionsSing].Selected) { ToggleSongOptions(ESongOptionsView.None); - StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); + StartSong(SongMenus[SongMenu].GetSelectedSong()); return true; } - else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) + else if (Buttons[ButtonOptionsPlaylist].Selected) { ToggleSongOptions(ESongOptionsView.None); OpenAndAddPlaylistAction(); return true; } - else if (Buttons[htButtons(ButtonOptionsRandom)].Selected) + else if (Buttons[ButtonOptionsRandom].Selected) { if (CSongs.IsInCategory) { - SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); + SongMenus[SongMenu].SetSelectedSong(CSongs.GetRandomSong()); return true; } } - else if (Buttons[htButtons(ButtonOptionsRandomCategory)].Selected) + else if (Buttons[ButtonOptionsRandomCategory].Selected) { if (!CSongs.IsInCategory) { - SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory()); + SongMenus[SongMenu].SetSelectedCategory(CSongs.GetRandomCategory()); return true; } } - else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected) + else if (Buttons[ButtonOptionsSingAll].Selected) { ToggleSongOptions(ESongOptionsView.None); StartRandomAllSongs(); return true; } - else if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected) + else if (Buttons[ButtonOptionsSingAllVisible].Selected) { ToggleSongOptions(ESongOptionsView.None); StartRandomVisibleSongs(); return true; } - else if (Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Selected) + else if (Buttons[ButtonOptionsOpenSelectedItem].Selected) { _HandleSelectButton(); return true; } - else if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].ValueSelected) + else if (SelectSlides[SelectSlideOptionsPlaylistOpen].ValueSelected) { OpenPlaylistAction(); return true; } - else if (Buttons[htButtons(ButtonOptionsRandomMedley)].Selected) + else if (Buttons[ButtonOptionsRandomMedley].Selected) { ToggleSongOptions(ESongOptionsView.Medley); return true; } - else if (Buttons[htButtons(ButtonOptionsStartMedley)].Selected) + else if (Buttons[ButtonOptionsStartMedley].Selected) { ToggleSongOptions(ESongOptionsView.None); - StartRandomMedley(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Selection + 1, !CSongs.IsInCategory); + StartRandomMedley(SelectSlides[SelectSlideOptionsNumMedleySongs].Selection + 1, !CSongs.IsInCategory); return true; } 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; } @@ -551,7 +551,7 @@ namespace Vocaluxe.Screens { if (i < _sso.Selection.NumJokers.Length) { - if (Buttons[htButtons(ButtonsJoker[i])].Selected) + if (Buttons[ButtonsJoker[i]].Selected) { SelectNextRandom(i); 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); return true; @@ -578,11 +578,11 @@ namespace Vocaluxe.Screens 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; - Playlists[htPlaylists(Playlist)].DragAndDropSongID = CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetActualSelection()].ID; + Playlists[Playlist].DragAndDropSongID = CSongs.VisibleSongs[SongMenus[SongMenu].GetActualSelection()].ID; DragAndDropActive = true; return true; } @@ -592,7 +592,7 @@ namespace Vocaluxe.Screens if (!MouseEvent.LBH && DragAndDropActive) { DragAndDropActive = false; - Playlists[htPlaylists(Playlist)].DragAndDropSongID = -1; + Playlists[Playlist].DragAndDropSongID = -1; return true; } @@ -608,7 +608,7 @@ namespace Vocaluxe.Screens else if(_sso.Selection.CategoryChangeAllowed) { ToggleSongOptions(ESongOptionsView.None); - SongMenus[htSongMenus(SongMenu)].EnterCurrentCategory(); + SongMenus[SongMenu].EnterCurrentCategory(); } } @@ -625,7 +625,7 @@ namespace Vocaluxe.Screens _SearchText = _sso.Sorting.SearchString; CGame.EnterNormalGame(); - SongMenus[htSongMenus(SongMenu)].OnShow(); + SongMenus[SongMenu].OnShow(); if (_sso.Selection.PartyMode) _PlaylistActive = false; @@ -633,56 +633,56 @@ namespace Vocaluxe.Screens if (_sso.Selection.PartyMode) ToggleSongOptions(ESongOptionsView.None); - SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); - SongMenus[htSongMenus(SongMenu)].SetSmallView(Playlists[htPlaylists(Playlist)].Visible); + SongMenus[SongMenu].SetActive(!_PlaylistActive); + SongMenus[SongMenu].SetSmallView(Playlists[Playlist].Visible); - if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != -1) - Playlists[htPlaylists(Playlist)].LoadPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + if (Playlists[Playlist].ActivePlaylistID != -1) + Playlists[Playlist].LoadPlaylist(Playlists[Playlist].ActivePlaylistID); DragAndDropActive = false; - Playlists[htPlaylists(Playlist)].DragAndDropSongID = -1; + Playlists[Playlist].DragAndDropSongID = -1; UpdateGame(); } public override bool UpdateGame() { - if (SongMenus[htSongMenus(SongMenu)].IsSmallView()) + if (SongMenus[SongMenu].IsSmallView()) CheckPlaylist(); - Texts[htTexts(TextCategory)].Text = CSongs.GetCurrentCategoryName(); + Texts[TextCategory].Text = CSongs.GetCurrentCategoryName(); if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) CBackgroundMusic.Disabled = true; else 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) { - 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) { - Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name; + Texts[TextSelection].Text = CSongs.Categories[song].Name; } else - Texts[htTexts(TextSelection)].Text = String.Empty; + Texts[TextSelection].Text = String.Empty; - Texts[htTexts(TextSearchBar)].Text = _SearchText; + Texts[TextSearchBar].Text = _SearchText; if (_SearchActive) { - Texts[htTexts(TextSearchBar)].Text += '|'; + Texts[TextSearchBar].Text += '|'; - Texts[htTexts(TextSearchBar)].Visible = true; - Texts[htTexts(TextSearchBarTitle)].Visible = true; - Statics[htStatics(StaticSearchBar)].Visible = true; + Texts[TextSearchBar].Visible = true; + Texts[TextSearchBarTitle].Visible = true; + Statics[StaticSearchBar].Visible = true; } else { - Texts[htTexts(TextSearchBar)].Visible = false; - Texts[htTexts(TextSearchBarTitle)].Visible = false; - Statics[htStatics(StaticSearchBar)].Visible = false; + Texts[TextSearchBar].Visible = false; + Texts[TextSearchBarTitle].Visible = false; + Statics[StaticSearchBar].Visible = false; } UpdatePartyModeOptions(); @@ -704,12 +704,12 @@ namespace Vocaluxe.Screens { base.OnClose(); CBackgroundMusic.Disabled = false; - SongMenus[htSongMenus(SongMenu)].OnHide(); + SongMenus[SongMenu].OnHide(); } public override void ApplyVolume() { - SongMenus[htSongMenus(SongMenu)].ApplyVolume(CConfig.PreviewMusicVolume); + SongMenus[SongMenu].ApplyVolume(CConfig.PreviewMusicVolume); } private void HandlePartySongSelection(int SongNr) @@ -738,12 +738,12 @@ namespace Vocaluxe.Screens SelectNextRandomSong(); 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); } @@ -760,55 +760,55 @@ namespace Vocaluxe.Screens ToggleSongOptions(ESongOptionsView.None); } - SongMenus[htSongMenus(SongMenu)].Update(_sso); + SongMenus[SongMenu].Update(_sso); if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null) { - Buttons[htButtons(ButtonStart)].Visible = true; + Buttons[ButtonStart].Visible = true; - if (!SongMenus[htSongMenus(SongMenu)].IsSmallView()) - SongMenus[htSongMenus(SongMenu)].SetSmallView(true); + if (!SongMenus[SongMenu].IsSmallView()) + SongMenus[SongMenu].SetSmallView(true); for (int i = 0; i < CMain.Settings.GetMaxNumPlayer(); i++) { if (i < _sso.Selection.NumJokers.Length) { - Buttons[htButtons(ButtonsJoker[i])].Visible = true; - Buttons[htButtons(ButtonsJoker[i])].Text.Text = _sso.Selection.NumJokers[i].ToString(); - Texts[htTexts(TextsPlayer[i])].Visible = true; + Buttons[ButtonsJoker[i]].Visible = true; + Buttons[ButtonsJoker[i]].Text.Text = _sso.Selection.NumJokers[i].ToString(); + Texts[TextsPlayer[i]].Visible = true; bool NameExists = false; if (_sso.Selection.TeamNames != null) { 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; } } if (!NameExists) - Texts[htTexts(TextsPlayer[i])].Text = i.ToString(); + Texts[TextsPlayer[i]].Text = i.ToString(); } else { - Buttons[htButtons(ButtonsJoker[i])].Visible = false; - Texts[htTexts(TextsPlayer[i])].Visible = false; + Buttons[ButtonsJoker[i]].Visible = false; + Texts[TextsPlayer[i]].Visible = false; } } } else { - if (_sso.Selection.PartyMode && SongMenus[htSongMenus(SongMenu)].IsSmallView()) - SongMenus[htSongMenus(SongMenu)].SetSmallView(false); + if (_sso.Selection.PartyMode && SongMenus[SongMenu].IsSmallView()) + SongMenus[SongMenu].SetSmallView(false); for (int i = 0; i < CMain.Settings.GetMaxNumPlayer(); i++) { - Buttons[htButtons(ButtonsJoker[i])].Visible = false; - Texts[htTexts(TextsPlayer[i])].Visible = false; + Buttons[ButtonsJoker[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)) { 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 { @@ -1001,7 +1001,7 @@ namespace Vocaluxe.Screens if (CSongs.IsInCategory) { ToggleSongOptions(ESongOptionsView.None); - SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); + SongMenus[SongMenu].SetSelectedSong(CSongs.GetRandomSong()); return true; } return false; @@ -1012,7 +1012,7 @@ namespace Vocaluxe.Screens if (!CSongs.IsInCategory) { ToggleSongOptions(ESongOptionsView.None); - SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory()); + SongMenus[SongMenu].SetSelectedCategory(CSongs.GetRandomCategory()); return true; } return false; @@ -1021,7 +1021,7 @@ namespace Vocaluxe.Screens private void JumpTo(char Letter) { int start = 0; - int curSelected = SongMenus[htSongMenus(SongMenu)].GetActualSelection(); + int curSelected = SongMenus[SongMenu].GetActualSelection(); if (CSongs.IsInCategory) { //TODO: Check and use sorting method @@ -1037,7 +1037,7 @@ namespace Vocaluxe.Screens if (visibleID < 0 && start > 1) visibleID = Array.FindIndex(Songs, 0, start - 1, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase)); if (visibleID > -1) - SongMenus[htSongMenus(SongMenu)].SetSelectedSong(visibleID); + SongMenus[SongMenu].SetSelectedSong(visibleID); } else { @@ -1049,7 +1049,7 @@ namespace Vocaluxe.Screens if (visibleID < 0 && start > 1) visibleID = Array.FindIndex(Categories, 0, start - 1, element => element.Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase)); if (visibleID > -1) - SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(visibleID); + SongMenus[SongMenu].SetSelectedCategory(visibleID); } } @@ -1062,7 +1062,7 @@ namespace Vocaluxe.Screens bool refresh = false; _SearchText = NewFilterString; - int SongIndex = SongMenus[htSongMenus(SongMenu)].GetSelectedSong(); + int SongIndex = SongMenus[SongMenu].GetSelectedSong(); int SongID = -1; if (SongIndex != -1 && CSongs.NumVisibleSongs > 0 && CSongs.NumVisibleSongs > SongIndex) { @@ -1087,30 +1087,30 @@ namespace Vocaluxe.Screens refresh = true; if (refresh) - SongMenus[htSongMenus(SongMenu)].OnHide(); + SongMenus[SongMenu].OnHide(); - SongMenus[htSongMenus(SongMenu)].OnShow(); + SongMenus[SongMenu].OnShow(); } private void ToggleSongOptions(ESongOptionsView view) { - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false; - SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Visible = false; - Buttons[htButtons(ButtonOptionsClose)].Visible = false; - Buttons[htButtons(ButtonOptionsSing)].Visible = false; - Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; - Buttons[htButtons(ButtonOptionsRandom)].Visible = false; - Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = false; - Buttons[htButtons(ButtonOptionsSingAll)].Visible = false; - Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false; - Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Visible = false; - Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = false; - Buttons[htButtons(ButtonOptionsStartMedley)].Visible = false; - Texts[htTexts(TextOptionsTitle)].Visible = false; - Statics[htStatics(StaticOptionsBG)].Visible = false; - Buttons[htButtons(ButtonOpenOptions)].Visible = true; + SelectSlides[SelectSlideOptionsMode].Visible = false; + SelectSlides[SelectSlideOptionsPlaylistAdd].Visible = false; + SelectSlides[SelectSlideOptionsPlaylistOpen].Visible = false; + SelectSlides[SelectSlideOptionsNumMedleySongs].Visible = false; + Buttons[ButtonOptionsClose].Visible = false; + Buttons[ButtonOptionsSing].Visible = false; + Buttons[ButtonOptionsPlaylist].Visible = false; + Buttons[ButtonOptionsRandom].Visible = false; + Buttons[ButtonOptionsRandomCategory].Visible = false; + Buttons[ButtonOptionsSingAll].Visible = false; + Buttons[ButtonOptionsSingAllVisible].Visible = false; + Buttons[ButtonOptionsOpenSelectedItem].Visible = false; + Buttons[ButtonOptionsRandomMedley].Visible = false; + Buttons[ButtonOptionsStartMedley].Visible = false; + Texts[TextOptionsTitle].Visible = false; + Statics[StaticOptionsBG].Visible = false; + Buttons[ButtonOpenOptions].Visible = true; _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! UpdatePlaylistNames(); - Texts[htTexts(TextOptionsTitle)].Visible = true; - Buttons[htButtons(ButtonOptionsClose)].Visible = true; - Statics[htStatics(StaticOptionsBG)].Visible = true; - Buttons[htButtons(ButtonOpenOptions)].Visible = false; + Texts[TextOptionsTitle].Visible = true; + Buttons[ButtonOptionsClose].Visible = true; + Statics[StaticOptionsBG].Visible = true; + Buttons[ButtonOpenOptions].Visible = false; if (view == ESongOptionsView.Song) _ShowSongOptionsSong(); else if (view == ESongOptionsView.General) @@ -1136,92 +1136,92 @@ namespace Vocaluxe.Screens { EGameMode LastMode = EGameMode.TR_GAMEMODE_NORMAL; if (_AvailableGameModes.Count > 0) - LastMode = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; - SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); + LastMode = _AvailableGameModes[SelectSlides[SelectSlideOptionsMode].Selection]; + SetInteractionToButton(Buttons[ButtonOptionsSing]); _AvailableGameModes.Clear(); - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear(); - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + SelectSlides[SelectSlideOptionsMode].Clear(); + 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); } 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); - 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); } - 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); } //Set SelectSlide-Selection to last selected game-mode if possible for (int i = 0; i < _AvailableGameModes.Count; i++) { if (_AvailableGameModes[i] == LastMode) - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].SetSelectionByValueIndex(i); + SelectSlides[SelectSlideOptionsMode].SetSelectionByValueIndex(i); } - SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = true; - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = true; - Buttons[htButtons(ButtonOptionsSing)].Visible = true; - Buttons[htButtons(ButtonOptionsPlaylist)].Visible = true; - SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); + SelectSlides[SelectSlideOptionsMode].Visible = true; + SelectSlides[SelectSlideOptionsPlaylistAdd].Visible = true; + Buttons[ButtonOptionsSing].Visible = true; + Buttons[ButtonOptionsPlaylist].Visible = true; + SetInteractionToButton(Buttons[ButtonOptionsSing]); } private void _ShowSongOptionsGeneral() { if (CSongs.IsInCategory) { - Buttons[htButtons(ButtonOptionsRandom)].Visible = true; - Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = true; + Buttons[ButtonOptionsRandom].Visible = true; + Buttons[ButtonOptionsSingAllVisible].Visible = true; } else - Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = true; - Buttons[htButtons(ButtonOptionsSingAll)].Visible = true; - Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = true; - Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Visible = true; + Buttons[ButtonOptionsRandomCategory].Visible = true; + Buttons[ButtonOptionsSingAll].Visible = true; + Buttons[ButtonOptionsRandomMedley].Visible = true; + Buttons[ButtonOptionsOpenSelectedItem].Visible = true; - if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues > 0) - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = true; + if (SelectSlides[SelectSlideOptionsPlaylistOpen].NumValues > 0) + SelectSlides[SelectSlideOptionsPlaylistOpen].Visible = true; - if (Buttons[htButtons(ButtonOptionsRandom)].Visible) - SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandom)]); + if (Buttons[ButtonOptionsRandom].Visible) + SetInteractionToButton(Buttons[ButtonOptionsRandom]); else - SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandomCategory)]); + SetInteractionToButton(Buttons[ButtonOptionsRandomCategory]); } private void _ShowSongOptionsMedley() { - Buttons[htButtons(ButtonOptionsStartMedley)].Visible = true; - SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Visible = true; - SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Clear(); + Buttons[ButtonOptionsStartMedley].Visible = true; + SelectSlides[SelectSlideOptionsNumMedleySongs].Visible = true; + SelectSlides[SelectSlideOptionsNumMedleySongs].Clear(); if (CSongs.IsInCategory) { for (int i = 1; i <= CSongs.VisibleSongs.Length; i++) { - SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].AddValue(i.ToString()); + SelectSlides[SelectSlideOptionsNumMedleySongs].AddValue(i.ToString()); } } else { 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) - SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].SetSelectionByValueIndex(4); + if (SelectSlides[SelectSlideOptionsNumMedleySongs].NumValues >= 5) + SelectSlides[SelectSlideOptionsNumMedleySongs].SetSelectionByValueIndex(4); else - SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].SetSelectionByValueIndex(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].NumValues - 1); - SetInteractionToButton(Buttons[htButtons(ButtonOptionsStartMedley)]); + SelectSlides[SelectSlideOptionsNumMedleySongs].SetSelectionByValueIndex(SelectSlides[SelectSlideOptionsNumMedleySongs].NumValues - 1); + SetInteractionToButton(Buttons[ButtonOptionsStartMedley]); } #region Playlist Actions public void CheckPlaylist() { - if (Playlists[htPlaylists(Playlist)].ActivePlaylistID == -1 && _PlaylistActive) + if (Playlists[Playlist].ActivePlaylistID == -1 && _PlaylistActive) ClosePlaylist(); } @@ -1229,101 +1229,101 @@ namespace Vocaluxe.Screens { if (CPlaylists.Playlists.Length > PlaylistID && PlaylistID > -1) { - Playlists[htPlaylists(Playlist)].LoadPlaylist(PlaylistID); - SongMenus[htSongMenus(SongMenu)].SetSmallView(true); - Playlists[htPlaylists(Playlist)].Visible = true; + Playlists[Playlist].LoadPlaylist(PlaylistID); + SongMenus[SongMenu].SetSmallView(true); + Playlists[Playlist].Visible = true; } } 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; - Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive; - SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive); - Playlists[htPlaylists(Playlist)].ClosePlaylist(); + Playlists[Playlist].Selected = _PlaylistActive; + SongMenus[SongMenu].SetActive(!_PlaylistActive); + Playlists[Playlist].ClosePlaylist(); } } private void UpdatePlaylistNames() { - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Clear(); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValue("TR_SCREENSONG_NEWPLAYLIST"); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValues(CPlaylists.PlaylistNames); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Clear(); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].AddValues(CPlaylists.PlaylistNames); + SelectSlides[SelectSlideOptionsPlaylistAdd].Clear(); + SelectSlides[SelectSlideOptionsPlaylistAdd].AddValue("TR_SCREENSONG_NEWPLAYLIST"); + SelectSlides[SelectSlideOptionsPlaylistAdd].AddValues(CPlaylists.PlaylistNames); + SelectSlides[SelectSlideOptionsPlaylistOpen].Clear(); + SelectSlides[SelectSlideOptionsPlaylistOpen].AddValues(CPlaylists.PlaylistNames); } private void OpenPlaylistAction() { //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(); //Open playlist - OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + OpenPlaylist(Playlists[Playlist].ActivePlaylistID); } } private void OpenAndAddPlaylistAction() { //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 EGameMode gm; - if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) - gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + if (_AvailableGameModes.Count >= SelectSlides[SelectSlideOptionsMode].Selection) + gm = _AvailableGameModes[SelectSlides[SelectSlideOptionsMode].Selection]; else - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + if (CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].IsDuet) gm = EGameMode.TR_GAMEMODE_DUET; else gm = EGameMode.TR_GAMEMODE_NORMAL; //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 - 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 - OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + OpenPlaylist(Playlists[Playlist].ActivePlaylistID); SetSelectSlidePlaylistToCurrentPlaylist(); - Playlists[htPlaylists(Playlist)].ScrollToBottom(); + Playlists[Playlist].ScrollToBottom(); } } //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 EGameMode gm; - if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) - gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + if (_AvailableGameModes.Count >= SelectSlides[SelectSlideOptionsMode].Selection) + gm = _AvailableGameModes[SelectSlides[SelectSlideOptionsMode].Selection]; else - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + if (CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].IsDuet) gm = EGameMode.TR_GAMEMODE_DUET; else gm = EGameMode.TR_GAMEMODE_NORMAL; //Create new playlist - Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + Playlists[Playlist].ActivePlaylistID = CPlaylists.NewPlaylist(); //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 - OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); + OpenPlaylist(Playlists[Playlist].ActivePlaylistID); //Add new playlist to select-slide - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].AddValue(CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].PlaylistName); + SelectSlides[SelectSlideOptionsPlaylistAdd].AddValue(CPlaylists.Playlists[Playlists[Playlist].ActivePlaylistID].PlaylistName); + SelectSlides[SelectSlideOptionsPlaylistOpen].AddValue(CPlaylists.Playlists[Playlists[Playlist].ActivePlaylistID].PlaylistName); SetSelectSlidePlaylistToCurrentPlaylist(); @@ -1333,25 +1333,25 @@ namespace Vocaluxe.Screens { //Check selected game-mode EGameMode gm; - if (_AvailableGameModes.Count >= SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection) - gm = _AvailableGameModes[SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Selection]; + if (_AvailableGameModes.Count >= SelectSlides[SelectSlideOptionsMode].Selection) + gm = _AvailableGameModes[SelectSlides[SelectSlideOptionsMode].Selection]; else - if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) + if (CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].IsDuet) gm = EGameMode.TR_GAMEMODE_DUET; else gm = EGameMode.TR_GAMEMODE_NORMAL; - CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID, gm); - Playlists[htPlaylists(Playlist)].UpdatePlaylist(); - Playlists[htPlaylists(Playlist)].ScrollToBottom(); + CPlaylists.Playlists[Playlists[Playlist].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[SongMenu].GetSelectedSong()].ID, gm); + Playlists[Playlist].UpdatePlaylist(); + Playlists[Playlist].ScrollToBottom(); } } private void SetSelectSlidePlaylistToCurrentPlaylist() { - if (Playlists[htPlaylists(Playlist)].ActivePlaylistID > -1) - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection = Playlists[htPlaylists(Playlist)].ActivePlaylistID + 1; + if (Playlists[Playlist].ActivePlaylistID > -1) + SelectSlides[SelectSlideOptionsPlaylistAdd].Selection = Playlists[Playlist].ActivePlaylistID + 1; else - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Selection = 0; + SelectSlides[SelectSlideOptionsPlaylistAdd].Selection = 0; } #endregion Playlist Actions } diff --git a/VocaluxeLib/Menu/CMenu.cs b/VocaluxeLib/Menu/CMenu.cs index cb2bed9e..2f32f7c7 100644 --- a/VocaluxeLib/Menu/CMenu.cs +++ b/VocaluxeLib/Menu/CMenu.cs @@ -19,39 +19,98 @@ namespace Vocaluxe.Menu } public abstract class CMenu : IMenu - { + { + public class COrderedDictionaryLite : IEnumerable + { + private List _Items; + private Dictionary _htIndex; + private CMenu _Parent; + + public COrderedDictionaryLite(CMenu Parent) + { + _Items = new List(); + _htIndex = new Dictionary(); + _Parent = Parent; + } + + public COrderedDictionaryLite(COrderedDictionaryLite Dict) + { + _Items = new List(Dict._Items); + _htIndex = new Dictionary(Dict._htIndex); + _Parent = Dict._Parent; + } + + public T this[int index] + { + get { return _Items[index]; } + set { _Items[index] = value; } + } + + public T this[string key] + { + get + { + try + { + return _Items[_htIndex[key]]; + } + catch (Exception) + { + CBase.Log.LogError("Can't find " + typeof(T).Name.Substring(1) + " Element \"" + key + "\" in Screen " + _Parent._ThemeName); + throw; + } + } + set + { + if (!_htIndex.ContainsKey(key)) + { + _htIndex.Add(key, _Items.Count); + _Items.Add(value); + } + else + _Items[_htIndex[key]] = value; + } + } + + public int Add(T item, String key = null) + { + if (key != null) + _htIndex.Add(key, _Items.Count); + _Items.Add(item); + return _Items.Count - 1; + } + + public IEnumerator GetEnumerator() + { + return _Items.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return (IEnumerator)GetEnumerator(); + } + } + + + private List _Interactions; private int _Selection = 0; private string _ThemePath = String.Empty; protected int _PartyModeID = -1; - - private List _Backgrounds; - private List _Buttons; - private List _Texts; - private List _Statics; - private List _SelectSlides; - private List _SongMenus; - private List _Lyrics; - private List _SingNotes; - private List _NameSelections; - private List _Equalizers; - private List _Playlists; - private List _ParticleEffects; - private List _ScreenSettings; - private Hashtable _htBackgrounds; - private Hashtable _htStatics; - private Hashtable _htTexts; - private Hashtable _htButtons; - private Hashtable _htSongMenus; - private Hashtable _htLyrics; - private Hashtable _htSelectSlides; - private Hashtable _htSingNotes; - private Hashtable _htNameSelections; - private Hashtable _htEqualizers; - private Hashtable _htPlaylists; - private Hashtable _htParticleEffects; - private Hashtable _htScreenSettings; + private COrderedDictionaryLite _Backgrounds; + private COrderedDictionaryLite _Buttons; + private COrderedDictionaryLite _Texts; + private COrderedDictionaryLite _Statics; + private COrderedDictionaryLite _SelectSlides; + private COrderedDictionaryLite _SongMenus; + private COrderedDictionaryLite _Lyrics; + private COrderedDictionaryLite _SingNotes; + private COrderedDictionaryLite _NameSelections; + private COrderedDictionaryLite _Equalizers; + private COrderedDictionaryLite _Playlists; + private COrderedDictionaryLite _ParticleEffects; + private COrderedDictionaryLite _ScreenSettings; private int _PrevMouseX; @@ -109,33 +168,19 @@ namespace Vocaluxe.Menu _Interactions = new List(); _Selection = 0; - _Backgrounds = new List(); - _Buttons = new List(); - _Texts = new List(); - _Statics = new List(); - _SelectSlides = new List(); - _SongMenus = new List(); - _Lyrics = new List(); - _SingNotes = new List(); - _NameSelections = new List(); - _Equalizers = new List(); - _Playlists = new List(); - _ParticleEffects = new List(); - _ScreenSettings = new List(); - - _htBackgrounds = new Hashtable(); - _htStatics = new Hashtable(); - _htTexts = new Hashtable(); - _htButtons = new Hashtable(); - _htSongMenus = new Hashtable(); - _htLyrics = new Hashtable(); - _htSelectSlides = new Hashtable(); - _htSingNotes = new Hashtable(); - _htNameSelections = new Hashtable(); - _htEqualizers = new Hashtable(); - _htPlaylists = new Hashtable(); - _htParticleEffects = new Hashtable(); - _htScreenSettings = new Hashtable(); + _Backgrounds = new COrderedDictionaryLite(this); + _Buttons = new COrderedDictionaryLite(this); + _Texts = new COrderedDictionaryLite(this); + _Statics = new COrderedDictionaryLite(this); + _SelectSlides = new COrderedDictionaryLite(this); + _SongMenus = new COrderedDictionaryLite(this); + _Lyrics = new COrderedDictionaryLite(this); + _SingNotes = new COrderedDictionaryLite(this); + _NameSelections = new COrderedDictionaryLite(this); + _Equalizers = new COrderedDictionaryLite(this); + _Playlists = new COrderedDictionaryLite(this); + _ParticleEffects = new COrderedDictionaryLite(this); + _ScreenSettings = new COrderedDictionaryLite(this); _PrevMouseX = 0; _PrevMouseY = 0; @@ -145,7 +190,7 @@ namespace Vocaluxe.Menu _Active = false; _ScreenArea = new SRectF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH(), 0f); - + _ThemeName = String.Empty; _ThemeBackgrounds = null; _ThemeStatics = null; @@ -168,6 +213,28 @@ namespace Vocaluxe.Menu } #region ThemeHandler + + protected delegate void DAddElement(T Element, String key); + + private void LoadThemeElement(string[] Elements, DAddElement MAddElement, CXMLReader xmlReader, int SkinIndex) where T : IMenuElement + { + if (Elements != null) + { + for (int i = 0; i < Elements.Length; i++) + { + T Element = (T)Activator.CreateInstance(typeof(T), _PartyModeID); + if (Element.LoadTheme("//root/" + _ThemeName, _ThemeBackgrounds[i], xmlReader, SkinIndex)) + { + MAddElement(Element, Elements[i]); + } + else + { + CBase.Log.LogError("Can't load " + typeof(T).Name.Substring(1) + " \"" + Elements[i] + "\" in screen " + _ThemeName); + } + } + } + } + public virtual void LoadTheme(string XmlPath) { string file = Path.Combine(XmlPath, _ThemeName + ".xml"); @@ -186,213 +253,19 @@ namespace Vocaluxe.Menu _ThemePath = XmlPath; LoadThemeBasics(xmlReader, SkinIndex); - if (_ThemeBackgrounds != null) - { - for (int i = 0; i < _ThemeBackgrounds.Length; i++) - { - CBackground background = new CBackground(_PartyModeID); - if (background.LoadTheme("//root/" + _ThemeName, _ThemeBackgrounds[i], xmlReader, SkinIndex)) - { - _htBackgrounds.Add(_ThemeBackgrounds[i], AddBackground(background)); - } - else - { - CBase.Log.LogError("Can't load Background \"" + _ThemeBackgrounds[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeStatics != null) - { - for (int i = 0; i < _ThemeStatics.Length; i++) - { - CStatic stat = new CStatic(_PartyModeID); - if (stat.LoadTheme("//root/" + _ThemeName, _ThemeStatics[i], xmlReader, SkinIndex)) - { - _htStatics.Add(_ThemeStatics[i], AddStatic(stat)); - } - else - { - CBase.Log.LogError("Can't load Static \"" + _ThemeStatics[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeTexts != null) - { - for (int i = 0; i < _ThemeTexts.Length; i++) - { - CText text = new CText(_PartyModeID); - if (text.LoadTheme("//root/" + _ThemeName, _ThemeTexts[i], xmlReader, SkinIndex)) - { - _htTexts.Add(_ThemeTexts[i], AddText(text)); - } - else - { - CBase.Log.LogError("Can't load Text \"" + _ThemeTexts[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeButtons != null) - { - for (int i = 0; i < _ThemeButtons.Length; i++) - { - CButton button = new CButton(_PartyModeID); - if (button.LoadTheme("//root/" + _ThemeName, _ThemeButtons[i], xmlReader, SkinIndex)) - { - _htButtons.Add(_ThemeButtons[i], AddButton(button)); - } - else - { - CBase.Log.LogError("Can't load Button \"" + _ThemeButtons[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeSelectSlides != null) - { - for (int i = 0; i < _ThemeSelectSlides.Length; i++) - { - CSelectSlide slide = new CSelectSlide(_PartyModeID); - if (slide.LoadTheme("//root/" + _ThemeName, _ThemeSelectSlides[i], xmlReader, SkinIndex)) - { - _htSelectSlides.Add(_ThemeSelectSlides[i], AddSelectSlide(slide)); - } - else - { - CBase.Log.LogError("Can't load SelectSlide \"" + _ThemeSelectSlides[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeSongMenus != null) - { - for (int i = 0; i < _ThemeSongMenus.Length; i++) - { - CSongMenu sm = new CSongMenu(_PartyModeID); - if (sm.LoadTheme("//root/" + _ThemeName, _ThemeSongMenus[i], xmlReader, SkinIndex)) - { - _htSongMenus.Add(_ThemeSongMenus[i], AddSongMenu(sm)); - } - else - { - CBase.Log.LogError("Can't load SongMenu \"" + _ThemeSongMenus[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeLyrics != null) - { - for (int i = 0; i < _ThemeLyrics.Length; i++) - { - CLyric lyric = new CLyric(_PartyModeID); - if (lyric.LoadTheme("//root/" + _ThemeName, _ThemeLyrics[i], xmlReader, SkinIndex)) - { - _htLyrics.Add(_ThemeLyrics[i], AddLyric(lyric)); - } - else - { - CBase.Log.LogError("Can't load Lyric \"" + _ThemeLyrics[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeSingNotes != null) - { - for (int i = 0; i < _ThemeSingNotes.Length; i++) - { - CSingNotes notes = new CSingNotesClassic(_PartyModeID); - if (notes.LoadTheme("//root/" + _ThemeName, _ThemeSingNotes[i], xmlReader, SkinIndex)) - { - _htSingNotes.Add(_ThemeSingNotes[i], AddSingNote(notes)); - } - else - { - CBase.Log.LogError("Can't load SingBar \"" + _ThemeSingNotes[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeNameSelections != null) - { - for (int i = 0; i < _ThemeNameSelections.Length; i++) - { - CNameSelection nsel = new CNameSelection(_PartyModeID); - if (nsel.LoadTheme("//root/" + _ThemeName, _ThemeNameSelections[i], xmlReader, SkinIndex)) - { - _htNameSelections.Add(_ThemeNameSelections[i], AddNameSelection(nsel)); - } - else - { - CBase.Log.LogError("Can't load NameSelection \"" + _ThemeNameSelections[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeEqualizers != null) - { - for (int i = 0; i < _ThemeEqualizers.Length; i++) - { - CEqualizer eq = new CEqualizer(_PartyModeID); - if (eq.LoadTheme("//root/" + _ThemeName, _ThemeEqualizers[i], xmlReader, SkinIndex)) - { - _htEqualizers.Add(_ThemeEqualizers[i], AddEqualizer(eq)); - } - else - { - CBase.Log.LogError("Can't load equalizer \"" + _ThemeEqualizers[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemePlaylists != null) - { - for (int i = 0; i < _ThemePlaylists.Length; i++) - { - CPlaylist pls = new CPlaylist(_PartyModeID); - if (pls.LoadTheme("//root/" + _ThemeName, _ThemePlaylists[i], xmlReader, SkinIndex)) - { - _htPlaylists.Add(_ThemePlaylists[i], AddPlaylist(pls)); - } - else - { - CBase.Log.LogError("Can't load Playlist \"" + _ThemePlaylists[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeParticleEffects != null) - { - for (int i = 0; i < _ThemeParticleEffects.Length; i++) - { - CParticleEffect pe = new CParticleEffect(_PartyModeID); - if (pe.LoadTheme("//root/" + _ThemeName, _ThemeParticleEffects[i], xmlReader, SkinIndex)) - { - _htParticleEffects.Add(_ThemeParticleEffects[i], AddParticleEffect(pe)); - } - else - { - CBase.Log.LogError("Can't load ParticleEffect \"" + _ThemeParticleEffects[i] + "\" in screen " + _ThemeName); - } - } - } - - if (_ThemeScreenSettings != null) - { - for (int i = 0; i < _ThemeScreenSettings.Length; i++) - { - CScreenSetting se = new CScreenSetting(_PartyModeID); - if (se.LoadTheme("//root/" + _ThemeName, _ThemeScreenSettings[i], xmlReader, SkinIndex)) - { - _htScreenSettings.Add(_ThemeScreenSettings[i], AddScreenSetting(se)); - } - else - { - CBase.Log.LogError("Can't load ThemeSetting \"" + _ThemeScreenSettings[i] + "\" in screen " + _ThemeName); - } - } - } + LoadThemeElement(_ThemeBackgrounds, AddBackground, xmlReader, SkinIndex); + LoadThemeElement(_ThemeStatics, AddStatic, xmlReader, SkinIndex); + LoadThemeElement(_ThemeTexts, AddText, xmlReader, SkinIndex); + LoadThemeElement(_ThemeButtons, AddButton, xmlReader, SkinIndex); + LoadThemeElement(_ThemeSelectSlides, AddSelectSlide, xmlReader, SkinIndex); + LoadThemeElement(_ThemeSongMenus, AddSongMenu, xmlReader, SkinIndex); + LoadThemeElement(_ThemeLyrics, AddLyric, xmlReader, SkinIndex); + LoadThemeElement(_ThemeSingNotes, AddSingNote, xmlReader, SkinIndex); + LoadThemeElement(_ThemeNameSelections, AddNameSelection, xmlReader, SkinIndex); + LoadThemeElement(_ThemeEqualizers, AddEqualizer, xmlReader, SkinIndex); + LoadThemeElement(_ThemePlaylists, AddPlaylist, xmlReader, SkinIndex); + LoadThemeElement(_ThemeParticleEffects, AddParticleEffect, xmlReader, SkinIndex); + LoadThemeElement(_ThemeScreenSettings, AddScreenSetting, xmlReader, SkinIndex); } } @@ -402,7 +275,7 @@ namespace Vocaluxe.Menu return; XmlWriterSettings settings = new XmlWriterSettings(); - settings.Indent = true; + settings.Indent = true; settings.Encoding = Encoding.UTF8; settings.ConformanceLevel = ConformanceLevel.Document; @@ -419,78 +292,56 @@ namespace Vocaluxe.Menu writer.WriteElementString("ScreenVersion", _ScreenVersion.ToString()); // Backgrounds - for (int i = 0; i < _Backgrounds.Count; i++) - _Backgrounds[i].SaveTheme(writer); + foreach (CBackground bg in _Backgrounds) + bg.SaveTheme(writer); // Statics - for (int i = 0; i < _Statics.Count; i++) - _Statics[i].SaveTheme(writer); + foreach (CStatic st in _Statics) + st.SaveTheme(writer); // Texts - for (int i = 0; i < _Texts.Count; i++) - { - _Texts[i].SaveTheme(writer); - } + foreach (CText txt in _Texts) + txt.SaveTheme(writer); // Buttons - for (int i = 0; i < _Buttons.Count; i++) - { - _Buttons[i].SaveTheme(writer); - } + foreach (CButton bt in _Buttons) + bt.SaveTheme(writer); // SelectSlides - for (int i = 0; i < _SelectSlides.Count; i++) - { - _SelectSlides[i].SaveTheme(writer); - } + foreach (CSelectSlide ss in _SelectSlides) + ss.SaveTheme(writer); // SongMenus - for (int i = 0; i < _SongMenus.Count; i++) - { - _SongMenus[i].SaveTheme(writer); - } + foreach (CSongMenu sm in _SongMenus) + sm.SaveTheme(writer); // Lyrics - for (int i = 0; i < _Lyrics.Count; i++) - { - _Lyrics[i].SaveTheme(writer); - } + foreach (CLyric ly in _Lyrics) + ly.SaveTheme(writer); // SingBars - for (int i = 0; i < _SingNotes.Count; i++) - { - _SingNotes[i].SaveTheme(writer); - } + foreach (CSingNotes sn in _SingNotes) + sn.SaveTheme(writer); // NameSelections - for (int i = 0; i < _NameSelections.Count; i++) - { - _NameSelections[i].SaveTheme(writer); - } + foreach (CNameSelection ns in _NameSelections) + ns.SaveTheme(writer); //Equalizers - for (int i = 0; i < _Equalizers.Count; i++) - { - _Equalizers[i].SaveTheme(writer); - } + foreach (CEqualizer eq in _Equalizers) + eq.SaveTheme(writer); //Playlists - for (int i = 0; i < _Playlists.Count; i++) - { - _Playlists[i].SaveTheme(writer); - } + foreach (CPlaylist pl in _Playlists) + pl.SaveTheme(writer); //ParticleEffects - for (int i = 0; i < _ParticleEffects.Count; i++) - { - _ParticleEffects[i].SaveTheme(writer); - } + foreach (CParticleEffect pa in _ParticleEffects) + pa.SaveTheme(writer); //ScreenSettings - for (int i = 0; i < _ScreenSettings.Count; i++) - { - _ScreenSettings[i].SaveTheme(writer); - } + foreach (CScreenSetting cs in _ScreenSettings) + cs.SaveTheme(writer); writer.WriteEndElement(); @@ -649,7 +500,7 @@ namespace Vocaluxe.Menu #endregion ThemeHandler #region GetLists - public List GetButtons() + /*public List GetButtons() { return _Buttons; } @@ -712,7 +563,7 @@ namespace Vocaluxe.Menu public List GetScreenSettings() { return _ScreenSettings; - } + }*/ #endregion GetLists #region ElementHandler @@ -809,282 +660,73 @@ namespace Vocaluxe.Menu } #endregion Create Elements - #region Get Arrays - public CButton[] Buttons + #region Get Elements + public COrderedDictionaryLite Buttons { - get - { - return _Buttons.ToArray(); - } + get { return _Buttons; } } - public CText[] Texts + public COrderedDictionaryLite Texts { - get - { - return _Texts.ToArray(); - } + get { return _Texts; } } - public CBackground[] Backgrounds + public COrderedDictionaryLite Backgrounds { - get - { - return _Backgrounds.ToArray(); - } + get { return _Backgrounds; } } - public CStatic[] Statics + public COrderedDictionaryLite Statics { - get - { - return _Statics.ToArray(); - } + get { return _Statics; } } - public CSelectSlide[] SelectSlides + public COrderedDictionaryLite SelectSlides { - get - { - return _SelectSlides.ToArray(); - } + get { return _SelectSlides; } } - public CSongMenu[] SongMenus + public COrderedDictionaryLite SongMenus { - get - { - return _SongMenus.ToArray(); - } + get { return _SongMenus; } } - public CLyric[] Lyrics + public COrderedDictionaryLite Lyrics { - get - { - return _Lyrics.ToArray(); - } + get { return _Lyrics; } } - public CSingNotes[] SingNotes + public COrderedDictionaryLite SingNotes { - get - { - return _SingNotes.ToArray(); - } + get { return _SingNotes; } } - public CNameSelection[] NameSelections + public COrderedDictionaryLite NameSelections { - get - { - return _NameSelections.ToArray(); - } + get { return _NameSelections; } } - public CEqualizer[] Equalizers + public COrderedDictionaryLite Equalizers { - get - { - return _Equalizers.ToArray(); - } + get { return _Equalizers; } } - public CPlaylist[] Playlists + + public COrderedDictionaryLite Playlists { - get - { - return _Playlists.ToArray(); - } + get { return _Playlists; } } - public CParticleEffect[] ParticleEffects + public COrderedDictionaryLite ParticleEffects { - get - { - return _ParticleEffects.ToArray(); - } + get { return _ParticleEffects; } } - public CScreenSetting[] ScreenSettings + public COrderedDictionaryLite ScreenSettings { - get - { - return _ScreenSettings.ToArray(); - } + get { return _ScreenSettings; } } #endregion Get Arrays - - #region Hashtables - public int htBackgrounds(string key) - { - try - { - return (int)_htBackgrounds[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find Background Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htStatics(string key) - { - try - { - return (int)_htStatics[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find Statics Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htTexts(string key) - { - try - { - return (int)_htTexts[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find Text Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htButtons(string key) - { - try - { - return (int)_htButtons[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find Button Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htSongMenus(string key) - { - try - { - return (int)_htSongMenus[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find SongMenu Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htLyrics(string key) - { - try - { - return (int)_htLyrics[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find Lyric Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htSelectSlides(string key) - { - try - { - return (int)_htSelectSlides[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find SelectSlide Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htSingNotes(string key) - { - try - { - return (int)_htSingNotes[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find SingBar Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htNameSelections(string key) - { - try - { - return (int)_htNameSelections[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find NameSelection Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htEqualizer(string key) - { - try - { - return (int)_htEqualizers[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find Equalizer Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htPlaylists(string key) - { - try - { - return (int)_htPlaylists[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find Playlist Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htParticleEffects(string key) - { - try - { - return (int)_htParticleEffects[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find ParticleEffect Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - - public int htScreenSettings(string key) - { - try - { - return (int)_htScreenSettings[key]; - } - catch (Exception) - { - CBase.Log.LogError("Can't find ScreenSetting Element \"" + key + "\" in Screen " + _ThemeName); - throw; - } - } - #endregion Hashtables #endregion ElementHandler #region MenuHandler @@ -1129,7 +771,7 @@ namespace Vocaluxe.Menu if (KeyEvent.Key == Keys.Right) NextElement(); } - + return true; } @@ -1157,7 +799,7 @@ namespace Vocaluxe.Menu _UnsetHighlighted(_Selection); if (KeyEvent.KeyPressed) { - + } else { @@ -1236,7 +878,7 @@ namespace Vocaluxe.Menu if (MouseEvent.X - _PrevMouseX <= -5) stepX -= 5; - + _PrevMouseX = MouseEvent.X - (_MouseDX - stepX); } @@ -1251,22 +893,22 @@ namespace Vocaluxe.Menu _PrevMouseY = MouseEvent.Y - (_MouseDY - stepY); } } - + if (MouseEvent.LBH) { //if (IsMouseOver(MouseEvent.X, _PrevMouseY)) //{ - if (MouseEvent.Mod == EModifier.None) - MoveElement(stepX, stepY); + if (MouseEvent.Mod == EModifier.None) + MoveElement(stepX, stepY); - if (MouseEvent.Mod == EModifier.Ctrl) - MoveElement(_MouseDX, _MouseDY); + if (MouseEvent.Mod == EModifier.Ctrl) + MoveElement(_MouseDX, _MouseDY); - if (MouseEvent.Mod == EModifier.Shift) - ResizeElement(stepX, stepY); + if (MouseEvent.Mod == EModifier.Shift) + ResizeElement(stepX, stepY); - if (MouseEvent.Mod == (EModifier.Shift | EModifier.Ctrl)) - ResizeElement(_MouseDX, _MouseDY); + if (MouseEvent.Mod == (EModifier.Shift | EModifier.Ctrl)) + ResizeElement(_MouseDX, _MouseDY); //} } else @@ -1322,7 +964,7 @@ namespace Vocaluxe.Menu DrawFG(); return true; } - + public void DrawBG() { foreach (CBackground bg in _Backgrounds) @@ -1335,7 +977,7 @@ namespace Vocaluxe.Menu { if (_Interactions.Count <= 0) return; - + List items = new List(); for (int i = 0; i < _Interactions.Count; i++) @@ -1361,106 +1003,82 @@ namespace Vocaluxe.Menu if (items.Count <= 0) return; - + items.Sort(delegate(ZSort s1, ZSort s2) { return (s2.z.CompareTo(s1.z)); }); for (int i = 0; i < items.Count; i++) { _DrawInteraction(items[i].ID); } - + } #endregion Drawing #region Elements - public int AddBackground(CBackground bg) + + public void AddBackground(CBackground bg, String key = null) { - _Backgrounds.Add(bg); - _AddInteraction(_Backgrounds.Count - 1, EType.TBackground); - return _Backgrounds.Count - 1; + _AddInteraction(_Backgrounds.Add(bg, key), EType.TBackground); } - public int AddButton(CButton button) + public void AddButton(CButton button, String key = null) { - _Buttons.Add(button); - _AddInteraction(_Buttons.Count - 1, EType.TButton); - return _Buttons.Count - 1; + _AddInteraction(_Buttons.Add(button, key), EType.TButton); } - public int AddSelectSlide(CSelectSlide slide) + public void AddSelectSlide(CSelectSlide slide, String key = null) { - _SelectSlides.Add(slide); - _AddInteraction(_SelectSlides.Count - 1, EType.TSelectSlide); - return _SelectSlides.Count - 1; + _AddInteraction(_SelectSlides.Add(slide, key), EType.TSelectSlide); } - public int AddStatic(CStatic stat) + public void AddStatic(CStatic stat, String key = null) { - _Statics.Add(stat); - _AddInteraction(_Statics.Count - 1, EType.TStatic); - return _Statics.Count - 1; + _AddInteraction(_Statics.Add(stat, key), EType.TStatic); } - public int AddText(CText text) + public void AddText(CText text, String key = null) { - _Texts.Add(text); - _AddInteraction(_Texts.Count - 1, EType.TText); - return _Texts.Count - 1; + _AddInteraction(_Texts.Add(text, key), EType.TText); } - public int AddSongMenu(CSongMenu songmenu) + public void AddSongMenu(CSongMenu songmenu, String key = null) { - _SongMenus.Add(songmenu); - _AddInteraction(_SongMenus.Count - 1, EType.TSongMenu); - return _SongMenus.Count - 1; + _AddInteraction(_SongMenus.Add(songmenu, key), EType.TSongMenu); } - public int AddLyric(CLyric lyric) + public void AddLyric(CLyric lyric, String key = null) { - _Lyrics.Add(lyric); - _AddInteraction(_Lyrics.Count - 1, EType.TLyric); - return _Lyrics.Count - 1; + _AddInteraction(_Lyrics.Add(lyric, key), EType.TLyric); } - public int AddSingNote(CSingNotes sn) + public void AddSingNote(CSingNotes sn, String key = null) { - _SingNotes.Add(sn); - _AddInteraction(_SingNotes.Count - 1, EType.TSingNote); - return _SingNotes.Count - 1; + _AddInteraction(_SingNotes.Add(sn, key), EType.TSingNote); } - public int AddNameSelection(CNameSelection ns) + public void AddNameSelection(CNameSelection ns, String key = null) { - _NameSelections.Add(ns); - _AddInteraction(_NameSelections.Count - 1, EType.TNameSelection); - return _NameSelections.Count - 1; + _AddInteraction(_NameSelections.Add(ns, key), EType.TNameSelection); } - public int AddEqualizer(CEqualizer eq) + public void AddEqualizer(CEqualizer eq, String key = null) { - _Equalizers.Add(eq); - _AddInteraction(_Equalizers.Count - 1, EType.TEqualizer); - return _Equalizers.Count - 1; + _AddInteraction(_Equalizers.Add(eq, key), EType.TEqualizer); } - public int AddPlaylist(CPlaylist pls) + public void AddPlaylist(CPlaylist pls, String key = null) { - _Playlists.Add(pls); - _AddInteraction(_Playlists.Count - 1, EType.TPlaylist); - return _Playlists.Count - 1; + _AddInteraction(_Playlists.Add(pls, key), EType.TPlaylist); } - public int AddParticleEffect(CParticleEffect pe) + public void AddParticleEffect(CParticleEffect pe, String key = null) { - _ParticleEffects.Add(pe); - _AddInteraction(_ParticleEffects.Count - 1, EType.TParticleEffect); - return _ParticleEffects.Count - 1; + _AddInteraction(_ParticleEffects.Add(pe, key), EType.TParticleEffect); } - public int AddScreenSetting(CScreenSetting se) + public void AddScreenSetting(CScreenSetting se, String key = null) { - _ScreenSettings.Add(se); - return _ScreenSettings.Count - 1; + _ScreenSettings.Add(se, key); } #endregion Elements @@ -1474,7 +1092,7 @@ namespace Vocaluxe.Menu public void NextInteraction() { if (_Interactions.Count > 0) - _NextInteraction(); + _NextInteraction(); } public void PrevInteraction() @@ -1484,9 +1102,9 @@ namespace Vocaluxe.Menu } /// - /// Selects the next element in a menu interaction. + /// Selects the next element in a menu Interaction. /// - /// True if the next element is selected. False if either there is no next element or the interaction does not provide such a method. + /// True if the next element is selected. False if either there is no next element or the Interaction does not provide such a method. public bool NextElement() { if (_Interactions.Count > 0) @@ -1496,9 +1114,9 @@ namespace Vocaluxe.Menu } /// - /// Selects the previous element in a menu interaction. + /// Selects the previous element in a menu Interaction. /// - /// True if the previous element is selected. False if either there is no next element or the interaction does not provide such a method. + /// True if the previous element is selected. False if either there is no next element or the Interaction does not provide such a method. public bool PrevElement() { if (_Interactions.Count > 0) @@ -1659,7 +1277,7 @@ namespace Vocaluxe.Menu if (CHelper.IsInBounds(_ParticleEffects[interact.Num].Rect, x, y)) return true; break; - } + } return false; } @@ -2381,7 +1999,7 @@ namespace Vocaluxe.Menu case EType.TParticleEffect: _ParticleEffects[_Interactions[interaction].Num].Draw(); break; - + //TODO: //case EType.TLyric: // _Lyrics[_Interactions[interaction].Num].Draw(0); @@ -2439,7 +2057,7 @@ namespace Vocaluxe.Menu break; } } - } + } private void ResizeElement(int stepW, int stepH) { @@ -2516,24 +2134,24 @@ namespace Vocaluxe.Menu string value = String.Empty; // Backgrounds - CBackground background = new CBackground( _PartyModeID); + CBackground background = new CBackground(_PartyModeID); int i = 1; while (background.LoadTheme("//root/" + _ThemeName, "Background" + i.ToString(), xmlReader, SkinIndex)) { AddBackground(background); background = new CBackground(_PartyModeID); i++; - } - + } + // Statics CStatic stat = new CStatic(_PartyModeID); i = 1; - while (stat.LoadTheme("//root/" + _ThemeName, "Static" + i.ToString(), xmlReader, SkinIndex)) + while (stat.LoadTheme("//root/" + _ThemeName, "Statics[" + i.ToString(), xmlReader, SkinIndex)) { AddStatic(stat); stat = new CStatic(_PartyModeID); i++; - } + } // Texts CText text = new CText(_PartyModeID); @@ -2546,14 +2164,14 @@ namespace Vocaluxe.Menu } // ParticleEffects - CParticleEffect partef = new CParticleEffect(_PartyModeID); + CParticleEffect partef = new CParticleEffect(_PartyModeID); i = 1; while (partef.LoadTheme("//root/" + _ThemeName, "ParticleEffect" + i.ToString(), xmlReader, SkinIndex)) { AddParticleEffect(partef); partef = new CParticleEffect(_PartyModeID); i++; - } + } } private void ReloadThemeEditMode() @@ -2569,4 +2187,4 @@ namespace Vocaluxe.Menu } #endregion Theme Handling } -} +} \ No newline at end of file