Delta-v/Content.Client/Overlays
Pieter-Jan Briers b7f297f612 Fix usages of TryIndex() (#39124)
* Fix usages of TryIndex()

Most usages of TryIndex() were using it incorrectly. Checking whether prototype IDs specified in prototypes actually existed before using them. This is not appropriate as it's just hiding bugs that should be getting caught by the YAML linter and other tools. (#39115)

This then resulted in TryIndex() getting modified to log errors (94f98073b0), which is incorrect as it causes false-positive errors in proper uses of the API: external data validation. (#39098)

This commit goes through and checks every call site of TryIndex() to see whether they were correct. Most call sites were replaced with the new Resolve(), which is suitable for these "defensive programming" use cases.

Fixes #39115

Breaking change: while doing this I noticed IdCardComponent and related systems were erroneously using ProtoId<AccessLevelPrototype> for job prototypes. This has been corrected.

* fix tests

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2025-12-29 11:39:03 -06:00
..
BlackAndWhiteOverlay.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
BlackAndWhiteOverlaySystem.cs improve noir glasses shader (#37996) 2025-08-06 23:31:27 +02:00
EntityHealthBarOverlay.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
EquipmentHudSystem.cs Adds Skia (σκιά, shade) as a Midround Antagonist (#4152) 2025-09-01 08:46:23 +00:00
NoirOverlay.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
NoirOverlaySystem.cs improve noir glasses shader (#37996) 2025-08-06 23:31:27 +02:00
ShowCriminalRecordIconsSystem.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
ShowHealthBarsSystem.cs make RefreshOverlay default to the player session (#32354) 2025-02-14 16:09:48 +00:00
ShowHealthIconsSystem.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
ShowHungerIconsSystem.cs Cleans up StatusIconSystem and fixing some bugs (#28270) 2024-06-08 19:59:10 +02:00
ShowJobIconsSystem.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
ShowMindShieldIconsSystem.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
ShowSyndicateIconsSystem.cs Add tooltips to the agent ID job icons and improve status icon prototypes (#28575) 2024-08-09 19:17:05 +01:00
ShowThirstIconsSystem.cs Hunger and thirst huds fix (#32832) 2024-11-15 17:28:49 +00:00
StencilOverlay.RestrictedRange.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
StencilOverlay.Weather.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
StencilOverlay.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
StencilOverlaySystem.cs Replace obsolete GetTilesIntersecting methods (#32455) 2024-12-07 21:55:22 +00:00