From f2e9b212979bff0874c6d0223475b30f6c3e096f Mon Sep 17 00:00:00 2001 From: Luciano Ciccariello Date: Sat, 23 May 2020 13:59:32 +0100 Subject: [PATCH] Fix a bug where the New Game animation could be constantly triggered --- OpenKh.Game/States/TitleState.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/OpenKh.Game/States/TitleState.cs b/OpenKh.Game/States/TitleState.cs index 785b79562..a5f19d843 100644 --- a/OpenKh.Game/States/TitleState.cs +++ b/OpenKh.Game/States/TitleState.cs @@ -1,4 +1,4 @@ -using OpenKh.Engine; +using OpenKh.Engine; using OpenKh.Engine.Renderers; using OpenKh.Game.Debugging; using OpenKh.Game.Infrastructure; @@ -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; @@ -177,7 +179,7 @@ public void Initialize(StateInitDesc initDesc) public void Destroy() { - throw new System.NotImplementedException(); + throw new NotImplementedException(); } public void Update(DeltaTimes deltaTimes) @@ -211,6 +213,10 @@ public void Update(DeltaTimes deltaTimes) { if (_inputManager.IsCross || _inputManager.IsCircle) SkipIntro(); + } + else if (IsNewGameStarting) + { + } else { @@ -225,7 +231,7 @@ public void Draw(DeltaTimes deltaTimes) { layoutRendererBg.Draw(); - if (!IsIntro) + if (!(IsIntro || IsNewGameStarting)) layoutRendererFg.Draw(); if (_isInTheaterMenu)