master
← Tayrtahn:refactor/examinable-damage
opened 12:44AM - 14 Jul 25 UTC
## About the PR
Refactors `ExaminableDamageComponent` and `ExaminableDamageSy… stem` to clean up some old code and make use of more modern features.
## Why / Balance
The original intent was to remove the prototype caching from `ExaminableDamageComponent`, but a little soap happened along the way.
## Technical details
- `ExaminableDamageComponent` no longer caches its `ExaminableDamagePrototype` (prototype caching is bad).
- `Entity, Component` -> `Entity<T>`
- Replaced convoluted logic for trying to get maximum threshold from `DestructibleComponent` with calling `DestructibleSystem.DestroyedAt`.
- Swapped `ExaminableDamagePrototype` (which just contains an array of LocId strings) in `ExaminableDamageComponent` for a `LocalizedDatasetPrototype`.
- Deleted `ExaminableDamagePrototype`.
## Requirements
- [X] I have read and am following the [Pull Request and Changelog Guidelines](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html).
- [X] I have added media to this PR or it does not require an ingame showcase.
## Breaking changes
- `ExaminableDamageComponent.MessagesProto` has been removed. `ExaminableDamageComponent.Messages` contains the ProtoId which can be indexed by the prototype manager.
- `ExaminableDamagePrototype` has been removed. Use a `LocalizedDatasetPrototype` instead.
Example:
```
- type: examinableDamage
id: WindowMessages
messages:
- comp-window-damaged-1
- comp-window-damaged-2
- comp-window-damaged-3
- comp-window-damaged-4
- comp-window-damaged-5
- comp-window-damaged-6
```
is now:
```
- type: localizedDataset
id: WindowMessages
values:
prefix: comp-window-damaged-
count: 6
```
[Breaking Changes]
ExaminableDamageComponent.MessagesProto
has been removed. ExaminableDamageComponent.Messages
contains the ProtoId which can be indexed by the prototype manager.
ExaminableDamagePrototype
has been removed. Use a LocalizedDatasetPrototype
instead.
Example:
- type: examinableDamage
id: WindowMessages
messages:
- comp-window-damaged-1
- comp-window-damaged-2
- comp-window-damaged-3
- comp-window-damaged-4
- comp-window-damaged-5
- comp-window-damaged-6
is now:
- type: localizedDataset
id: WindowMessages
values:
prefix: comp-window-damaged-
count: 6