From 7202cf5616ec0f9738868239a42a6ad9f0c416e5 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Mon, 17 Dec 2012 23:48:05 +0100 Subject: [PATCH] fixed song navigation in party mode --- Vocaluxe/Screens/CScreenSong.cs | 11 +++++++---- VocaluxeLib/Menu/SongMenu/CSongMenu.cs | 4 ++-- .../Menu/SongMenu/CSongMenuFramework.cs | 2 +- .../Menu/SongMenu/CSongMenuTileBoard.cs | 19 +++++++++++++++++-- VocaluxeLib/Menu/SongMenu/ISongMenu.cs | 2 +- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 321b7f06..54fe8db8 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -654,7 +654,7 @@ namespace Vocaluxe.Screens if (_sso.Selection.PartyMode) ToggleSongOptions(ESongOptionsView.None); - SongMenus[htSongMenus(SongMenu)].Update(); + SongMenus[htSongMenus(SongMenu)].Update(_sso); if (SongMenus[htSongMenus(SongMenu)].IsSmallView()) CheckPlaylist(); @@ -697,7 +697,10 @@ namespace Vocaluxe.Screens if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null) { Buttons[htButtons(ButtonStart)].Visible = true; - SongMenus[htSongMenus(SongMenu)].SetSmallView(true); + + if(!SongMenus[htSongMenus(SongMenu)].IsSmallView()) + SongMenus[htSongMenus(SongMenu)].SetSmallView(true); + for (int i = 0; i < _Base.Settings.GetMaxNumPlayer(); i++) { if (i < _sso.Selection.NumJokers.Length) @@ -1073,7 +1076,7 @@ namespace Vocaluxe.Screens Buttons[htButtons(ButtonOptionsSingAll)].Visible = false; Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false; Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false; - Buttons[htButtons(ButtonOpenOptions)].Visible = true; + Buttons[htButtons(ButtonOpenOptions)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false; Statics[htStatics(StaticOptionsBG)].Visible = false; } @@ -1082,7 +1085,7 @@ namespace Vocaluxe.Screens #region Playlist Actions public void CheckPlaylist() { - if (Playlists[htPlaylists(Playlist)].ActivePlaylistID == -1) + if (Playlists[htPlaylists(Playlist)].ActivePlaylistID == -1 && _PlaylistActive) ClosePlaylist(); } diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenu.cs b/VocaluxeLib/Menu/SongMenu/CSongMenu.cs index c720cf6f..4a654c00 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenu.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenu.cs @@ -48,9 +48,9 @@ namespace Vocaluxe.Menu.SongMenu } #region ISongMenu - public void Update() + public void Update(ScreenSongOptions SongOptions) { - _SongMenu.Update(); + _SongMenu.Update(SongOptions); } public void OnShow() diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs index 7b7f9de3..c9d30789 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs @@ -434,7 +434,7 @@ namespace Vocaluxe.Menu.SongMenu Init(); } - public virtual void Update() + public virtual void Update(ScreenSongOptions SongOptions) { if (!_Initialized) return; diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs index 4a32720f..405ad95f 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs @@ -100,6 +100,21 @@ namespace Vocaluxe.Menu.SongMenu _Title = _Theme.songMenuTileBoard.TextTitle; _SongLength = _Theme.songMenuTileBoard.TextSongLength; } + + public override void Update(ScreenSongOptions SongOptions) + { + base.Update(SongOptions); + + if (SongOptions.Selection.RandomOnly) + { + _Locked = _PreviewSelected; + _actualSelection = _PreviewSelected; + for (int i = 0; i < _Tiles.Count; i++) + { + _Tiles[i].Selected = _Locked == i + _Offset; + } + } + } public override void OnShow() { @@ -170,9 +185,9 @@ namespace Vocaluxe.Menu.SongMenu break; } } - + if ((_Locked == -1 || !sel) && - KeyEvent.Key != Keys.Escape && KeyEvent.Key != Keys.Back && KeyEvent.Key != Keys.PageUp && KeyEvent.Key != Keys.PageDown) + (KeyEvent.Key != Keys.Escape && KeyEvent.Key != Keys.Back && KeyEvent.Key != Keys.PageUp && KeyEvent.Key != Keys.PageDown)) { if (_PreviewSelected > -1) { diff --git a/VocaluxeLib/Menu/SongMenu/ISongMenu.cs b/VocaluxeLib/Menu/SongMenu/ISongMenu.cs index 4017ec3a..e5c3d60f 100644 --- a/VocaluxeLib/Menu/SongMenu/ISongMenu.cs +++ b/VocaluxeLib/Menu/SongMenu/ISongMenu.cs @@ -8,7 +8,7 @@ namespace Vocaluxe.Menu.SongMenu { interface ISongMenu : IMenuElement { - void Update(); + void Update(ScreenSongOptions SongOptions); void OnShow(); void OnHide();