]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Shuttle UI now properly goes into pilot mode only when using the UI (#40491)
authorbeck-thompson <107373427+beck-thompson@users.noreply.github.com>
Mon, 22 Sep 2025 06:40:13 +0000 (23:40 -0700)
committerGitHub <noreply@github.com>
Mon, 22 Sep 2025 06:40:13 +0000 (23:40 -0700)
Shuttle UI bug fix

Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs
Content.Shared/UserInterface/ActivatableUIEvents.cs

index cbd6abe9f58e23ca03d199e7ecde1a3fc1ad4bbe..126c4f963c77384115ac91a15a8bd58ef98106ac 100644 (file)
@@ -56,7 +56,7 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
         SubscribeLocalEvent<ShuttleConsoleComponent, ComponentShutdown>(OnConsoleShutdown);
         SubscribeLocalEvent<ShuttleConsoleComponent, PowerChangedEvent>(OnConsolePowerChange);
         SubscribeLocalEvent<ShuttleConsoleComponent, AnchorStateChangedEvent>(OnConsoleAnchorChange);
-        SubscribeLocalEvent<ShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnConsoleUIOpenAttempt);
+        SubscribeLocalEvent<ShuttleConsoleComponent, AfterActivatableUIOpenEvent>(OnConsoleUIOpenAttempt);
         Subs.BuiEvents<ShuttleConsoleComponent>(ShuttleConsoleUiKey.Key, subs =>
         {
             subs.Event<ShuttleConsoleFTLBeaconMessage>(OnBeaconFTLMessage);
@@ -150,10 +150,9 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
     }
 
     private void OnConsoleUIOpenAttempt(EntityUid uid, ShuttleConsoleComponent component,
-        ActivatableUIOpenAttemptEvent args)
+        AfterActivatableUIOpenEvent args)
     {
-        if (!TryPilot(args.User, uid))
-            args.Cancel();
+        TryPilot(args.User, uid);
     }
 
     private void OnConsoleAnchorChange(EntityUid uid, ShuttleConsoleComponent component,
index 338673a3ca6d42f36fe3f3233151db2dca836db2..ef2a7b1b9f75534527e0fb001bc649d381051d1a 100644 (file)
@@ -1,6 +1,9 @@
-using Robust.Shared.Player;
-
 namespace Content.Shared.UserInterface;
+
+/// <summary>
+/// This is raised BEFORE opening a UI! Do not listen and then open / do something use
+/// <see cref="AfterActivatableUIOpenEvent"/> for that.
+/// </summary>
 public sealed class ActivatableUIOpenAttemptEvent : CancellableEntityEventArgs
 {
     public EntityUid User { get; }