From 752b8e91feb95958f312bfbfbfa147de3db75afe Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 4 Feb 2020 12:15:28 +0100 Subject: [PATCH 1/8] Add list button to toggle playlist filter (#218) --- VocaluxeLib/Menu/CPlaylist.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/VocaluxeLib/Menu/CPlaylist.cs b/VocaluxeLib/Menu/CPlaylist.cs index 45517bf2..bd613e7b 100644 --- a/VocaluxeLib/Menu/CPlaylist.cs +++ b/VocaluxeLib/Menu/CPlaylist.cs @@ -81,6 +81,7 @@ namespace VocaluxeLib.Menu public SThemeButton ButtonPlaylistSave; public SThemeButton ButtonPlaylistDelete; public SThemeButton ButtonPlaylistSing; + public SThemeButton ButtonPlaylistList; public SThemeSelectSlide SelectSlideGameMode; } @@ -163,6 +164,7 @@ namespace VocaluxeLib.Menu private readonly CButton _ButtonPlaylistSave; private readonly CButton _ButtonPlaylistDelete; private readonly CButton _ButtonPlaylistSing; + private readonly CButton _ButtonPlaylistList; private readonly CText _Text1; private readonly CSelectSlide _SelectSlideGameMode; private readonly CStatic _StaticPlaylistHeader; @@ -235,6 +237,7 @@ namespace VocaluxeLib.Menu _ButtonPlaylistDelete = new CButton(_PartyModeID); _ButtonPlaylistSave = new CButton(_PartyModeID); _ButtonPlaylistSing = new CButton(_PartyModeID); + _ButtonPlaylistList = new CButton(_PartyModeID); _SelectSlideGameMode = new CSelectSlide(_PartyModeID); Visible = false; @@ -254,6 +257,7 @@ namespace VocaluxeLib.Menu _ButtonPlaylistDelete = new CButton(_Theme.ButtonPlaylistDelete, _PartyModeID); _ButtonPlaylistSave = new CButton(_Theme.ButtonPlaylistSave, _PartyModeID); _ButtonPlaylistSing = new CButton(_Theme.ButtonPlaylistSing, _PartyModeID); + _ButtonPlaylistList = new CButton(_Theme.ButtonPlaylistList, _PartyModeID); _SelectSlideGameMode = new CSelectSlide(_Theme.SelectSlideGameMode, _PartyModeID); _AddStatic(_StaticPlaylistFooter); @@ -263,6 +267,7 @@ namespace VocaluxeLib.Menu _AddButton(_ButtonPlaylistDelete); _AddButton(_ButtonPlaylistSave); _AddButton(_ButtonPlaylistSing); + _AddButton(_ButtonPlaylistList); Visible = false; Selected = false; @@ -279,6 +284,7 @@ namespace VocaluxeLib.Menu _Theme.ButtonPlaylistClose = (SThemeButton)_ButtonPlaylistClose.GetTheme(); _Theme.ButtonPlaylistSave = (SThemeButton)_ButtonPlaylistSave.GetTheme(); _Theme.ButtonPlaylistDelete = (SThemeButton)_ButtonPlaylistDelete.GetTheme(); + _Theme.ButtonPlaylistList = (SThemeButton)_ButtonPlaylistList.GetTheme(); } public void UpdateGame() @@ -321,6 +327,7 @@ namespace VocaluxeLib.Menu _ButtonPlaylistName.UnloadSkin(); _ButtonPlaylistSave.UnloadSkin(); _ButtonPlaylistSing.UnloadSkin(); + _ButtonPlaylistList.UnloadSkin(); _StaticPlaylistFooter.UnloadSkin(); _StaticPlaylistHeader.UnloadSkin(); @@ -342,6 +349,7 @@ namespace VocaluxeLib.Menu _ButtonPlaylistName.LoadSkin(); _ButtonPlaylistSave.LoadSkin(); _ButtonPlaylistSing.LoadSkin(); + _ButtonPlaylistList.LoadSkin(); _StaticPlaylistFooter.LoadSkin(); _StaticPlaylistHeader.LoadSkin(); @@ -640,6 +648,8 @@ namespace VocaluxeLib.Menu _StartPlaylistSongs(); else if (_ButtonPlaylistSave.Selected) CBase.Playlist.Save(ActivePlaylistID); + else if (isButtonPlaylistListSelected()) + return false; // Currently CScreenSong do this event! else if (_ButtonPlaylistDelete.Selected) { CBase.Playlist.Delete(ActivePlaylistID); @@ -672,6 +682,11 @@ namespace VocaluxeLib.Menu return true; } + public bool isButtonPlaylistListSelected() + { + return _ButtonPlaylistList.Selected; + } + private void _SetSelectionToLastEntry() { if (_PlaylistElementContents.Count == 0) @@ -781,6 +796,8 @@ namespace VocaluxeLib.Menu //LB actions if (mouseEvent.LB) { + if (isButtonPlaylistListSelected()) + return false; // Currently CScreenSong do this event! if (_CurrentPlaylistElement != -1) { CBase.Playlist.GetSong(ActivePlaylistID, _CurrentPlaylistElement + _Offset).GameMode = @@ -1171,6 +1188,15 @@ namespace VocaluxeLib.Menu _CompleteRect.W = _ButtonPlaylistDelete.Rect.W + _ButtonPlaylistDelete.Rect.X - _CompleteRect.X; if (_ButtonPlaylistDelete.Rect.Y + _ButtonPlaylistDelete.Rect.H > _CompleteRect.Y + _CompleteRect.H) _CompleteRect.H = _ButtonPlaylistDelete.Rect.H + _ButtonPlaylistDelete.Rect.Y - _CompleteRect.Y; + //ButtonPlaylistList + if (_ButtonPlaylistList.Rect.X < _CompleteRect.X) + _CompleteRect.X = _ButtonPlaylistList.Rect.X; + if (_ButtonPlaylistList.Rect.Y < _CompleteRect.Y) + _CompleteRect.Y = _ButtonPlaylistList.Rect.Y; + if (_ButtonPlaylistList.Rect.W + _ButtonPlaylistList.Rect.X > _CompleteRect.W + _CompleteRect.X) + _CompleteRect.W = _ButtonPlaylistList.Rect.W + _ButtonPlaylistList.Rect.X - _CompleteRect.X; + if (_ButtonPlaylistList.Rect.Y + _ButtonPlaylistList.Rect.H > _CompleteRect.Y + _CompleteRect.H) + _CompleteRect.H = _ButtonPlaylistList.Rect.H + _ButtonPlaylistList.Rect.Y - _CompleteRect.Y; } #region ThemeEdit From 8824eb3f25eff495cf8b3b057bad4244a0ed2a05 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 4 Feb 2020 12:16:47 +0100 Subject: [PATCH 2/8] Button image -> Toggle playlist filter --- Output/Themes/Genius/ListIcon.png | Bin 0 -> 720 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Output/Themes/Genius/ListIcon.png diff --git a/Output/Themes/Genius/ListIcon.png b/Output/Themes/Genius/ListIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..33bd9d4753f577a6470acded208bef93a779bcbb GIT binary patch literal 720 zcmeAS@N?(olHy`uVBq!ia0vp^CqS5k4M?tyST_$yF%}28J29*~C-V}>VM%xNb!1@J z*w6hZkrl}2EbxddW?XfSbx09w{PTUVRBRuKqKn@sn^C{|I2mm<@EA9`W!5c z4gy3IEr-)D9sivFxMI({2X`xuzx(|({LGTWDol+E0vyB=-)DBE?>yBQ5?c z=6(Egd!bES`G>qc$>0Be(zd(BFqwm;$w7fwLdI?~-{zT~?Ve~sf`@xhD#P!*REC8n zNzTn)u+zr)r9mh0P6K+u_T`*;wl52Uhz&@vIx<5OdzAmlj+_^8+$;02|KF9sRLJ1z L>gTe~DWM4f;o-Yb literal 0 HcmV?d00001 From 8ad4f060151bcc013ca16cfbd073a6b2f04746a6 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 4 Feb 2020 12:17:38 +0100 Subject: [PATCH 3/8] Add playlist filter toggle image --- Output/Themes/Genius/01_Standard.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/Output/Themes/Genius/01_Standard.xml b/Output/Themes/Genius/01_Standard.xml index 8147bbdf..f3174336 100644 --- a/Output/Themes/Genius/01_Standard.xml +++ b/Output/Themes/Genius/01_Standard.xml @@ -353,6 +353,7 @@ DeleteIcon.png SaveIcon.png SingIcon.png + ListIcon.png MinusIcon.png PlusIcon.png VolUp.png From 57c78d47b4d5ed5e056db373318708632590e805 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 4 Feb 2020 12:17:59 +0100 Subject: [PATCH 4/8] Add playlist filter toggle image --- Output/Themes/Genius/02_Ice_Blue.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/Output/Themes/Genius/02_Ice_Blue.xml b/Output/Themes/Genius/02_Ice_Blue.xml index 0e9d9806..9d27bd3b 100644 --- a/Output/Themes/Genius/02_Ice_Blue.xml +++ b/Output/Themes/Genius/02_Ice_Blue.xml @@ -353,6 +353,7 @@ DeleteIcon.png SaveIcon.png SingIcon.png + ListIcon.png MinusIcon.png PlusIcon.png VolUp.png From 0672f4aff63d630562c8bb2fd4f65e6c68288036 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 4 Feb 2020 12:18:26 +0100 Subject: [PATCH 5/8] Add playlist filter toggle image --- Output/Themes/Genius/03_Crimson_Red.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/Output/Themes/Genius/03_Crimson_Red.xml b/Output/Themes/Genius/03_Crimson_Red.xml index aa3f4cfb..c29f5e8e 100644 --- a/Output/Themes/Genius/03_Crimson_Red.xml +++ b/Output/Themes/Genius/03_Crimson_Red.xml @@ -353,6 +353,7 @@ DeleteIcon.png SaveIcon.png SingIcon.png + ListIcon.png MinusIcon.png PlusIcon.png VolUp.png From cc724c55b371c438fe50a7bcf99c6217c45ce090 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 4 Feb 2020 12:19:37 +0100 Subject: [PATCH 6/8] Add playlist filter toggle button image --- Output/Themes/Genius/Screens/ScreenSong.xml | 29 ++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Output/Themes/Genius/Screens/ScreenSong.xml b/Output/Themes/Genius/Screens/ScreenSong.xml index 4d69765a..e100713c 100644 --- a/Output/Themes/Genius/Screens/ScreenSong.xml +++ b/Output/Themes/Genius/Screens/ScreenSong.xml @@ -2,7 +2,7 @@ ScreenSong - 9 + 10 @@ -1460,6 +1460,33 @@ + + ListIcon + ListIcon + + 1120 + 548 + 35 + 35 + -1.01 + + + + + 180 + 5 + 0 + 25 + 350 + + + Center + Center + + Outline + + + DeleteIcon DeleteIcon From e209aee3e7d1cfe3f55d2250b43f3c2017dcc4b2 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 4 Feb 2020 12:20:17 +0100 Subject: [PATCH 7/8] Update Changelog_ScreenSong.txt --- Output/Themes/Changelog/Changelog_ScreenSong.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Output/Themes/Changelog/Changelog_ScreenSong.txt b/Output/Themes/Changelog/Changelog_ScreenSong.txt index 563bd3ab..7b5e00a2 100644 --- a/Output/Themes/Changelog/Changelog_ScreenSong.txt +++ b/Output/Themes/Changelog/Changelog_ScreenSong.txt @@ -1,5 +1,11 @@ ScreenSong +++++++++++ +Version 10: + +Add: + + ++++++++++ Version 9: From 56413904422458e877bf563f5a028c774d24f99b Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 4 Feb 2020 12:22:02 +0100 Subject: [PATCH 8/8] Add event handling for new playlist filter toggle button --- Vocaluxe/Screens/CScreenSong.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 3f851153..33130398 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -43,7 +43,7 @@ namespace Vocaluxe.Screens // Version number for theme files. Increment it, if you've changed something on the theme files! protected override int _ScreenVersion { - get { return 9; } + get { return 10; } } private const string _TextCategory = "TextCategory"; @@ -217,6 +217,11 @@ namespace Vocaluxe.Screens keyEvent.Handled = true; return true; } + if (keyEvent.Key == Keys.Enter && _Playlist.isButtonPlaylistListSelected()) + { + _TogglePlaylistFilter(); + return true; + } } // Playlist selection is handled below not in base! @@ -506,6 +511,11 @@ namespace Vocaluxe.Screens _SongMenu.SmallView = false; return true; } + if (mouseEvent.LB && _Playlist.isButtonPlaylistListSelected()) + { + _TogglePlaylistFilter(); + return true; + } } else if (CHelper.IsInBounds(_SongMenu.Rect, mouseEvent)) {