screen manager now only triggers event when screen is actually required.
This commit is contained in:
parent
d8bb78252d
commit
fffc883327
@ -23,7 +23,7 @@ namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
|||||||
public MainScreen(ContentSystem assets) : base(true)
|
public MainScreen(ContentSystem assets) : base(true)
|
||||||
{
|
{
|
||||||
background = assets.Get<Texture2D>("backgrounds/mainBG");
|
background = assets.Get<Texture2D>("backgrounds/mainBG");
|
||||||
fat = new FadeAwayTransition(3f);
|
fat = new FadeAwayTransition(1.5f);
|
||||||
book = new Book(Camera);
|
book = new Book(Camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,8 +35,8 @@ namespace RhythmBullet.Zer01HD.Game.Screens.MainMenu
|
|||||||
|
|
||||||
public override void Draw(SpriteBatch spriteBatch)
|
public override void Draw(SpriteBatch spriteBatch)
|
||||||
{
|
{
|
||||||
book.Draw(spriteBatch);
|
|
||||||
spriteBatch.Draw(background, ScreenSize, Color.White);
|
spriteBatch.Draw(background, ScreenSize, Color.White);
|
||||||
|
book.Draw(spriteBatch);
|
||||||
base.Draw(spriteBatch);
|
base.Draw(spriteBatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,8 +66,11 @@ namespace RhythmBullet.Zer01HD.Utilities.ScreenSystem
|
|||||||
break;
|
break;
|
||||||
case ScreenState.ExitTransition:
|
case ScreenState.ExitTransition:
|
||||||
if (Screen.UseRenderTargetForExitTransition || Screen.UpdateTransition(gameTime.ElapsedGameTime.TotalSeconds, assetsDone))
|
if (Screen.UseRenderTargetForExitTransition || Screen.UpdateTransition(gameTime.ElapsedGameTime.TotalSeconds, assetsDone))
|
||||||
|
{
|
||||||
|
if (Screen.NextScreen == null)
|
||||||
{
|
{
|
||||||
OnRequireNextScreen(Screen);
|
OnRequireNextScreen(Screen);
|
||||||
|
}
|
||||||
if (Screen.NextScreen != null)
|
if (Screen.NextScreen != null)
|
||||||
{
|
{
|
||||||
Debug.WriteLine("Changing to the next given screen.");
|
Debug.WriteLine("Changing to the next given screen.");
|
||||||
@ -77,7 +80,8 @@ namespace RhythmBullet.Zer01HD.Utilities.ScreenSystem
|
|||||||
{
|
{
|
||||||
Debug.WriteLine("Changing to previous screen.");
|
Debug.WriteLine("Changing to previous screen.");
|
||||||
Screen = previousScreen;
|
Screen = previousScreen;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("No next screen provided and no previous screen to return to.");
|
throw new InvalidOperationException("No next screen provided and no previous screen to return to.");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user