diff --git a/PartyModeChallenge/PartyModeChallenge.cs b/PartyModeChallenge/PartyModeChallenge.cs index e38fb9f9..bda02000 100644 --- a/PartyModeChallenge/PartyModeChallenge.cs +++ b/PartyModeChallenge/PartyModeChallenge.cs @@ -283,6 +283,7 @@ namespace Vocaluxe.PartyModes _Screens.TryGetValue("PartyScreenChallengeMain", out Screen); if (_Screens != null) { + _Base.Songs.ResetPartySongSung(); GameData.Rounds = new ChallengeRounds(GameData.NumRounds, GameData.NumPlayer, GameData.NumPlayerAtOnce); GameData.CurrentRoundNr = 1; ToScreenMain.CurrentRoundNr = 1; @@ -372,13 +373,11 @@ namespace Vocaluxe.PartyModes if (TeamNr >= _ScreenSongOptions.Selection.NumJokers.Length) return; - if (_ScreenSongOptions.Selection.RandomOnly) + if (!_ScreenSongOptions.Selection.CategoryChangeAllowed) _ScreenSongOptions.Selection.NumJokers[TeamNr]--; _ScreenSongOptions.Selection.RandomOnly = true; _ScreenSongOptions.Selection.CategoryChangeAllowed = false; - - } public override void SongSelected(int SongID) @@ -420,6 +419,7 @@ namespace Vocaluxe.PartyModes } } + _Base.Songs.AddPartySongSung(SongID); _Base.Graphics.FadeTo(EScreens.ScreenSing); } diff --git a/Vocaluxe/Base/CMain.cs b/Vocaluxe/Base/CMain.cs index 430c66e3..e4bcb757 100644 --- a/Vocaluxe/Base/CMain.cs +++ b/Vocaluxe/Base/CMain.cs @@ -612,6 +612,21 @@ namespace Vocaluxe.Base return new CCategory(CSongs.Categories[Index]); } + public void AddPartySongSung(int SongID) + { + CSongs.AddPartySongSung(SongID); + } + + public void ResetPartySongSung() + { + CSongs.ResetPartySongSung(); + } + + public void ResetPartySongSung(int CatIndex) + { + CSongs.ResetPartySongSung(CatIndex); + } + public void NextCategory() { CSongs.NextCategory(); diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs index c4f84cd4..a4b1a3b4 100644 --- a/Vocaluxe/Base/CSongs.cs +++ b/Vocaluxe/Base/CSongs.cs @@ -21,6 +21,7 @@ namespace Vocaluxe.Base public int CatIndex; public bool Visible; + public bool PartyHidden; public SongPointer(int ID, string sortString) { @@ -28,6 +29,7 @@ namespace Vocaluxe.Base SortString = sortString; CatIndex = -1; Visible = false; + PartyHidden = false; } } @@ -131,7 +133,7 @@ namespace Vocaluxe.Base for (int i = 0; i < _SongsSortList.Length; i++) { - _SongsSortList[i].Visible = (_SongsSortList[i].CatIndex == _CatIndex); + _SongsSortList[i].Visible = (_SongsSortList[i].CatIndex == _CatIndex && !_SongsSortList[i].PartyHidden); } } } @@ -150,7 +152,7 @@ namespace Vocaluxe.Base int num = 0; for (int i = 0; i < _SongsSortList.Length; i++) { - if (_SongsSortList[i].CatIndex == CatIndex) + if (_SongsSortList[i].CatIndex == CatIndex && !_SongsSortList[i].PartyHidden) num++; } return num; @@ -219,7 +221,7 @@ namespace Vocaluxe.Base _CoverLoaded = true; } - public static string GetActualCategoryName() + public static string GetCurrentCategoryName() { if ((_Categories.Count > 0) && (_CatIndex >= 0) && (_Categories.Count > _CatIndex)) return _Categories[_CatIndex].Name; @@ -237,6 +239,44 @@ namespace Vocaluxe.Base return null; } + public static void AddPartySongSung(int SongID) + { + int cat = -1; + for (int i = 0; i < _SongsSortList.Length; i++) + { + if (SongID == _SongsSortList[i].SongID) + { + _SongsSortList[i].PartyHidden = true; + _SongsSortList[i].Visible = false; + cat = _SongsSortList[i].CatIndex; + break; + } + } + + if (cat != -1) + { + if (NumSongsInCategory(cat) == 0) + ResetPartySongSung(cat); + } + } + + public static void ResetPartySongSung() + { + for (int i = 0; i < _SongsSortList.Length; i++) + { + _SongsSortList[i].PartyHidden = false; + } + } + + public static void ResetPartySongSung(int CatIndex) + { + for (int i = 0; i < _SongsSortList.Length; i++) + { + if (_SongsSortList[i].CatIndex == CatIndex) + _SongsSortList[i].PartyHidden = false; + } + } + public static int GetVisibleSongNumber(int SongID) { int i = -1; diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 43c21b97..2f18a470 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -659,7 +659,7 @@ namespace Vocaluxe.Screens if (SongMenus[htSongMenus(SongMenu)].IsSmallView()) CheckPlaylist(); - Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); + Texts[htTexts(TextCategory)].Text = CSongs.GetCurrentCategoryName(); if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) CBackgroundMusic.Disabled = true; diff --git a/VocaluxeLib/Menu/IMenu.cs b/VocaluxeLib/Menu/IMenu.cs index 19156cf6..f8499d5e 100644 --- a/VocaluxeLib/Menu/IMenu.cs +++ b/VocaluxeLib/Menu/IMenu.cs @@ -239,6 +239,10 @@ namespace Vocaluxe.Menu CSong GetSongByID(int SongID); CCategory GetCategory(int Index); + void AddPartySongSung(int SongID); + void ResetPartySongSung(); + void ResetPartySongSung(int CatIndex); + void NextCategory(); void PrevCategory(); }