From 9ddff4d56728514347d24ca8a59e973a69188584 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 11 Jul 2012 14:17:34 +0200 Subject: [PATCH] Move Playlist-related elements (buttons, texts, statics) to playlist-element. --- Output/Themes/Ambient/Screens/ScreenSong.xml | 500 +++++++++---------- Vocaluxe/Menu/CButton.cs | 5 + Vocaluxe/Menu/CPlaylist.cs | 87 +++- Vocaluxe/Screens/CScreenSong.cs | 142 ++---- 4 files changed, 378 insertions(+), 356 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 1a140efe..6250bf88 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -72,38 +72,6 @@ 26 - - - Menu - - 970 - 40 - -1,00 - 295 - 40 - - - StaticColor - - - - - - - Menu - - 970 - 550 - -1,00 - 295 - 40 - - - StaticColor - - - - Button @@ -245,194 +213,6 @@ - - - CloseIcon - - CloseIcon - - 1215 - 42 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - SingIcon - - SingIcon - - 975 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - SaveIcon - - SaveIcon - - 1175 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - - - - DeleteIcon - - DeleteIcon - - 1215 - 553 - -1,01 - 35 - 35 - - - ButtonColor - - - ButtonSColor - - - 180 - 5 - - 30 - - 350 - - - ButtonTextColor - - - ButtonTextSColor - - Center - - - - Outline - - - - - - - - - - 200 @@ -587,36 +367,6 @@ - - - 975 - 45 - - -1,01 - - 30 - - 220 - - - StaticColor - - - TextSColor - - Left - - Center - - - - Outline - - - - - - Button @@ -1087,6 +837,36 @@ + + + 975 + 45 + + -1,01 + + 30 + + 220 + + + StaticColor + + + TextSColor + + Left + + Center + + + + Outline + + + + + + @@ -1103,6 +883,226 @@ + + + Menu + + 970 + 40 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + Menu + + 970 + 550 + -1,00 + 295 + 40 + + + StaticColor + + + + + + + CloseIcon + + CloseIcon + + 1215 + 42 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + SingIcon + + SingIcon + + 975 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + SaveIcon + + SaveIcon + + 1175 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + + + + DeleteIcon + + DeleteIcon + + 1215 + 553 + -1,01 + 35 + 35 + + + ButtonColor + + + ButtonSColor + + + 180 + 5 + + 30 + + 350 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + + + + + + + + + Button diff --git a/Vocaluxe/Menu/CButton.cs b/Vocaluxe/Menu/CButton.cs index d4b5d231..9e688fbb 100644 --- a/Vocaluxe/Menu/CButton.cs +++ b/Vocaluxe/Menu/CButton.cs @@ -262,6 +262,11 @@ namespace Vocaluxe.Menu } } + public void ProzessMouseMove(int x, int y) + { + Selected = CHelper.IsInBounds(Rect, x, y); + } + public void UnloadTextures() { Text.UnloadTextures(); diff --git a/Vocaluxe/Menu/CPlaylist.cs b/Vocaluxe/Menu/CPlaylist.cs index abdd604a..6a3902ee 100644 --- a/Vocaluxe/Menu/CPlaylist.cs +++ b/Vocaluxe/Menu/CPlaylist.cs @@ -32,8 +32,16 @@ namespace Vocaluxe.Menu public CText Text1; public CText Text2; public CText Text3; + public CText TextPlaylistHeader; public CStatic StaticCover; + public CStatic StaticPlaylistHeader; + public CStatic StaticPlaylistFooter; + + public CButton ButtonPlaylistClose; + public CButton ButtonPlaylistSave; + public CButton ButtonPlaylistDelete; + public CButton ButtonPlaylistSing; public CSelectSlide SelectSlideGameMode; } @@ -72,7 +80,7 @@ namespace Vocaluxe.Menu public bool Selected; public bool changeOrder = false; - public int ActivePlaylistID = 0; + public int ActivePlaylistID = -1; public int Offset = 0; public int ActiveHover = -1; public int CurrentPlaylistElement = -1; @@ -83,7 +91,14 @@ namespace Vocaluxe.Menu _Theme.Text1 = new CText(); _Theme.Text2 = new CText(); _Theme.Text3 = new CText(); + _Theme.TextPlaylistHeader = new CText(); _Theme.StaticCover = new CStatic(); + _Theme.StaticPlaylistFooter = new CStatic(); + _Theme.StaticPlaylistHeader = new CStatic(); + _Theme.ButtonPlaylistClose = new CButton(); + _Theme.ButtonPlaylistDelete = new CButton(); + _Theme.ButtonPlaylistSave = new CButton(); + _Theme.ButtonPlaylistSing = new CButton(); _Theme.SelectSlideGameMode = new CSelectSlide(); Rect = new SRectF(); @@ -141,12 +156,22 @@ namespace Vocaluxe.Menu _ThemeLoaded &= _Theme.Text1.LoadTheme(item, "TextPart1", navigator, SkinIndex); _ThemeLoaded &= _Theme.Text2.LoadTheme(item, "TextPart2", navigator, SkinIndex); _ThemeLoaded &= _Theme.Text2.LoadTheme(item, "TextPart3", navigator, SkinIndex); + _ThemeLoaded &= _Theme.TextPlaylistHeader.LoadTheme(item, "TextPlaylistHeader", navigator, SkinIndex); _Theme.StringText1 = _Theme.Text1.Text; _Theme.StringText2 = _Theme.Text2.Text; _Theme.StringText3 = _Theme.Text3.Text; _ThemeLoaded &= _Theme.StaticCover.LoadTheme(item, "StaticCover", navigator, SkinIndex); + _ThemeLoaded &= _Theme.StaticPlaylistHeader.LoadTheme(item, "StaticPlaylistHeader", navigator, SkinIndex); + _ThemeLoaded &= _Theme.StaticPlaylistFooter.LoadTheme(item, "StaticPlaylistFooter", navigator, SkinIndex); + + _ThemeLoaded &= _Theme.ButtonPlaylistSing.LoadTheme(item, "ButtonPlaylistSing", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistClose.LoadTheme(item, "ButtonPlaylistClose", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistSave.LoadTheme(item, "ButtonPlaylistSave", navigator, SkinIndex); + _ThemeLoaded &= _Theme.ButtonPlaylistDelete.LoadTheme(item, "ButtonPlaylistDelete", navigator, SkinIndex); + _ThemeLoaded &= _Theme.SelectSlideGameMode.LoadTheme(item, "SelectSlideGameMode", navigator, SkinIndex); + _ThemeLoaded &= CHelper.TryGetFloatValueFromXML(item + "/EntryHeight", navigator, ref _Theme.EntryHeight); if (_ThemeLoaded) { @@ -258,6 +283,13 @@ namespace Vocaluxe.Menu PlaylistElements[i].Text3.Draw(); PlaylistElements[i].SelectSlide.Draw(); } + _Theme.ButtonPlaylistSing.Draw(); + _Theme.ButtonPlaylistSave.Draw(); + _Theme.ButtonPlaylistDelete.Draw(); + _Theme.ButtonPlaylistClose.Draw(); + _Theme.StaticPlaylistHeader.Draw(); + _Theme.StaticPlaylistFooter.Draw(); + _Theme.TextPlaylistHeader.Draw(); } public void UnloadTextures() @@ -501,6 +533,34 @@ namespace Vocaluxe.Menu CurrentPlaylistElement = -1; } } + + if (ActivePlaylistID > -1) + { + _Theme.ButtonPlaylistClose.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistSing.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistSave.ProzessMouseMove(mevent.X, mevent.Y); + _Theme.ButtonPlaylistDelete.ProzessMouseMove(mevent.X, mevent.Y); + if (mevent.LB) + { + if (CHelper.IsInBounds(_Theme.ButtonPlaylistClose.Rect, mevent)) + { + ClosePlaylist(); + } + else if (CHelper.IsInBounds(_Theme.ButtonPlaylistSing.Rect, mevent)) + { + StartPlaylistSongs(); + } + else if (CHelper.IsInBounds(_Theme.ButtonPlaylistSave.Rect, mevent)) + { + CPlaylists.SavePlaylist(ActivePlaylistID); + } + else if (CHelper.IsInBounds(_Theme.ButtonPlaylistDelete.Rect, mevent)) + { + CPlaylists.DeletePlaylist(ActivePlaylistID); + ClosePlaylist(); + } + } + } return false; } @@ -528,6 +588,7 @@ namespace Vocaluxe.Menu { if (PlaylistID > -1 && PlaylistID < CPlaylists.NumPlaylists) { + _Theme.TextPlaylistHeader.Text = CPlaylists.Playlists[ActivePlaylistID].PlaylistName; ActivePlaylistID = PlaylistID; PlaylistElementContents.Clear(); for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) @@ -559,6 +620,30 @@ namespace Vocaluxe.Menu Update(); } + private void StartPlaylistSongs() + { + CGame.Reset(); + CGame.ClearSongs(); + + if (ActivePlaylistID > -1 && ActivePlaylistID < CPlaylists.NumPlaylists) + { + for (int i = 0; i < CPlaylists.Playlists[ActivePlaylistID].Songs.Count; i++) + { + CGame.AddSong(CPlaylists.Playlists[ActivePlaylistID].Songs[i].SongID, CPlaylists.Playlists[ActivePlaylistID].Songs[i].GameMode); + } + if (CGame.GetNumSongs() > 0) + CGraphics.FadeTo(EScreens.ScreenNames); + } + } + + + private void ClosePlaylist() + { + Visible = false; + Selected = false; + ActivePlaylistID = -1; + } + public void Update() { if (ActivePlaylistID > -1 && ActivePlaylistID < CPlaylists.NumPlaylists) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 72e52066..de464dfd 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -25,23 +25,16 @@ namespace Vocaluxe.Screens private const string TextSearchBarTitle = "TextSearchBarTitle"; private const string TextSearchBar = "TextSearchBar"; private const string TextOptionsTitle = "TextOptionsTitle"; - private const string TextPlaylistHeader = "TextPlaylistHeader"; private const string ButtonOptionsSing = "ButtonOptionsSing"; private const string ButtonOptionsPlaylist = "ButtonOptionsPlaylist"; private const string ButtonOptionsClose = "ButtonOptionsClose"; - private const string ButtonPlaylistClose = "ButtonPlaylistClose"; - private const string ButtonPlaylistSing = "ButtonPlaylistSing"; - private const string ButtonPlaylistSave = "ButtonPlaylistSave"; - private const string ButtonPlaylistDelete = "ButtonPlaylistDelete"; private const string SelectSlideOptionsMode = "SelectSlideOptionsMode"; private const string SelectSlideOptionsPlaylist = "SelectSlideOptionsPlaylist"; private const string StaticSearchBar = "StaticSearchBar"; private const string StaticOptionsBG = "StaticOptionsBG"; - private const string StaticPlaylistHeader = "StaticPlaylistHeader"; - private const string StaticPlaylistFooter = "StaticPlaylistFooter"; private const string SongMenu = "SongMenu"; private const string Playlist = "Playlist"; @@ -49,7 +42,6 @@ namespace Vocaluxe.Screens private bool _SearchActive = false; private bool _SongOptionsActive = false; - private int _OpenedPlaylist = -1; private List _AvailableGameModes; public CScreenSong() @@ -65,9 +57,9 @@ namespace Vocaluxe.Screens _ThemeName = "ScreenSong"; _ScreenVersion = ScreenVersion; - _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG, StaticPlaylistHeader, StaticPlaylistFooter }; - _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle, TextPlaylistHeader }; - _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing, ButtonPlaylistClose, ButtonPlaylistSing, ButtonPlaylistSave, ButtonPlaylistDelete }; + _ThemeStatics = new string[] { StaticSearchBar, StaticOptionsBG }; + _ThemeTexts = new string[] { TextCategory, TextSelection, TextSearchBarTitle, TextSearchBar, TextOptionsTitle }; + _ThemeButtons = new string[] { ButtonOptionsClose, ButtonOptionsPlaylist, ButtonOptionsSing }; _ThemeSelectSlides = new string[] { SelectSlideOptionsMode, SelectSlideOptionsPlaylist }; _ThemeSongMenus = new string[] { SongMenu }; _ThemePlaylists = new string[] { Playlist }; @@ -81,15 +73,8 @@ namespace Vocaluxe.Screens Buttons[htButtons(ButtonOptionsClose)].Visible = false; Buttons[htButtons(ButtonOptionsSing)].Visible = false; Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false; - Buttons[htButtons(ButtonPlaylistClose)].Visible = false; - Buttons[htButtons(ButtonPlaylistSing)].Visible = false; - Buttons[htButtons(ButtonPlaylistSave)].Visible = false; - Buttons[htButtons(ButtonPlaylistDelete)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false; - Texts[htTexts(TextPlaylistHeader)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; - Statics[htStatics(StaticPlaylistHeader)].Visible = false; - Statics[htStatics(StaticPlaylistFooter)].Visible = false; Playlists[htPlaylists(Playlist)].Visible = false; } @@ -221,25 +206,26 @@ namespace Vocaluxe.Screens else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { //Open a playlist and add song - if (_OpenedPlaylist != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) { - _OpenedPlaylist = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - if (_OpenedPlaylist < 0) - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); + if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + else + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) { - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist else { - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } ToggleSongOptions(); @@ -308,27 +294,26 @@ namespace Vocaluxe.Screens else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected) { //Open a playlist and add song - if (_OpenedPlaylist != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1)) { - _OpenedPlaylist = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1; - if (_OpenedPlaylist < 0) - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); + if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1 < 0) + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + else + Playlists[htPlaylists(Playlist)].ActivePlaylistID = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection; + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Create a new playlist and add song else if ((SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection - 1) == -1) { - _OpenedPlaylist = CPlaylists.NewPlaylist(); - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); - OpenPlaylist(_OpenedPlaylist); - UpdatePlaylistNames(); - SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].Selection = SelectSlides[htSelectSlides(SelectSlideOptionsPlaylist)].NumValues - 1; + Playlists[htPlaylists(Playlist)].ActivePlaylistID = CPlaylists.NewPlaylist(); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + OpenPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); } //Add song to loaded playlist - else + else { - CPlaylists.Playlists[_OpenedPlaylist].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); + CPlaylists.Playlists[Playlists[htPlaylists(Playlist)].ActivePlaylistID].AddSong(CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].ID); Playlists[htPlaylists(Playlist)].UpdatePlaylist(); } ToggleSongOptions(); @@ -340,31 +325,6 @@ namespace Vocaluxe.Screens } } - if (_OpenedPlaylist > -1) - { - if (MouseEvent.LB && IsMouseOver(MouseEvent)) - { - if (Buttons[htButtons(ButtonPlaylistClose)].Selected) - { - ClosePlaylist(); - } - else if (Buttons[htButtons(ButtonPlaylistSing)].Selected) - { - StartPlaylistSongs(); - } - else if (Buttons[htButtons(ButtonPlaylistSave)].Selected) - { - CPlaylists.SavePlaylist(_OpenedPlaylist); - } - else if (Buttons[htButtons(ButtonPlaylistDelete)].Selected) - { - CPlaylists.DeletePlaylist(_OpenedPlaylist); - ClosePlaylist(); - UpdatePlaylistNames(); - } - } - } - return true; } @@ -374,15 +334,16 @@ namespace Vocaluxe.Screens CGame.EnterNormalGame(); SongMenus[htSongMenus(SongMenu)].OnShow(); Playlists[htPlaylists(Playlist)].Init(); - if(_OpenedPlaylist != -1) - Playlists[htPlaylists(Playlist)].LoadPlaylist(_OpenedPlaylist); + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != -1) + Playlists[htPlaylists(Playlist)].LoadPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); UpdatePlaylistNames(); } public override bool UpdateGame() { SongMenus[htSongMenus(SongMenu)].Update(); - Playlists[htPlaylists(Playlist)].Visible = SongMenus[htSongMenus(SongMenu)].IsSmallView(); + if (SongMenus[htSongMenus(SongMenu)].IsSmallView()) + CheckPlaylist(); Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) @@ -478,22 +439,6 @@ namespace Vocaluxe.Screens } } - private void StartPlaylistSongs() - { - CGame.Reset(); - CGame.ClearSongs(); - - if (_OpenedPlaylist > -1 && _OpenedPlaylist < CPlaylists.NumPlaylists) - { - for (int i = 0; i < CPlaylists.Playlists[_OpenedPlaylist].Songs.Count; i++) - { - CGame.AddSong(CPlaylists.Playlists[_OpenedPlaylist].Songs[i].SongID, CPlaylists.Playlists[_OpenedPlaylist].Songs[i].GameMode); - } - if (CGame.GetNumSongs() > 0) - CGraphics.FadeTo(EScreens.ScreenNames); - } - } - private void StartRandomAllSongs() { CGame.Reset(); @@ -643,38 +588,25 @@ namespace Vocaluxe.Screens } } + public void CheckPlaylist() + { + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID == -1) + ClosePlaylist(); + } + private void OpenPlaylist(int PlaylistID) { if (CPlaylists.Playlists.Length > PlaylistID && PlaylistID > -1) { - _OpenedPlaylist = PlaylistID; - Playlists[htPlaylists(Playlist)].LoadPlaylist(_OpenedPlaylist); + Playlists[htPlaylists(Playlist)].LoadPlaylist(PlaylistID); SongMenus[htSongMenus(SongMenu)].SetSmallView(true); Playlists[htPlaylists(Playlist)].Visible = true; - Statics[htStatics(StaticPlaylistHeader)].Visible = true; - Statics[htStatics(StaticPlaylistFooter)].Visible = true; - Texts[htTexts(TextPlaylistHeader)].Visible = true; - Texts[htTexts(TextPlaylistHeader)].Text = CPlaylists.Playlists[PlaylistID].PlaylistName; - Buttons[htButtons(ButtonPlaylistClose)].Visible = true; - Buttons[htButtons(ButtonPlaylistSing)].Visible = true; - Buttons[htButtons(ButtonPlaylistSave)].Visible = true; - Buttons[htButtons(ButtonPlaylistDelete)].Visible = true; } } private void ClosePlaylist() { - _OpenedPlaylist = -1; SongMenus[htSongMenus(SongMenu)].SetSmallView(false); - Playlists[htPlaylists(Playlist)].Visible = false; - Statics[htStatics(StaticPlaylistHeader)].Visible = false; - Statics[htStatics(StaticPlaylistFooter)].Visible = false; - Texts[htTexts(TextPlaylistHeader)].Visible = false; - Texts[htTexts(TextPlaylistHeader)].Text = String.Empty; - Buttons[htButtons(ButtonPlaylistClose)].Visible = false; - Buttons[htButtons(ButtonPlaylistSing)].Visible = false; - Buttons[htButtons(ButtonPlaylistSave)].Visible = false; - Buttons[htButtons(ButtonPlaylistDelete)].Visible = false; } private void UpdatePlaylistNames()