[TF2] Added option to display owned weapons' name/strange count in Player Status HUD #1787
+92
−21
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.
Resolves ValveSoftware/Source-1-Games#4608
This PR aims to add additional functionality to the Player Status HUD via a new convar (cl_hud_playerclass_display_weapon_info, default = 0).
When enabled (value = 1), the Player Status HUD will display the item name underneath the player portrait (similar to when picking up a dropped weapon). This function differs from the one used for dropped weapons and supports more detailed names:

'Dropped by' portion of UI has been retooled for player's own weapons to display primary Strange count (when one is available). Code dynamically pulls localized string token to support other languages:

PR has been tested in community modes with custom weapons (Zombie Infection, VSH):

Feature has been disabled in Mann vs Machine due to conflicts with existing UI (image below is image of weapon info UI if kept visible in MvM)

Known issue is that weapon info panel is known to conflict with the Killstreak meter if an item has a long enough name:

A similar issue can currently be experienced when inspecting dropped weapons.
If constructed item name is too long for your liking, replace pItem->GetItemName() with CEconItemLocalizedFullNameGenerator(GLocalizationProvider(), pItem->GetItemDefinition(), pItem->GetItemQuality()).GetFullName()