From 1eb1b118f3dce92d13ab08e7a4178aabe560cad9 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 24 May 2019 13:04:34 +0300 Subject: [PATCH] Fixed: Shield, tools buffs not displayed in tooltip --HG-- branch : patches-from-atys --- .../client/src/interface_v3/dbctrl_sheet.cpp | 33 ++++++++++--------- .../client/src/interface_v3/dbctrl_sheet.h | 3 ++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index 8d76d7606..1b9a7d720 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -1082,6 +1082,20 @@ void CDBCtrlSheet::setupPact() } } +// *************************************************************************** +bool CDBCtrlSheet::useItemInfoForFamily(ITEMFAMILY::EItemFamily family) const +{ + return family == ITEMFAMILY::CRYSTALLIZED_SPELL + || family == ITEMFAMILY::JEWELRY + || family == ITEMFAMILY::ARMOR + || family == ITEMFAMILY::MELEE_WEAPON + || family == ITEMFAMILY::RANGE_WEAPON + || family == ITEMFAMILY::SHIELD + || family == ITEMFAMILY::CRAFTING_TOOL + || family == ITEMFAMILY::HARVEST_TOOL + || family == ITEMFAMILY::TAMING_TOOL + || family == ITEMFAMILY::TRAINING_TOOL; +} // *************************************************************************** void CDBCtrlSheet::setupItem () @@ -3161,11 +3175,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const const CItemSheet *item= asItemSheet(); if(item) { - if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL - || item->Family == ITEMFAMILY::JEWELRY - || item->Family == ITEMFAMILY::ARMOR - || item->Family == ITEMFAMILY::MELEE_WEAPON - || item->Family == ITEMFAMILY::RANGE_WEAPON) + if (useItemInfoForFamily(item->Family)) { string luaMethodName = ( (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip"); CDBCtrlSheet *ctrlSheet = const_cast(this); @@ -3310,11 +3320,7 @@ void CDBCtrlSheet::getContextHelpToolTip(ucstring &help) const const CItemSheet *item = asItemSheet(); if (item) { - if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL - || item->Family == ITEMFAMILY::JEWELRY - || item->Family == ITEMFAMILY::ARMOR - || item->Family == ITEMFAMILY::MELEE_WEAPON - || item->Family == ITEMFAMILY::RANGE_WEAPON) + if (useItemInfoForFamily(item->Family)) { string luaMethodName = (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip"; CDBCtrlSheet *ctrlSheet = const_cast(this); @@ -4469,16 +4475,13 @@ std::string CDBCtrlSheet::getContextHelpWindowName() const if (getType() == CCtrlSheetInfo::SheetType_Item) { const CItemSheet *item= asItemSheet(); - if(item) + if(item && useItemInfoForFamily(item->Family)) { if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) { return "crystallized_spell_context_help"; } - else if (item->Family == ITEMFAMILY::JEWELRY - || item->Family == ITEMFAMILY::ARMOR - || item->Family == ITEMFAMILY::MELEE_WEAPON - || item->Family == ITEMFAMILY::RANGE_WEAPON) + else { return "buff_item_context_help"; } diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.h b/code/ryzom/client/src/interface_v3/dbctrl_sheet.h index 40218f3e1..ac2f2c3aa 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.h +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.h @@ -34,6 +34,7 @@ #include "game_share/skills.h" #include "game_share/slot_types.h" #include "game_share/rm_family.h" +#include "game_share/item_family.h" // #include "../time_client.h" @@ -581,6 +582,8 @@ public: protected: + inline bool useItemInfoForFamily(ITEMFAMILY::EItemFamily family) const; + void setupItem(); void setupPact(); void setupMacro();