From 7a2608e38c82f803cf974aabe7f9b1437c0cc212 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 5 Aug 2019 13:47:23 +0300 Subject: [PATCH] Fixed: Buff markers visible for icons that does not support them. --HG-- branch : feature-item-icon-buffs --- .../client/src/interface_v3/dbctrl_sheet.cpp | 21 +++++++++++++++++-- .../client/src/interface_v3/dbctrl_sheet.h | 2 ++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index 2d3a6790a..b49df3d2d 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -1066,11 +1066,19 @@ void CDBCtrlSheet::updateIconSize() } } +// *************************************************************************** +void CDBCtrlSheet::clearIconBuffs() +{ + _EnchantIcons.clear(); + _BuffIcons.clear(); +} + // *************************************************************************** void CDBCtrlSheet::infoReceived() { if (!_ItemSheet) { + clearIconBuffs(); return; } @@ -1082,9 +1090,10 @@ void CDBCtrlSheet::infoReceived() return; } + clearIconBuffs(); + // crystallized spell { - _EnchantIcons.clear(); CViewRenderer &rVR = *CViewRenderer::getInstance(); CSBrickManager *pBM= CSBrickManager::getInstance(); for(uint i=0; iEnchantment.Bricks.size(); ++i) @@ -1109,7 +1118,6 @@ void CDBCtrlSheet::infoReceived() // buff icons { - _BuffIcons.clear(); CViewRenderer &rVR = *CViewRenderer::getInstance(); if (itemInfo->HpBuff > 0) _BuffIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(_HpBuffIcon))); @@ -3268,13 +3276,22 @@ void CDBCtrlSheet::setupItemInfoWaiter() { const CItemSheet *item = asItemSheet(); if(!item) + { + clearIconBuffs(); return; + } if (!useItemInfoForFamily(item->Family)) + { + clearIconBuffs(); return; + } if (getItemSerial() == 0 || getItemCreateTime() == 0) + { + clearIconBuffs(); return; + } string luaMethodName = ((item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip"); CDBCtrlSheet *ctrlSheet = const_cast(this); diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.h b/code/ryzom/client/src/interface_v3/dbctrl_sheet.h index 2b12924a5..71c7b670a 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.h +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.h @@ -804,6 +804,8 @@ private: void updateIconSize(); void resetAllTexIDs(); 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 resetCharBitmaps();