Fixed: Buff markers visible for icons that does not support them.

--HG--
branch : feature-item-icon-buffs
hg/atys
Nimetu 6 years ago
parent ba42b50cf0
commit 7a2608e38c

@ -1066,11 +1066,19 @@ void CDBCtrlSheet::updateIconSize()
} }
} }
// ***************************************************************************
void CDBCtrlSheet::clearIconBuffs()
{
_EnchantIcons.clear();
_BuffIcons.clear();
}
// *************************************************************************** // ***************************************************************************
void CDBCtrlSheet::infoReceived() void CDBCtrlSheet::infoReceived()
{ {
if (!_ItemSheet) if (!_ItemSheet)
{ {
clearIconBuffs();
return; return;
} }
@ -1082,9 +1090,10 @@ void CDBCtrlSheet::infoReceived()
return; return;
} }
clearIconBuffs();
// crystallized spell // crystallized spell
{ {
_EnchantIcons.clear();
CViewRenderer &rVR = *CViewRenderer::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance();
CSBrickManager *pBM= CSBrickManager::getInstance(); CSBrickManager *pBM= CSBrickManager::getInstance();
for(uint i=0; i<itemInfo->Enchantment.Bricks.size(); ++i) for(uint i=0; i<itemInfo->Enchantment.Bricks.size(); ++i)
@ -1109,7 +1118,6 @@ void CDBCtrlSheet::infoReceived()
// buff icons // buff icons
{ {
_BuffIcons.clear();
CViewRenderer &rVR = *CViewRenderer::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance();
if (itemInfo->HpBuff > 0) _BuffIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(_HpBuffIcon))); if (itemInfo->HpBuff > 0) _BuffIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(_HpBuffIcon)));
@ -3268,13 +3276,22 @@ void CDBCtrlSheet::setupItemInfoWaiter()
{ {
const CItemSheet *item = asItemSheet(); const CItemSheet *item = asItemSheet();
if(!item) if(!item)
{
clearIconBuffs();
return; return;
}
if (!useItemInfoForFamily(item->Family)) if (!useItemInfoForFamily(item->Family))
{
clearIconBuffs();
return; return;
}
if (getItemSerial() == 0 || getItemCreateTime() == 0) if (getItemSerial() == 0 || getItemCreateTime() == 0)
{
clearIconBuffs();
return; return;
}
string luaMethodName = ((item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip"); string luaMethodName = ((item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip");
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this); CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);

@ -804,6 +804,8 @@ private:
void updateIconSize(); void updateIconSize();
void resetAllTexIDs(); void resetAllTexIDs();
void setupInit(); void setupInit();
// remove enchant and buff markers from item icon
void clearIconBuffs();
void setupCharBitmaps(sint32 maxW, sint32 maxLine, sint32 maxWChar= 1000, bool topDown= false); void setupCharBitmaps(sint32 maxW, sint32 maxLine, sint32 maxWChar= 1000, bool topDown= false);
void resetCharBitmaps(); void resetCharBitmaps();

Loading…
Cancel
Save