Added possibility to open highscores from song screen
If opened from song screen, you can use the Arrow Left/Right keys to switch between the game modes Normal, Short, Medley and Duet.
This commit is contained in:
1 parent
4c1eaa407e
commit
72d279e525
1 file changed
+52
-14
@@ -49,6 +49,7 @@ namespace Vocaluxe.Screens
|
|||||||
private int _Round;
|
private int _Round;
|
||||||
private int _Pos;
|
private int _Pos;
|
||||||
private bool _IsDuet;
|
private bool _IsDuet;
|
||||||
|
private bool _FromScreenSong = false;
|
||||||
|
|
||||||
public override EMusicType CurrentMusicType
|
public override EMusicType CurrentMusicType
|
||||||
{
|
{
|
||||||
@@ -113,11 +114,13 @@ namespace Vocaluxe.Screens
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Down:
|
case Keys.Down:
|
||||||
_ChangePos(1);
|
if (!_FromScreenSong)
|
||||||
|
_ChangePos(1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Up:
|
case Keys.Up:
|
||||||
_ChangePos(-1);
|
if (!_FromScreenSong)
|
||||||
|
_ChangePos(-1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Keys.Left:
|
case Keys.Left:
|
||||||
@@ -234,13 +237,31 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
_Pos = 0;
|
_Pos = 0;
|
||||||
int rounds = CGame.NumRounds;
|
int rounds = CGame.NumRounds;
|
||||||
_Scores = new List<SDBScoreEntry>[rounds];
|
|
||||||
for (int round = 0; round < rounds; round++)
|
if (rounds == 0)
|
||||||
{
|
{
|
||||||
int songID = CGame.GetSong(round).ID;
|
_FromScreenSong = true;
|
||||||
EGameMode gameMode = CGame.GetGameMode(round);
|
_Round = (int)EGameMode.TR_GAMEMODE_NORMAL;
|
||||||
|
_Scores = new List<SDBScoreEntry>[4];
|
||||||
|
int songID = CSongs.VisibleSongs[CScreenSong.getSelectedSongID()].ID;
|
||||||
EHighscoreStyle style = CBase.Config.GetHighscoreStyle();
|
EHighscoreStyle style = CBase.Config.GetHighscoreStyle();
|
||||||
_Scores[round] = CDataBase.LoadScore(songID, gameMode, style);
|
|
||||||
|
for (int gameModeNum = 0; gameModeNum < 4; gameModeNum++)
|
||||||
|
{
|
||||||
|
_Scores[gameModeNum] = CDataBase.LoadScore(songID, (EGameMode)gameModeNum, style);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_FromScreenSong = false;
|
||||||
|
_Scores = new List<SDBScoreEntry>[rounds];
|
||||||
|
for (int round = 0; round < rounds; round++)
|
||||||
|
{
|
||||||
|
int songID = CGame.GetSong(round).ID;
|
||||||
|
EGameMode gameMode = CGame.GetGameMode(round);
|
||||||
|
EHighscoreStyle style = CBase.Config.GetHighscoreStyle();
|
||||||
|
_Scores[round] = CDataBase.LoadScore(songID, gameMode, style);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,15 +269,21 @@ namespace Vocaluxe.Screens
|
|||||||
{
|
{
|
||||||
_IsDuet = false;
|
_IsDuet = false;
|
||||||
CPoints points = CGame.GetPoints();
|
CPoints points = CGame.GetPoints();
|
||||||
CSong song = CGame.GetSong(_Round);
|
|
||||||
|
CSong song;
|
||||||
|
if (_FromScreenSong)
|
||||||
|
song = CSongs.GetSong(CSongs.VisibleSongs[CScreenSong.getSelectedSongID()].ID);
|
||||||
|
else
|
||||||
|
song = CGame.GetSong(_Round);
|
||||||
|
|
||||||
if (song == null)
|
if (song == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_Texts[_TextSongName].Text = song.Artist + " - " + song.Title;
|
_Texts[_TextSongName].Text = song.Artist + " - " + song.Title;
|
||||||
if (points.NumRounds > 1)
|
if (points != null && points.NumRounds > 1)
|
||||||
_Texts[_TextSongName].Text += " (" + (_Round + 1) + "/" + points.NumRounds + ")";
|
_Texts[_TextSongName].Text += " (" + (_Round + 1) + "/" + points.NumRounds + ")";
|
||||||
|
|
||||||
switch (CGame.GetGameMode(_Round))
|
switch ((_FromScreenSong ? (EGameMode)_Round : CGame.GetGameMode(_Round)))
|
||||||
{
|
{
|
||||||
case EGameMode.TR_GAMEMODE_NORMAL:
|
case EGameMode.TR_GAMEMODE_NORMAL:
|
||||||
_Texts[_TextSongMode].Text = "TR_GAMEMODE_NORMAL";
|
_Texts[_TextSongMode].Text = "TR_GAMEMODE_NORMAL";
|
||||||
@@ -296,9 +323,20 @@ namespace Vocaluxe.Screens
|
|||||||
|
|
||||||
private void _ChangeRound(int num)
|
private void _ChangeRound(int num)
|
||||||
{
|
{
|
||||||
CPoints points = CGame.GetPoints();
|
if (_FromScreenSong)
|
||||||
_Round += num;
|
{
|
||||||
_Round = _Round.Clamp(0, points.NumRounds - 1);
|
if (_Round == (int)EGameMode.TR_GAMEMODE_SHORTSONG)
|
||||||
|
_Round = (int)EGameMode.TR_GAMEMODE_NORMAL;
|
||||||
|
else
|
||||||
|
++_Round;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CPoints points = CGame.GetPoints();
|
||||||
|
_Round += num;
|
||||||
|
_Round = _Round.Clamp(0, points.NumRounds - 1);
|
||||||
|
}
|
||||||
|
|
||||||
_UpdateRound();
|
_UpdateRound();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,4 +345,4 @@ namespace Vocaluxe.Screens
|
|||||||
CParty.LeavingHighscore();
|
CParty.LeavingHighscore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user