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

upstream merge 15/11 #2205

Merged
merged 98 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from 90 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
3d7e121
Hotfix add debug info to traitor activation (#33119)
Errant-4 Nov 2, 2024
07ae96e
change ShowHealthBars and ShowHealthIcons to use protoId (#32355)
MilonPL Nov 2, 2024
0b19652
Combat and survival knife storage/inhand sprites (#33111)
SpaceRox1244 Nov 2, 2024
4b0cfd6
Delete conveyor_old.rsi (#33102)
Flareguy Nov 2, 2024
2b87c96
Fix broken computer white shadows (#33103)
Flareguy Nov 2, 2024
bb2e3da
Bugfix: Wielding now uses identity system. (#33134)
Plykiya Nov 3, 2024
87abe91
Automatic changelog update
PJBot Nov 3, 2024
c0c9a8c
Collapsible ghost roles menu (#32717)
MilenVolf Nov 4, 2024
b3ae66b
Automatic changelog update
PJBot Nov 4, 2024
c51f5e9
Added Popup for the Ligneous plant mutation when using hands. (#33136)
Tr1bute Nov 4, 2024
3d472f8
Automatic changelog update
PJBot Nov 4, 2024
074a71a
fix: Remove duplicate light blue towel from misc loadout (#33145)
michael-krebs Nov 4, 2024
df31595
Made the SpeciesChange mutation no longer transfer with Sterile Swabs…
Tr1bute Nov 4, 2024
e0b6c2f
make emergency lights (de)constructable (#32945)
Boolean-Buckeye Nov 4, 2024
aab7a17
Automatic changelog update
PJBot Nov 4, 2024
2d47903
Fix: Web Clothing Butcher Issues (#33121)
thetolbean Nov 4, 2024
d840e52
Automatic changelog update
PJBot Nov 4, 2024
4370d56
Add Silicon Law cues to Every method a Silicon can have their laws ch…
poklj Nov 4, 2024
3f9d204
Automatic changelog update
PJBot Nov 4, 2024
6ce73a5
Fix DisplayVotes doing nothing for a vote (#33170)
DrSmugleaf Nov 5, 2024
f7f8a68
Automatic changelog update
PJBot Nov 5, 2024
56dcba3
Hunger and thirst huds fix (#32832)
Kirus59 Nov 5, 2024
c71d299
Automatic changelog update
PJBot Nov 5, 2024
3eebc83
Don't show Reinforcement codewords on round end (#33181)
Errant-4 Nov 5, 2024
0b6ca38
Automatic changelog update
PJBot Nov 5, 2024
67d97ad
fix artifact debug assert (#33171)
slarticodefast Nov 5, 2024
30534d7
Fix AI in Intelicard can see through walls (#33177)
Baptr0b0t Nov 6, 2024
f18b3de
Automatic changelog update
PJBot Nov 6, 2024
5adf91b
remove wanted list cartridge from captain PDA (#33084)
slarticodefast Nov 6, 2024
58dd61c
Automatic changelog update
PJBot Nov 6, 2024
d8e4c83
make admeme mouse eternally hungry and thirsty by increasing decay ra…
Plykiya Nov 6, 2024
8f095ee
Rework the Flare Gun & add a Security Shell Gun. (#32829)
BramvanZijp Nov 6, 2024
0f5725d
Automatic changelog update
PJBot Nov 6, 2024
9304ee4
Changes to "Burst" firemode; Drozd, WT550 and C20-r (#31292)
SlamBamActionman Nov 6, 2024
1113ac2
Automatic changelog update
PJBot Nov 6, 2024
1c78a6b
AI can now speak once more. (#33196)
ScarKy0 Nov 7, 2024
6e39687
Fixes Lambordeere bolt buttons not being connected (#33065)
PopGamer45 Nov 7, 2024
4425e19
Automatic changelog update
PJBot Nov 7, 2024
93981a2
Fix research disk crash (#33205)
ewokswagger Nov 8, 2024
47d17fd
Fix cursed mask bug (#33014)
FireNameFN Nov 8, 2024
af0c9e6
pass Actor to cartridge messages (#33210)
deltanedas Nov 8, 2024
b1206ef
cham projector fixes/rewrite (#27111)
deltanedas Nov 8, 2024
8ea3ee2
Stable Merge (#33218)
Jezithyr Nov 8, 2024
4cbf1a4
dark green jumpsuit recolor, casual green jumpsuits added (#31710)
Boaz1111 Nov 8, 2024
b56091e
Automatic changelog update
PJBot Nov 8, 2024
493a7cb
Add a Walking alert (#32954)
SlamBamActionman Nov 9, 2024
cf257d9
The Jumpsuit Re-Detailening (#33096)
Flareguy Nov 9, 2024
ca7e827
Intellicards now have a doAfter. (#33198)
ScarKy0 Nov 9, 2024
dce71cf
Automatic changelog update
PJBot Nov 9, 2024
deab51e
Removed bola stam damage (#32989)
ARMOKS Nov 10, 2024
ba4494a
tweak: weather command tooltip (#33130)
IProduceWidgets Nov 10, 2024
a91bc54
Automatic changelog update
PJBot Nov 10, 2024
ae4da78
Goliath rebalance (#31492)
Shaddap1 Nov 10, 2024
26cd83c
Fix vape use without check if doafter cancelled (#33245)
leonidussaks Nov 11, 2024
dbc17f7
HOTFIX: Fix Security Shell Gun being uncraftable. (#33247)
BramvanZijp Nov 11, 2024
0943ded
Make the Flare Gun & Security Shell Gun be unbolted by default. (#33248)
BramvanZijp Nov 11, 2024
0c0d9c2
Automatic changelog update
PJBot Nov 11, 2024
4078532
BUGFIX: Fix APEs being able to be turned on without power (#32493)
AndrewMontagne Nov 11, 2024
a20499a
Automatic changelog update
PJBot Nov 11, 2024
df426f2
Separate CCVars into separate files
Simyon264 Nov 12, 2024
b94731c
improve BiomeDunGen (#33113)
TheShuEd Nov 12, 2024
ecec393
Make Droppers Respect Closed/Sealed Containers (#33011)
thetolbean Nov 12, 2024
7d9e135
Automatic changelog update
PJBot Nov 12, 2024
1a210cf
Allow editing angle of the fired projectile (#33254)
MilenVolf Nov 12, 2024
345cf26
Fix unban/editing role bans placed in groups. (#30659)
Titian3 Nov 12, 2024
862e0b9
Automatic changelog update
PJBot Nov 12, 2024
cbcb60a
Adds new sprites for shotgun shell boxes (#33176)
SpaceRox1244 Nov 12, 2024
b19fdde
Added the ability to microwave inert flesh anomaly cores to turn into…
august-sun Nov 13, 2024
75e1216
Automatic changelog update
PJBot Nov 13, 2024
c0a6ef2
Window sprite tweaks (#33282)
UbaserB Nov 13, 2024
0102431
Automatic changelog update
PJBot Nov 13, 2024
a48bc2d
tag:with toolshed command (#31751)
dffdff2423 Nov 13, 2024
24907ad
Automatic changelog update
PJBot Nov 13, 2024
0fee1b6
Ethereal Jaunt Spell for Wizard & Jaunt ECS (#33201)
keronshb Nov 13, 2024
28057fe
Automatic changelog update
PJBot Nov 13, 2024
2629b07
Update Label workflows to use new labels (#33310)
SlamBamActionman Nov 14, 2024
0fbf77c
Fix mime broken vow alert (#33303)
CheddaCheez Nov 14, 2024
80732e9
Automatic changelog update
PJBot Nov 14, 2024
4aecc67
Borg type switching. (#32586)
PJB3005 Nov 14, 2024
7276706
Automatic changelog update
PJBot Nov 14, 2024
099aca0
change labeler sizes to powers of 2
Nov 15, 2024
ad46ea8
Note expiry time is now relative instead of using timestamps (#33262)
beck-thompson Nov 15, 2024
22a15a2
Automatic changelog update
PJBot Nov 15, 2024
ba20b4a
Prevent Digiboard recycling (#33315)
thetolbean Nov 15, 2024
2d01a15
Automatic changelog update
PJBot Nov 15, 2024
59c9ec5
Command external airlocks (#33333)
UbaserB Nov 15, 2024
bd7df1f
remove our now duplicate command airlocks
Nov 15, 2024
e1ec36a
New ruin variant (#33332)
UbaserB Nov 15, 2024
6367d69
:trollface:
Nov 15, 2024
3d18dae
cvar gaming
Nov 15, 2024
586a09b
fix yml linter
Nov 15, 2024
5ffc9c1
CONFLICT LABELER CONFLICT!!!
Nov 15, 2024
ddf11c8
real
Nov 16, 2024
069a733
Merge branch 'master' into upstream-ops
deltanedas Nov 18, 2024
9d74c06
fix
Nov 20, 2024
3b6c3b5
merge master
Nov 20, 2024
51d8874
merge master
Nov 24, 2024
9977160
change secborg thing so it doesnt log errors
Nov 24, 2024
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
Expand Up @@ -16,6 +16,10 @@ jobs:
- name: Check for Merge Conflicts
uses: eps1lon/[email protected]
with:
<<<<<<< HEAD:.github/workflows/conflict-labeler.yml
dirtyLabel: "Status: Merge Conflict"
=======
dirtyLabel: "S: Merge Conflict"
>>>>>>> 75ec546550 (Update Label workflows to use new labels (#33310)):.github/workflows/labeler-conflict.yml
repoToken: "${{ secrets.GITHUB_TOKEN }}"
commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request."
4 changes: 2 additions & 2 deletions .github/workflows/labeler-needsreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "Status: Needs Review"
labels: "S: Needs Review"
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "Status: Awaiting Changes"
labels: "S: Awaiting Changes"
21 changes: 21 additions & 0 deletions .github/workflows/labeler-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Labels: Size"
on: pull_request_target
jobs:
size-label:
runs-on: ubuntu-latest
steps:
- name: size-label
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
# Custom size configuration
# DeltaV: changed to powers of 4
sizes: >
{
"0": "XS",
"16": "S",
"64": "M",
"256": "L",
"1024": "XL"
}
4 changes: 3 additions & 1 deletion .github/workflows/labeler-untriaged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
on:
issues:
types: [opened]
pull_request_target:
types: [opened]

jobs:
add_label:
Expand All @@ -11,4 +13,4 @@ jobs:
- uses: actions-ecosystem/action-add-labels@v1
if: join(github.event.issue.labels) == ''
with:
labels: "Status: Untriaged"
labels: "S: Untriaged"
1 change: 1 addition & 0 deletions Content.Client/Administration/UI/Notes/NoteEdit.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<Label Name="ExpiryLabel" Text="{Loc admin-note-editor-expiry-label}" Visible="False" />
<HistoryLineEdit Name="ExpiryLineEdit" PlaceHolder="{Loc admin-note-editor-expiry-placeholder}"
Visible="False" HorizontalExpand="True" />
<OptionButton Name="ExpiryLengthDropdown" Visible="False" />
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<OptionButton Name="TypeOption" HorizontalAlignment="Center" />
Expand Down
53 changes: 50 additions & 3 deletions Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ public sealed partial class NoteEdit : FancyWindow
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IClientConsoleHost _console = default!;

private enum Multipliers
{
Minutes,
Hours,
Days,
Weeks,
Months,
Years,
Centuries
}

public event Action<int, NoteType, string, NoteSeverity?, bool, DateTime?>? SubmitPressed;

public NoteEdit(SharedAdminNote? note, string playerName, bool canCreate, bool canEdit)
Expand All @@ -31,6 +42,20 @@ public NoteEdit(SharedAdminNote? note, string playerName, bool canCreate, bool c

ResetSubmitButton();

// It's weird to use minutes as the IDs, but it works and makes sense kind of :)
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-minutes"), (int) Multipliers.Minutes);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-hours"), (int) Multipliers.Hours);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-days"), (int) Multipliers.Days);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-weeks"), (int) Multipliers.Weeks);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-months"), (int) Multipliers.Months);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-years"), (int) Multipliers.Years);
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-centuries"), (int) Multipliers.Centuries);
ExpiryLengthDropdown.OnItemSelected += OnLengthChanged;

ExpiryLengthDropdown.SelectId((int) Multipliers.Weeks);

ExpiryLineEdit.OnTextChanged += OnTextChanged;

TypeOption.AddItem(Loc.GetString("admin-note-editor-type-note"), (int) NoteType.Note);
TypeOption.AddItem(Loc.GetString("admin-note-editor-type-message"), (int) NoteType.Message);
TypeOption.AddItem(Loc.GetString("admin-note-editor-type-watchlist"), (int) NoteType.Watchlist);
Expand Down Expand Up @@ -172,8 +197,9 @@ private void UpdatePermanentCheckboxFields()
{
ExpiryLabel.Visible = !PermanentCheckBox.Pressed;
ExpiryLineEdit.Visible = !PermanentCheckBox.Pressed;
ExpiryLengthDropdown.Visible = !PermanentCheckBox.Pressed;

ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty;
ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? 1.ToString() : string.Empty;
}

private void OnSecretPressed(BaseButton.ButtonEventArgs _)
Expand All @@ -187,6 +213,16 @@ private void OnSeverityChanged(OptionButton.ItemSelectedEventArgs args)
SeverityOption.SelectId(args.Id);
}

private void OnLengthChanged(OptionButton.ItemSelectedEventArgs args)
{
ExpiryLengthDropdown.SelectId(args.Id);
}

private void OnTextChanged(HistoryLineEdit.LineEditEventArgs args)
{
ParseExpiryTime();
}

private void OnSubmitButtonPressed(BaseButton.ButtonEventArgs args)
{
if (!ParseExpiryTime())
Expand Down Expand Up @@ -263,13 +299,24 @@ private bool ParseExpiryTime()
return true;
}

if (string.IsNullOrWhiteSpace(ExpiryLineEdit.Text) || !DateTime.TryParse(ExpiryLineEdit.Text, out var result) || DateTime.UtcNow > result)
if (string.IsNullOrWhiteSpace(ExpiryLineEdit.Text) || !uint.TryParse(ExpiryLineEdit.Text, out var inputInt))
{
ExpiryLineEdit.ModulateSelfOverride = Color.Red;
return false;
}

ExpiryTime = result.ToUniversalTime();
var mult = ExpiryLengthDropdown.SelectedId switch
{
(int) Multipliers.Minutes => TimeSpan.FromMinutes(1).TotalMinutes,
(int) Multipliers.Hours => TimeSpan.FromHours(1).TotalMinutes,
(int) Multipliers.Days => TimeSpan.FromDays(1).TotalMinutes,
(int) Multipliers.Weeks => TimeSpan.FromDays(7).TotalMinutes,
(int) Multipliers.Months => TimeSpan.FromDays(30).TotalMinutes,
(int) Multipliers.Years => TimeSpan.FromDays(365).TotalMinutes,
(int) Multipliers.Centuries => TimeSpan.FromDays(36525).TotalMinutes,
_ => throw new ArgumentOutOfRangeException(nameof(ExpiryLengthDropdown.SelectedId), "Multiplier out of range :(")
};
ExpiryTime = DateTime.UtcNow.AddMinutes(inputInt * mult);
ExpiryLineEdit.ModulateSelfOverride = null;
return true;
}
Expand Down
15 changes: 10 additions & 5 deletions Content.Client/Alerts/ClientAlertsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Alert;
using JetBrains.Annotations;
using Robust.Client.Player;
using Robust.Shared.GameStates;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;

Expand All @@ -24,8 +25,7 @@ public override void Initialize()

SubscribeLocalEvent<AlertsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<AlertsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);

SubscribeLocalEvent<AlertsComponent, AfterAutoHandleStateEvent>(ClientAlertsHandleState);
SubscribeLocalEvent<AlertsComponent, ComponentHandleState>(OnHandleState);
}
protected override void LoadPrototypes()
{
Expand All @@ -47,17 +47,22 @@ public IReadOnlyDictionary<AlertKey, AlertState>? ActiveAlerts
}
}

protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
private void OnHandleState(Entity<AlertsComponent> alerts, ref ComponentHandleState args)
{
if (args.Current is not AlertComponentState cast)
return;

alerts.Comp.Alerts = cast.Alerts;

UpdateHud(alerts);
}

protected override void AfterClearAlert(Entity<AlertsComponent> alerts)
protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
{
UpdateHud(alerts);
}

private void ClientAlertsHandleState(Entity<AlertsComponent> alerts, ref AfterAutoHandleStateEvent args)
protected override void AfterClearAlert(Entity<AlertsComponent> alerts)
{
UpdateHud(alerts);
}
Expand Down
24 changes: 19 additions & 5 deletions Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public override void Initialize()
base.Initialize();

SubscribeLocalEvent<ClothingComponent, GetEquipmentVisualsEvent>(OnGetVisuals);
SubscribeLocalEvent<ClothingComponent, InventoryTemplateUpdated>(OnInventoryTemplateUpdated);

SubscribeLocalEvent<InventoryComponent, VisualsChangedEvent>(OnVisualsChanged);
SubscribeLocalEvent<SpriteComponent, DidUnequipEvent>(OnDidUnequip);
Expand All @@ -70,11 +71,7 @@ private void OnAppearanceUpdate(EntityUid uid, InventoryComponent component, ref
if (args.Sprite == null)
return;

var enumerator = _inventorySystem.GetSlotEnumerator((uid, component));
while (enumerator.NextItem(out var item, out var slot))
{
RenderEquipment(uid, item, slot.Name, component);
}
UpdateAllSlots(uid, component);

// No clothing equipped -> make sure the layer is hidden, though this should already be handled by on-unequip.
if (args.Sprite.LayerMapTryGet(HumanoidVisualLayers.StencilMask, out var layer))
Expand All @@ -84,6 +81,23 @@ private void OnAppearanceUpdate(EntityUid uid, InventoryComponent component, ref
}
}

private void OnInventoryTemplateUpdated(Entity<ClothingComponent> ent, ref InventoryTemplateUpdated args)
{
UpdateAllSlots(ent.Owner, clothing: ent.Comp);
}

private void UpdateAllSlots(
EntityUid uid,
InventoryComponent? inventoryComponent = null,
ClothingComponent? clothing = null)
{
var enumerator = _inventorySystem.GetSlotEnumerator((uid, inventoryComponent));
while (enumerator.NextItem(out var item, out var slot))
{
RenderEquipment(uid, item, slot.Name, inventoryComponent, clothingComponent: clothing);
}
}

private void OnGetVisuals(EntityUid uid, ClothingComponent item, GetEquipmentVisualsEvent args)
{
if (!TryComp(args.Equipee, out InventoryComponent? inventory))
Expand Down
4 changes: 3 additions & 1 deletion Content.Client/Commands/ShowHealthBarsCommand.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Content.Shared.Damage.Prototypes;
using Content.Shared.Overlays;
using Robust.Client.Player;
using Robust.Shared.Console;
using Robust.Shared.Prototypes;
using System.Linq;

namespace Content.Client.Commands;
Expand Down Expand Up @@ -34,7 +36,7 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var showHealthBarsComponent = new ShowHealthBarsComponent
{
DamageContainers = args.ToList(),
DamageContainers = args.Select(arg => new ProtoId<DamageContainerPrototype>(arg)).ToList(),
HealthStatusIcon = null,
NetSyncEnabled = false
};
Expand Down
10 changes: 10 additions & 0 deletions Content.Client/Effects/ColorFlashEffectSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ private void OnColorFlashEffect(ColorFlashEffectEvent ev)
continue;
}

var targetEv = new GetFlashEffectTargetEvent(ent);
RaiseLocalEvent(ent, ref targetEv);
ent = targetEv.Target;

EnsureComp<ColorFlashEffectComponent>(ent, out comp);
comp.NetSyncEnabled = false;
comp.Color = sprite.Color;
Expand All @@ -132,3 +136,9 @@ private void OnColorFlashEffect(ColorFlashEffectEvent ev)
}
}
}

/// <summary>
/// Raised on an entity to change the target for a color flash effect.
/// </summary>
[ByRefEvent]
public record struct GetFlashEffectTargetEvent(EntityUid Target);
16 changes: 15 additions & 1 deletion Content.Client/Inventory/ClientInventorySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,23 @@ public void UIInventoryAltActivateItem(string slot, EntityUid uid)
EntityManager.RaisePredictiveEvent(new InteractInventorySlotEvent(GetNetEntity(item.Value), altInteract: true));
}

protected override void UpdateInventoryTemplate(Entity<InventoryComponent> ent)
{
base.UpdateInventoryTemplate(ent);

if (TryComp(ent, out InventorySlotsComponent? inventorySlots))
{
foreach (var slot in ent.Comp.Slots)
{
if (inventorySlots.SlotData.TryGetValue(slot.Name, out var slotData))
slotData.SlotDef = slot;
}
}
}

public sealed class SlotData
{
public readonly SlotDefinition SlotDef;
public SlotDefinition SlotDef;
public EntityUid? HeldEntity => Container?.ContainedEntity;
public bool Blocked;
public bool Highlighted;
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Overlays/EquipmentHudSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public abstract class EquipmentHudSystem<T> : EntitySystem where T : IComponent
{
[Dependency] private readonly IPlayerManager _player = default!;

[ViewVariables]
protected bool IsActive;
protected virtual SlotFlags TargetSlots => ~SlotFlags.POCKET;

Expand Down Expand Up @@ -102,7 +103,7 @@ protected virtual void OnRefreshComponentHud(EntityUid uid, T component, Refresh
args.Components.Add(component);
}

private void RefreshOverlay(EntityUid uid)
protected void RefreshOverlay(EntityUid uid)
{
if (uid != _player.LocalSession?.AttachedEntity)
return;
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Overlays/ShowHealthBarsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<ShowHealthBarsComponent, AfterAutoHandleStateEvent>(OnHandleState);

_overlay = new(EntityManager, _prototype);
}

private void OnHandleState(Entity<ShowHealthBarsComponent> ent, ref AfterAutoHandleStateEvent args)
{
RefreshOverlay(ent);
}

protected override void UpdateInternal(RefreshEquipmentHudEvent<ShowHealthBarsComponent> component)
{
base.UpdateInternal(component);
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Overlays/ShowHealthIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ public sealed class ShowHealthIconsSystem : EquipmentHudSystem<ShowHealthIconsCo
{
[Dependency] private readonly IPrototypeManager _prototypeMan = default!;

[ViewVariables]
public HashSet<string> DamageContainers = new();

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<DamageableComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
SubscribeLocalEvent<ShowHealthIconsComponent, AfterAutoHandleStateEvent>(OnHandleState);
}

protected override void UpdateInternal(RefreshEquipmentHudEvent<ShowHealthIconsComponent> component)
Expand All @@ -43,6 +45,11 @@ protected override void DeactivateInternal()
DamageContainers.Clear();
}

private void OnHandleState(Entity<ShowHealthIconsComponent> ent, ref AfterAutoHandleStateEvent args)
{
RefreshOverlay(ent);
}

private void OnGetStatusIconsEvent(Entity<DamageableComponent> entity, ref GetStatusIconsEvent args)
{
if (!IsActive)
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Overlays/ShowThirstIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ private void OnGetStatusIconsEvent(EntityUid uid, ThirstComponent component, ref
return;

if (_thirst.TryGetStatusIconPrototype(component, out var iconPrototype))
ev.StatusIcons.Add(iconPrototype!);
ev.StatusIcons.Add(iconPrototype);
}
}
Loading