View Single Post
04-30-18, 09:14 AM   #24
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
My Vignette addon stopped working. The event VIGNETTE_ADDED is nowhere to be found. Is there a new system for rare mob icons on the minimap? If so how can it be accessed?

Lua Code:
  1. local function OnVignetteAdded(self,event,id)
  2.   if not id then return end
  3.   self.vignettes = self.vignettes or {}
  4.   if self.vignettes[id] then return end
  5.   local x, y, name, icon = C_Vignettes.GetVignetteInfoFromInstanceID(id)
  6.   local left, right, top, bottom = GetObjectIconTextureCoords(icon)
  7.   PlaySoundFile("Sound\\Interface\\RaidWarning.ogg")
  8.   local str = "|TInterface\\MINIMAP\\ObjectIconsAtlas:0:0:0:0:256:256:"..(left*256)..":"..(right*256)..":"..(top*256)..":"..(bottom*256).."|t"
  9.   RaidNotice_AddMessage(RaidWarningFrame, str..name.." spotted!", ChatTypeInfo["RAID_WARNING"])
  10.   print(str..name,"spotted!")
  11.   self.vignettes[id] = true
  12. end
  13.  
  14. --eventHandler
  15. local eventHandler = CreateFrame("Frame")
  16. eventHandler:RegisterEvent("VIGNETTE_ADDED")
  17. eventHandler:SetScript("OnEvent", OnVignetteAdded)
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote