From ce4529325bc1e8eec642a2c0ebbf1f40770c105e Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Mon, 6 Nov 2017 10:08:06 +0100 Subject: [PATCH 01/12] Fix: exception when intro video is missing --- Vocaluxe/Base/CVideoPlayer.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Base/CVideoPlayer.cs b/Vocaluxe/Base/CVideoPlayer.cs index 3e0762f6..1f451396 100644 --- a/Vocaluxe/Base/CVideoPlayer.cs +++ b/Vocaluxe/Base/CVideoPlayer.cs @@ -53,6 +53,10 @@ namespace Vocaluxe.Base { _VideoTimer.Reset(); _Finished = false; + if (_VideoStream == null) + { + return; + } //CVideo.VdSkip(_VideoStream, 0f, 0f); _VideoTimer.Start(); CVideo.Resume(_VideoStream); @@ -60,12 +64,19 @@ namespace Vocaluxe.Base public void Pause() { - CVideo.Pause(_VideoStream); + if (_VideoStream != null) + { + CVideo.Pause(_VideoStream); + } _VideoTimer.Stop(); } public void Resume() { + if (_VideoStream == null) + { + return; + } CVideo.Resume(_VideoStream); _VideoTimer.Start(); } @@ -92,7 +103,7 @@ namespace Vocaluxe.Base public void PreLoad() { - if (!_Loaded) + if (!_Loaded || _VideoStream == null) { return; } @@ -111,7 +122,10 @@ namespace Vocaluxe.Base public void Close() { - CVideo.Close(ref _VideoStream); + if (_VideoStream != null) + { + CVideo.Close(ref _VideoStream); + } _Loaded = false; _Finished = false; _VideoTimer.Reset(); From c31fdb78391fc02776782f0ee31442f6a12cc839 Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Mon, 6 Nov 2017 19:33:03 +0100 Subject: [PATCH 02/12] Make option to autoplay previews on song selection --- Output/Languages/English.xml | 1 + .../Changelog/Changelog_ScreenOptionsGame.txt | 5 ++ .../Genius/Screens/ScreenOptionsGame.xml | 66 +++++++++++++++++-- Vocaluxe/Base/CConfig.cs | 3 + Vocaluxe/Base/CMain.cs | 5 ++ Vocaluxe/Screens/CScreenOptionsGame.cs | 5 +- VocaluxeLib/IBasic.cs | 1 + VocaluxeLib/Menu/SongMenu/CSongMenuList.cs | 16 +++++ .../Menu/SongMenu/CSongMenuTileBoard.cs | 16 +++++ 9 files changed, 112 insertions(+), 6 deletions(-) diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index 3455a91f..3c758738 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -188,6 +188,7 @@ Song-menu style Song sorting Tabs + Autoplay song previews Game difficulty Timer mode Highscore style diff --git a/Output/Themes/Changelog/Changelog_ScreenOptionsGame.txt b/Output/Themes/Changelog/Changelog_ScreenOptionsGame.txt index fcc4de50..2aed5985 100644 --- a/Output/Themes/Changelog/Changelog_ScreenOptionsGame.txt +++ b/Output/Themes/Changelog/Changelog_ScreenOptionsGame.txt @@ -1,5 +1,10 @@ ScreenOptionsGame +++++++++++ +Version 4: + +Add: + ++++++++++ Version 3: diff --git a/Output/Themes/Genius/Screens/ScreenOptionsGame.xml b/Output/Themes/Genius/Screens/ScreenOptionsGame.xml index 2619d909..af212eaf 100644 --- a/Output/Themes/Genius/Screens/ScreenOptionsGame.xml +++ b/Output/Themes/Genius/Screens/ScreenOptionsGame.xml @@ -2,7 +2,7 @@ ScreenOptionsGame - 3 + 4 @@ -111,7 +111,7 @@ Outline TR_SCREENOGAME_TABS - + 75 407 0 @@ -123,11 +123,25 @@ Center Outline + TR_SCREENOGAME_AUTOPLAYPREVIEWS + + + 75 + 467 + 0 + 27 + 0 + + + Left + Center + + Outline TR_SCREENOGAME_TIMERMODE 75 - 467 + 527 0 27 0 @@ -425,7 +439,7 @@ Bold 2 - + SelectSlideArrowLeft SelectSlideArrowRight @@ -467,7 +481,7 @@ Bold 3 - + SelectSlideArrowLeft SelectSlideArrowRight @@ -509,6 +523,48 @@ Bold 2 + + + SelectSlideArrowLeft + SelectSlideArrowRight + SelectSlide + SelectSlideArrowLeft + SelectSlideArrowRight + + 500 + 520 + 715 + 50 + 0 + + + 505 + 525 + 40 + 40 + 0 + + + 1170 + 525 + 40 + 40 + 0 + + + + + + + + 27 + 50 + 0 + 200 + Outline + Bold + 2 + diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 8172d7c6..d90c6395 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -171,6 +171,7 @@ namespace Vocaluxe.Base [DefaultValue(ETimerMode.TR_CONFIG_TIMERMODE_REMAINING)] public ETimerMode TimerMode; [XmlAltName("NumPlayer"), DefaultValue(2)] public int NumPlayers; [DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn Tabs; + [DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn AutoplayPreviews; [DefaultValue(ELyricsPosition.TR_CONFIG_LYRICSPOSITION_BOTTOM)] public ELyricsPosition LyricsPosition; [DefaultValue(0.1f)] public float MinLineBreakTime; //Minimum time to show the text before it is (to be) sung (if possible) [XmlArrayItem("Player"), XmlArray] public string[] Players; @@ -521,6 +522,8 @@ namespace Vocaluxe.Base return "NumPlayers: 1.." + CSettings.MaxNumPlayer; case "Tabs": return "Order songs in tabs: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))); + case "AutoplayPreviews": + return "Automatically play song preview when selected: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))); case "LyricsPosition": return "Position if lyrics on screen: " + CHelper.ListStrings(Enum.GetNames(typeof(ELyricsPosition))); case "MinLineBreakTime": diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index f1053ce3..9d33cb37 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -141,6 +141,11 @@ namespace Vocaluxe.Base return CConfig.Config.Game.Tabs; } + public EOffOn GetAutoplayPreviews() + { + return CConfig.Config.Game.AutoplayPreviews; + } + public EOffOn GetIgnoreArticles() { return CConfig.Config.Game.IgnoreArticles; diff --git a/Vocaluxe/Screens/CScreenOptionsGame.cs b/Vocaluxe/Screens/CScreenOptionsGame.cs index 72a7d4e6..669be7ae 100644 --- a/Vocaluxe/Screens/CScreenOptionsGame.cs +++ b/Vocaluxe/Screens/CScreenOptionsGame.cs @@ -27,7 +27,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 3; } + get { return 4; } } private const string _SelectSlideLanguage = "SelectSlideLanguage"; @@ -35,6 +35,7 @@ namespace Vocaluxe.Screens private const string _SelectSlideSongMenu = "SelectSlideSongMenu"; private const string _SelectSlideSongSorting = "SelectSlideSongSorting"; private const string _SelectSlideTabs = "SelectSlideTabs"; + private const string _SelectSlideAutoplayPreviews = "SelectSlideAutoplayPreviews"; private const string _SelectSlideTimerMode = "SelectSlideTimerMode"; private const string _SelectSlideHighscoreStyle = "SelectSlideHighscoreStyle"; @@ -60,6 +61,7 @@ namespace Vocaluxe.Screens _SelectSlides[_SelectSlideSongMenu].SetValues((int)CConfig.SongMenu); _SelectSlides[_SelectSlideSongSorting].SetValues((int)CConfig.Config.Game.SongSorting); _SelectSlides[_SelectSlideTabs].SetValues((int)CConfig.Config.Game.Tabs); + _SelectSlides[_SelectSlideAutoplayPreviews].SetValues((int)CConfig.Config.Game.AutoplayPreviews); _SelectSlides[_SelectSlideTimerMode].SetValues((int)CConfig.Config.Game.TimerMode); _SelectSlides[_SelectSlideHighscoreStyle].SetValues((int)CConfig.Config.Game.HighscoreStyle); } @@ -142,6 +144,7 @@ namespace Vocaluxe.Screens CConfig.SongMenu = (ESongMenu)_SelectSlides[_SelectSlideSongMenu].Selection; CConfig.Config.Game.SongSorting = (ESongSorting)_SelectSlides[_SelectSlideSongSorting].Selection; CConfig.Config.Game.Tabs = (EOffOn)_SelectSlides[_SelectSlideTabs].Selection; + CConfig.Config.Game.AutoplayPreviews = (EOffOn)_SelectSlides[_SelectSlideAutoplayPreviews].Selection; CConfig.Config.Game.TimerMode = (ETimerMode)_SelectSlides[_SelectSlideTimerMode].Selection; CConfig.Config.Game.HighscoreStyle = (EHighscoreStyle)_SelectSlides[_SelectSlideHighscoreStyle].Selection; diff --git a/VocaluxeLib/IBasic.cs b/VocaluxeLib/IBasic.cs index 26cb64bf..6d2706dd 100644 --- a/VocaluxeLib/IBasic.cs +++ b/VocaluxeLib/IBasic.cs @@ -56,6 +56,7 @@ namespace VocaluxeLib IEnumerable GetSongFolders(); ESongSorting GetSongSorting(); EOffOn GetTabs(); + EOffOn GetAutoplayPreviews(); EOffOn GetIgnoreArticles(); bool IsMicConfigured(int playerNr); diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs index 771854e1..207ec31a 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs @@ -364,6 +364,10 @@ namespace VocaluxeLib.Menu.SongMenu if (_SelectionNr > 0 && moveAllowed) { _SelectionNr--; + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PreviewNr = _SelectionNr; + } keyEvent.Handled = true; } break; @@ -372,6 +376,10 @@ namespace VocaluxeLib.Menu.SongMenu if (moveAllowed) { _SelectionNr++; + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PreviewNr = _SelectionNr; + } keyEvent.Handled = true; } break; @@ -388,6 +396,10 @@ namespace VocaluxeLib.Menu.SongMenu else if (_SelectionNr >= 1 && moveAllowed) { _SelectionNr -= 1; + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PreviewNr = _SelectionNr; + } keyEvent.Handled = true; } break; @@ -404,6 +416,10 @@ namespace VocaluxeLib.Menu.SongMenu else if (moveAllowed) { _SelectionNr += 1; + if(CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PreviewNr = _SelectionNr; + } keyEvent.Handled = true; } break; diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs index 4dc50faf..a331e0b1 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs @@ -355,6 +355,10 @@ namespace VocaluxeLib.Menu.SongMenu if (_SelectionNr > 0 && moveAllowed) { _SelectionNr--; + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PreviewNr = _SelectionNr; + } keyEvent.Handled = true; } break; @@ -363,6 +367,10 @@ namespace VocaluxeLib.Menu.SongMenu if (moveAllowed) { _SelectionNr++; + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PreviewNr = _SelectionNr; + } keyEvent.Handled = true; } break; @@ -379,6 +387,10 @@ namespace VocaluxeLib.Menu.SongMenu else if (_SelectionNr >= _NumW && moveAllowed) { _SelectionNr -= _NumW; + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PreviewNr = _SelectionNr; + } keyEvent.Handled = true; } break; @@ -395,6 +407,10 @@ namespace VocaluxeLib.Menu.SongMenu else if (moveAllowed) { _SelectionNr += _NumW; + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PreviewNr = _SelectionNr; + } keyEvent.Handled = true; } break; From ec64a797f55ddddc85ed64a9e41fe9d99a6e9ce9 Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Mon, 6 Nov 2017 19:37:21 +0100 Subject: [PATCH 03/12] Add Swedish translation --- Output/Languages/Swedish.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/Output/Languages/Swedish.xml b/Output/Languages/Swedish.xml index 673f66f1..81bfe9f9 100644 --- a/Output/Languages/Swedish.xml +++ b/Output/Languages/Swedish.xml @@ -183,6 +183,7 @@ Låtmeny Låtsortering Flikar + Förhandsvisa låtar automatiskt Spelets svårighetsgrad Timerläge Topplistsvy From 8d50d9f8d1fcda6e0e99a92d253ee622cfc36fe9 Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Mon, 6 Nov 2017 20:03:27 +0100 Subject: [PATCH 04/12] Clean up code a bit --- VocaluxeLib/Menu/SongMenu/CSongMenuList.cs | 28 ++++++++----------- .../Menu/SongMenu/CSongMenuTileBoard.cs | 28 ++++++++----------- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs index 207ec31a..58de1560 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs @@ -364,10 +364,7 @@ namespace VocaluxeLib.Menu.SongMenu if (_SelectionNr > 0 && moveAllowed) { _SelectionNr--; - if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PreviewNr = _SelectionNr; - } + _AutoplayPreviewIfEnabled(); keyEvent.Handled = true; } break; @@ -376,10 +373,7 @@ namespace VocaluxeLib.Menu.SongMenu if (moveAllowed) { _SelectionNr++; - if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PreviewNr = _SelectionNr; - } + _AutoplayPreviewIfEnabled(); keyEvent.Handled = true; } break; @@ -396,10 +390,7 @@ namespace VocaluxeLib.Menu.SongMenu else if (_SelectionNr >= 1 && moveAllowed) { _SelectionNr -= 1; - if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PreviewNr = _SelectionNr; - } + _AutoplayPreviewIfEnabled(); keyEvent.Handled = true; } break; @@ -416,10 +407,7 @@ namespace VocaluxeLib.Menu.SongMenu else if (moveAllowed) { _SelectionNr += 1; - if(CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PreviewNr = _SelectionNr; - } + _AutoplayPreviewIfEnabled(); keyEvent.Handled = true; } break; @@ -572,6 +560,14 @@ namespace VocaluxeLib.Menu.SongMenu _UpdateListIfRequired(); } + private void _AutoplayPreviewIfEnabled() + { + if(CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PreviewNr = _SelectionNr; + } + } + private void _NextCategory() { if (CBase.Songs.IsInCategory()) diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs index a331e0b1..56795c16 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs @@ -355,10 +355,7 @@ namespace VocaluxeLib.Menu.SongMenu if (_SelectionNr > 0 && moveAllowed) { _SelectionNr--; - if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PreviewNr = _SelectionNr; - } + _AutoplayPreviewIfEnabled(); keyEvent.Handled = true; } break; @@ -367,10 +364,7 @@ namespace VocaluxeLib.Menu.SongMenu if (moveAllowed) { _SelectionNr++; - if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PreviewNr = _SelectionNr; - } + _AutoplayPreviewIfEnabled(); keyEvent.Handled = true; } break; @@ -387,10 +381,7 @@ namespace VocaluxeLib.Menu.SongMenu else if (_SelectionNr >= _NumW && moveAllowed) { _SelectionNr -= _NumW; - if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PreviewNr = _SelectionNr; - } + _AutoplayPreviewIfEnabled(); keyEvent.Handled = true; } break; @@ -407,10 +398,7 @@ namespace VocaluxeLib.Menu.SongMenu else if (moveAllowed) { _SelectionNr += _NumW; - if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PreviewNr = _SelectionNr; - } + _AutoplayPreviewIfEnabled(); keyEvent.Handled = true; } break; @@ -535,6 +523,14 @@ namespace VocaluxeLib.Menu.SongMenu _UpdateListIfRequired(); } + private void _AutoplayPreviewIfEnabled() + { + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PreviewNr = _SelectionNr; + } + } + private void _NextCategory() { if (CBase.Songs.IsInCategory()) From dad5f5ec11e4ca61e96d83c7db52da269100974b Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Tue, 7 Nov 2017 20:19:43 +0100 Subject: [PATCH 05/12] Add a delay before playing preview --- VocaluxeLib/Menu/SongMenu/CSongMenuList.cs | 53 ++++++++++++++----- .../Menu/SongMenu/CSongMenuTileBoard.cs | 53 ++++++++++++++----- 2 files changed, 80 insertions(+), 26 deletions(-) diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs index 58de1560..fc0befc5 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs @@ -64,6 +64,9 @@ namespace VocaluxeLib.Menu.SongMenu private readonly List _SubElements = new List(); + private int _AutoplayDelay = 500; + private System.Timers.Timer _AutoplayTimer = new System.Timers.Timer(); + public override float SelectedTileZoomFactor { get { return 1.2f; } @@ -204,7 +207,7 @@ namespace VocaluxeLib.Menu.SongMenu public override void Update(SScreenSongOptions songOptions) { if (songOptions.Selection.RandomOnly) - _PreviewNr = _SelectionNr; + _PreviewSelectedSong(); if (_Length < 0 && CBase.Songs.IsInCategory() && CBase.BackgroundMusic.GetLength() > 0) _UpdateLength(CBase.Songs.GetVisibleSong(_PreviewNr)); @@ -300,7 +303,7 @@ namespace VocaluxeLib.Menu.SongMenu SetSelectedSong(_SelectionNr < 0 ? 0 : _SelectionNr); else SetSelectedCategory(_SelectionNr < 0 ? 0 : _SelectionNr); - _PreviewNr = _SelectionNr; + _PreviewSelectedSong(); _UpdateListIfRequired(); } @@ -323,7 +326,7 @@ namespace VocaluxeLib.Menu.SongMenu { if (_SelectionNr >= 0 && _PreviewNr != _SelectionNr) { - _PreviewNr = _SelectionNr; + _PreviewSelectedSong(); keyEvent.Handled = true; } } @@ -413,7 +416,7 @@ namespace VocaluxeLib.Menu.SongMenu break; } if (!CBase.Songs.IsInCategory()) - _PreviewNr = _SelectionNr; + _PreviewSelectedSong(); return keyEvent.Handled; } @@ -473,7 +476,7 @@ namespace VocaluxeLib.Menu.SongMenu { if (_PreviewNr == _SelectionNr) return false; - _PreviewNr = _SelectionNr; + _PreviewSelectedSong(); } else EnterSelectedCategory(); @@ -560,14 +563,6 @@ namespace VocaluxeLib.Menu.SongMenu _UpdateListIfRequired(); } - private void _AutoplayPreviewIfEnabled() - { - if(CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PreviewNr = _SelectionNr; - } - } - private void _NextCategory() { if (CBase.Songs.IsInCategory()) @@ -586,6 +581,38 @@ namespace VocaluxeLib.Menu.SongMenu } } + private void _PreviewSelectedSong() + { + _PreviewNr = _SelectionNr; + } + + private void _AutoplayPreviewIfEnabled() + { + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PlayPreviewAfterDelay(_AutoplayDelay); + } + } + + private void _PlayPreviewAfterDelay(double delay) + { + if (!_AutoplayTimer.Enabled) + { + _AutoplayTimer = new System.Timers.Timer(delay); + _AutoplayTimer.AutoReset = false; + _AutoplayTimer.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) => + { + _PreviewSelectedSong(); + }; + _AutoplayTimer.Start(); + } + else + { + _AutoplayTimer.Stop(); + _AutoplayTimer.Start(); + } + } + private void _UpdateListIfRequired() { int curElements = CBase.Songs.IsInCategory() ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories(); diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs index 56795c16..7d7bb0fe 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs @@ -60,6 +60,9 @@ namespace VocaluxeLib.Menu.SongMenu private readonly List _SubElements = new List(); + private int _AutoplayDelay = 500; + private System.Timers.Timer _AutoplayTimer = new System.Timers.Timer(); + public override float SelectedTileZoomFactor { get { return 1.2f; } @@ -195,7 +198,7 @@ namespace VocaluxeLib.Menu.SongMenu public override void Update(SScreenSongOptions songOptions) { if (songOptions.Selection.RandomOnly) - _PreviewNr = _SelectionNr; + _PreviewSelectedSong(); if (_Length < 0 && CBase.Songs.IsInCategory() && CBase.BackgroundMusic.GetLength() > 0) _UpdateLength(CBase.Songs.GetVisibleSong(_PreviewNr)); @@ -291,7 +294,7 @@ namespace VocaluxeLib.Menu.SongMenu SetSelectedSong(_SelectionNr < 0 ? 0 : _SelectionNr); else SetSelectedCategory(_SelectionNr < 0 ? 0 : _SelectionNr); - _PreviewNr = _SelectionNr; + _PreviewSelectedSong(); _UpdateListIfRequired(); } @@ -314,7 +317,7 @@ namespace VocaluxeLib.Menu.SongMenu { if (_SelectionNr >= 0 && _PreviewNr != _SelectionNr) { - _PreviewNr = _SelectionNr; + _PreviewSelectedSong(); keyEvent.Handled = true; } } @@ -404,7 +407,7 @@ namespace VocaluxeLib.Menu.SongMenu break; } if (!CBase.Songs.IsInCategory()) - _PreviewNr = _SelectionNr; + _PreviewSelectedSong(); return keyEvent.Handled; } @@ -460,7 +463,7 @@ namespace VocaluxeLib.Menu.SongMenu { if (_PreviewNr == _SelectionNr) return false; - _PreviewNr = _SelectionNr; + _PreviewSelectedSong(); } else EnterSelectedCategory(); @@ -523,14 +526,6 @@ namespace VocaluxeLib.Menu.SongMenu _UpdateListIfRequired(); } - private void _AutoplayPreviewIfEnabled() - { - if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PreviewNr = _SelectionNr; - } - } - private void _NextCategory() { if (CBase.Songs.IsInCategory()) @@ -549,6 +544,38 @@ namespace VocaluxeLib.Menu.SongMenu } } + private void _PreviewSelectedSong() + { + _PreviewNr = _SelectionNr; + } + + private void _AutoplayPreviewIfEnabled() + { + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PlayPreviewAfterDelay(_AutoplayDelay); + } + } + + private void _PlayPreviewAfterDelay(double delay) + { + if (!_AutoplayTimer.Enabled) + { + _AutoplayTimer = new System.Timers.Timer(delay); + _AutoplayTimer.AutoReset = false; + _AutoplayTimer.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) => + { + _PreviewSelectedSong(); + }; + _AutoplayTimer.Start(); + } + else + { + _AutoplayTimer.Stop(); + _AutoplayTimer.Start(); + } + } + private void _UpdateListIfRequired() { int curElements = CBase.Songs.IsInCategory() ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories(); From 2fbb6002723bfb0db9b0680a53d2316af13e6631 Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Wed, 8 Nov 2017 21:24:11 +0100 Subject: [PATCH 06/12] Code move and delay made configurable Moved code to CSongMenuFramework and made autoplay-delay configurable in config.xml as suggested in code review. --- Vocaluxe/Base/CConfig.cs | 3 ++ Vocaluxe/Base/CMain.cs | 5 +++ VocaluxeLib/IBasic.cs | 1 + .../Menu/SongMenu/CSongMenuFramework.cs | 40 +++++++++++++++++++ VocaluxeLib/Menu/SongMenu/CSongMenuList.cs | 35 ---------------- .../Menu/SongMenu/CSongMenuTileBoard.cs | 35 ---------------- 6 files changed, 49 insertions(+), 70 deletions(-) diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index d90c6395..d80e0024 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -172,6 +172,7 @@ namespace Vocaluxe.Base [XmlAltName("NumPlayer"), DefaultValue(2)] public int NumPlayers; [DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn Tabs; [DefaultValue(EOffOn.TR_CONFIG_OFF)] public EOffOn AutoplayPreviews; + [XmlAltName("AutoplayPreviewDelay"), DefaultValue(500)] public int AutoplayPreviewDelay; [DefaultValue(ELyricsPosition.TR_CONFIG_LYRICSPOSITION_BOTTOM)] public ELyricsPosition LyricsPosition; [DefaultValue(0.1f)] public float MinLineBreakTime; //Minimum time to show the text before it is (to be) sung (if possible) [XmlArrayItem("Player"), XmlArray] public string[] Players; @@ -524,6 +525,8 @@ namespace Vocaluxe.Base return "Order songs in tabs: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))); case "AutoplayPreviews": return "Automatically play song preview when selected: " + CHelper.ListStrings(Enum.GetNames(typeof(EOffOn))); + case "AutoplayPreviewDelay": + return "Delay before playback of autoplay previews is started in milliseconds"; case "LyricsPosition": return "Position if lyrics on screen: " + CHelper.ListStrings(Enum.GetNames(typeof(ELyricsPosition))); case "MinLineBreakTime": diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index 9d33cb37..41f79bb2 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -146,6 +146,11 @@ namespace Vocaluxe.Base return CConfig.Config.Game.AutoplayPreviews; } + public int GetAutoplayPreviewDelay() + { + return CConfig.Config.Game.AutoplayPreviewDelay; + } + public EOffOn GetIgnoreArticles() { return CConfig.Config.Game.IgnoreArticles; diff --git a/VocaluxeLib/IBasic.cs b/VocaluxeLib/IBasic.cs index 6d2706dd..8eb73b2b 100644 --- a/VocaluxeLib/IBasic.cs +++ b/VocaluxeLib/IBasic.cs @@ -57,6 +57,7 @@ namespace VocaluxeLib ESongSorting GetSongSorting(); EOffOn GetTabs(); EOffOn GetAutoplayPreviews(); + int GetAutoplayPreviewDelay(); EOffOn GetIgnoreArticles(); bool IsMicConfigured(int playerNr); diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs index d4328025..ecd41bb8 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs @@ -158,6 +158,9 @@ namespace VocaluxeLib.Menu.SongMenu } } + protected int _AutoplayDelayinMs = CBase.Config.GetAutoplayPreviewDelay(); + protected System.Timers.Timer _AutoplayTimer = new System.Timers.Timer(); + private SColorF _ColorInternal; protected SColorF _Color { @@ -204,6 +207,7 @@ namespace VocaluxeLib.Menu.SongMenu public virtual void Init() { _ResetPreview(false); + _InitializeAutoplayTimer(); _Initialized = true; } @@ -358,6 +362,42 @@ namespace VocaluxeLib.Menu.SongMenu _PreviewNrInternal = -1; } + protected void _PreviewSelectedSong() + { + _PreviewNr = _SelectionNr; + } + + protected void _InitializeAutoplayTimer() + { + _AutoplayTimer.Interval = _AutoplayDelayinMs; + _AutoplayTimer.AutoReset = false; + _AutoplayTimer.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) => + { + _PreviewSelectedSong(); + }; + } + + protected void _AutoplayPreviewIfEnabled() + { + if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) + { + _PlayPreviewAfterDelay(); + } + } + + protected void _PlayPreviewAfterDelay() + { + if (!_AutoplayTimer.Enabled) + { + _AutoplayTimer.Start(); + } + else + { + _AutoplayTimer.Stop(); + _AutoplayTimer.Start(); + } + } + #region ThemeEdit public void MoveElement(int stepX, int stepY) { diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs index fc0befc5..2c85058a 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuList.cs @@ -64,9 +64,6 @@ namespace VocaluxeLib.Menu.SongMenu private readonly List _SubElements = new List(); - private int _AutoplayDelay = 500; - private System.Timers.Timer _AutoplayTimer = new System.Timers.Timer(); - public override float SelectedTileZoomFactor { get { return 1.2f; } @@ -581,38 +578,6 @@ namespace VocaluxeLib.Menu.SongMenu } } - private void _PreviewSelectedSong() - { - _PreviewNr = _SelectionNr; - } - - private void _AutoplayPreviewIfEnabled() - { - if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PlayPreviewAfterDelay(_AutoplayDelay); - } - } - - private void _PlayPreviewAfterDelay(double delay) - { - if (!_AutoplayTimer.Enabled) - { - _AutoplayTimer = new System.Timers.Timer(delay); - _AutoplayTimer.AutoReset = false; - _AutoplayTimer.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) => - { - _PreviewSelectedSong(); - }; - _AutoplayTimer.Start(); - } - else - { - _AutoplayTimer.Stop(); - _AutoplayTimer.Start(); - } - } - private void _UpdateListIfRequired() { int curElements = CBase.Songs.IsInCategory() ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories(); diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs index 7d7bb0fe..18bcad8f 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs @@ -60,9 +60,6 @@ namespace VocaluxeLib.Menu.SongMenu private readonly List _SubElements = new List(); - private int _AutoplayDelay = 500; - private System.Timers.Timer _AutoplayTimer = new System.Timers.Timer(); - public override float SelectedTileZoomFactor { get { return 1.2f; } @@ -544,38 +541,6 @@ namespace VocaluxeLib.Menu.SongMenu } } - private void _PreviewSelectedSong() - { - _PreviewNr = _SelectionNr; - } - - private void _AutoplayPreviewIfEnabled() - { - if (CBase.Config.GetAutoplayPreviews() == EOffOn.TR_CONFIG_ON) - { - _PlayPreviewAfterDelay(_AutoplayDelay); - } - } - - private void _PlayPreviewAfterDelay(double delay) - { - if (!_AutoplayTimer.Enabled) - { - _AutoplayTimer = new System.Timers.Timer(delay); - _AutoplayTimer.AutoReset = false; - _AutoplayTimer.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) => - { - _PreviewSelectedSong(); - }; - _AutoplayTimer.Start(); - } - else - { - _AutoplayTimer.Stop(); - _AutoplayTimer.Start(); - } - } - private void _UpdateListIfRequired() { int curElements = CBase.Songs.IsInCategory() ? CBase.Songs.GetNumSongsVisible() : CBase.Songs.GetNumCategories(); From 42505e3e95548cda3f6a3f831d7521c881f5c49a Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Sat, 11 Nov 2017 14:40:44 +0100 Subject: [PATCH 07/12] Sort Profiles by Player Name Something that resembles natural sorting by player name (for names with numbers up to 9999) of the profiles. --- Vocaluxe/Base/CProfiles.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Base/CProfiles.cs b/Vocaluxe/Base/CProfiles.cs index 1cf1d983..43841704 100644 --- a/Vocaluxe/Base/CProfiles.cs +++ b/Vocaluxe/Base/CProfiles.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.IO; +using System.Text.RegularExpressions; using VocaluxeLib; using VocaluxeLib.Draw; using VocaluxeLib.Profile; @@ -300,7 +301,7 @@ namespace Vocaluxe.Base return new CProfile[0]; var list = new List(_Profiles.Values); - list.Sort(_CompareByPlayerName); + list.Sort(_AlphaNumericCompareByPlayerName); return list.ToArray(); } @@ -646,9 +647,14 @@ namespace Vocaluxe.Base _ProfilesChanged = true; } - private static int _CompareByPlayerName(CProfile a, CProfile b) + private static int _AlphaNumericCompareByPlayerName(CProfile a, CProfile b) { - return String.CompareOrdinal(a.PlayerName, b.PlayerName); + return _PadNumbersInString(a.PlayerName).CompareTo(_PadNumbersInString(b.PlayerName)); + } + + private static string _PadNumbersInString(string text) + { + return Regex.Replace(text, "[0-9]+", match => match.Value.PadLeft(4, '0')); } public static CAvatar GetAvatarByFilename(string fileName) From 24fc44a1fb6cb6690ecf1caab4a157f9b42bf8f1 Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Sat, 11 Nov 2017 15:19:42 +0100 Subject: [PATCH 08/12] Fix Lost Profile Bug in Player Selection Non-guest profiles assigned to player numbers higher than current amount of players were left as already selected and thus couldn't be selected anymore. Now the player numbers that are higher than the totals will be cleared and the assigned profiles put back to the pool of profiles to select from. New profiles will have to be selected if the player amount is increased. --- Vocaluxe/Screens/CScreenNames.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Vocaluxe/Screens/CScreenNames.cs b/Vocaluxe/Screens/CScreenNames.cs index 873d4ad7..3d573d35 100644 --- a/Vocaluxe/Screens/CScreenNames.cs +++ b/Vocaluxe/Screens/CScreenNames.cs @@ -669,6 +669,7 @@ namespace Vocaluxe.Screens _Texts["TextPlayer" + i].Visible = false; _Equalizers["EqualizerPlayer" + i].Visible = false; _SelectSlides["SelectSlideDuetPlayer" + i].Visible = false; + _ResetPlayerSelection(i - 1); } } CConfig.SaveConfig(); From 06d6be528a0c35181edf41b130000bcd0b7e4519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Thu, 16 Nov 2017 12:26:38 +0100 Subject: [PATCH 09/12] Fixed wrong song folder path that leads to not working folder-sorting --- Vocaluxe/Base/CConfig.cs | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 7db2f250..1b7fde8e 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -191,13 +191,14 @@ namespace Vocaluxe.Base public static event OnSongMenuChanged SongMenuChanged; //Folders + //We need full path for folders for matching folder path with textfile path when loading public static readonly List SongFolders = new List { #if INSTALLER Path.Combine(CSettings.DataFolder, CSettings.FolderNameSongs), - CSettings.FolderNameSongs + Path.Combine(CSettings.ProgramFolder, FolderNameSongs) #elif WIN - CSettings.FolderNameSongs + Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameSongs) #elif LINUX Path.Combine(CSettings.DataFolder, CSettings.FolderNameSongs) #endif @@ -335,15 +336,8 @@ namespace Vocaluxe.Base else Config = xml.DeserializeString(""); - if (Config.Game.SongFolder.Length > 0 && Config.Game.SongFolder[0] != "") - { - SongFolders.Clear(); - SongFolders.AddRange(Config.Game.SongFolder); - } - else - { - Config.Game.SongFolder = SongFolders.ToArray(); - } + NormalizeSongPaths(); + if ((Config.Game.ScoreAnimationTime > 0 && Config.Game.ScoreAnimationTime < 1) || Config.Game.ScoreAnimationTime < 0) Config.Game.ScoreAnimationTime = 1; @@ -625,6 +619,29 @@ namespace Vocaluxe.Base return false; } + /// + /// Set song path if none is find in config and check if every path exists + /// + public static void NormalizeSongPaths() + { + //Check if there are configured songfolders + if (Config.Game.SongFolder.Length > 0 && Config.Game.SongFolder[0] != "") + { + SongFolders.Clear(); + + foreach (string folder in Config.Game.SongFolder) + { + //Check if folder exists + if (Directory.Exists(folder)) + SongFolders.Add(folder); + } + } + + //Test if songfolders are still empty or now empty + if(Config.Game.SongFolder.Length == 0) + Config.Game.SongFolder = SongFolders.ToArray(); + } + /// /// Load command-line-parameters and their values to lists. /// From b71437ee83ac3c4babe285cd0ed8bc3f158e8083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 19 Nov 2017 13:39:42 +0100 Subject: [PATCH 10/12] More dynamically statics and texts loading for pause screen --- Vocaluxe/Screens/CScreenSing.cs | 36 +++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index a7508f67..07c8ceb6 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -50,12 +50,12 @@ namespace Vocaluxe.Screens private const string _TextSongName = "TextSongName"; private const string _TextTime = "TextTime"; - private const string _TextPause = "TextPause"; private const string _TextDuetName1 = "TextDuetName1"; private const string _TextDuetName2 = "TextDuetName2"; private const string _TextMedleyCountdown = "TextMedleyCountdown"; private string[,,] _TextScores; private string[,,] _TextNames; + private List _TextsPause; private const string _StaticSongText = "StaticSongText"; private const string _StaticLyrics = "StaticLyrics"; @@ -69,7 +69,7 @@ namespace Vocaluxe.Screens private const string _StaticLyricHelper = "StaticLyricHelper"; private const string _StaticLyricHelperDuet = "StaticLyricHelperDuet"; private const string _StaticLyricHelperTop = "StaticLyricHelperTop"; - private const string _StaticPauseBG = "StaticPauseBG"; + private List _StaticsPause; private string[,,] _StaticScores; private string[,,] _StaticAvatars; @@ -139,7 +139,7 @@ namespace Vocaluxe.Screens { base.Init(); - var texts = new List { _TextSongName, _TextTime, _TextPause, _TextDuetName1, _TextDuetName2, _TextMedleyCountdown }; + var texts = new List { _TextSongName, _TextTime, _TextDuetName1, _TextDuetName2, _TextMedleyCountdown }; _BuildTextStrings(texts); _ThemeTexts = texts.ToArray(); @@ -156,9 +156,8 @@ namespace Vocaluxe.Screens _StaticTimePointer, _StaticLyricHelper, _StaticLyricHelperDuet, - _StaticLyricHelperTop, - _StaticPauseBG - }; + _StaticLyricHelperTop + }; _BuildStaticStrings(ref statics); _ThemeStatics = statics.ToArray(); @@ -181,6 +180,21 @@ namespace Vocaluxe.Screens _TimerDuetText2 = new Stopwatch(); } + public override void LoadTheme(string xmlPath) + { + base.LoadTheme(xmlPath); + + _StaticsPause = new List(); + _TextsPause = new List(); + + //Automatically find statics and texts with pause prefix + foreach (CStatic s in _Statics.Where(s => s.ThemeLoaded && s.GetThemeName().StartsWith("StaticPause"))) + _StaticsPause.Add(s.GetThemeName()); + + foreach (CText t in _Texts.Where(s => s.ThemeLoaded && s.GetThemeName().StartsWith("TextPause"))) + _TextsPause.Add(t.GetThemeName()); + } + public override bool HandleInput(SKeyEvent keyEvent) { base.HandleInput(keyEvent); @@ -826,11 +840,17 @@ namespace Vocaluxe.Screens private void _SetPause(bool paused) { _Pause = paused; - _Statics[_StaticPauseBG].Visible = _Pause; - _Texts[_TextPause].Visible = _Pause; + + foreach(String s in _StaticsPause) + _Statics[s].Visible = _Pause; + + foreach(String s in _TextsPause) + _Texts[s].Visible = _Pause; + _Buttons[_ButtonCancel].Visible = _Pause; _Buttons[_ButtonContinue].Visible = _Pause; _Buttons[_ButtonSkip].Visible = _Pause && CGame.NumRounds > CGame.RoundNr && CGame.NumRounds > 1; + if (_Pause) CSound.Pause(_CurrentStream); else From fd1eff08676d54501f91194f16308f9558a250b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Tue, 21 Nov 2017 09:37:00 +0100 Subject: [PATCH 11/12] Added methods for restarting song/game, for #282 --- Vocaluxe/Screens/CScreenSing.cs | 42 ++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 07c8ceb6..24eb6692 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -240,7 +240,7 @@ namespace Vocaluxe.Screens if (CGame.NumRounds > CGame.RoundNr) { if (keyEvent.ModCtrl) - _LoadNextSong(); + _NextSong(); } break; case Keys.W: @@ -262,7 +262,7 @@ namespace Vocaluxe.Screens _Stop(); if (_Buttons[_ButtonSkip].Selected) { - _LoadNextSong(); + _NextSong(); _SetPause(false); } } @@ -307,7 +307,7 @@ namespace Vocaluxe.Screens if (_Buttons[_ButtonSkip].Selected) { - _LoadNextSong(); + _NextSong(); _SetPause(false); } } @@ -330,7 +330,7 @@ namespace Vocaluxe.Screens finish = true; if (finish && !_FadeOut) - _LoadNextSong(); + _NextSong(); _UpdateSongText(); _UpdateDuetNames(); @@ -463,7 +463,7 @@ namespace Vocaluxe.Screens base.OnShowFinish(); CGame.Start(); - _LoadNextSong(); + _NextSong(); } public override void Draw() @@ -547,12 +547,40 @@ namespace Vocaluxe.Screens _Texts[_TextMedleyCountdown].Text = String.Empty; } - private void _LoadNextSong() + private void _RestartRound() + { + _CloseSong(); + + CGame.ResetPlayer(); + _LoadCurrentSong(); + + _StartSong(); + } + + private void _RestartGame() + { + _CloseSong(); + + CGame.Reset(); + CGame.ResetPlayer(); + CGame.NextRound(); + _LoadCurrentSong(); + + _StartSong(); + } + + private void _NextSong() { _CloseSong(); CGame.NextRound(); + _LoadCurrentSong(); + _StartSong(); + } + + private void _LoadCurrentSong() + { if (CGame.IsFinished()) { _FinishedSinging(); @@ -654,8 +682,6 @@ namespace Vocaluxe.Screens if (!song.IsDuet) _TimerSongText.Start(); - - _StartSong(); } private void _SetNormalLyricsVisibility() From 7dbd2363dbf59d81f2cb5d675d86f1b03961d5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Tue, 21 Nov 2017 09:49:45 +0100 Subject: [PATCH 12/12] Fix: Points were assigned to not sung songs --- Vocaluxe/Screens/CScreenSing.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 2a0fa1b9..4fdc3e76 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -651,7 +651,10 @@ namespace Vocaluxe.Screens { //Need this to set other songs to points-var while (!CGame.IsFinished()) + { CGame.NextRound(); + CGame.ResetPlayer(); + } _FinishedSinging(); }