Added methods for restarting song/game, for #282

This commit is contained in:
Florian Küpper committed 2017-11-21 09:37:00 +01:00
1 parent d568e1b01f
commit fd1eff0867
1 file changed
+34 -8
+34 -8
View File
@@ -240,7 +240,7 @@ namespace Vocaluxe.Screens
if (CGame.NumRounds > CGame.RoundNr) if (CGame.NumRounds > CGame.RoundNr)
{ {
if (keyEvent.ModCtrl) if (keyEvent.ModCtrl)
_LoadNextSong(); _NextSong();
} }
break; break;
case Keys.W: case Keys.W:
@@ -262,7 +262,7 @@ namespace Vocaluxe.Screens
_Stop(); _Stop();
if (_Buttons[_ButtonSkip].Selected) if (_Buttons[_ButtonSkip].Selected)
{ {
_LoadNextSong(); _NextSong();
_SetPause(false); _SetPause(false);
} }
} }
@@ -307,7 +307,7 @@ namespace Vocaluxe.Screens
if (_Buttons[_ButtonSkip].Selected) if (_Buttons[_ButtonSkip].Selected)
{ {
_LoadNextSong(); _NextSong();
_SetPause(false); _SetPause(false);
} }
} }
@@ -330,7 +330,7 @@ namespace Vocaluxe.Screens
finish = true; finish = true;
if (finish && !_FadeOut) if (finish && !_FadeOut)
_LoadNextSong(); _NextSong();
_UpdateSongText(); _UpdateSongText();
_UpdateDuetNames(); _UpdateDuetNames();
@@ -463,7 +463,7 @@ namespace Vocaluxe.Screens
base.OnShowFinish(); base.OnShowFinish();
CGame.Start(); CGame.Start();
_LoadNextSong(); _NextSong();
} }
public override void Draw() public override void Draw()
@@ -547,12 +547,40 @@ namespace Vocaluxe.Screens
_Texts[_TextMedleyCountdown].Text = String.Empty; _Texts[_TextMedleyCountdown].Text = String.Empty;
} }
private void _LoadNextSong() private void _RestartRound()
{
_CloseSong();
CGame.ResetPlayer();
_LoadCurrentSong();
_StartSong();
}
private void _RestartGame()
{
_CloseSong();
CGame.Reset();
CGame.ResetPlayer();
CGame.NextRound();
_LoadCurrentSong();
_StartSong();
}
private void _NextSong()
{ {
_CloseSong(); _CloseSong();
CGame.NextRound(); CGame.NextRound();
_LoadCurrentSong();
_StartSong();
}
private void _LoadCurrentSong()
{
if (CGame.IsFinished()) if (CGame.IsFinished())
{ {
_FinishedSinging(); _FinishedSinging();
@@ -654,8 +682,6 @@ namespace Vocaluxe.Screens
if (!song.IsDuet) if (!song.IsDuet)
_TimerSongText.Start(); _TimerSongText.Start();
_StartSong();
} }
private void _SetNormalLyricsVisibility() private void _SetNormalLyricsVisibility()