Use IsGameModeAvail for duet check
This commit is contained in:
1 parent
b12e4156fa
commit
6de23ea428
7 files changed
+19
-22
No files matched your search
@@ -90,11 +90,6 @@ namespace Vocaluxe.Base
|
||||
get { return _CurrentPlaylistElement.SongID; }
|
||||
}
|
||||
|
||||
public static bool Duet
|
||||
{
|
||||
get { return _CurrentPlaylistElement.Duet; }
|
||||
}
|
||||
|
||||
public static bool SongHasVideo
|
||||
{
|
||||
get { return File.Exists(_CurrentPlaylistElement.VideoFilePath); }
|
||||
@@ -581,17 +576,6 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
}
|
||||
|
||||
public bool Duet
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Song != null)
|
||||
return _Song.IsDuet;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public CPlaylistElement(CSong song)
|
||||
{
|
||||
MusicFilePath = string.Empty;
|
||||
|
||||
@@ -532,6 +532,11 @@ namespace Vocaluxe.Base
|
||||
return CGame.GetTimeFromBeats(beat, bpm);
|
||||
}
|
||||
|
||||
public float GetBeatFromTime(float time, float bpm, float gap)
|
||||
{
|
||||
return CGame.GetBeatFromTime(time, bpm, gap);
|
||||
}
|
||||
|
||||
public void AddSong(int songID, EGameMode gameMode)
|
||||
{
|
||||
CGame.AddSong(songID, gameMode);
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Vocaluxe.GameModes
|
||||
{
|
||||
protected override CSong _PrepareSong(CSong song)
|
||||
{
|
||||
return song;
|
||||
return (song.IsGameModeAvailable(EGameMode.TR_GAMEMODE_NORMAL)) ? song : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Vocaluxe.GameModes
|
||||
{
|
||||
protected override CSong _PrepareSong(CSong song)
|
||||
{
|
||||
return (song.IsDuet) ? song : null;
|
||||
return (song.IsGameModeAvailable(EGameMode.TR_GAMEMODE_DUET)) ? song : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,8 @@ namespace Vocaluxe.GameModes
|
||||
{
|
||||
protected override CSong _PrepareSong(CSong song)
|
||||
{
|
||||
if (!song.IsGameModeAvailable(EGameMode.TR_GAMEMODE_SHORTSONG))
|
||||
return null;
|
||||
var newSong = new CSong(song) {Finish = CGame.GetTimeFromBeats(song.ShortEnd.EndBeat, song.BPM) + CSettings.DefaultMedleyFadeOutTime + song.Gap};
|
||||
// set lines to short mode
|
||||
newSong.Notes.SetMedley(0, song.ShortEnd.EndBeat);
|
||||
@@ -80,6 +82,8 @@ namespace Vocaluxe.GameModes
|
||||
{
|
||||
protected override CSong _PrepareSong(CSong song)
|
||||
{
|
||||
if (!song.IsGameModeAvailable(EGameMode.TR_GAMEMODE_MEDLEY))
|
||||
return null;
|
||||
var newSong = new CSong(song) {Start = CGame.GetTimeFromBeats(song.Medley.StartBeat, song.BPM) - song.Medley.FadeInTime + song.Gap};
|
||||
if (newSong.Start < 0f)
|
||||
newSong.Start = 0f;
|
||||
|
||||
@@ -180,7 +180,11 @@ namespace Vocaluxe.Lib.Playlist
|
||||
|
||||
public void AddSong(int songID)
|
||||
{
|
||||
var song = new CPlaylistSong {SongID = songID, GameMode = CSongs.GetSong(songID).IsDuet ? EGameMode.TR_GAMEMODE_DUET : EGameMode.TR_GAMEMODE_NORMAL};
|
||||
var song = new CPlaylistSong
|
||||
{
|
||||
SongID = songID,
|
||||
GameMode = CSongs.GetSong(songID).IsGameModeAvailable(EGameMode.TR_GAMEMODE_DUET) ? EGameMode.TR_GAMEMODE_DUET : EGameMode.TR_GAMEMODE_NORMAL
|
||||
};
|
||||
|
||||
Songs.Add(song);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ namespace Vocaluxe.Screens
|
||||
CGame.ClearSongs();
|
||||
|
||||
var gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
if (CSongs.AllSongs[songNr].IsDuet)
|
||||
if (CSongs.AllSongs[songNr].IsGameModeAvailable(EGameMode.TR_GAMEMODE_DUET))
|
||||
gm = EGameMode.TR_GAMEMODE_DUET;
|
||||
|
||||
CGame.AddSong(songNr, gm);
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Vocaluxe.SongQueue
|
||||
|
||||
private bool _AddSong(int songID, EGameMode gameMode)
|
||||
{
|
||||
if (gameMode == EGameMode.TR_GAMEMODE_DUET && !CSongs.GetSong(songID).IsDuet)
|
||||
if (CSongs.GetSong(songID).IsGameModeAvailable(gameMode))
|
||||
return false;
|
||||
|
||||
_SongQueue.Add(new SSongQueueEntry(songID, gameMode));
|
||||
|
||||
@@ -971,11 +971,11 @@ namespace VocaluxeLib.Menu
|
||||
|
||||
if (!mouseEvent.LBH && DragAndDropSongID != -1)
|
||||
{
|
||||
var gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
CSong song = CBase.Songs.GetSongByID(DragAndDropSongID);
|
||||
|
||||
if (song != null)
|
||||
{
|
||||
var gm = EGameMode.TR_GAMEMODE_NORMAL;
|
||||
if (song.IsDuet)
|
||||
gm = EGameMode.TR_GAMEMODE_DUET;
|
||||
|
||||
|
||||
Reference in new issue
Block a user