Shuttle UI now properly goes into pilot mode only when using the UI (#40491)
Shuttle UI bug fix
This commit is contained in:
@@ -56,7 +56,7 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
|
|||||||
SubscribeLocalEvent<ShuttleConsoleComponent, ComponentShutdown>(OnConsoleShutdown);
|
SubscribeLocalEvent<ShuttleConsoleComponent, ComponentShutdown>(OnConsoleShutdown);
|
||||||
SubscribeLocalEvent<ShuttleConsoleComponent, PowerChangedEvent>(OnConsolePowerChange);
|
SubscribeLocalEvent<ShuttleConsoleComponent, PowerChangedEvent>(OnConsolePowerChange);
|
||||||
SubscribeLocalEvent<ShuttleConsoleComponent, AnchorStateChangedEvent>(OnConsoleAnchorChange);
|
SubscribeLocalEvent<ShuttleConsoleComponent, AnchorStateChangedEvent>(OnConsoleAnchorChange);
|
||||||
SubscribeLocalEvent<ShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnConsoleUIOpenAttempt);
|
SubscribeLocalEvent<ShuttleConsoleComponent, AfterActivatableUIOpenEvent>(OnConsoleUIOpenAttempt);
|
||||||
Subs.BuiEvents<ShuttleConsoleComponent>(ShuttleConsoleUiKey.Key, subs =>
|
Subs.BuiEvents<ShuttleConsoleComponent>(ShuttleConsoleUiKey.Key, subs =>
|
||||||
{
|
{
|
||||||
subs.Event<ShuttleConsoleFTLBeaconMessage>(OnBeaconFTLMessage);
|
subs.Event<ShuttleConsoleFTLBeaconMessage>(OnBeaconFTLMessage);
|
||||||
@@ -150,10 +150,9 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void OnConsoleUIOpenAttempt(EntityUid uid, ShuttleConsoleComponent component,
|
private void OnConsoleUIOpenAttempt(EntityUid uid, ShuttleConsoleComponent component,
|
||||||
ActivatableUIOpenAttemptEvent args)
|
AfterActivatableUIOpenEvent args)
|
||||||
{
|
{
|
||||||
if (!TryPilot(args.User, uid))
|
TryPilot(args.User, uid);
|
||||||
args.Cancel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnConsoleAnchorChange(EntityUid uid, ShuttleConsoleComponent component,
|
private void OnConsoleAnchorChange(EntityUid uid, ShuttleConsoleComponent component,
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
using Robust.Shared.Player;
|
|
||||||
|
|
||||||
namespace Content.Shared.UserInterface;
|
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 sealed class ActivatableUIOpenAttemptEvent : CancellableEntityEventArgs
|
||||||
{
|
{
|
||||||
public EntityUid User { get; }
|
public EntityUid User { get; }
|
||||||
|
|||||||
Reference in New Issue
Block a user