Adjust durability indications in item/part repair messages #30167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Interface "Adjust durability indications in item/part repair messages"
Purpose of change
When repairing an item or a vehicle part, the game uses the name of the part from before the operation completed, meaning the durability indicator (both symbol and color) was for the durability state before the repair attempt.
This results in odd feedback, such as being informed that you fully repaired an object, but the name shows
|\
for its durability, despite clearly having been restored to full durability.Describe the solution
Adjusted sequencing of durability update logic such that the durability is changed before the part name is printed, so that the message log reflects the new state of the object rather than the old state of the object.
In the process of working on that, I added support for the destroyed (
XX
) state for items, to allow printing item names that were destroyed in the process of a repair attempt.Since this provided functionality previously only used for vehicles, I was able to remove some vehicle-specific logic surrounding durability symbol/color.
Bonus: the message output for repairing vehicle parts now distinguishes between repairs and replacements.
Describe alternatives you've considered
I considered learning to live with misleading output, but it's simply not in my nature.
Additional context
Before and after for item repairs:
'Repairing' an object to destruction:
Before and after for vehicle repairs:
Message log output for a part that was fully destroyed yet not retained on the vehicle in the broken state:
Examples of repair-vs-replace for vehicles: