Skip to content
Closed
2 changes: 1 addition & 1 deletion src/game/client/econ/base_loadout_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void CBaseLoadoutPanel::SetBorderForItem( CItemModelPanel *pItemPanel, bool bMou
{
iRarity = pItemPanel->GetItem()->GetItemQuality() ;

uint8 nRarity = pItemPanel->GetItem()->GetItemDefinition()->GetRarity();
uint8 nRarity = pItemPanel->GetItem()->GetRarity(); // FIX: This will ensure that border colors are drawn for War Painted weapons. Item rarities are not stored on base paintkit weapon schema entries
if ( ( nRarity != k_unItemRarity_Any ) && ( iRarity != AE_SELFMADE ) && ( iRarity != AE_UNUSUAL ) )
{
// translate this quality to rarity
Expand Down
7 changes: 5 additions & 2 deletions src/game/client/tf/tf_hud_playerstatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,14 @@ void CTFHudPlayerClass::OnThink()
locchar_t wszLocString [128];

// Construct and set the weapon's name
g_pVGuiLocalize->ConstructString_safe( wszLocString, L"%s1", 1, CEconItemLocalizedFullNameGenerator( GLocalizationProvider(), pItem->GetItemDefinition(), pItem->GetItemQuality() ).GetFullName() );
g_pVGuiLocalize->ConstructString_safe( wszLocString, L"%s1", 1, pItem->GetItemName()); // FIX: Weapons will now display custom names & war paint weapons will display design name
m_pCarryingWeaponPanel->SetDialogVariable( "carrying", wszLocString );

// Get and set the rarity color of the weapon
const char* pszColorName = GetItemSchema()->GetRarityColor( pItem->GetItemDefinition()->GetRarity() );
const char* pszColorName = GetItemSchema()->GetRarityColor( pItem->GetRarity() ); // FIX: War Paint weapons will display color on ground
if (pItem->GetItemQuality() == AE_SELFMADE)
pszColorName = EconQuality_GetColorString(AE_SELFMADE); // Addition for consistency with other economy UI

pszColorName = pszColorName ? pszColorName : "TanLight";
if ( pszColorName )
{
Expand Down
9 changes: 6 additions & 3 deletions src/game/client/tf/tf_hud_target_id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,11 +950,11 @@ void CTargetID::UpdateID( void )
_snwprintf( wszChargeLevel, ARRAYSIZE( wszChargeLevel ) - 1, L"%.0f", pDroppedWeapon->GetChargeLevel() * 100 );
wszChargeLevel[ARRAYSIZE( wszChargeLevel ) - 1] = '\0';

g_pVGuiLocalize->ConstructString_safe( sIDString, L"%s1 (%s2%)", 2, CEconItemLocalizedFullNameGenerator( GLocalizationProvider(), pDroppedEconItem->GetItemDefinition(), pDroppedEconItem->GetItemQuality() ).GetFullName(), wszChargeLevel );
g_pVGuiLocalize->ConstructString_safe(sIDString, L"%s1 (%s2%)", 2, pDroppedEconItem->GetItemName(), wszChargeLevel); //FIX; The previous version of code would only pull data from static schema, which doesn't work with War Paint weapons. Weapons will now display custom names & war paint weapons will display design name
}
else
{
g_pVGuiLocalize->ConstructString_safe( sIDString, L"%s1", 1, CEconItemLocalizedFullNameGenerator( GLocalizationProvider(), pDroppedEconItem->GetItemDefinition(), pDroppedEconItem->GetItemQuality() ).GetFullName() );
g_pVGuiLocalize->ConstructString_safe(sIDString, L"%s1", 1, pDroppedEconItem->GetItemName()); // FIX: Weapons will now display custom names & war paint weapons will display design name
}

locchar_t wszPlayerName [128];
Expand All @@ -969,7 +969,10 @@ void CTargetID::UpdateID( void )
vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( GetScheme() );
if ( pScheme )
{
const char* pszColorName = GetItemSchema()->GetRarityColor( pDroppedEconItem->GetItemDefinition()->GetRarity() );
const char* pszColorName = GetItemSchema()->GetRarityColor( pDroppedEconItem->GetRarity() ); // FIX: War Paint weapons now display color on ground
if (pDroppedEconItem->GetItemQuality() == AE_SELFMADE)
pszColorName = EconQuality_GetColorString(AE_SELFMADE); // Addition for consistency with other economy UI

pszColorName = pszColorName ? pszColorName : "TanLight";
colorName = pScheme->GetColor( pszColorName, Color( 255, 255, 255, 255 ) );
}
Expand Down