Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docking window to shuttle consoles #8756

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c0082e4
lewd
metalgearsloth Jun 7, 2022
b144377
A
metalgearsloth Jun 7, 2022
82be8ae
Realtime
metalgearsloth Jun 7, 2022
c92359c
Sleepy dork
metalgearsloth Jun 7, 2022
a34590c
Draw radar position
metalgearsloth Jun 7, 2022
9f4ba35
Accurate infiltrator
metalgearsloth Jun 7, 2022
4fa9627
experiments
metalgearsloth Jun 7, 2022
ff90f06
Better drawing
metalgearsloth Jun 8, 2022
72dd6f1
Labels
metalgearsloth Jun 8, 2022
a7ed853
I need aan adult
metalgearsloth Jun 8, 2022
a8c4f10
Cleanup
metalgearsloth Jun 8, 2022
5b83f55
Show toggles
metalgearsloth Jun 8, 2022
c892665
display I guess
metalgearsloth Jun 8, 2022
f412cea
A
metalgearsloth Jun 8, 2022
6a120da
fix
metalgearsloth Jun 8, 2022
7a81bb3
fix
metalgearsloth Jun 8, 2022
9c24229
cleanupsies
metalgearsloth Jun 8, 2022
79f3182
Bit more polish
metalgearsloth Jun 8, 2022
02ff52d
Make sure mass scanners actually work
metalgearsloth Jun 8, 2022
4127216
Merge remote-tracking branch 'upstream/master' into 2022-06-07_shuttl…
metalgearsloth Jun 8, 2022
491d782
Remove dummy state
metalgearsloth Jun 8, 2022
d7ac006
fren
metalgearsloth Jun 8, 2022
89be398
opposite
metalgearsloth Jun 8, 2022
66befb6
aghost crash
metalgearsloth Jun 8, 2022
3fe9cd2
comment
metalgearsloth Jun 8, 2022
884f344
What's in a name
metalgearsloth Jun 8, 2022
44564b5
woops
metalgearsloth Jun 8, 2022
022712e
Show docking ports
metalgearsloth Jun 9, 2022
1b088f5
Dock highlighting
metalgearsloth Jun 9, 2022
e0c5f87
Drawing dock
metalgearsloth Jun 9, 2022
7bd6d2a
Shitty docks
metalgearsloth Jun 9, 2022
cfbe63a
Lots of docking drawing
metalgearsloth Jun 11, 2022
30fb08f
Autodock working
metalgearsloth Jun 11, 2022
575b111
dork
metalgearsloth Jun 11, 2022
a68add6
More graceful shutdown
metalgearsloth Jun 11, 2022
a9008f4
zoomies
metalgearsloth Jun 11, 2022
497e08f
Lines and distance change
metalgearsloth Jun 11, 2022
ab1788f
Merge remote-tracking branch 'upstream/master' into 2022-06-09_shuttl…
metalgearsloth Jun 12, 2022
ea57eb8
Merge remote-tracking branch 'upstream/master' into 2022-06-09_shuttl…
metalgearsloth Jun 13, 2022
149b62b
revert
metalgearsloth Jun 13, 2022
1a0d14a
Good enough
metalgearsloth Jun 15, 2022
2233dd1
cleanup
metalgearsloth Jun 15, 2022
74a99cc
Fix default range
metalgearsloth Jun 15, 2022
4e3c03c
Dock UI and loc update
metalgearsloth Jun 15, 2022
4b94867
Update on undock
metalgearsloth Jun 15, 2022
1c312da
Loc fixes
metalgearsloth Jun 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Content.Client/Radar/RadarConsoleWindow.xaml

This file was deleted.

116 changes: 0 additions & 116 deletions Content.Client/Radar/RadarConsoleWindow.xaml.cs

This file was deleted.

29 changes: 29 additions & 0 deletions Content.Client/Shuttles/BUI/RadarConsoleBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Content.Client.Shuttles.UI;
using Content.Shared.Shuttles.BUIStates;
using JetBrains.Annotations;
using Robust.Client.GameObjects;

namespace Content.Client.Shuttles.BUI;

[UsedImplicitly]
public sealed class RadarConsoleBoundUserInterface : BoundUserInterface
{
private RadarConsoleWindow? _window;

public RadarConsoleBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey) {}

protected override void Open()
{
base.Open();
_window = new RadarConsoleWindow();
_window?.OpenCentered();
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not RadarConsoleBoundInterfaceState cState) return;

_window?.UpdateState(cState);
}
}
70 changes: 70 additions & 0 deletions Content.Client/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using Content.Client.Shuttles.UI;
using Content.Shared.Shuttles.BUIStates;
using Content.Shared.Shuttles.Components;
using Content.Shared.Shuttles.Events;
using JetBrains.Annotations;
using Robust.Client.GameObjects;

namespace Content.Client.Shuttles.BUI;

[UsedImplicitly]
public sealed class ShuttleConsoleBoundUserInterface : BoundUserInterface
{
private ShuttleConsoleWindow? _window;

public ShuttleConsoleBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey) {}

protected override void Open()
{
base.Open();
_window = new ShuttleConsoleWindow();
_window.ShuttleModePressed += OnShuttleModePressed;
_window.UndockPressed += OnUndockPressed;
_window.StartAutodockPressed += OnAutodockPressed;
_window.StopAutodockPressed += OnStopAutodockPressed;
_window.OpenCentered();
_window.OnClose += OnClose;
}

private void OnClose()
{
Close();
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);

if (disposing)
{
_window?.Dispose();
}
}

private void OnStopAutodockPressed(EntityUid obj)
{
SendMessage(new StopAutodockRequestMessage() {Entity = obj});
}

private void OnAutodockPressed(EntityUid obj)
{
SendMessage(new AutodockRequestMessage() {Entity = obj});
}

private void OnUndockPressed(EntityUid obj)
{
SendMessage(new UndockRequestMessage() {Entity = obj});
}

private void OnShuttleModePressed(ShuttleMode obj)
{
SendMessage(new ShuttleModeRequestMessage() {Mode = obj});
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not ShuttleConsoleBoundInterfaceState cState) return;
_window?.UpdateState(cState);
}
}
8 changes: 1 addition & 7 deletions Content.Client/Shuttles/ShuttleConsoleComponent.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
using Content.Shared.Shuttles;
using Content.Shared.Shuttles.Components;
using Robust.Shared.GameObjects;

namespace Content.Client.Shuttles
{
[RegisterComponent]
[ComponentReference(typeof(SharedShuttleConsoleComponent))]
internal sealed class ShuttleConsoleComponent : SharedShuttleConsoleComponent
{

}
public sealed class ShuttleConsoleComponent : SharedShuttleConsoleComponent {}
}
9 changes: 0 additions & 9 deletions Content.Client/Shuttles/ShuttleConsoleSystem.cs

This file was deleted.

21 changes: 21 additions & 0 deletions Content.Client/Shuttles/Systems/DockingSystem.cs
Original file line number Diff line number Diff line change
@@ -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 changes: 8 additions & 0 deletions Content.Client/Shuttles/Systems/RadarConsoleSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Content.Shared.Shuttles.Systems;

namespace Content.Client.Shuttles.Systems;

public sealed class RadarConsoleSystem : SharedRadarConsoleSystem
{

}
37 changes: 37 additions & 0 deletions Content.Client/Shuttles/Systems/ShuttleConsoleSystem.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
Loading