diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 97a8d9f..31415dd 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -141,6 +141,19 @@ public sealed class GameWindow : IDisposable private AcDream.Core.Vfx.ParticleSystem? _particleSystem; private AcDream.Core.Vfx.ParticleHookSink? _particleSink; + // Phase F.1-H.1 — client-side state classes fed by GameEventWiring. + // Exposed publicly so plugins + UI panels can bind directly. + public readonly AcDream.Core.Chat.ChatLog Chat = new(); + public readonly AcDream.Core.Combat.CombatState Combat = new(); + public readonly AcDream.Core.Spells.Spellbook SpellBook = new(); + public readonly AcDream.Core.Items.ItemRepository Items = new(); + + // Phase G.1-G.2 world lighting/time state. + public readonly AcDream.Core.World.WorldTimeService WorldTime = + new AcDream.Core.World.WorldTimeService( + AcDream.Core.World.SkyStateProvider.Default()); + public readonly AcDream.Core.Lighting.LightManager Lighting = new(); + // Phase B.2: player movement mode. private AcDream.App.Input.PlayerMovementController? _playerController; private AcDream.App.Rendering.ChaseCamera? _chaseCamera; @@ -710,6 +723,23 @@ public sealed class GameWindow : IDisposable _liveSession.MotionUpdated += OnLiveMotionUpdated; _liveSession.PositionUpdated += OnLivePositionUpdated; _liveSession.TeleportStarted += OnTeleportStarted; + + // Phase F.1-H.1: wire every parsed GameEvent into the right + // Core state class (chat, combat, spellbook, items). After + // this one call, server-sent ChannelBroadcast / damage + // notifications / spell learns / wield events all update + // the corresponding client-side state without further glue. + AcDream.Core.Net.GameEventWiring.WireAll( + _liveSession.GameEvents, Items, Combat, SpellBook, Chat); + + // Phase H.1: feed inbound HearSpeech into the chat log. + _liveSession.SpeechHeard += speech => + Chat.OnLocalSpeech( + sender: speech.SenderName, + text: speech.Text, + senderGuid: speech.SenderGuid, + isRanged: speech.IsRanged); + _liveSession.Connect(user, pass); if (_liveSession.Characters is null || _liveSession.Characters.Characters.Count == 0)