From 6d619c942071390243d101d02f492ae038152305 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 29 Apr 2024 18:41:58 +1000 Subject: [PATCH] Tippy fixes (#27475) How does that UISystemDependency not crash. --- Content.Client/Tips/TippyUIController.cs | 11 ++++------- Content.Client/Tips/TipsSystem.cs | 20 -------------------- Content.Server/Tips/TipsSystem.cs | 1 - 3 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 Content.Client/Tips/TipsSystem.cs diff --git a/Content.Client/Tips/TippyUIController.cs b/Content.Client/Tips/TippyUIController.cs index ad5a3fbcfb..67c3ee45a7 100644 --- a/Content.Client/Tips/TippyUIController.cs +++ b/Content.Client/Tips/TippyUIController.cs @@ -23,13 +23,9 @@ namespace Content.Client.Tips; public sealed class TippyUIController : UIController { - [Dependency] private readonly IStateManager _state = default!; - [Dependency] private readonly IConsoleHost _conHost = default!; - [Dependency] private readonly IPrototypeManager _protoMan = default!; [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IResourceCache _resCache = default!; [UISystemDependency] private readonly AudioSystem _audio = default!; - [UISystemDependency] private readonly EntityManager _entSys = default!; public const float Padding = 50; public static Angle WaddleRotation = Angle.FromDegrees(10); @@ -44,11 +40,12 @@ public sealed class TippyUIController : UIController { base.Initialize(); UIManager.OnScreenChanged += OnScreenChanged; + SubscribeNetworkEvent(OnTippyEvent); } - public void AddMessage(TippyEvent ev) + private void OnTippyEvent(TippyEvent msg, EntitySessionEventArgs args) { - _queuedMessages.Enqueue(ev); + _queuedMessages.Enqueue(msg); } public override void FrameUpdate(FrameEventArgs args) @@ -146,7 +143,7 @@ public sealed class TippyUIController : UIController return; if (!EntityManager.HasComponent(_entity)) { - var paper = EntityManager.AddComponent(_entity); + var paper = EntityManager.AddComponent(_entity); paper.BackgroundImagePath = "/Textures/Interface/Paper/paper_background_default.svg.96dpi.png"; paper.BackgroundPatchMargin = new(16f, 16f, 16f, 16f); paper.BackgroundModulate = new(255, 255, 204); diff --git a/Content.Client/Tips/TipsSystem.cs b/Content.Client/Tips/TipsSystem.cs deleted file mode 100644 index f9376a7005..0000000000 --- a/Content.Client/Tips/TipsSystem.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Content.Shared.Tips; -using Robust.Client.UserInterface; - -namespace Content.Client.Tips; - -public sealed class TipsSystem : EntitySystem -{ - [Dependency] private readonly IUserInterfaceManager _uiMan = default!; - public override void Initialize() - { - base.Initialize(); - - SubscribeNetworkEvent(OnClippyEv); - } - - private void OnClippyEv(TippyEvent ev) - { - _uiMan.GetUIController().AddMessage(ev); - } -} diff --git a/Content.Server/Tips/TipsSystem.cs b/Content.Server/Tips/TipsSystem.cs index ccc732623b..168f11de8f 100644 --- a/Content.Server/Tips/TipsSystem.cs +++ b/Content.Server/Tips/TipsSystem.cs @@ -115,7 +115,6 @@ public sealed class TipsSystem : EntitySystem var ev = new TippyEvent(args[1]); - string proto; if (args.Length > 2) { ev.Proto = args[2]; -- 2.52.0