View Single Post
11-24-22, 01:56 PM   #4
fatrog
A Fallenroot Satyr
Join Date: Nov 2022
Posts: 21
Hey, thank you,
I should have known that I had to check patch changes >,< my bad..

Lua Code:
  1. local function GetDisplayGCDInfos(tt)
  2.     gcdMS, cooldownMS, spellName, spellName, spellID, itemName, ItemLink = nil
  3.     spellName, spellID = tt:GetSpell()
  4.     itemName, ItemLink = tt:GetItem()
  5.     if spellID ~= nil then
  6.        cooldownMS, gcdMS = GetSpellBaseCooldown(spellID)
  7.        print("ID:"..gcdMS)
  8.     elseif itemName ~= nil then
  9.        spellName, spellID = GetItemSpell(ItemLink)
  10.        cooldownMS, gcdMS = GetSpellBaseCooldown(spellID)
  11.        print("spell from item link:"..gcdMS)
  12.     else
  13.        -- MACRO WAS HERE
  14.        spellName = _G[tt:GetName().."TextLeft"..1]:GetText()
  15.        _,_,_,_,_,_,spellID = GetSpellInfo(spellName)
  16.        cooldownMS, gcdMS = GetSpellBaseCooldown(spellID)
  17.        print("spell with no ID:"..gcdMS)
  18.     end
  19.     gcdMS = round(gcdMS / 1000,2)
  20.     gcdText = ""
  21.     gcdText = "GCD "..gcdMS.."sec"
  22.     tt:AddLine(gcdText,1,1,1)
  23. end
  24.  
  25. TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Spell, GetDisplayGCDInfos)
  26. TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, GetDisplayGCDInfos)

Only thing, how do I check "other" types? I mean, since onshow was global, it worked on macros with showtooltip in it (I marked the line in my code above). I can't find where there's a list of types in the patch changes?
  Reply With Quote