added handling for song selection and fade to sing screen

This commit is contained in:
Alexander Eckart committed 2012-12-17 21:34:23 +01:00
1 parent 9069553330
commit fea7b42fba
7 files changed
+59 -12

No files matched your search

+30 -1
View File
@@ -314,6 +314,35 @@ namespace Vocaluxe.PartyModes
}
public override void SongSelected(int SongID)
{
EGameMode gm = EGameMode.TR_GAMEMODE_NORMAL;
_Base.Game.Reset();
_Base.Game.ClearSongs();
_Base.Game.AddSong(SongID, gm);
_Base.Game.SetNumPlayer(GameData.NumPlayerAtOnce);
SPlayer[] player = _Base.Game.GetPlayer();
if (player == null)
return;
if (player.Length < GameData.NumPlayerAtOnce)
return;
//TODO: set the right data
SProfile[] profiles = _Base.Profiles.GetProfiles();
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
{
player[i].Name = _ScreenSongOptions.Selection.TeamNames[i];
player[i].Difficulty = profiles[GameData.ProfileIDs[i]].Difficulty;
player[i].ProfileID = GameData.ProfileIDs[i];
}
_Base.Graphics.FadeTo(EScreens.ScreenSing);
}
private void StartNextRound()
{
_ScreenSongOptions.Selection.RandomOnly = false;
@@ -371,7 +400,7 @@ namespace Vocaluxe.PartyModes
_ScreenSongOptions.Selection.TeamNames = new string[] { "foo", "bar" };
return;
}
//TODO: set the right data
_ScreenSongOptions.Selection.TeamNames = new string[GameData.NumPlayerAtOnce];
for (int i = 0; i < GameData.NumPlayerAtOnce; i++)
+5
View File
@@ -473,6 +473,11 @@ namespace Vocaluxe.Base
return CGame.NumPlayer;
}
public void SetNumPlayer(int NumPlayer)
{
CGame.NumPlayer = NumPlayer;
}
public SPlayer[] GetPlayer()
{
return CGame.Player;
+5
View File
@@ -171,6 +171,11 @@ namespace Vocaluxe.Base
{
_CurrentPartyMode.PartyMode.JokerUsed(TeamNr);
}
public static void SongSelected(int SongID)
{
_CurrentPartyMode.PartyMode.SongSelected(SongID);
}
#endregion Interface
#region private stuff
+13 -11
View File
@@ -212,15 +212,12 @@ namespace Vocaluxe.Screens
HandlePartySongSelection(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
}
}
if (CSongs.NumVisibleSongs > 0)
if (CSongs.NumVisibleSongs > 0 && !_sso.Selection.PartyMode)
{
if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive)
{
if (!_sso.Selection.PartyMode)
ToggleSongOptions(ESongOptionsView.Song);
else
//Is this still needed?
HandlePartySongSelection(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
}
}
break;
@@ -552,7 +549,7 @@ namespace Vocaluxe.Screens
if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null)
{
if (Buttons[htButtons(ButtonOptionsOpenPlaylist)].Selected)
if (Buttons[htButtons(ButtonStart)].Selected)
{
HandlePartySongSelection(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
return true;
@@ -571,16 +568,14 @@ namespace Vocaluxe.Screens
}
}
}
if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1)
if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1 && !_sso.Selection.PartyMode)
{
if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive)
{
if (!_sso.Selection.PartyMode)
ToggleSongOptions(ESongOptionsView.Song);
else
//Is this still needed?
HandlePartySongSelection(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
return true;
}
else
@@ -771,7 +766,14 @@ namespace Vocaluxe.Screens
private void HandlePartySongSelection(int SongNr)
{
CGraphics.FadeTo(EScreens.ScreenPartyDummy);
if ((CSongs.Category >= 0) && (SongNr >= 0))
{
CSong song = CSongs.VisibleSongs[SongNr];
if (song != null)
{
CParty.SongSelected(song.ID);
}
}
}
private void StartSong(int SongNr)
+1
View File
@@ -196,6 +196,7 @@ namespace Vocaluxe.Menu
public interface IGame
{
int GetNumPlayer();
void SetNumPlayer(int NumPlayer);
SPlayer[] GetPlayer();
float GetMidBeatD();
int GetCurrentBeatD();
+4
View File
@@ -107,6 +107,10 @@ namespace Vocaluxe.PartyModes
if (_ScreenSongOptions.Selection.NumJokers[TeamNr] > 0)
_ScreenSongOptions.Selection.NumJokers[TeamNr]--;
}
public virtual void SongSelected(int SongID)
{
}
#endregion Implementation
}
}
+1
View File
@@ -77,5 +77,6 @@ namespace Vocaluxe.PartyModes
void SetSearchString(string SearchString, bool Visible);
void JokerUsed(int TeamNr);
void SongSelected(int SongID);
}
}