Add docking window to shuttle consoles (#8756)
* lewd * A * Realtime * Sleepy dork * Draw radar position * Accurate infiltrator * experiments * Better drawing * Labels * I need aan adult * Cleanup * Show toggles * display I guess * A * fix * fix * cleanupsies * Bit more polish * Make sure mass scanners actually work * Remove dummy state * fren * opposite * aghost crash * comment * What's in a name * woops * Show docking ports * Dock highlighting * Drawing dock * Shitty docks * Lots of docking drawing * Autodock working * dork * More graceful shutdown * zoomies * Lines and distance change * revert * Good enough * cleanup * Fix default range * Dock UI and loc update * Update on undock * Loc fixes
This commit is contained in:
21
Content.Client/Shuttles/Systems/DockingSystem.cs
Normal file
21
Content.Client/Shuttles/Systems/DockingSystem.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Content.Shared.Shuttles.Events;
|
||||
|
||||
namespace Content.Client.Shuttles.Systems;
|
||||
|
||||
public sealed class DockingSystem : EntitySystem
|
||||
{
|
||||
public void StartAutodock(EntityUid uid)
|
||||
{
|
||||
RaiseNetworkEvent(new AutodockRequestMessage {Entity = uid});
|
||||
}
|
||||
|
||||
public void StopAutodock(EntityUid uid)
|
||||
{
|
||||
RaiseNetworkEvent(new StopAutodockRequestMessage() {Entity = uid});
|
||||
}
|
||||
|
||||
public void Undock(EntityUid uid)
|
||||
{
|
||||
RaiseNetworkEvent(new UndockRequestMessage() {Entity = uid});
|
||||
}
|
||||
}
|
||||
8
Content.Client/Shuttles/Systems/RadarConsoleSystem.cs
Normal file
8
Content.Client/Shuttles/Systems/RadarConsoleSystem.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Content.Shared.Shuttles.Systems;
|
||||
|
||||
namespace Content.Client.Shuttles.Systems;
|
||||
|
||||
public sealed class RadarConsoleSystem : SharedRadarConsoleSystem
|
||||
{
|
||||
|
||||
}
|
||||
37
Content.Client/Shuttles/Systems/ShuttleConsoleSystem.cs
Normal file
37
Content.Client/Shuttles/Systems/ShuttleConsoleSystem.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Content.Shared.Shuttles.Components;
|
||||
using Content.Shared.Shuttles.Events;
|
||||
using Content.Shared.Shuttles.Systems;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Client.Shuttles.Systems
|
||||
{
|
||||
public sealed class ShuttleConsoleSystem : SharedShuttleConsoleSystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<PilotComponent, ComponentHandleState>(OnHandleState);
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, PilotComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not PilotComponentState state) return;
|
||||
|
||||
var console = state.Console.GetValueOrDefault();
|
||||
if (!console.IsValid())
|
||||
{
|
||||
component.Console = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TryComp<ShuttleConsoleComponent>(console, out var shuttleConsoleComponent))
|
||||
{
|
||||
Logger.Warning($"Unable to set Helmsman console to {console}");
|
||||
return;
|
||||
}
|
||||
|
||||
component.Console = shuttleConsoleComponent;
|
||||
ActionBlockerSystem.UpdateCanMove(uid);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user