|
|
|
@ -75,52 +75,52 @@ const uint64 NOTIFY_ANIM_MS_DURATION = 1000;
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// **********************************************************************************************************
|
|
|
|
|
class CControlSheetTooltipInfoWaiter : public IItemInfoWaiter
|
|
|
|
|
void CControlSheetInfoWaiter::sendRequest()
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
// The item used to open this window
|
|
|
|
|
CDBCtrlSheet* CtrlSheet;
|
|
|
|
|
string LuaMethodName;
|
|
|
|
|
public:
|
|
|
|
|
ucstring infoValidated(CDBCtrlSheet* ctrlSheet, string luaMethodName);
|
|
|
|
|
virtual void infoReceived();
|
|
|
|
|
};
|
|
|
|
|
static CControlSheetTooltipInfoWaiter ControlSheetTooltipUpdater;
|
|
|
|
|
Requesting = true;
|
|
|
|
|
getInventory().addItemInfoWaiter(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CControlSheetTooltipInfoWaiter::infoReceived()
|
|
|
|
|
void CControlSheetInfoWaiter::infoReceived()
|
|
|
|
|
{
|
|
|
|
|
getInventory().removeItemInfoWaiter(&ControlSheetTooltipUpdater);
|
|
|
|
|
infoValidated(CtrlSheet, LuaMethodName);
|
|
|
|
|
if (!Requesting) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getInventory().removeItemInfoWaiter(this);
|
|
|
|
|
infoValidated();
|
|
|
|
|
CtrlSheet->infoReceived();
|
|
|
|
|
Requesting = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ucstring CControlSheetTooltipInfoWaiter::infoValidated(CDBCtrlSheet* ctrlSheet, string luaMethodName)
|
|
|
|
|
ucstring CControlSheetInfoWaiter::infoValidated() const
|
|
|
|
|
{
|
|
|
|
|
ucstring help;
|
|
|
|
|
|
|
|
|
|
// delegate setup of context he help ( & window ) to lua
|
|
|
|
|
CInterfaceManager *im = CInterfaceManager::getInstance();
|
|
|
|
|
CLuaState *ls= CLuaManager::getInstance().getLuaState();
|
|
|
|
|
if (CtrlSheet && !LuaMethodName.empty())
|
|
|
|
|
{
|
|
|
|
|
CLuaStackRestorer lsr(ls, 0);
|
|
|
|
|
// delegate setup of context he help ( & window ) to lua
|
|
|
|
|
CInterfaceManager *im = CInterfaceManager::getInstance();
|
|
|
|
|
CLuaState *ls= CLuaManager::getInstance().getLuaState();
|
|
|
|
|
{
|
|
|
|
|
CLuaStackRestorer lsr(ls, 0);
|
|
|
|
|
|
|
|
|
|
CLuaIHM::pushReflectableOnStack(*ls, (CReflectableRefPtrTarget *)ctrlSheet);
|
|
|
|
|
ls->pushGlobalTable();
|
|
|
|
|
CLuaObject game(*ls);
|
|
|
|
|
game = game["game"];
|
|
|
|
|
game.callMethodByNameNoThrow(luaMethodName.c_str(), 1, 1);
|
|
|
|
|
CLuaIHM::pushReflectableOnStack(*ls, (CReflectableRefPtrTarget *)CtrlSheet);
|
|
|
|
|
ls->pushGlobalTable();
|
|
|
|
|
CLuaObject game(*ls);
|
|
|
|
|
game = game["game"];
|
|
|
|
|
game.callMethodByNameNoThrow(LuaMethodName.c_str(), 1, 1);
|
|
|
|
|
|
|
|
|
|
// retrieve result from stack
|
|
|
|
|
if (!ls->empty())
|
|
|
|
|
{
|
|
|
|
|
CLuaIHM::pop(*ls, help);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
nlwarning(toString("Ucstring result expected when calling '%s', possible script error", luaMethodName.c_str()).c_str());
|
|
|
|
|
// retrieve result from stack
|
|
|
|
|
if (!ls->empty())
|
|
|
|
|
{
|
|
|
|
|
CLuaIHM::pop(*ls, help);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
nlwarning(toString("Ucstring result expected when calling '%s', possible script error", LuaMethodName.c_str()).c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -137,7 +137,7 @@ int CDBCtrlSheet::luaGetDraggedSheet(CLuaState &ls)
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
int CDBCtrlSheet::luaGetItemInfo(CLuaState &ls)
|
|
|
|
|
{
|
|
|
|
|
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
|
|
|
|
|
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet *>(this);
|
|
|
|
|
uint32 itemSlotId = getInventory().getItemSlotId(ctrlSheet);
|
|
|
|
|
CClientItemInfo itemInfo = getInventory().getItemInfo(itemSlotId);
|
|
|
|
|
|
|
|
|
@ -237,7 +237,6 @@ int CDBCtrlSheet::luaWaitInfo(CLuaState &ls)
|
|
|
|
|
int CDBCtrlSheet::luaBuildCrystallizedSpellListBrick(CLuaState &ls)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
|
|
|
|
|
uint32 itemSlotId= getInventory().getItemSlotId(ctrlSheet);
|
|
|
|
|
CClientItemInfo itemInfo = getInventory().getItemInfo(itemSlotId);
|
|
|
|
@ -505,6 +504,7 @@ CCtrlDraggable(param)
|
|
|
|
|
_Useable= true;
|
|
|
|
|
_GrayedLink= NULL;
|
|
|
|
|
_NeedSetup= true;
|
|
|
|
|
_ItemInfoChanged = true;
|
|
|
|
|
_IconW = 0;
|
|
|
|
|
_IconH = 0;
|
|
|
|
|
_SetupInit= false;
|
|
|
|
@ -528,6 +528,11 @@ CCtrlDraggable(param)
|
|
|
|
|
_ItemRMClassType= NULL;
|
|
|
|
|
_ItemRMFaberStatType= NULL;
|
|
|
|
|
_NotifyAnimEndTime = 0;
|
|
|
|
|
|
|
|
|
|
_HpBuffIcon = "ico_heal.tga";
|
|
|
|
|
_SapBuffIcon = "ico_sap.tga";
|
|
|
|
|
_StaBuffIcon = "ico_stamina.tga";
|
|
|
|
|
_FocusBuffIcon = "ico_focus.tga";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
@ -535,6 +540,11 @@ CDBCtrlSheet::~CDBCtrlSheet()
|
|
|
|
|
{
|
|
|
|
|
NL3D::UDriver *Driver = CViewRenderer::getInstance()->getDriver();
|
|
|
|
|
|
|
|
|
|
if (_ItemInfoWaiter.Requesting)
|
|
|
|
|
{
|
|
|
|
|
getInventory().removeItemInfoWaiter(&_ItemInfoWaiter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_GuildBack)
|
|
|
|
|
{
|
|
|
|
|
if (Driver)
|
|
|
|
@ -613,6 +623,22 @@ bool CDBCtrlSheet::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
|
|
|
|
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"slot" );
|
|
|
|
|
if(prop) _DrawSlot= CInterfaceElement::convertBool(prop);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
_HpBuffIcon = "ico_heal.tga";
|
|
|
|
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"hp_buff_icon" );
|
|
|
|
|
if (prop) _HpBuffIcon = string((const char *)prop);
|
|
|
|
|
|
|
|
|
|
_SapBuffIcon = "ico_sap.tga";
|
|
|
|
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"sap_buff_icon" );
|
|
|
|
|
if (prop) _SapBuffIcon = string((const char *)prop);
|
|
|
|
|
|
|
|
|
|
_StaBuffIcon = "ico_stamina.tga";
|
|
|
|
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"sta_buff_icon" );
|
|
|
|
|
if (prop) _StaBuffIcon = string((const char *)prop);
|
|
|
|
|
|
|
|
|
|
_FocusBuffIcon = "ico_focus.tga";
|
|
|
|
|
prop = (char*) xmlGetProp( cur, (xmlChar*)"focus_buff_icon" );
|
|
|
|
|
if (prop) _FocusBuffIcon = string((const char *)prop);
|
|
|
|
|
|
|
|
|
|
updateActualType();
|
|
|
|
|
// Init size for Type
|
|
|
|
@ -1040,6 +1066,64 @@ void CDBCtrlSheet::updateIconSize()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CDBCtrlSheet::infoReceived()
|
|
|
|
|
{
|
|
|
|
|
if (!_ItemSheet)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const CClientItemInfo *itemInfo = getInventory().getItemInfoCache(getItemSerial(), getItemCreateTime());
|
|
|
|
|
if (itemInfo == NULL)
|
|
|
|
|
{
|
|
|
|
|
// schedule for recheck on next draw()
|
|
|
|
|
_ItemInfoChanged = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// crystallized spell
|
|
|
|
|
{
|
|
|
|
|
_EnchantIcons.clear();
|
|
|
|
|
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
|
|
|
|
CSBrickManager *pBM= CSBrickManager::getInstance();
|
|
|
|
|
for(uint i=0; i<itemInfo->Enchantment.Bricks.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
const CSBrickSheet *brick = pBM->getBrick(itemInfo->Enchantment.Bricks[i]);
|
|
|
|
|
if (brick)
|
|
|
|
|
{
|
|
|
|
|
if (!brick->isRoot() && !brick->isCredit() && !brick->isParameter())
|
|
|
|
|
{
|
|
|
|
|
_EnchantIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(brick->getIcon()), brick->IconColor));
|
|
|
|
|
rVR.getTextureSizeFromId(_EnchantIcons.back().TextureId, _EnchantIcons.back().IconW, _EnchantIcons.back().IconH);
|
|
|
|
|
}
|
|
|
|
|
else if (brick->isRoot())
|
|
|
|
|
{
|
|
|
|
|
// there should be single root icon and it should be first one
|
|
|
|
|
_EnchantIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(brick->getIconBack()), brick->IconBackColor));
|
|
|
|
|
rVR.getTextureSizeFromId(_EnchantIcons.back().TextureId, _EnchantIcons.back().IconW, _EnchantIcons.back().IconH);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// buff icons
|
|
|
|
|
{
|
|
|
|
|
_BuffIcons.clear();
|
|
|
|
|
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
|
|
|
|
|
|
|
|
|
if (itemInfo->HpBuff > 0) _BuffIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(_HpBuffIcon)));
|
|
|
|
|
if (itemInfo->SapBuff > 0) _BuffIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(_SapBuffIcon)));
|
|
|
|
|
if (itemInfo->StaBuff > 0) _BuffIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(_StaBuffIcon)));
|
|
|
|
|
if (itemInfo->FocusBuff > 0) _BuffIcons.push_back(SBuffIcon(rVR.getTextureIdFromName(_FocusBuffIcon)));
|
|
|
|
|
|
|
|
|
|
// update sizes
|
|
|
|
|
for(uint i = 0; i < _BuffIcons.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
rVR.getTextureSizeFromId(_BuffIcons[i].TextureId, _BuffIcons[i].IconW, _BuffIcons[i].IconH);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CDBCtrlSheet::setupPact()
|
|
|
|
@ -1103,6 +1187,7 @@ void CDBCtrlSheet::setupItem ()
|
|
|
|
|
CInterfaceManager *pIM= CInterfaceManager::getInstance();
|
|
|
|
|
|
|
|
|
|
sint32 sheet = _SheetId.getSInt32();
|
|
|
|
|
|
|
|
|
|
// If this is the same sheet, need to resetup
|
|
|
|
|
if (_LastSheetId != sheet || _NeedSetup)
|
|
|
|
|
{
|
|
|
|
@ -1203,6 +1288,9 @@ void CDBCtrlSheet::setupItem ()
|
|
|
|
|
|
|
|
|
|
// Special Item requirement
|
|
|
|
|
updateItemCharacRequirement(_LastSheetId);
|
|
|
|
|
|
|
|
|
|
// update item info markers
|
|
|
|
|
_ItemInfoChanged = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -1277,6 +1365,13 @@ void CDBCtrlSheet::setupItem ()
|
|
|
|
|
_Useable = CSkillManager::getInstance()->checkBaseSkillMetRequirement(_ItemSheet->RequiredSkill, _ItemSheet->RequiredSkillLevel);
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// at each frame, update item info icon if changed
|
|
|
|
|
if (_ItemInfoChanged)
|
|
|
|
|
{
|
|
|
|
|
_ItemInfoChanged = false;
|
|
|
|
|
setupItemInfoWaiter();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2220,6 +2315,69 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
|
|
|
|
|
rVR.draw11RotFlipBitmap (_RenderLayer+1, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOver2Color));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!_BuffIcons.empty())
|
|
|
|
|
{
|
|
|
|
|
// there is max 4 icons
|
|
|
|
|
sint32 hArea = (hSheet / 4);
|
|
|
|
|
sint32 xIcon = x;
|
|
|
|
|
sint32 yIcon = y;
|
|
|
|
|
for (uint i = 0; i < _BuffIcons.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
sint32 wIcon = _BuffIcons[i].IconW;
|
|
|
|
|
sint32 hIcon = _BuffIcons[i].IconH;
|
|
|
|
|
if (hIcon > hArea)
|
|
|
|
|
{
|
|
|
|
|
wIcon = wIcon * ((float)hArea / hIcon);
|
|
|
|
|
hIcon = hArea;
|
|
|
|
|
}
|
|
|
|
|
rVR.drawRotFlipBitmap (_RenderLayer+1, xIcon, yIcon, wIcon, hIcon, 0, false, _BuffIcons[i].TextureId, fastMulRGB(curSheetColor, _BuffIcons[i].Color));
|
|
|
|
|
xIcon += wIcon;
|
|
|
|
|
// move up the row for 3rd/4th icon
|
|
|
|
|
if (i % 3 == 1) {
|
|
|
|
|
xIcon = x;
|
|
|
|
|
yIcon += hIcon;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Is the item enchanted ?
|
|
|
|
|
sint32 enchant = _Enchant.getSInt32();
|
|
|
|
|
if (enchant > 0)
|
|
|
|
|
{
|
|
|
|
|
// Yes draw the additionnal bitmap and the charge (number of enchanted spell we can launch with the enchanted item)
|
|
|
|
|
enchant--;
|
|
|
|
|
rVR.draw11RotFlipBitmap (_RenderLayer+1, x, y, 0, false, rVR.getSystemTextureId(CViewRenderer::ItemEnchantedTexture), curSheetColor);
|
|
|
|
|
drawNumber(x+1, y-2+hSheet-rVR.getFigurTextureH(), wSheet, hSheet, numberColor, enchant, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!_EnchantIcons.empty())
|
|
|
|
|
{
|
|
|
|
|
// should only only 2 icons at most
|
|
|
|
|
// draw them in single line, top-right
|
|
|
|
|
sint32 hArea = (hSheet / 3);
|
|
|
|
|
sint32 xIcon = x + wSheet - 1;
|
|
|
|
|
sint32 yIcon = y + hSheet - 1/* - hArea*/;
|
|
|
|
|
// 0 is expected to be background
|
|
|
|
|
for (uint i = 1; i < _EnchantIcons.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
sint32 wIcon = _EnchantIcons[i].IconW;
|
|
|
|
|
sint32 hIcon = _EnchantIcons[i].IconH;
|
|
|
|
|
if (hIcon > hArea)
|
|
|
|
|
{
|
|
|
|
|
wIcon = wIcon * ((float)hArea / hIcon);
|
|
|
|
|
hIcon = hArea;
|
|
|
|
|
}
|
|
|
|
|
// need to move x before draw because of right aligned
|
|
|
|
|
if (i == 1)
|
|
|
|
|
{
|
|
|
|
|
xIcon -= wIcon;
|
|
|
|
|
}
|
|
|
|
|
yIcon -= hIcon;
|
|
|
|
|
rVR.drawRotFlipBitmap(_RenderLayer + 1, xIcon, yIcon, wIcon, hIcon, 0, false, _EnchantIcons[0].TextureId, fastMulRGB(curSheetColor, _EnchantIcons[0].Color));
|
|
|
|
|
rVR.drawRotFlipBitmap(_RenderLayer+1, xIcon, yIcon, wIcon, hIcon, 0, false, _EnchantIcons[i].TextureId, fastMulRGB(curSheetColor, _EnchantIcons[i].Color));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Draw Quality. -1 for lookandfeel. Draw it with global color
|
|
|
|
|
if (_DispQuality != -1)
|
|
|
|
|
{
|
|
|
|
@ -2242,15 +2400,6 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
|
|
|
|
|
}
|
|
|
|
|
drawNumber(x+1+crossW, y+1, wSheet, hSheet, curSheetColor, quantity, false);
|
|
|
|
|
}
|
|
|
|
|
// Is the item enchanted ?
|
|
|
|
|
sint32 enchant = _Enchant.getSInt32();
|
|
|
|
|
if (enchant > 0)
|
|
|
|
|
{
|
|
|
|
|
// Yes draw the additionnal bitmap and the charge (number of enchanted spell we can launch with the enchanted item)
|
|
|
|
|
enchant--;
|
|
|
|
|
rVR.draw11RotFlipBitmap (_RenderLayer+2, x, y, 0, false, rVR.getSystemTextureId(CViewRenderer::ItemEnchantedTexture), curSheetColor);
|
|
|
|
|
drawNumber(x+1, y-2+hSheet-rVR.getFigurTextureH(), wSheet, hSheet, numberColor, enchant, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if a raw material for example, must add special icon text.
|
|
|
|
|
displayCharBitmaps(_RenderLayer+2, x, y, curSheetColor);
|
|
|
|
@ -3114,6 +3263,53 @@ const COutpostBuildingSheet *CDBCtrlSheet::asOutpostBuildingSheet() const
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CDBCtrlSheet::setupItemInfoWaiter()
|
|
|
|
|
{
|
|
|
|
|
const CItemSheet *item = asItemSheet();
|
|
|
|
|
if(!item)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (!useItemInfoForFamily(item->Family))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (getItemSerial() == 0 || getItemCreateTime() == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
string luaMethodName = ((item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip");
|
|
|
|
|
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
|
|
|
|
|
uint itemSlotId = getInventory().getItemSlotId(ctrlSheet);
|
|
|
|
|
|
|
|
|
|
// Prepare the waiter for tooltips
|
|
|
|
|
_ItemInfoWaiter.ItemSheet= ctrlSheet->getSheetId();
|
|
|
|
|
_ItemInfoWaiter.LuaMethodName = luaMethodName;
|
|
|
|
|
_ItemInfoWaiter.ItemSlotId= itemSlotId;
|
|
|
|
|
_ItemInfoWaiter.CtrlSheet = ctrlSheet;
|
|
|
|
|
|
|
|
|
|
// send out request only if cache is not set
|
|
|
|
|
const CClientItemInfo *itemInfo = getInventory().getItemInfoCache(getItemSerial(), getItemCreateTime());
|
|
|
|
|
if (itemInfo)
|
|
|
|
|
{
|
|
|
|
|
infoReceived();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Using isInventoryPresent/Available() will fail for packers when out of range
|
|
|
|
|
// Getting server item however will work correctly for packer/room/guild
|
|
|
|
|
const CItemImage *itemImage = getInventory().getServerItem(itemSlotId);
|
|
|
|
|
if (itemImage)
|
|
|
|
|
{
|
|
|
|
|
_ItemInfoWaiter.sendRequest();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// schedule for next draw() - if inventory should not be available (ie guild),
|
|
|
|
|
// but user opens it anyway, then this will loop back here on every draw()
|
|
|
|
|
_ItemInfoChanged = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
void CDBCtrlSheet::getContextHelp(ucstring &help) const
|
|
|
|
|
{
|
|
|
|
@ -3177,34 +3373,17 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
|
|
|
|
|
{
|
|
|
|
|
if (useItemInfoForFamily(item->Family))
|
|
|
|
|
{
|
|
|
|
|
string luaMethodName = ( (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip");
|
|
|
|
|
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
|
|
|
|
|
CCtrlBase *ctrlBase = const_cast<CDBCtrlSheet*>(this);
|
|
|
|
|
if ( ! getInventory().isItemInfoUpToDate(getInventory().getItemSlotId(ctrlSheet)))
|
|
|
|
|
{
|
|
|
|
|
// Prepare the waiter
|
|
|
|
|
ControlSheetTooltipUpdater.ItemSheet= ctrlSheet->getSheetId();
|
|
|
|
|
ControlSheetTooltipUpdater.LuaMethodName = luaMethodName;
|
|
|
|
|
ControlSheetTooltipUpdater.ItemSlotId= getInventory().getItemSlotId(ctrlSheet);
|
|
|
|
|
ControlSheetTooltipUpdater.CtrlSheet = ctrlSheet;
|
|
|
|
|
|
|
|
|
|
// Add the waiter
|
|
|
|
|
getInventory().addItemInfoWaiter(&ControlSheetTooltipUpdater);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!_ContextHelp.empty())
|
|
|
|
|
{
|
|
|
|
|
help= _ContextHelp;
|
|
|
|
|
ctrlBase->setDefaultContextHelp(ucstring());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
help = ControlSheetTooltipUpdater.infoValidated(ctrlSheet, luaMethodName);
|
|
|
|
|
// call lua function to update tooltip window
|
|
|
|
|
help = _ItemInfoWaiter.infoValidated();
|
|
|
|
|
}
|
|
|
|
|
else if (!_ContextHelp.empty())
|
|
|
|
|
{
|
|
|
|
|
help = _ContextHelp;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (!_ContextHelp.empty())
|
|
|
|
|
help= _ContextHelp;
|
|
|
|
|
else
|
|
|
|
|
help= getItemActualName();
|
|
|
|
|
{
|
|
|
|
|
help = getItemActualName();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
help= _ContextHelp;
|
|
|
|
@ -3322,21 +3501,7 @@ void CDBCtrlSheet::getContextHelpToolTip(ucstring &help) const
|
|
|
|
|
{
|
|
|
|
|
if (useItemInfoForFamily(item->Family))
|
|
|
|
|
{
|
|
|
|
|
string luaMethodName = (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip";
|
|
|
|
|
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
|
|
|
|
|
if ( ! getInventory().isItemInfoUpToDate(getInventory().getItemSlotId(ctrlSheet)))
|
|
|
|
|
{
|
|
|
|
|
// Prepare the waiter
|
|
|
|
|
ControlSheetTooltipUpdater.ItemSheet= ctrlSheet->getSheetId();
|
|
|
|
|
ControlSheetTooltipUpdater.LuaMethodName = luaMethodName;
|
|
|
|
|
ControlSheetTooltipUpdater.ItemSlotId= getInventory().getItemSlotId(ctrlSheet);
|
|
|
|
|
ControlSheetTooltipUpdater.CtrlSheet = ctrlSheet;
|
|
|
|
|
|
|
|
|
|
// Add the waiter
|
|
|
|
|
getInventory().addItemInfoWaiter(&ControlSheetTooltipUpdater);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
help = ControlSheetTooltipUpdater.infoValidated(ctrlSheet, luaMethodName);
|
|
|
|
|
help = _ItemInfoWaiter.infoValidated();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -3551,6 +3716,10 @@ void CDBCtrlSheet::resetAllTexIDs()
|
|
|
|
|
_Stackable= 1;
|
|
|
|
|
_IconW = 0;
|
|
|
|
|
_IconH = 0;
|
|
|
|
|
|
|
|
|
|
_ItemInfoChanged = true;
|
|
|
|
|
_EnchantIcons.clear();
|
|
|
|
|
_BuffIcons.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|