added hiding of hidden songs for party mode (not finished and not tested)

This commit is contained in:
Alexander Eckart committed 2012-12-20 19:17:36 +01:00
1 parent 487ba660a1
commit e62f18ada6
5 files changed
+66 -7

No files matched your search

+3 -3
View File
@@ -283,6 +283,7 @@ namespace Vocaluxe.PartyModes
_Screens.TryGetValue("PartyScreenChallengeMain", out Screen); _Screens.TryGetValue("PartyScreenChallengeMain", out Screen);
if (_Screens != null) if (_Screens != null)
{ {
_Base.Songs.ResetPartySongSung();
GameData.Rounds = new ChallengeRounds(GameData.NumRounds, GameData.NumPlayer, GameData.NumPlayerAtOnce); GameData.Rounds = new ChallengeRounds(GameData.NumRounds, GameData.NumPlayer, GameData.NumPlayerAtOnce);
GameData.CurrentRoundNr = 1; GameData.CurrentRoundNr = 1;
ToScreenMain.CurrentRoundNr = 1; ToScreenMain.CurrentRoundNr = 1;
@@ -372,13 +373,11 @@ namespace Vocaluxe.PartyModes
if (TeamNr >= _ScreenSongOptions.Selection.NumJokers.Length) if (TeamNr >= _ScreenSongOptions.Selection.NumJokers.Length)
return; return;
if (_ScreenSongOptions.Selection.RandomOnly) if (!_ScreenSongOptions.Selection.CategoryChangeAllowed)
_ScreenSongOptions.Selection.NumJokers[TeamNr]--; _ScreenSongOptions.Selection.NumJokers[TeamNr]--;
_ScreenSongOptions.Selection.RandomOnly = true; _ScreenSongOptions.Selection.RandomOnly = true;
_ScreenSongOptions.Selection.CategoryChangeAllowed = false; _ScreenSongOptions.Selection.CategoryChangeAllowed = false;
} }
public override void SongSelected(int SongID) public override void SongSelected(int SongID)
@@ -420,6 +419,7 @@ namespace Vocaluxe.PartyModes
} }
} }
_Base.Songs.AddPartySongSung(SongID);
_Base.Graphics.FadeTo(EScreens.ScreenSing); _Base.Graphics.FadeTo(EScreens.ScreenSing);
} }
+15
View File
@@ -612,6 +612,21 @@ namespace Vocaluxe.Base
return new CCategory(CSongs.Categories[Index]); 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() public void NextCategory()
{ {
CSongs.NextCategory(); CSongs.NextCategory();
+43 -3
View File
@@ -21,6 +21,7 @@ namespace Vocaluxe.Base
public int CatIndex; public int CatIndex;
public bool Visible; public bool Visible;
public bool PartyHidden;
public SongPointer(int ID, string sortString) public SongPointer(int ID, string sortString)
{ {
@@ -28,6 +29,7 @@ namespace Vocaluxe.Base
SortString = sortString; SortString = sortString;
CatIndex = -1; CatIndex = -1;
Visible = false; Visible = false;
PartyHidden = false;
} }
} }
@@ -131,7 +133,7 @@ namespace Vocaluxe.Base
for (int i = 0; i < _SongsSortList.Length; i++) 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; int num = 0;
for (int i = 0; i < _SongsSortList.Length; i++) for (int i = 0; i < _SongsSortList.Length; i++)
{ {
if (_SongsSortList[i].CatIndex == CatIndex) if (_SongsSortList[i].CatIndex == CatIndex && !_SongsSortList[i].PartyHidden)
num++; num++;
} }
return num; return num;
@@ -219,7 +221,7 @@ namespace Vocaluxe.Base
_CoverLoaded = true; _CoverLoaded = true;
} }
public static string GetActualCategoryName() public static string GetCurrentCategoryName()
{ {
if ((_Categories.Count > 0) && (_CatIndex >= 0) && (_Categories.Count > _CatIndex)) if ((_Categories.Count > 0) && (_CatIndex >= 0) && (_Categories.Count > _CatIndex))
return _Categories[_CatIndex].Name; return _Categories[_CatIndex].Name;
@@ -237,6 +239,44 @@ namespace Vocaluxe.Base
return null; 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) public static int GetVisibleSongNumber(int SongID)
{ {
int i = -1; int i = -1;
+1 -1
View File
@@ -659,7 +659,7 @@ namespace Vocaluxe.Screens
if (SongMenus[htSongMenus(SongMenu)].IsSmallView()) if (SongMenus[htSongMenus(SongMenu)].IsSmallView())
CheckPlaylist(); CheckPlaylist();
Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); Texts[htTexts(TextCategory)].Text = CSongs.GetCurrentCategoryName();
if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) if (CSongs.Category > -1 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF)
CBackgroundMusic.Disabled = true; CBackgroundMusic.Disabled = true;
+4
View File
@@ -239,6 +239,10 @@ namespace Vocaluxe.Menu
CSong GetSongByID(int SongID); CSong GetSongByID(int SongID);
CCategory GetCategory(int Index); CCategory GetCategory(int Index);
void AddPartySongSung(int SongID);
void ResetPartySongSung();
void ResetPartySongSung(int CatIndex);
void NextCategory(); void NextCategory();
void PrevCategory(); void PrevCategory();
} }