Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
bf4a807
Add EntitySystemSubscriptionsGenerator project to Content solution. (…
Ataman Jul 2, 2026
247b528
Fix dupe
DrSmugleaf Aug 16, 2026
4cf19fe
Ventcrawling fix (#5756)
Mackamuir Aug 20, 2026
d139af6
Changelog: PR #5756 [skip ci]
starlightgithub[bot] Aug 20, 2026
952ac13
Merge branch 'starlight-dev' into fix/event-generator
StarlightHost Aug 20, 2026
fc7fe01
Fix EntitySystemSubscriptionsGenerator not running for Client/Shared/…
walksanatora Aug 21, 2026
7e5349e
Guidebook re-organization (#5432)
RHSvenson Aug 21, 2026
496db64
Revenge of the roach (#5617)
RedSpeeds Aug 21, 2026
6b2af44
Changelog: PR #5432 [skip ci]
starlightgithub[bot] Aug 21, 2026
300081e
Ticker command update (#5527)
neomoth Aug 21, 2026
0c14b03
Funky Boxes (#5720)
Conflee Aug 21, 2026
3e171f2
Sword Resprites (#5745)
Conflee Aug 21, 2026
101825f
Changelog: PR #5617 [skip ci]
starlightgithub[bot] Aug 21, 2026
d21e4bb
Fix ItemSwitchState typo (#5754)
Omegalucky Aug 21, 2026
daef1c8
Changelog: PR #5754 [skip ci]
starlightgithub[bot] Aug 21, 2026
991bc35
Makes news manager console use Journalism access (#5755)
CawsForConcern Aug 21, 2026
566a8e0
Changelog: PR #5755 [skip ci]
starlightgithub[bot] Aug 21, 2026
deef0b8
Add Froggy Chair to the game (#5691)
briochebear Aug 21, 2026
e72c252
Changelog: PR #5691 [skip ci]
starlightgithub[bot] Aug 21, 2026
08f2a7d
Changelog: PR #5720 [skip ci]
starlightgithub[bot] Aug 21, 2026
6b19099
Add artist credits to music vinyl descriptions (#5727)
wayiscool Aug 21, 2026
943a586
Changelog: PR #5727 [skip ci]
starlightgithub[bot] Aug 21, 2026
1f8efc7
(Elkridge) Departmental Lathes, Radio Host. (#5729)
wayiscool Aug 21, 2026
98558af
Changelog: PR #5729 [skip ci]
starlightgithub[bot] Aug 21, 2026
99e3c8c
Cell Bars (#5737)
Conflee Aug 21, 2026
a9df0c6
Changelog: PR #5737 [skip ci]
starlightgithub[bot] Aug 21, 2026
75005c4
Removes law communications console (#5743)
CawsForConcern Aug 21, 2026
1c64f34
Changelog: PR #5743 [skip ci]
starlightgithub[bot] Aug 21, 2026
2e1ec8b
Removes Command access from Internal Affairs Agents (#5744)
CawsForConcern Aug 21, 2026
5b76ed4
Changelog: PR #5744 [skip ci]
starlightgithub[bot] Aug 21, 2026
beadac9
Changelog: PR #5745 [skip ci]
starlightgithub[bot] Aug 21, 2026
b1b7f57
PA Control Box Resprite (#5746)
Conflee Aug 21, 2026
a7dbec6
Changelog: PR #5746 [skip ci]
starlightgithub[bot] Aug 21, 2026
95e424a
Grant canine creatures cold resistance (#5740)
Sparlight Aug 21, 2026
d89e098
Changelog: PR #5740 [skip ci]
starlightgithub[bot] Aug 21, 2026
16cb413
(Novo Lobster) No random rotation (#5761)
CawsForConcern Aug 21, 2026
3f7c309
Changelog: PR #5761 [skip ci]
starlightgithub[bot] Aug 21, 2026
f90876b
Antag Selection Fixes 2 (#5765)
wonderfulnewworld Aug 21, 2026
2be323d
Changelog: PR #5765 [skip ci]
starlightgithub[bot] Aug 21, 2026
ac0b0b2
Digestive Chems Fix (#5772)
Citrea-Lingua Aug 21, 2026
d9f707a
Changelog: PR #5772 [skip ci]
starlightgithub[bot] Aug 21, 2026
d40c3ad
Enabling war wizard trial 2 (#5771)
Littlemen07 Aug 21, 2026
4c562d7
Changelog: PR #5771 [skip ci]
starlightgithub[bot] Aug 21, 2026
5e458e1
Intellicard fixes to transfer, unified naming conventions and name tr…
Proximitron Aug 22, 2026
5231e13
Changelog: PR #5776 [skip ci]
starlightgithub[bot] Aug 22, 2026
6ca3174
BEHOLD TRIGGER SYSTEM (#5779)
walksanatora Aug 22, 2026
0b5c6b9
Big prototype and datafield cleanup (#45202)
deltanedas Aug 12, 2026
8c749c4
Merge fixes
DrSmugleaf Aug 23, 2026
1a39986
Add a sample file for partial prototypes, and add loading them at sta…
DrSmugleaf Aug 23, 2026
50493c5
Update RobustToolbox
DrSmugleaf Aug 23, 2026
b1dd6d0
One million build fixes
DrSmugleaf Aug 23, 2026
231f0b0
Fix reactor guidebook (#5797)
Mackamuir Aug 23, 2026
fa07188
Changelog: PR #5797 [skip ci]
starlightgithub[bot] Aug 23, 2026
252278b
Update engine to v289.0.0 (#5794)
walksanatora Aug 23, 2026
efbb479
Syndicate Bomb Tweak (#5804)
JohnnyMalawny Aug 24, 2026
516bf53
Changelog: PR #5804 [skip ci]
starlightgithub[bot] Aug 24, 2026
44c356b
Manor Brig Door Fix (#5781)
SeaborneProto Aug 24, 2026
3ce9284
Changelog: PR #5781 [skip ci]
starlightgithub[bot] Aug 24, 2026
6a2d29b
- fix: Ghost roles like Paradox Clone and Exterminators should no lon…
CawsForConcern Aug 24, 2026
f2550d7
Merge branch 'starlight-dev' into Port_44382
CawsForConcern Aug 24, 2026
e1644f2
Fixes small mistake in the cultist metrics (#5808)
RedSpeeds Aug 24, 2026
0e50eb0
Ports TryFindRandomTileOnStation rewrite from Upstream #44382 & #4466…
walksanatora Aug 25, 2026
e518a9a
Changelog: PR #5810 [skip ci]
starlightgithub[bot] Aug 25, 2026
58b0cb2
Security K9 (#5715)
Sparlight Aug 25, 2026
7f15c0b
Changelog: PR #5715 [skip ci]
starlightgithub[bot] Aug 25, 2026
6b6802e
Fixes monkeys and kobolds overheating in hardsuits (#5809)
CawsForConcern Aug 25, 2026
2fada4e
Changelog: PR #5809 [skip ci]
starlightgithub[bot] Aug 25, 2026
fb8ce57
Fix metabolism shuffle (#5775)
Mackamuir Aug 25, 2026
37f007a
Changelog: PR #5775 [skip ci]
starlightgithub[bot] Aug 25, 2026
0021393
New chem Respirazone,airloss-autoinjector exclusive (#5497)
sir-lutz Aug 25, 2026
6f2d746
Changelog: PR #5497 [skip ci]
starlightgithub[bot] Aug 25, 2026
4ee0dbd
Allow K9s to be put in pet carriers (#5822)
Sparlight Aug 26, 2026
f59e6ab
Fixes not being able to trash medipens (#5817)
RhapsodySL Aug 26, 2026
c52de72
Labelable Wallmounts (#5785)
Conflee Aug 26, 2026
e137573
Changelog: PR #5822 [skip ci]
starlightgithub[bot] Aug 26, 2026
ee7d7e1
Horrific Necktie Description Changes (#5814)
Swonkus Aug 26, 2026
6a798ce
Changelog: PR #5814 [skip ci]
starlightgithub[bot] Aug 26, 2026
06444ba
Add animal-only animal languages (#5818)
Sparlight Aug 26, 2026
81e891c
Changelog: PR #5817 [skip ci]
starlightgithub[bot] Aug 26, 2026
465697c
Changelog: PR #5818 [skip ci]
starlightgithub[bot] Aug 26, 2026
fbaa1d8
update starlight cooking appliances to use new powerstate from upstre…
Mackamuir Aug 26, 2026
7059d96
Changelog: PR #5796 [skip ci]
starlightgithub[bot] Aug 26, 2026
cada626
Changelog: PR #5785 [skip ci]
starlightgithub[bot] Aug 26, 2026
6f4e824
False Shutters Projector (#5780)
Conflee Aug 26, 2026
c6e8d29
Changelog: PR #5780 [skip ci]
starlightgithub[bot] Aug 26, 2026
66634e8
QoL AI jump to position on more maps extension (#5831)
Proximitron Aug 26, 2026
5772e25
Changelog: PR #5831 [skip ci]
starlightgithub[bot] Aug 26, 2026
396bfc0
Switch a jug for a chemical case in the advanced first aid cyborg mod…
RhapsodySL Aug 26, 2026
9d342f8
Changelog: PR #5830 [skip ci]
starlightgithub[bot] Aug 26, 2026
f6b762d
AI Job icons fix (no job icons outside camera vision with deactivated…
Proximitron Aug 26, 2026
602c87c
Changelog: PR #5799 [skip ci]
starlightgithub[bot] Aug 26, 2026
7a46129
Changes to ninja threat calls for comms console (#5832)
JohnnyMalawny Aug 26, 2026
80b3204
Changelog: PR #5832 [skip ci]
starlightgithub[bot] Aug 26, 2026
9939e91
Uranium Rod De-research (#5805)
OrangeJuiceGoose Aug 27, 2026
eddface
Changelog: PR #5805 [skip ci]
starlightgithub[bot] Aug 27, 2026
8401b9f
add SSD log (#5828)
Mackamuir Aug 27, 2026
ae6b3ec
Refinery Again (#5714)
OrangeJuiceGoose Aug 27, 2026
9374105
Changelog: PR #5714 [skip ci]
starlightgithub[bot] Aug 27, 2026
097beaf
Surveillance camera & monitoring UI - bugfix & cleanup (#45401)
whatston3 Aug 18, 2026
1f2351a
cameras work now (#5836)
walksanatora Aug 27, 2026
09f354b
Changelog: PR #5836 [skip ci]
starlightgithub[bot] Aug 27, 2026
837a5ce
K9 can no longer roll antag + display weight (#5839)
wonderfulnewworld Aug 27, 2026
e0273f7
Changelog: PR #5839 [skip ci]
starlightgithub[bot] Aug 27, 2026
dbe2670
Kiki, Pun Pun, Stir Stir, and other antag rolling animals can roll an…
wonderfulnewworld Aug 27, 2026
144a4b9
Changelog: PR #5840 [skip ci]
starlightgithub[bot] Aug 27, 2026
91f0949
Fix k9s teleporting across the station (#5842)
Sparlight Aug 27, 2026
6d08837
Changelog: PR #5842 [skip ci]
starlightgithub[bot] Aug 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
using Content.Shared.Atmos.Components;
using Content.Shared.Medical.CrewMonitoring;
using Content.Shared.Silicons.StationAi;
using Robust.Shared.Map;
using Robust.Shared.Player;

namespace Content.Client.Atmos.Consoles;

public sealed class AtmosAlertsComputerBoundUserInterface : BoundUserInterface
{
#region Starlight
[Dependency] private ISharedPlayerManager _playerManager = default!;
#endregion
[ViewVariables]
private AtmosAlertsComputerWindow? _menu;

public AtmosAlertsComputerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
public AtmosAlertsComputerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
IoCManager.InjectDependencies(this); // Starlight: go to clicked location for AI
}

protected override void Open()
{
Expand All @@ -18,6 +28,21 @@ protected override void Open()
_menu.OnClose += Close;
}

#region Starlight
/// <summary>
/// Sends a map-click request to move the Station AI's remote eye to the specified coordinates.
/// </summary>
/// <param name="coordinates">The map coordinates selected by the user.</param>
public void SendMapClicked(EntityCoordinates coordinates)
{
var local = _playerManager.LocalEntity;
if (local is null || !EntMan.HasComponent<StationAiHeldComponent>(local.Value))
return;

SendMessage(new CrewMonitoringWarpRequestMessage(EntMan.GetNetCoordinates(coordinates)));
}
#endregion

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow

public event Action<NetEntity?>? SendFocusChangeMessageAction;
public event Action<NetEntity, bool>? SendDeviceSilencedMessageAction;
public event Action<EntityCoordinates>? MapClicked; // Starlight: go to clicked location for AI

private bool _autoScrollActive = false;
private bool _autoScrollAwaitsUpdate = false;
Expand Down Expand Up @@ -95,6 +96,7 @@ public AtmosAlertsComputerWindow(AtmosAlertsComputerBoundUserInterface userInter

// Set trackable entity selected action
NavMap.TrackedEntitySelectedAction += SetTrackedEntityFromNavMap;
NavMap.MapClickedAction += OnNavMapClicked; // Starlight: go to clicked location for AI

// Update nav map
NavMap.ForceNavMapUpdate();
Expand All @@ -113,8 +115,15 @@ public AtmosAlertsComputerWindow(AtmosAlertsComputerBoundUserInterface userInter
// Set atmos monitoring message action
SendFocusChangeMessageAction += userInterface.SendFocusChangeMessage;
SendDeviceSilencedMessageAction += userInterface.SendDeviceSilencedMessage;
MapClicked += userInterface.SendMapClicked; // Starlight: go to clicked location for AI
}

#region Starlight
private void OnNavMapClicked(EntityCoordinates coordinates)
{
MapClicked?.Invoke(coordinates);
}
#endregion
#region Toggle handling

private void OnShowAlarmsToggled(CheckBox toggle, AtmosAlarmType toggledAlarmState)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
using Content.Shared.Atmos.Components;
using Content.Shared.Medical.CrewMonitoring;
using Content.Shared.Silicons.StationAi;
using Robust.Shared.Map;
using Robust.Shared.Player;

namespace Content.Client.Atmos.Consoles;

public sealed class AtmosMonitoringConsoleBoundUserInterface : BoundUserInterface
{
#region Starlight
[Dependency] private ISharedPlayerManager _playerManager = default!;
#endregion
[ViewVariables]
private AtmosMonitoringConsoleWindow? _menu;

public AtmosMonitoringConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
public AtmosMonitoringConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
IoCManager.InjectDependencies(this); // Starlight: go to clicked position for AI
}

protected override void Open()
{
Expand All @@ -18,6 +28,20 @@ protected override void Open()
_menu.OnClose += Close;
}

#region Starlight
/// <summary>
/// Sends a map-click request to move the Station AI's remote eye to the specified coordinates.
/// </summary>
/// <param name="coordinates">The map coordinates selected by the user.</param>
public void SendMapClicked(EntityCoordinates coordinates)
{
var local = _playerManager.LocalEntity;
if (local is null || !EntMan.HasComponent<StationAiHeldComponent>(local.Value))
return;

SendMessage(new CrewMonitoringWarpRequestMessage(EntMan.GetNetCoordinates(coordinates)));
}
#endregion
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public sealed partial class AtmosMonitoringConsoleWindow : FancyWindow
private int? _focusNetId;

private bool _autoScrollActive = false;
public event Action<EntityCoordinates>? MapClicked; // Starlight: go to clicked position for AI

private readonly Color _unfocusedDeviceColor = Color.DimGray;
private ProtoId<NavMapBlipPrototype> _navMapConsoleProtoId = "NavMapConsole";
Expand Down Expand Up @@ -84,6 +85,8 @@ public AtmosMonitoringConsoleWindow(AtmosMonitoringConsoleBoundUserInterface use

// Set trackable entity selected action
NavMap.TrackedEntitySelectedAction += SetTrackedEntityFromNavMap;
NavMap.MapClickedAction += OnNavMapClicked; // Starlight: go to clicked position for AI
MapClicked += userInterface.SendMapClicked; // Starlight: go to clicked position for AI

// Update nav map
NavMap.ForceNavMapUpdate();
Expand All @@ -106,6 +109,13 @@ public AtmosMonitoringConsoleWindow(AtmosMonitoringConsoleBoundUserInterface use
UpdateUI(consoleCoords, Array.Empty<AtmosMonitoringConsoleEntry>());
}

#region Starlight
private void OnNavMapClicked(EntityCoordinates coordinates)
{
MapClicked?.Invoke(coordinates);
}
#endregion

#region Toggle handling

private void OnShowPipeNetworkToggled()
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Content.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@
</ItemGroup>
<Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
<Import Project="..\RobustToolbox\MSBuild\XamlIL.targets" />
<Import Project="..\RobustToolbox\MSBuild\Robust.EntitySystemSubscriptionsGenerator.targets" />
</Project>
30 changes: 8 additions & 22 deletions Content.Client/Guidebook/Controls/GuideReagentReaction.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public GuideReagentReaction(ReactionPrototype prototype, IPrototypeManager proto
Container container = ReactantsContainer;
SetReagents(prototype.Reactants, ref container, protoMan);
Container productContainer = ProductsContainer;
var products = new Dictionary<string, FixedPoint2>(prototype.Products);
var products = new Dictionary<ProtoId<ReagentPrototype>, FixedPoint2>(prototype.Products);
foreach (var (reagent, reactantProto) in prototype.Reactants)
{
if (reactantProto.Catalyst)
Expand Down Expand Up @@ -103,9 +103,9 @@ public GuideReagentReaction(GasPrototype prototype,

if (prototype.Reagent != null)
{
var quantity = new Dictionary<string, FixedPoint2>
var quantity = new Dictionary<ProtoId<ReagentPrototype>, FixedPoint2>
{
{ prototype.Reagent, FixedPoint2.New(0.21f) }
{ prototype.Reagent.Value, FixedPoint2.New(0.21f) }
};
Container productContainer = ProductsContainer;
SetReagents(quantity, ref productContainer, protoMan, false);
Expand All @@ -115,48 +115,34 @@ public GuideReagentReaction(GasPrototype prototype,

private void SetReagents(List<ReagentQuantity> reagents, ref Container container, IPrototypeManager protoMan, bool addLinks = true)
{
var amounts = new Dictionary<string, FixedPoint2>();
var amounts = new Dictionary<ProtoId<ReagentPrototype>, FixedPoint2>();
foreach (var (reagent, quantity) in reagents)
{
amounts.Add(reagent.Prototype, quantity);
}
SetReagents(amounts, ref container, protoMan, addLinks);
}

private void SetReagents(
Dictionary<string, ReactantPrototype> reactants,
ref Container container,
IPrototypeManager protoMan,
bool addLinks = true)
{
var amounts = new Dictionary<string, FixedPoint2>();
foreach (var (reagent, reactantPrototype) in reactants)
{
amounts.Add(reagent, reactantPrototype.Amount);
}
SetReagents(amounts, ref container, protoMan, addLinks);
}

[PublicAPI]
private void SetReagents(
Dictionary<ProtoId<MixingCategoryPrototype>, ReactantPrototype> reactants,
Dictionary<ProtoId<ReagentPrototype>, ReactantPrototype> reactants,
ref Container container,
IPrototypeManager protoMan,
bool addLinks = true)
{
var amounts = new Dictionary<string, FixedPoint2>();
var amounts = new Dictionary<ProtoId<ReagentPrototype>, FixedPoint2>();
foreach (var (reagent, reactantPrototype) in reactants)
{
amounts.Add(reagent, reactantPrototype.Amount);
}
SetReagents(amounts, ref container, protoMan, addLinks);
}

private void SetReagents(Dictionary<string, FixedPoint2> reagents, ref Container container, IPrototypeManager protoMan, bool addLinks = true)
private void SetReagents(Dictionary<ProtoId<ReagentPrototype>, FixedPoint2> reagents, ref Container container, IPrototypeManager protoMan, bool addLinks = true)
{
foreach (var (product, amount) in reagents.OrderByDescending(p => p.Value))
{
var productProto = protoMan.Index<ReagentPrototype>(product);
var productProto = protoMan.Index(product);
var msg = new FormattedMessage();
msg.AddMarkupOrThrow(Loc.GetString("guidebook-reagent-recipes-reagent-display",
("reagent", productProto.LocalizedName), ("ratio", amount)));
Expand Down
5 changes: 3 additions & 2 deletions Content.Client/IconSmoothing/IconSmoothComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Client.IconSmoothing
Expand Down Expand Up @@ -38,8 +39,8 @@ public sealed partial class IconSmoothComponent : Component
[ViewVariables(VVAccess.ReadWrite), DataField("base")]
public string StateBase { get; set; } = string.Empty;

[DataField("shader", customTypeSerializer:typeof(PrototypeIdSerializer<ShaderPrototype>))]
public string? Shader;
[DataField("shader")]
public ProtoId<ShaderPrototype>? Shader;

/// <summary>
/// Mode that controls how the icon should be selected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Content.Shared._Starlight.Medical.Limbs;
using Content.Client._Starlight.Humanoid;
using Content.Shared._Starlight.Humanoid;
using Content.Shared._Starlight.Roles;
#endregion

namespace Content.Client.Lobby.UI.ProfileEditorControls;
Expand Down Expand Up @@ -126,6 +127,13 @@ private void LoadHumanoidEntity(HumanoidCharacterProfile humanoid, JobPrototype?
JobName = job.LocalizedName;
// Grab the loadout specific name too!
LoadoutName = GetLoadoutName(loadout);
// Starlight - the preview dummy never reaches the server, so
// give client-side systems a chance to react to the loadout too
EntMan.EventBus.RaiseLocalEvent(PreviewDummy, new RoleLoadoutAppliedEvent(loadout));
// Starlight - actually equip loadout-selected clothing on the
// dummy too, same as the humanoid path below does. Borg/AI
// never had wearable loadout slots so this was never hit.
GiveDummyLoadout(PreviewDummy, loadout);
return;
}
}
Expand Down
41 changes: 40 additions & 1 deletion Content.Client/Overlays/ShowJobIconsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
using Content.Shared._Starlight.StatusIcon;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.Overlays;
using Content.Shared.PDA;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
using Robust.Shared.Prototypes;
using Robust.Client.Player;
using Content.Shared.Silicons.StationAi;
using Content.Shared.Medical.SuitSensors;
using Content.Shared.Medical.SuitSensor;

namespace Content.Client.Overlays;

Expand All @@ -13,6 +18,11 @@ public sealed partial class ShowJobIconsSystem : EquipmentHudSystem<ShowJobIcons
[Dependency] private IPrototypeManager _prototype = default!;
[Dependency] private AccessReaderSystem _accessReader = default!;

#region Starlight
[Dependency] private StationAiVisionSystem _vision = default!;
[Dependency] private IPlayerManager _player = default!;
#endregion

private static readonly ProtoId<JobIconPrototype> JobIconForNoId = "JobIconNoId";

public override void Initialize()
Expand All @@ -29,7 +39,13 @@ private void OnGetStatusIconsEvent(EntityUid uid, StatusIconComponent _, ref Get

var iconId = JobIconForNoId;

if (_accessReader.FindAccessItemsInventory(uid, out var items))
// Starlight Start
if (TryComp<FixedJobIconComponent>(uid, out var fixedIcon) && _prototype.Resolve(fixedIcon.Job, out var job))
{
iconId = job.Icon;
}
else if (_accessReader.FindAccessItemsInventory(uid, out var items))
// Starlight End
{
foreach (var item in items)
{
Expand All @@ -51,6 +67,29 @@ private void OnGetStatusIconsEvent(EntityUid uid, StatusIconComponent _, ref Get
}
}

// Starlight - start
// Show job icons if entity is in camera view (only relevant for AI viewers) OR they have active suit sensors.

// First, determine if the local viewer is an AI-style viewer. Only then consult the AI vision system.
if (_player.LocalEntity is EntityUid localEnt
&& TryComp(localEnt, out StationAiOverlayComponent? _)
&& _vision.IsOutsideCameraViewCached(uid))
{
var suitSensorsActive = false;
// Iterate all suit sensors and check if any are assigned to this user and active.
foreach (var sensor in EntityQuery<SuitSensorComponent>(true))
{
if (sensor.User == uid && sensor.Mode == SuitSensorMode.SensorCords)
{
suitSensorsActive = true;
break;
}
}

if(!suitSensorsActive) return;
}
// Starlight - end

if (_prototype.Resolve(iconId, out var iconPrototype))
ev.StatusIcons.Add(iconPrototype);
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
using Content.Shared.Power;
using Content.Shared.Medical.CrewMonitoring;
using Content.Shared.Silicons.StationAi;
using Robust.Client.UserInterface;
using Robust.Shared.Map;
using Robust.Shared.Player;

namespace Content.Client.Power;

public sealed class PowerMonitoringConsoleBoundUserInterface : BoundUserInterface
{
[Dependency] private ISharedPlayerManager _playerManager = default!; // Starlight: go to clicked position for AI

[ViewVariables]
private PowerMonitoringWindow? _menu;

public PowerMonitoringConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
public PowerMonitoringConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
IoCManager.InjectDependencies(this); // Starlight: go to clicked position for AI
}

protected override void Open()
{
Expand All @@ -17,6 +26,7 @@ protected override void Open()
_menu = this.CreateWindow<PowerMonitoringWindow>();
_menu.SetEntity(Owner);
_menu.SendPowerMonitoringConsoleMessageAction += SendPowerMonitoringConsoleMessage;
_menu.MapClicked += SendMapClicked; // Starlight: go to clicked position for AI
}

protected override void UpdateState(BoundUserInterfaceState state)
Expand All @@ -40,4 +50,15 @@ public void SendPowerMonitoringConsoleMessage(NetEntity? netEntity, PowerMonitor
{
SendMessage(new PowerMonitoringConsoleMessage(netEntity, group));
}

#region Starlight
private void SendMapClicked(EntityCoordinates coordinates)
{
var local = _playerManager.LocalEntity;
if (local is null || !EntMan.HasComponent<StationAiHeldComponent>(local.Value))
return;

SendMessage(new CrewMonitoringWarpRequestMessage(EntMan.GetNetCoordinates(coordinates)));
}
#endregion
}
Loading
Loading