Delta-v/Content.Client/Lobby/UI
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
..
Loadouts Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
Roles Give jobs & antags prototypes a guide field (#28614) 2024-07-13 04:20:47 +02:00
CharacterPickerButton.xaml Make CharacterPickerButton the same height for dwarves as for non-dwarves (#35297) 2025-03-01 13:42:31 +00:00
CharacterPickerButton.xaml.cs Add Job preference tests (#28625) 2024-06-08 20:19:39 +02:00
CharacterSetupGui.xaml Add admin remarks button to lobby (#31761) 2024-12-07 15:43:42 +00:00
CharacterSetupGui.xaml.cs Add admin remarks button to lobby (#31761) 2024-12-07 15:43:42 +00:00
CharacterSetupGuiSavePanel.xaml Character menu asks if you want to save your character on exit (#29875) 2024-08-09 17:38:31 +01:00
CharacterSetupGuiSavePanel.xaml.cs Character menu asks if you want to save your character on exit (#29875) 2024-08-09 17:38:31 +01:00
HighlightedContainer.xaml Lobby refactor + species loadouts support (#27576) 2024-05-18 13:55:56 +02:00
HighlightedContainer.xaml.cs Lobby refactor + species loadouts support (#27576) 2024-05-18 13:55:56 +02:00
HumanoidProfileEditor.xaml Unhide the height slider in the humanoid profile editor (#3304) 2025-03-24 20:52:03 +00:00
HumanoidProfileEditor.xaml.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
LobbyCharacterPreviewPanel.xaml Partial cherry-pick: Loadouts redux (#25715) 2024-04-22 03:28:58 +02:00
LobbyCharacterPreviewPanel.xaml.cs Power stuff (#31314) 2024-08-27 01:00:42 +01:00
LobbyGui.xaml Playtime Reminders - Raising awareness of addiction by highlighting excessive playtime (#36483) 2025-08-07 19:33:32 +02:00
LobbyGui.xaml.cs Add collapse button to lobby right panel (#37140) 2025-05-18 16:51:33 +01:00
ObserveWarningWindow.xaml Fix late join & observe to de-admin admins. (#28319) 2024-06-01 17:18:14 +02:00
ObserveWarningWindow.xaml.cs Fix late join & observe to de-admin admins. (#28319) 2024-06-01 17:18:14 +02:00