This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] [BC] [Lua] Options for addon  (Read 677 times)

ninja159

  • Registred Member
  • Race Changer
  • *****
  • Posts: 28
    • View Profile
[QUESTION] [BC] [Lua] Options for addon
« on: May 24, 2016, 06:31:48 pm »
Hello, how i can add status of my custom currency (from DB) to addon, and how i can add list of items to addon, when the player moves the mouse pops up a detailed description of item , thanks for answer
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Nothing is impossible :) TBC is BEST !

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [QUESTION] [BC] [Lua] Options for addon
« Reply #1 on: May 24, 2016, 09:54:20 pm »
Quote from: "ninja159"
Hello, how i can add status of my custom currency (from DB) to addon, and how i can add list of items to addon, when the player moves the mouse pops up a detailed description of item , thanks for answer

Well, for example, to display an item/spell in a tooltip on mouseover of an image in 3.3.5a:

Code: [Select]
local function OnEnterFrame(self, motion)
GameTooltip:Hide()
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
if (self.type == 1) then
GameTooltip:SetHyperlink("spell:"..self.id)
elseif (self.type == 2) then
if (self.gemSpell ~= 0) then
GameTooltip:SetHyperlink("spell:"..self.gemSpell)
else
GameTooltip:SetHyperlink("item:"..self.id)
end
local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType,
itemStackCount, itemEquipLoc, itemTexture, itemSellPrice =
GetItemInfo(self.id)
self:SetBackdrop({bgFile = itemTexture,
edgeFile = "",
tile = false, tileSize = 68, edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 }});
end
GameTooltip:SetFrameLevel(5)
GameTooltip:Show()
end
« Last Edit: January 01, 1970, 01:00:00 am by Admin »