1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 12:58:33 +01:00

added DoUpdate to MlemGame

This commit is contained in:
Ellpeck 2019-12-05 17:35:24 +01:00
parent 0c74dfc38e
commit f86944ee9a
3 changed files with 10 additions and 8 deletions

View file

@ -79,8 +79,8 @@ namespace Demos {
base.DoDraw(gameTime);
}
protected override void Update(GameTime gameTime) {
base.Update(gameTime);
protected override void DoUpdate(GameTime gameTime) {
base.DoUpdate(gameTime);
if (this.activeDemo != null)
this.activeDemo.Update(gameTime);
}

View file

@ -40,12 +40,10 @@ namespace MLEM.Startup {
this.OnLoadContent?.Invoke(this);
}
protected override void Update(GameTime gameTime) {
base.Update(gameTime);
protected sealed override void Update(GameTime gameTime) {
this.InputHandler.Update();
this.DoUpdate(gameTime);
this.UiSystem.Update(gameTime);
this.OnUpdate?.Invoke(this, gameTime);
CoroutineHandler.Tick(gameTime.GetElapsedSeconds());
CoroutineHandler.RaiseEvent(CoroutineEvents.Update);
@ -63,6 +61,10 @@ namespace MLEM.Startup {
base.Draw(gameTime);
}
protected virtual void DoUpdate(GameTime gameTime) {
base.Update(gameTime);
}
public static T LoadContent<T>(string name) {
return instance.Content.Load<T>(name);
}

View file

@ -59,8 +59,8 @@ namespace Sandbox {
this.UiSystem.Add("Panel", panel);*/
}
protected override void Update(GameTime gameTime) {
base.Update(gameTime);
protected override void DoUpdate(GameTime gameTime) {
base.DoUpdate(gameTime);
if (this.InputHandler.IsKeyPressed(Keys.F11))
this.GraphicsDeviceManager.SetFullscreen(!this.GraphicsDeviceManager.IsFullScreen);