Skip to content

Commit

Permalink
Fix a bug where the New Game animation could be constantly triggered
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeeynamo committed May 23, 2020
1 parent 3f17797 commit f2e9b21
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions OpenKh.Game/States/TitleState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OpenKh.Engine;
using OpenKh.Engine;
using OpenKh.Engine.Renderers;
using OpenKh.Game.Debugging;
using OpenKh.Game.Infrastructure;
Expand Down Expand Up @@ -127,11 +127,13 @@ private bool IsIntro
{
var currentSequence = layoutRendererBg.SelectedSequenceGroupIndex;
return currentSequence == _titleLayout.Copyright ||
currentSequence == _titleLayout.Intro ||
currentSequence == _titleLayout.NewGame;
currentSequence == _titleLayout.Intro;
}
}

private bool IsNewGameStarting =>
layoutRendererBg.SelectedSequenceGroupIndex == _titleLayout.NewGame;

public void Initialize(StateInitDesc initDesc)
{
_kernel = initDesc.Kernel;
Expand Down Expand Up @@ -177,7 +179,7 @@ public void Initialize(StateInitDesc initDesc)

public void Destroy()
{
throw new System.NotImplementedException();
throw new NotImplementedException();
}

public void Update(DeltaTimes deltaTimes)
Expand Down Expand Up @@ -211,6 +213,10 @@ public void Update(DeltaTimes deltaTimes)
{
if (_inputManager.IsCross || _inputManager.IsCircle)
SkipIntro();
}
else if (IsNewGameStarting)
{

}
else
{
Expand All @@ -225,7 +231,7 @@ public void Draw(DeltaTimes deltaTimes)
{
layoutRendererBg.Draw();

if (!IsIntro)
if (!(IsIntro || IsNewGameStarting))
layoutRendererFg.Draw();

if (_isInTheaterMenu)
Expand Down

0 comments on commit f2e9b21

Please sign in to comment.