Skip to content

Commit 849a89f

Browse files
authored
ITs live time (#5844)
## Short description <!-- What do you propose to change with your PR? --> ## Why we need to add this <!-- What is the reason for adding these changes? Please post links to Discussions as well as Bug Reports here. Please describe how this will change the game balance. --> ## Media (Video/Screenshots) <!-- If your PR contains in-game changes you must provide screenshots/videos of the changes. --> ## Checks <!-- check boxes for faster reviewing of your PR --> - [ ] I do not require assistance to complete the PR. - [ ] Before posting/requesting review of a PR, I have verified that the changes work. - [ ] I have added screenshots/videos of the changes, or this PR does not change in-game mechanics. - [ ] I affirm that my changes are licensed under the [MIT License](https://github.com/ss14Starlight/space-station-14/blob/Starlight/LICENSE.TXT) and grant permission for use in this repository under its conditions. **Changelog** <!-- If you want the players to know about changes made in this PR, specify them using the template outside the comment. Short and informative. :cl: STARLIGHT TEAM - add: Added Starlight. - remove: Removed SS13. - tweak: Changed SS14. - fix: Fixed Rinary. -->
2 parents e067373 + 6d08837 commit 849a89f

678 files changed

Lines changed: 268387 additions & 24120 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Content.Client/Atmos/Consoles/AtmosAlertsComputerBoundUserInterface.cs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
using Content.Shared.Atmos.Components;
2+
using Content.Shared.Medical.CrewMonitoring;
3+
using Content.Shared.Silicons.StationAi;
4+
using Robust.Shared.Map;
5+
using Robust.Shared.Player;
26

37
namespace Content.Client.Atmos.Consoles;
48

59
public sealed class AtmosAlertsComputerBoundUserInterface : BoundUserInterface
610
{
11+
#region Starlight
12+
[Dependency] private ISharedPlayerManager _playerManager = default!;
13+
#endregion
714
[ViewVariables]
815
private AtmosAlertsComputerWindow? _menu;
916

10-
public AtmosAlertsComputerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
17+
public AtmosAlertsComputerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
18+
{
19+
IoCManager.InjectDependencies(this); // Starlight: go to clicked location for AI
20+
}
1121

1222
protected override void Open()
1323
{
@@ -18,6 +28,21 @@ protected override void Open()
1828
_menu.OnClose += Close;
1929
}
2030

31+
#region Starlight
32+
/// <summary>
33+
/// Sends a map-click request to move the Station AI's remote eye to the specified coordinates.
34+
/// </summary>
35+
/// <param name="coordinates">The map coordinates selected by the user.</param>
36+
public void SendMapClicked(EntityCoordinates coordinates)
37+
{
38+
var local = _playerManager.LocalEntity;
39+
if (local is null || !EntMan.HasComponent<StationAiHeldComponent>(local.Value))
40+
return;
41+
42+
SendMessage(new CrewMonitoringWarpRequestMessage(EntMan.GetNetCoordinates(coordinates)));
43+
}
44+
#endregion
45+
2146
protected override void UpdateState(BoundUserInterfaceState state)
2247
{
2348
base.UpdateState(state);

Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
3737

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

4142
private bool _autoScrollActive = false;
4243
private bool _autoScrollAwaitsUpdate = false;
@@ -95,6 +96,7 @@ public AtmosAlertsComputerWindow(AtmosAlertsComputerBoundUserInterface userInter
9596

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

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

121+
#region Starlight
122+
private void OnNavMapClicked(EntityCoordinates coordinates)
123+
{
124+
MapClicked?.Invoke(coordinates);
125+
}
126+
#endregion
118127
#region Toggle handling
119128

120129
private void OnShowAlarmsToggled(CheckBox toggle, AtmosAlarmType toggledAlarmState)

Content.Client/Atmos/Consoles/AtmosMonitoringConsoleBoundUserInterface.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
using Content.Shared.Atmos.Components;
2+
using Content.Shared.Medical.CrewMonitoring;
3+
using Content.Shared.Silicons.StationAi;
4+
using Robust.Shared.Map;
5+
using Robust.Shared.Player;
26

37
namespace Content.Client.Atmos.Consoles;
48

59
public sealed class AtmosMonitoringConsoleBoundUserInterface : BoundUserInterface
610
{
11+
#region Starlight
12+
[Dependency] private ISharedPlayerManager _playerManager = default!;
13+
#endregion
714
[ViewVariables]
815
private AtmosMonitoringConsoleWindow? _menu;
916

10-
public AtmosMonitoringConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
17+
public AtmosMonitoringConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
18+
{
19+
IoCManager.InjectDependencies(this); // Starlight: go to clicked position for AI
20+
}
1121

1222
protected override void Open()
1323
{
@@ -18,6 +28,20 @@ protected override void Open()
1828
_menu.OnClose += Close;
1929
}
2030

31+
#region Starlight
32+
/// <summary>
33+
/// Sends a map-click request to move the Station AI's remote eye to the specified coordinates.
34+
/// </summary>
35+
/// <param name="coordinates">The map coordinates selected by the user.</param>
36+
public void SendMapClicked(EntityCoordinates coordinates)
37+
{
38+
var local = _playerManager.LocalEntity;
39+
if (local is null || !EntMan.HasComponent<StationAiHeldComponent>(local.Value))
40+
return;
41+
42+
SendMessage(new CrewMonitoringWarpRequestMessage(EntMan.GetNetCoordinates(coordinates)));
43+
}
44+
#endregion
2145
protected override void UpdateState(BoundUserInterfaceState state)
2246
{
2347
base.UpdateState(state);

Content.Client/Atmos/Consoles/AtmosMonitoringConsoleWindow.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public sealed partial class AtmosMonitoringConsoleWindow : FancyWindow
2929
private int? _focusNetId;
3030

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

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

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

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

112+
#region Starlight
113+
private void OnNavMapClicked(EntityCoordinates coordinates)
114+
{
115+
MapClicked?.Invoke(coordinates);
116+
}
117+
#endregion
118+
109119
#region Toggle handling
110120

111121
private void OnShowPipeNetworkToggled()

Content.Client/Content.Client.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@
3030
</ItemGroup>
3131
<Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
3232
<Import Project="..\RobustToolbox\MSBuild\XamlIL.targets" />
33+
<Import Project="..\RobustToolbox\MSBuild\Robust.EntitySystemSubscriptionsGenerator.targets" />
3334
</Project>

Content.Client/Guidebook/Controls/GuideReagentReaction.xaml.cs

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public GuideReagentReaction(ReactionPrototype prototype, IPrototypeManager proto
3636
Container container = ReactantsContainer;
3737
SetReagents(prototype.Reactants, ref container, protoMan);
3838
Container productContainer = ProductsContainer;
39-
var products = new Dictionary<string, FixedPoint2>(prototype.Products);
39+
var products = new Dictionary<ProtoId<ReagentPrototype>, FixedPoint2>(prototype.Products);
4040
foreach (var (reagent, reactantProto) in prototype.Reactants)
4141
{
4242
if (reactantProto.Catalyst)
@@ -103,9 +103,9 @@ public GuideReagentReaction(GasPrototype prototype,
103103

104104
if (prototype.Reagent != null)
105105
{
106-
var quantity = new Dictionary<string, FixedPoint2>
106+
var quantity = new Dictionary<ProtoId<ReagentPrototype>, FixedPoint2>
107107
{
108-
{ prototype.Reagent, FixedPoint2.New(0.21f) }
108+
{ prototype.Reagent.Value, FixedPoint2.New(0.21f) }
109109
};
110110
Container productContainer = ProductsContainer;
111111
SetReagents(quantity, ref productContainer, protoMan, false);
@@ -115,48 +115,34 @@ public GuideReagentReaction(GasPrototype prototype,
115115

116116
private void SetReagents(List<ReagentQuantity> reagents, ref Container container, IPrototypeManager protoMan, bool addLinks = true)
117117
{
118-
var amounts = new Dictionary<string, FixedPoint2>();
118+
var amounts = new Dictionary<ProtoId<ReagentPrototype>, FixedPoint2>();
119119
foreach (var (reagent, quantity) in reagents)
120120
{
121121
amounts.Add(reagent.Prototype, quantity);
122122
}
123123
SetReagents(amounts, ref container, protoMan, addLinks);
124124
}
125125

126-
private void SetReagents(
127-
Dictionary<string, ReactantPrototype> reactants,
128-
ref Container container,
129-
IPrototypeManager protoMan,
130-
bool addLinks = true)
131-
{
132-
var amounts = new Dictionary<string, FixedPoint2>();
133-
foreach (var (reagent, reactantPrototype) in reactants)
134-
{
135-
amounts.Add(reagent, reactantPrototype.Amount);
136-
}
137-
SetReagents(amounts, ref container, protoMan, addLinks);
138-
}
139-
140126
[PublicAPI]
141127
private void SetReagents(
142-
Dictionary<ProtoId<MixingCategoryPrototype>, ReactantPrototype> reactants,
128+
Dictionary<ProtoId<ReagentPrototype>, ReactantPrototype> reactants,
143129
ref Container container,
144130
IPrototypeManager protoMan,
145131
bool addLinks = true)
146132
{
147-
var amounts = new Dictionary<string, FixedPoint2>();
133+
var amounts = new Dictionary<ProtoId<ReagentPrototype>, FixedPoint2>();
148134
foreach (var (reagent, reactantPrototype) in reactants)
149135
{
150136
amounts.Add(reagent, reactantPrototype.Amount);
151137
}
152138
SetReagents(amounts, ref container, protoMan, addLinks);
153139
}
154140

155-
private void SetReagents(Dictionary<string, FixedPoint2> reagents, ref Container container, IPrototypeManager protoMan, bool addLinks = true)
141+
private void SetReagents(Dictionary<ProtoId<ReagentPrototype>, FixedPoint2> reagents, ref Container container, IPrototypeManager protoMan, bool addLinks = true)
156142
{
157143
foreach (var (product, amount) in reagents.OrderByDescending(p => p.Value))
158144
{
159-
var productProto = protoMan.Index<ReagentPrototype>(product);
145+
var productProto = protoMan.Index(product);
160146
var msg = new FormattedMessage();
161147
msg.AddMarkupOrThrow(Loc.GetString("guidebook-reagent-recipes-reagent-display",
162148
("reagent", productProto.LocalizedName), ("ratio", amount)));

Content.Client/IconSmoothing/IconSmoothComponent.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using JetBrains.Annotations;
22
using Robust.Client.Graphics;
3+
using Robust.Shared.Prototypes;
34
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
45

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

41-
[DataField("shader", customTypeSerializer:typeof(PrototypeIdSerializer<ShaderPrototype>))]
42-
public string? Shader;
42+
[DataField("shader")]
43+
public ProtoId<ShaderPrototype>? Shader;
4344

4445
/// <summary>
4546
/// Mode that controls how the icon should be selected.

Content.Client/Lobby/UI/ProfileEditorControls/ProfilePreviewSpriteView.Humanoid.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Content.Shared._Starlight.Medical.Limbs;
1616
using Content.Client._Starlight.Humanoid;
1717
using Content.Shared._Starlight.Humanoid;
18+
using Content.Shared._Starlight.Roles;
1819
#endregion
1920

2021
namespace Content.Client.Lobby.UI.ProfileEditorControls;
@@ -126,6 +127,13 @@ private void LoadHumanoidEntity(HumanoidCharacterProfile humanoid, JobPrototype?
126127
JobName = job.LocalizedName;
127128
// Grab the loadout specific name too!
128129
LoadoutName = GetLoadoutName(loadout);
130+
// Starlight - the preview dummy never reaches the server, so
131+
// give client-side systems a chance to react to the loadout too
132+
EntMan.EventBus.RaiseLocalEvent(PreviewDummy, new RoleLoadoutAppliedEvent(loadout));
133+
// Starlight - actually equip loadout-selected clothing on the
134+
// dummy too, same as the humanoid path below does. Borg/AI
135+
// never had wearable loadout slots so this was never hit.
136+
GiveDummyLoadout(PreviewDummy, loadout);
129137
return;
130138
}
131139
}

Content.Client/Overlays/ShowJobIconsSystem.cs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
using Content.Shared._Starlight.StatusIcon;
12
using Content.Shared.Access.Components;
23
using Content.Shared.Access.Systems;
34
using Content.Shared.Overlays;
45
using Content.Shared.PDA;
56
using Content.Shared.StatusIcon;
67
using Content.Shared.StatusIcon.Components;
78
using Robust.Shared.Prototypes;
9+
using Robust.Client.Player;
10+
using Content.Shared.Silicons.StationAi;
11+
using Content.Shared.Medical.SuitSensors;
12+
using Content.Shared.Medical.SuitSensor;
813

914
namespace Content.Client.Overlays;
1015

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

21+
#region Starlight
22+
[Dependency] private StationAiVisionSystem _vision = default!;
23+
[Dependency] private IPlayerManager _player = default!;
24+
#endregion
25+
1626
private static readonly ProtoId<JobIconPrototype> JobIconForNoId = "JobIconNoId";
1727

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

3040
var iconId = JobIconForNoId;
3141

32-
if (_accessReader.FindAccessItemsInventory(uid, out var items))
42+
// Starlight Start
43+
if (TryComp<FixedJobIconComponent>(uid, out var fixedIcon) && _prototype.Resolve(fixedIcon.Job, out var job))
44+
{
45+
iconId = job.Icon;
46+
}
47+
else if (_accessReader.FindAccessItemsInventory(uid, out var items))
48+
// Starlight End
3349
{
3450
foreach (var item in items)
3551
{
@@ -51,6 +67,29 @@ private void OnGetStatusIconsEvent(EntityUid uid, StatusIconComponent _, ref Get
5167
}
5268
}
5369

70+
// Starlight - start
71+
// Show job icons if entity is in camera view (only relevant for AI viewers) OR they have active suit sensors.
72+
73+
// First, determine if the local viewer is an AI-style viewer. Only then consult the AI vision system.
74+
if (_player.LocalEntity is EntityUid localEnt
75+
&& TryComp(localEnt, out StationAiOverlayComponent? _)
76+
&& _vision.IsOutsideCameraViewCached(uid))
77+
{
78+
var suitSensorsActive = false;
79+
// Iterate all suit sensors and check if any are assigned to this user and active.
80+
foreach (var sensor in EntityQuery<SuitSensorComponent>(true))
81+
{
82+
if (sensor.User == uid && sensor.Mode == SuitSensorMode.SensorCords)
83+
{
84+
suitSensorsActive = true;
85+
break;
86+
}
87+
}
88+
89+
if(!suitSensorsActive) return;
90+
}
91+
// Starlight - end
92+
5493
if (_prototype.Resolve(iconId, out var iconPrototype))
5594
ev.StatusIcons.Add(iconPrototype);
5695
else

Content.Client/Power/PowerMonitoringConsoleBoundUserInterface.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
using Content.Shared.Power;
2+
using Content.Shared.Medical.CrewMonitoring;
3+
using Content.Shared.Silicons.StationAi;
24
using Robust.Client.UserInterface;
5+
using Robust.Shared.Map;
6+
using Robust.Shared.Player;
37

48
namespace Content.Client.Power;
59

610
public sealed class PowerMonitoringConsoleBoundUserInterface : BoundUserInterface
711
{
12+
[Dependency] private ISharedPlayerManager _playerManager = default!; // Starlight: go to clicked position for AI
13+
814
[ViewVariables]
915
private PowerMonitoringWindow? _menu;
1016

11-
public PowerMonitoringConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
17+
public PowerMonitoringConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
18+
{
19+
IoCManager.InjectDependencies(this); // Starlight: go to clicked position for AI
20+
}
1221

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

2232
protected override void UpdateState(BoundUserInterfaceState state)
@@ -40,4 +50,15 @@ public void SendPowerMonitoringConsoleMessage(NetEntity? netEntity, PowerMonitor
4050
{
4151
SendMessage(new PowerMonitoringConsoleMessage(netEntity, group));
4252
}
53+
54+
#region Starlight
55+
private void SendMapClicked(EntityCoordinates coordinates)
56+
{
57+
var local = _playerManager.LocalEntity;
58+
if (local is null || !EntMan.HasComponent<StationAiHeldComponent>(local.Value))
59+
return;
60+
61+
SendMessage(new CrewMonitoringWarpRequestMessage(EntMan.GetNetCoordinates(coordinates)));
62+
}
63+
#endregion
4364
}

0 commit comments

Comments
 (0)