reworked logic.

This commit is contained in:
Harrison Deng 2019-01-22 19:33:42 -06:00
parent 7d14d8cc64
commit 5e1554edf0
4 changed files with 33 additions and 30 deletions

View File

@ -10,7 +10,7 @@
#-------------------------------- References --------------------------------# #-------------------------------- References --------------------------------#
/reference:..\..\References\RecrownedAthenaeum.Pipeline\RecrownedAthenaeum.Pipeline.dll /reference:..\..\References\RecrownedAthenaeum.Pipeline.dll
#---------------------------------- Content ---------------------------------# #---------------------------------- Content ---------------------------------#

View File

@ -2,7 +2,7 @@
"regions": [ "regions": [
{ {
"name": "Rounded9pButton-disabled", "name": "Rounded9pButton-disabled",
"location": { "bounds": {
"X": 0, "X": 0,
"Y": 0, "Y": 0,
"Width": 64, "Width": 64,
@ -12,13 +12,13 @@
"textureName": "Rounded9pButton-disabled.png", "textureName": "Rounded9pButton-disabled.png",
"left": 25, "left": 25,
"right": 25, "right": 25,
"down": 25, "bottom": 0,
"top": 25 "top": 25
} }
}, },
{ {
"name": "Rounded9pButton-down", "name": "Rounded9pButton-down",
"location": { "bounds": {
"X": 0, "X": 0,
"Y": 64, "Y": 64,
"Width": 64, "Width": 64,
@ -28,13 +28,13 @@
"textureName": "Rounded9pButton-down.png", "textureName": "Rounded9pButton-down.png",
"left": 25, "left": 25,
"right": 25, "right": 25,
"down": 25, "bottom": 0,
"top": 25 "top": 25
} }
}, },
{ {
"name": "Rounded9pButton", "name": "Rounded9pButton",
"location": { "bounds": {
"X": 64, "X": 64,
"Y": 0, "Y": 0,
"Width": 64, "Width": 64,
@ -44,7 +44,7 @@
"textureName": "Rounded9pButton.png", "textureName": "Rounded9pButton.png",
"left": 25, "left": 25,
"right": 25, "right": 25,
"down": 25, "bottom": 0,
"top": 25 "top": 25
} }
} }

View File

@ -57,14 +57,14 @@
<Compile Include="Audio\SupportedFormats.cs" /> <Compile Include="Audio\SupportedFormats.cs" />
<Compile Include="Audio\TransparentSampleProvider.cs" /> <Compile Include="Audio\TransparentSampleProvider.cs" />
<Compile Include="Audio\Visualizer\ReflectedHorizontalVisualizer.cs" /> <Compile Include="Audio\Visualizer\ReflectedHorizontalVisualizer.cs" />
<Compile Include="ContentResolvers\FontContentResolver.cs" />
<Compile Include="ContentResolvers\ResolutionContentResolver.cs" />
<Compile Include="Screens\MainMenu\MainPage.cs" /> <Compile Include="Screens\MainMenu\MainPage.cs" />
<Compile Include="Screens\Transitions\FadeAwayTransition.cs" /> <Compile Include="Screens\Transitions\FadeAwayTransition.cs" />
<Compile Include="Screens\MainMenu\MainScreen.cs" /> <Compile Include="Screens\MainMenu\MainScreen.cs" />
<Compile Include="RhythmBulletGame.cs" /> <Compile Include="RhythmBulletGame.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ContentResolvers\FontContentResolver.cs" />
<Compile Include="ContentResolvers\ResolutionContentResolver.cs" />
<Compile Include="Preferences\Controls.cs" /> <Compile Include="Preferences\Controls.cs" />
<Compile Include="Preferences\General.cs" /> <Compile Include="Preferences\General.cs" />
</ItemGroup> </ItemGroup>
@ -80,7 +80,7 @@
</Reference> </Reference>
<Reference Include="RecrownedAthenaeum, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="RecrownedAthenaeum, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\References\RecrownedAthenaeum\RecrownedAthenaeum.dll</HintPath> <HintPath>..\References\RecrownedAthenaeum.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />

View File

@ -1,21 +1,22 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using RecrownedAthenaeum.Audio;
using RecrownedAthenaeum.ContentResolvers;
using RecrownedAthenaeum.Preferences;
using RecrownedAthenaeum.Screens.MainMenu;
using RecrownedAthenaeum.Camera; using RecrownedAthenaeum.Camera;
using RecrownedAthenaeum.ContentSystem; using RecrownedAthenaeum.ContentSystem;
using RecrownedAthenaeum.SpecialTypes; using RecrownedAthenaeum.ContentSystem.ContentResolvers;
using RecrownedAthenaeum.Input; using RecrownedAthenaeum.Input;
using RecrownedAthenaeum.Persistence; using RecrownedAthenaeum.Persistence;
using RecrownedAthenaeum.ScreenSystem; using RecrownedAthenaeum.ScreenSystem;
using RecrownedAthenaeum.SpecialTypes;
using RecrownedAthenaeum.UI.Skin;
using RhythmBullet.Audio;
using RhythmBullet.Preferences;
using RhythmBullet.Screens.MainMenu;
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using RecrownedAthenaeum.UI.Skin; using System.IO;
namespace RecrownedAthenaeum namespace RhythmBullet
{ {
/// <summary> /// <summary>
/// This is the main type for your game. /// This is the main type for your game.
@ -61,6 +62,7 @@ namespace RecrownedAthenaeum
Resolution resolution = preferencesManager.GetPreferences<General>().Resolution; Resolution resolution = preferencesManager.GetPreferences<General>().Resolution;
graphics.PreferredBackBufferWidth = resolution.Width; graphics.PreferredBackBufferWidth = resolution.Width;
graphics.PreferredBackBufferHeight = resolution.Height; graphics.PreferredBackBufferHeight = resolution.Height;
RecrownedAthenaeum.Configuration.graphicsDeviceManager = graphics;
} }
/// <summary> /// <summary>
@ -89,7 +91,7 @@ namespace RecrownedAthenaeum
// Create a new SpriteBatch, which can be used to draw textures. // Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice); spriteBatch = new SpriteBatch(GraphicsDevice);
Camera = new Camera2D(graphics.GraphicsDevice); Camera = new Camera2D(graphics.GraphicsDevice);
screenManager = new ScreenManager(graphics, Camera); screenManager = new ScreenManager(Camera);
screenManager.ShowFirstScreenEvent += ShowFirstScreen; screenManager.ShowFirstScreenEvent += ShowFirstScreen;
QueueContent(); QueueContent();
screenManager.Screen = new LoadingScreen(this, Content.Load<Texture2D>("RhythmBullet"), 0.7f); screenManager.Screen = new LoadingScreen(this, Content.Load<Texture2D>("RhythmBullet"), 0.7f);
@ -113,21 +115,21 @@ namespace RecrownedAthenaeum
/// <param name="gameTime">Provides a snapshot of timing values.</param> /// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime) protected override void Update(GameTime gameTime)
{ {
if (!assets.Done) if (assets.Done)
{
if (resizing)
{ {
assets.Update(); assets.Update();
} }
else if (resizing) else if (!initialLoadComplete && CheckReadyForInitiate())
{ {
resizing = false;
PostResize();
}
else if (!initialLoadComplete)
{
Debug.WriteLine("Initial load complete.");
Initiate(); Initiate();
} }
}
else
{
assets.Update();
}
screenManager.UpdateCurrentScreen(gameTime, CheckReadyForInitiate()); screenManager.UpdateCurrentScreen(gameTime, CheckReadyForInitiate());
InputUtilities.Update(); InputUtilities.Update();
@ -201,6 +203,7 @@ namespace RecrownedAthenaeum
private bool CheckReadyForInitiate() private bool CheckReadyForInitiate()
{ {
Debug.WriteLine(skinManager.ReadyForUse);
return assets.Done && musicController.musicList.Searched && skinManager.ReadyForUse; return assets.Done && musicController.musicList.Searched && skinManager.ReadyForUse;
} }