Hlavní menu, synchronizace jmen hráčů. Client hru spustí až ve chvíli kdy dostane správný packet. Oprava bugu v se scalováním UIElementu

This commit is contained in:
Perry 2026-03-11 22:35:30 +01:00
parent e6128dc9f5
commit 7656707177
19 changed files with 315 additions and 53 deletions

View file

@ -14,18 +14,21 @@ public class GameMain() : Core("fnafkooo", 1280, 720, false) {
// private GraphicsDeviceManager _graphics;
// private SpriteBatch _spriteBatch;
protected override void Initialize() {
Client.Connect("127.0.0.1", 9012);
// 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();
// UIManager.InitUI();
UIManager.InitUI();
UIManager.DisplayMainMenu();
}
protected override void LoadContent() {
UIManager.LoadAssets();
// spriteBatch = new SpriteBatch(GraphicsDevice);
// font = Content.Load<SpriteFont>("font");
}
@ -40,6 +43,8 @@ public class GameMain() : Core("fnafkooo", 1280, 720, false) {
InputManager.NextInputCycle();
Screen.UpdateAll();
if(Client.State == Client.ConnectionState.IDLE) return;
Client.Update();
base.Update(gameTime);
}