Projekt přejmenován. Neko nastaven na výchozí pozici
This commit is contained in:
parent
1a27dd6fab
commit
ceac37920b
104 changed files with 873 additions and 208 deletions
69
ONDClient/GameMain.cs
Normal file
69
ONDClient/GameMain.cs
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using MonoGameLibrary;
|
||||
using MonoGameLibrary.Graphics;
|
||||
using MonoGameLibrary.Input;
|
||||
using ONDClient.GUI;
|
||||
|
||||
namespace ONDClient;
|
||||
|
||||
public class GameMain() : Core("fnafkooo", 1280, 720, false) {
|
||||
// private GraphicsDeviceManager _graphics;
|
||||
// private SpriteBatch _spriteBatch;
|
||||
|
||||
|
||||
protected override void Initialize() {
|
||||
Exiting += (_, _) => {
|
||||
Client.Disconnect();
|
||||
};
|
||||
|
||||
// Client.Connect("127.0.0.1", 9012);
|
||||
CommandManager.InitInputListeners();
|
||||
|
||||
// InputManager.AddListener(InputManager.MouseButton.LEFT, (() => Console.WriteLine("LMB pressed at: " + InputManager.MouseState.Position)), InputTiming.PRESS, new InputListenerHook(true));
|
||||
|
||||
base.Initialize();
|
||||
|
||||
Client.Init();
|
||||
UIManager.InitUI();
|
||||
UIManager.DisplayMainMenu();
|
||||
}
|
||||
|
||||
protected override void LoadContent() {
|
||||
UIManager.LoadAssets();
|
||||
SoundManager.LoadSounds();
|
||||
// spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||
// font = Content.Load<SpriteFont>("font");
|
||||
}
|
||||
|
||||
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);
|
||||
// Screen.CurrentScreen.Draw(spriteBatch);
|
||||
// spriteBatch.DrawString(font, "Elapsed time: " + gameTime.TotalGameTime.Milliseconds, new Vector2(10, 10), Color.White);
|
||||
|
||||
spriteBatch.End();
|
||||
base.Draw(gameTime);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue