Fixed: Shield, tools buffs not displayed in tooltip

--HG--
branch : patches-from-atys
Nimetu 6 years ago
parent 3b0324ad08
commit 1eb1b118f3

@ -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 () void CDBCtrlSheet::setupItem ()
@ -3161,11 +3175,7 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
const CItemSheet *item= asItemSheet(); const CItemSheet *item= asItemSheet();
if(item) if(item)
{ {
if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL if (useItemInfoForFamily(item->Family))
|| item->Family == ITEMFAMILY::JEWELRY
|| item->Family == ITEMFAMILY::ARMOR
|| item->Family == ITEMFAMILY::MELEE_WEAPON
|| item->Family == ITEMFAMILY::RANGE_WEAPON)
{ {
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);
@ -3310,11 +3320,7 @@ void CDBCtrlSheet::getContextHelpToolTip(ucstring &help) const
const CItemSheet *item = asItemSheet(); const CItemSheet *item = asItemSheet();
if (item) if (item)
{ {
if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL if (useItemInfoForFamily(item->Family))
|| item->Family == ITEMFAMILY::JEWELRY
|| item->Family == ITEMFAMILY::ARMOR
|| item->Family == ITEMFAMILY::MELEE_WEAPON
|| item->Family == ITEMFAMILY::RANGE_WEAPON)
{ {
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);
@ -4469,16 +4475,13 @@ std::string CDBCtrlSheet::getContextHelpWindowName() const
if (getType() == CCtrlSheetInfo::SheetType_Item) if (getType() == CCtrlSheetInfo::SheetType_Item)
{ {
const CItemSheet *item= asItemSheet(); const CItemSheet *item= asItemSheet();
if(item) if(item && useItemInfoForFamily(item->Family))
{ {
if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL)
{ {
return "crystallized_spell_context_help"; return "crystallized_spell_context_help";
} }
else if (item->Family == ITEMFAMILY::JEWELRY else
|| item->Family == ITEMFAMILY::ARMOR
|| item->Family == ITEMFAMILY::MELEE_WEAPON
|| item->Family == ITEMFAMILY::RANGE_WEAPON)
{ {
return "buff_item_context_help"; return "buff_item_context_help";
} }

@ -34,6 +34,7 @@
#include "game_share/skills.h" #include "game_share/skills.h"
#include "game_share/slot_types.h" #include "game_share/slot_types.h"
#include "game_share/rm_family.h" #include "game_share/rm_family.h"
#include "game_share/item_family.h"
// //
#include "../time_client.h" #include "../time_client.h"
@ -581,6 +582,8 @@ public:
protected: protected:
inline bool useItemInfoForFamily(ITEMFAMILY::EItemFamily family) const;
void setupItem(); void setupItem();
void setupPact(); void setupPact();
void setupMacro(); void setupMacro();

Loading…
Cancel
Save