Shuttle console + FTL rework (#24430)
* Add shuttle interior drawing back Just do it per-tile she'll be right, at least it's done with 1 draw call. * Revamp shuttle console * Bunch of cleanup work * Lables sortito * dok * Pixel alignment and colours * Fix a bunch of drawing bugs * Shuttle map drawing * Drawing fixes * Map parallax working finally * weh * Commit all my stuff * mic * deez * Update everything * Xamlify everything * uh * Rudimentary blocker range * My enemies have succeeded * Bunch of changes to FTL * Heaps of cleanup * Fix FTL bugs * FTL * weewoo * FTL fallback * wew * weh * Basic FTL working * FTL working * FTL destination fixes * a * Exclusion zones * Fix drawing / FTL * Beacons working * Coordinates drawing * Fix unknown map names * Dorks beginning * State + docking cleanup start * Basic dock drawing * Bunch of drawing fixes * Batching / color fixes * Cleanup and beacons support * weh * weh * Begin pings * First draft at map objects * Map fixup * Faster drawing * Fix perf + FTL * Cached drawing * Fix drawing * Best I got * strips * Back to lists but with caching * Final optimisation * Fix dock bounds * Docking work * stinker * kobolds * Btns * Docking vis working * Fix docking pre-vis * canasses * Helldivers 2 * a * Array life * Fix * Fix TODOs * liltenhead feature club * dorking * Merge artifacts * Last-minute touchup
This commit is contained in:
@@ -2,7 +2,7 @@ using Content.Client.Shuttles.UI;
|
||||
using Content.Shared.Shuttles.BUIStates;
|
||||
using Content.Shared.Shuttles.Events;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Client.Shuttles.BUI;
|
||||
|
||||
@@ -20,25 +20,48 @@ public sealed class ShuttleConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
base.Open();
|
||||
_window = new ShuttleConsoleWindow();
|
||||
_window.UndockPressed += OnUndockPressed;
|
||||
_window.StartAutodockPressed += OnAutodockPressed;
|
||||
_window.StopAutodockPressed += OnStopAutodockPressed;
|
||||
_window.DestinationPressed += OnDestinationPressed;
|
||||
_window.OpenCentered();
|
||||
_window.OnClose += OnClose;
|
||||
_window.OnClose += Close;
|
||||
|
||||
_window.RequestFTL += OnFTLRequest;
|
||||
_window.RequestBeaconFTL += OnFTLBeaconRequest;
|
||||
_window.DockRequest += OnDockRequest;
|
||||
_window.UndockRequest += OnUndockRequest;
|
||||
}
|
||||
|
||||
private void OnDestinationPressed(NetEntity obj)
|
||||
private void OnUndockRequest(NetEntity entity)
|
||||
{
|
||||
SendMessage(new ShuttleConsoleFTLRequestMessage()
|
||||
SendMessage(new UndockRequestMessage()
|
||||
{
|
||||
Destination = obj,
|
||||
DockEntity = entity,
|
||||
});
|
||||
}
|
||||
|
||||
private void OnClose()
|
||||
private void OnDockRequest(NetEntity entity, NetEntity target)
|
||||
{
|
||||
Close();
|
||||
SendMessage(new DockRequestMessage()
|
||||
{
|
||||
DockEntity = entity,
|
||||
TargetDockEntity = target,
|
||||
});
|
||||
}
|
||||
|
||||
private void OnFTLBeaconRequest(NetEntity ent, Angle angle)
|
||||
{
|
||||
SendMessage(new ShuttleConsoleFTLBeaconMessage()
|
||||
{
|
||||
Beacon = ent,
|
||||
Angle = angle,
|
||||
});
|
||||
}
|
||||
|
||||
private void OnFTLRequest(MapCoordinates obj, Angle angle)
|
||||
{
|
||||
SendMessage(new ShuttleConsoleFTLPositionMessage()
|
||||
{
|
||||
Coordinates = obj,
|
||||
Angle = angle,
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
@@ -51,27 +74,12 @@ public sealed class ShuttleConsoleBoundUserInterface : BoundUserInterface
|
||||
}
|
||||
}
|
||||
|
||||
private void OnStopAutodockPressed(NetEntity obj)
|
||||
{
|
||||
SendMessage(new StopAutodockRequestMessage() { DockEntity = obj });
|
||||
}
|
||||
|
||||
private void OnAutodockPressed(NetEntity obj)
|
||||
{
|
||||
SendMessage(new AutodockRequestMessage() { DockEntity = obj });
|
||||
}
|
||||
|
||||
private void OnUndockPressed(NetEntity obj)
|
||||
{
|
||||
SendMessage(new UndockRequestMessage() { DockEntity = obj });
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
if (state is not ShuttleConsoleBoundInterfaceState cState) return;
|
||||
if (state is not ShuttleBoundUserInterfaceState cState)
|
||||
return;
|
||||
|
||||
_window?.SetMatrix(EntMan.GetCoordinates(cState.Coordinates), cState.Angle);
|
||||
_window?.UpdateState(cState);
|
||||
_window?.UpdateState(Owner, cState);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user