]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Tippy fixes (#27475)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Mon, 29 Apr 2024 08:41:58 +0000 (18:41 +1000)
committerGitHub <noreply@github.com>
Mon, 29 Apr 2024 08:41:58 +0000 (18:41 +1000)
How does that UISystemDependency not crash.

Content.Client/Tips/TippyUIController.cs
Content.Client/Tips/TipsSystem.cs [deleted file]
Content.Server/Tips/TipsSystem.cs

index ad5a3fbcfb49e33ff4ec0f25acf0dad137548aa4..67c3ee45a7edb6b4049be9b24f6539aa04979ae9 100644 (file)
@@ -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<TippyEvent>(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<PaperVisualsComponent>(_entity))
                 {
-                    var paper = EntityManager.AddComponent<PaperVisualsComponent>(_entity); 
+                    var paper = EntityManager.AddComponent<PaperVisualsComponent>(_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 (file)
index f9376a7..0000000
+++ /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<TippyEvent>(OnClippyEv);
-    }
-
-    private void OnClippyEv(TippyEvent ev)
-    {
-        _uiMan.GetUIController<TippyUIController>().AddMessage(ev);
-    }
-}
index ccc732623bc708b8d66ad2ca23d2ef914fb699ce..168f11de8f8270cf475d1c279bfd62d0725e38f1 100644 (file)
@@ -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];