Skip to content

#showtooltip doesn't work for item. #89

Description

@Guillaume77
function Roids.FindItem(itemName)
    RoidsTooltip:SetOwner(WorldFrame, "ANCHOR_NONE");
    for i = 0, 4 do
        for j = 1, GetContainerNumSlots(i) do
            RoidsTooltip:ClearLines();
            RoidsTooltip:SetBagItem(i, j);
            if RoidsTooltipTextLeft1:GetText() == itemName then
                return i, j;
            end
        end
    end
    
    for i = 0, 19 do
        RoidsTooltip:ClearLines();
        hasItem = RoidsTooltip:SetInventoryItem("player", i);
        
        if hasItem and RoidsTooltipTextLeft1:GetText() == itemName then
            return -i;
        end
    end
end

trying to call Roids.FindItem return a nil value (for example; setting a "#showtooltip " of an item in bag return nil value in game)

It seems that putting that function at the end of Utility.lua resolve the problem (must be a global calling problem)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions