Skip to content

Commit a92387a

Browse files
committed
1 parent 6abaf1f commit a92387a

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

game/quiver/info_changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ Added the following Source SDK Pull Requests:
9898
- #1554: Add parameter for getpos/spec_pos to copy output to clipboard
9999
- #1556: Fix unspawned support wavespawns not giving their money
100100
- #1555: Sentry fixes for Exorcism spell
101+
- #1558: Fix spelled cosmetics not changing colors in backpack.
102+
- #1559: Fix Team Spirit Footprints BLU team coloring
101103

102104
Details:
103105
- Fixed a bug where the mini-crit damage effect doesn't show up when your shield breaks.

src/game/client/econ/item_model_panel.cpp

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3147,6 +3147,12 @@ void CItemModelPanel::UpdatePanels( void )
31473147
int iRGB0 = m_ItemData.GetModifiedRGBValue( false ),
31483148
iRGB1 = m_ItemData.GetModifiedRGBValue( true );
31493149

3150+
#ifdef BDSBASE
3151+
if (!bIsEconTool)
3152+
{
3153+
DrawPaintImage(iRGB0, iRGB1);
3154+
}
3155+
#else
31503156
if ( !bIsEconTool && (iRGB0 != 0 || iRGB1 != 0))
31513157
{
31523158
m_pPaintIcon->SetVisible( true );
@@ -3156,6 +3162,7 @@ void CItemModelPanel::UpdatePanels( void )
31563162
m_pPaintIcon->m_colPaintColors.AddToTail( Color( clamp( (iRGB1 & 0xFF0000) >> 16, 0, 255 ), clamp( (iRGB1 & 0xFF00) >> 8, 0, 255 ), clamp( (iRGB1 & 0xFF), 0, 255 ), 255 ) );
31573163
}
31583164
}
3165+
#endif
31593166
}
31603167
}
31613168

@@ -3409,19 +3416,68 @@ void CItemModelPanel::SetModelIsHidden( bool bHideModel )
34093416
}
34103417
}
34113418

3419+
#ifdef BDSBASE
3420+
void CItemModelPanel::DrawPaintImage(int iRGB0, int iRGB1)
3421+
{
3422+
if (iRGB0 != 0 || iRGB1 != 0)
3423+
{
3424+
m_pPaintIcon->SetVisible(true);
3425+
m_pPaintIcon->m_colPaintColors.AddToTail(Color(clamp((iRGB0 & 0xFF0000) >> 16, 0, 255), clamp((iRGB0 & 0xFF00) >> 8, 0, 255), clamp((iRGB0 & 0xFF), 0, 255), 255));
3426+
if (iRGB0 != iRGB1)
3427+
{
3428+
m_pPaintIcon->m_colPaintColors.AddToTail(Color(clamp((iRGB1 & 0xFF0000) >> 16, 0, 255), clamp((iRGB1 & 0xFF00) >> 8, 0, 255), clamp((iRGB1 & 0xFF), 0, 255), 255));
3429+
}
3430+
}
3431+
}
3432+
3433+
static CSchemaAttributeDefHandle pAttrDef_SpellColor("SPELL: set item tint RGB");
3434+
#endif
3435+
34123436
void CItemModelPanel::OnTick()
34133437
{
34143438
bool bStillWorking = LoadData();
3439+
#ifdef BDSBASE
3440+
if (m_pContainedItemPanel && bLoadingData)
3441+
#else
34153442
if ( m_pContainedItemPanel )
3443+
#endif
34163444
{
34173445
bStillWorking |= m_pContainedItemPanel->LoadData();
34183446
}
34193447

3448+
#ifdef BDSBASE
3449+
// If we're done working, lets check if the item is spelled and can change colors!
3450+
// If it is not, lets stop ticking the panel and act like normal.
3451+
if (!bStillWorking)
3452+
{
3453+
bLoadingData = false;
3454+
if (!pAttrDef_SpellColor || !m_ItemData.FindAttribute(pAttrDef_SpellColor))
3455+
{
3456+
RemovePanelTick();
3457+
}
3458+
else if (m_pPaintIcon)
3459+
{
3460+
if (!m_bHideModel && !m_bHidePaintIcon)
3461+
{
3462+
// Empty out our list of paint colors. We may or may not put things back in -- an empty
3463+
// list at the end means "don't draw the paint icon".
3464+
m_pPaintIcon->m_colPaintColors.RemoveAll();
3465+
3466+
// Has the item been painted?
3467+
int iRGB0 = m_ItemData.GetModifiedRGBValue(false),
3468+
iRGB1 = m_ItemData.GetModifiedRGBValue(true);
3469+
3470+
DrawPaintImage(iRGB0, iRGB1);
3471+
}
3472+
}
3473+
}
3474+
#else
34203475
// If we're done working, we dont need to tick anymore
34213476
if ( !bStillWorking )
34223477
{
34233478
LoadDataCompleted();
34243479
}
3480+
#endif
34253481

34263482
BaseClass::OnTick();
34273483
}
@@ -3529,7 +3585,11 @@ bool CItemModelPanel::LoadData()
35293585
return bStillWorking;
35303586
}
35313587

3588+
#ifdef BDSBASE
3589+
void CItemModelPanel::RemovePanelTick()
3590+
#else
35323591
void CItemModelPanel::LoadDataCompleted()
3592+
#endif
35333593
{
35343594
vgui::ivgui()->RemoveTickSignal( GetVPanel() );
35353595
}

src/game/client/econ/item_model_panel.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,11 @@ class CItemModelPanel : public vgui::EditablePanel
224224
virtual void OnTick() OVERRIDE;
225225
void SetNeedsToLoad();
226226
bool LoadData();
227+
#ifdef BDSBASE
228+
void RemovePanelTick();
229+
#else
227230
void LoadDataCompleted();
231+
#endif
228232

229233
CExLabel *GetNameLabel( void ) { return m_pItemNameLabel; }
230234

@@ -290,6 +294,11 @@ class CItemModelPanel : public vgui::EditablePanel
290294
void UpdateEquippedLabel( void );
291295
void CleanupNoItemWChars( void );
292296

297+
#ifdef BDSBASE
298+
bool bLoadingData = true;
299+
void DrawPaintImage(int iRGB0, int iRGB1);
300+
#endif
301+
293302
bool UpdateSeriesLabel();
294303
bool UpdateMatchesLabel();
295304
bool UpdateQuantityLabel();

0 commit comments

Comments
 (0)