using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using MonoGameLibrary; using MonoGameLibrary.Input; using ONDClient.GUI; using ONDClient.Net; using ONDClient.Sound; namespace ONDClient; public class GameMain(int width, int height) : Core("OND", width, height, false) { protected override void Initialize() { Exiting += (_, _) => { Client.Disconnect(); }; CommandManager.InitInputListeners(); base.Initialize(); Client.Init(); UIManager.InitUI(); UIManager.DisplayMainMenu(); } protected override void LoadContent() { UIManager.LoadAssets(); SoundManager.LoadSounds(); } protected override void Update(GameTime gameTime) { if (Keyboard.GetState().IsKeyDown(Keys.Escape)){ Exit(); } InputManager.NextInputCycle(); Screen.UpdateAll(); if(Client.State == Client.ConnectionState.IDLE) return; Client.Update(); base.Update(gameTime); } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(samplerState:SamplerState.PointClamp); Screen.DrawCurrentAndOverlay(spriteBatch); spriteBatch.End(); base.Draw(gameTime); } }