added drawing team names, fixed joker handling
This commit is contained in:
1 parent
b92169ff33
commit
2dfbecdb20
8 files changed
+168
-7
No files matched your search
@@ -97,10 +97,11 @@ namespace Vocaluxe.PartyModes
|
||||
_ScreenSongOptions.Selection.PartyMode = true;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
|
||||
|
||||
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
||||
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
||||
|
||||
|
||||
_Stage = EStage.NotStarted;
|
||||
|
||||
ToScreenConfig = new DataToScreenConfig();
|
||||
@@ -118,6 +119,11 @@ namespace Vocaluxe.PartyModes
|
||||
public override bool Init()
|
||||
{
|
||||
_Stage = EStage.NotStarted;
|
||||
|
||||
_ScreenSongOptions.Sorting.IgnoreArticles = _Base.Config.GetIgnoreArticles();
|
||||
_ScreenSongOptions.Sorting.SongSorting = ESongSorting.TR_CONFIG_FOLDER;
|
||||
_ScreenSongOptions.Sorting.Tabs = EOffOn.TR_CONFIG_ON;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -187,6 +193,14 @@ namespace Vocaluxe.PartyModes
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateGame()
|
||||
{
|
||||
if (_Base.Songs.GetCurrentCategoryIndex() != -1)
|
||||
_ScreenSongOptions.Selection.RandomOnly = true;
|
||||
else
|
||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||
}
|
||||
|
||||
public override CMenuParty GetNextPartyScreen(out EScreens AlternativeScreen)
|
||||
{
|
||||
CMenuParty Screen = null;
|
||||
@@ -283,9 +297,27 @@ namespace Vocaluxe.PartyModes
|
||||
return MaxNumRounds;
|
||||
}
|
||||
|
||||
public override void JokerUsed(int TeamNr)
|
||||
{
|
||||
if (_ScreenSongOptions.Selection.NumJokers == null)
|
||||
return;
|
||||
|
||||
if (TeamNr >= _ScreenSongOptions.Selection.NumJokers.Length)
|
||||
return;
|
||||
|
||||
_ScreenSongOptions.Selection.NumJokers[TeamNr]--;
|
||||
_ScreenSongOptions.Selection.RandomOnly = true;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void StartNextRound()
|
||||
{
|
||||
|
||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
||||
SetNumJokers();
|
||||
SetTeamNames();
|
||||
_Base.Graphics.FadeTo(EScreens.ScreenSong);
|
||||
}
|
||||
|
||||
@@ -321,5 +353,32 @@ namespace Vocaluxe.PartyModes
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetTeamNames()
|
||||
{
|
||||
SProfile[] profiles = _Base.Profiles.GetProfiles();
|
||||
|
||||
if (profiles == null)
|
||||
{
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
|
||||
return;
|
||||
}
|
||||
|
||||
if (GameData.NumPlayerAtOnce < 1 || GameData.NumPlayerAtOnce > 6 || GameData.ProfileIDs.Count < GameData.NumPlayerAtOnce || profiles.Length < GameData.NumPlayerAtOnce)
|
||||
{
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
|
||||
return;
|
||||
}
|
||||
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[GameData.NumPlayerAtOnce];
|
||||
|
||||
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||
{
|
||||
if (GameData.ProfileIDs[i] < profiles.Length)
|
||||
_ScreenSongOptions.Selection.TeamNames[i] = profiles[GameData.ProfileIDs[i]].PlayerName;
|
||||
else
|
||||
_ScreenSongOptions.Selection.TeamNames[i] = "foobar";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,10 +97,11 @@ namespace Vocaluxe.PartyModes
|
||||
_ScreenSongOptions.Selection.PartyMode = true;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
||||
_ScreenSongOptions.Selection.NumJokers = new int[] { 5, 5 };
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
|
||||
|
||||
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
||||
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
||||
|
||||
|
||||
_Stage = EStage.NotStarted;
|
||||
|
||||
ToScreenConfig = new DataToScreenConfig();
|
||||
@@ -118,6 +119,11 @@ namespace Vocaluxe.PartyModes
|
||||
public override bool Init()
|
||||
{
|
||||
_Stage = EStage.NotStarted;
|
||||
|
||||
_ScreenSongOptions.Sorting.IgnoreArticles = _Base.Config.GetIgnoreArticles();
|
||||
_ScreenSongOptions.Sorting.SongSorting = ESongSorting.TR_CONFIG_FOLDER;
|
||||
_ScreenSongOptions.Sorting.Tabs = EOffOn.TR_CONFIG_ON;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -187,6 +193,14 @@ namespace Vocaluxe.PartyModes
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateGame()
|
||||
{
|
||||
if (_Base.Songs.GetCurrentCategoryIndex() != -1)
|
||||
_ScreenSongOptions.Selection.RandomOnly = true;
|
||||
else
|
||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||
}
|
||||
|
||||
public override CMenuParty GetNextPartyScreen(out EScreens AlternativeScreen)
|
||||
{
|
||||
CMenuParty Screen = null;
|
||||
@@ -283,9 +297,27 @@ namespace Vocaluxe.PartyModes
|
||||
return MaxNumRounds;
|
||||
}
|
||||
|
||||
public override void JokerUsed(int TeamNr)
|
||||
{
|
||||
if (_ScreenSongOptions.Selection.NumJokers == null)
|
||||
return;
|
||||
|
||||
if (TeamNr >= _ScreenSongOptions.Selection.NumJokers.Length)
|
||||
return;
|
||||
|
||||
_ScreenSongOptions.Selection.NumJokers[TeamNr]--;
|
||||
_ScreenSongOptions.Selection.RandomOnly = true;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void StartNextRound()
|
||||
{
|
||||
|
||||
_ScreenSongOptions.Selection.RandomOnly = false;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
||||
SetNumJokers();
|
||||
SetTeamNames();
|
||||
_Base.Graphics.FadeTo(EScreens.ScreenSong);
|
||||
}
|
||||
|
||||
@@ -321,5 +353,32 @@ namespace Vocaluxe.PartyModes
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetTeamNames()
|
||||
{
|
||||
SProfile[] profiles = _Base.Profiles.GetProfiles();
|
||||
|
||||
if (profiles == null)
|
||||
{
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
|
||||
return;
|
||||
}
|
||||
|
||||
if (GameData.NumPlayerAtOnce < 1 || GameData.NumPlayerAtOnce > 6 || GameData.ProfileIDs.Count < GameData.NumPlayerAtOnce || profiles.Length < GameData.NumPlayerAtOnce)
|
||||
{
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
|
||||
return;
|
||||
}
|
||||
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[GameData.NumPlayerAtOnce];
|
||||
|
||||
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
|
||||
{
|
||||
if (GameData.ProfileIDs[i] < profiles.Length)
|
||||
_ScreenSongOptions.Selection.TeamNames[i] = profiles[GameData.ProfileIDs[i]].PlayerName;
|
||||
else
|
||||
_ScreenSongOptions.Selection.TeamNames[i] = "foobar";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -336,6 +336,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
_Run &= HandleInputs(Keys, Mouse);
|
||||
_Run &= Update();
|
||||
CParty.UpdateGame();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -142,6 +142,11 @@ namespace Vocaluxe.Base
|
||||
#endregion public stuff
|
||||
|
||||
#region Interface
|
||||
public static void UpdateGame()
|
||||
{
|
||||
_CurrentPartyMode.PartyMode.UpdateGame();
|
||||
}
|
||||
|
||||
public static EScreens GetStartScreen()
|
||||
{
|
||||
return _CurrentPartyMode.PartyMode.GetStartScreen();
|
||||
|
||||
@@ -647,6 +647,17 @@ namespace Vocaluxe.Screens
|
||||
|
||||
public override bool UpdateGame()
|
||||
{
|
||||
_sso = CParty.GetSongSelectionOptions();
|
||||
CSongs.Sort(_sso.Sorting.SongSorting, _sso.Sorting.Tabs, _sso.Sorting.IgnoreArticles, _sso.Sorting.SearchString);
|
||||
_SearchActive = _sso.Sorting.SearchStringVisible;
|
||||
_SearchText = _sso.Sorting.SearchString;
|
||||
|
||||
if (_sso.Selection.PartyMode)
|
||||
_PlaylistActive = false;
|
||||
|
||||
if (_sso.Selection.PartyMode)
|
||||
ToggleSongOptions(ESongOptionsView.None);
|
||||
|
||||
SongMenus[htSongMenus(SongMenu)].Update();
|
||||
|
||||
if (SongMenus[htSongMenus(SongMenu)].IsSmallView())
|
||||
@@ -698,8 +709,19 @@ namespace Vocaluxe.Screens
|
||||
Buttons[htButtons(ButtonsJoker[i])].Visible = true;
|
||||
Buttons[htButtons(ButtonsJoker[i])].Text.Text = _sso.Selection.NumJokers[i].ToString();
|
||||
Texts[htTexts(TextsPlayer[i])].Visible = true;
|
||||
//TODO: Set text to player-name.
|
||||
Texts[htTexts(TextsPlayer[i])].Text = i.ToString();
|
||||
|
||||
bool NameExists = false;
|
||||
if (_sso.Selection.TeamNames != null)
|
||||
{
|
||||
if (_sso.Selection.TeamNames.Length > i)
|
||||
{
|
||||
Texts[htTexts(TextsPlayer[i])].Text = _sso.Selection.TeamNames[i];
|
||||
NameExists = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!NameExists)
|
||||
Texts[htTexts(TextsPlayer[i])].Text = i.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -887,7 +909,10 @@ namespace Vocaluxe.Screens
|
||||
return result;
|
||||
}
|
||||
|
||||
return SelectNextRandomSong(TeamNr) || SelectNextRandomCategory();
|
||||
if (TeamNr == -1)
|
||||
return SelectNextRandomSong(TeamNr) || SelectNextRandomCategory();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool SelectNextRandomSong(int TeamNr)
|
||||
|
||||
@@ -42,6 +42,10 @@ namespace Vocaluxe.PartyModes
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void UpdateGame()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual CMenuParty GetNextPartyScreen(out EScreens AlternativeScreen)
|
||||
{
|
||||
AlternativeScreen = EScreens.ScreenMain;
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace Vocaluxe.PartyModes
|
||||
_ScreenSongOptions.Selection.PartyMode = false;
|
||||
_ScreenSongOptions.Selection.CategoryChangeAllowed = true;
|
||||
_ScreenSongOptions.Selection.NumJokers = null;
|
||||
_ScreenSongOptions.Selection.TeamNames = null;
|
||||
|
||||
_ScreenSongOptions.Sorting.SearchString = String.Empty;
|
||||
_ScreenSongOptions.Sorting.SearchStringVisible = false;
|
||||
|
||||
@@ -46,6 +46,11 @@ namespace Vocaluxe.PartyModes
|
||||
/// The number of jokers left for each team
|
||||
/// </summary>
|
||||
public int[] NumJokers;
|
||||
|
||||
/// <summary>
|
||||
/// The Team Name of the teams (:>)
|
||||
/// </summary>
|
||||
public string[] TeamNames;
|
||||
}
|
||||
#endregion Structs
|
||||
|
||||
@@ -56,6 +61,8 @@ namespace Vocaluxe.PartyModes
|
||||
void AddScreen(CMenuParty Screen, string ScreenName);
|
||||
void DataFromScreen(string ScreenName, Object Data);
|
||||
|
||||
void UpdateGame();
|
||||
|
||||
CMenuParty GetNextPartyScreen(out EScreens AlternativeScreen);
|
||||
EScreens GetStartScreen();
|
||||
EScreens GetMainScreen();
|
||||
|
||||
Reference in new issue
Block a user