I'm trying to pull the weapon DPS out of its tooltip to use for some calculations. Here's my psuedo-code
Code:
xDEP_Tooltip:ClearLines();
xDEP_Tooltip:SetInventoryItem("player", 16)
local textFrame = getglobal(xDEP_Tooltip:GetName() .. "TextLeft" .. 5);
local text = textFrame:GetText();
local mh = string.sub(text, 2,5);
DEFAULT_CHAT_FRAME:AddMessage("MH: " .. mh);
xDEP_Tooltip:Hide()
xDEP_Tooltip:ClearLines();
xDEP_Tooltip:SetInventoryItem("player", 17)
local textFrame = getglobal(xDEP_Tooltip:GetName() .. "TextLeft" .. 5);
text = textFrame:GetText();
local oh = string.sub(text, 2,5);
DEFAULT_CHAT_FRAME:AddMessage("OH: " .. oh);
xDEP_Tooltip:Hide()
And the tooltip code
Code:
<GameTooltip name="xDEP_Tooltip" inherits="GameTooltipTemplate">
<Scripts>
<Onload>
this:SetOwner(this, "ANCHOR_NONE");
</Onload>
</Scripts>
</GameTooltip>
The problem is it doesn't get anything past the first tooltip. So if I call it once It grabs the Main hand, but not the Off hand. Then if I all it again without reloading in between, it doesnt grab anything.
Any help would be much appreciated