WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   tried to call the protected function 'OnOpen()' (https://www.wowinterface.com/forums/showthread.php?t=59754)

Ssesmar2 01-06-24 06:06 AM

tried to call the protected function 'OnOpen()'
 
I use this code here so that icons created by my addon can be clicked on different maps (azeroth, continent, zone or instance map).

Lua Code:
  1. function pluginHandler:OnClick(button, pressed, uiMapId, coord)
  2.     if (not pressed) then return end
  3.     if (button == "LeftButton") then
  4.       local mnID = nodes[uiMapId][coord].mnID
  5.       if mnID then
  6.          WorldMapFrame:SetMapID(mnID)
  7.       end
  8.     end
  9. end

This works perfectly, only after you press a symbol of my addon on a map and then call up the map of a dungeon twice and press each time on a boss on the map, I get this error after the second time

Quote:

2x [ADDON_ACTION_FORBIDDEN] AddOn 'test' tried to call the protected function 'OnOpen()'.
[string "@!BugGrabber/BugGrabber.lua"]:481: in function <!BugGrabber/BugGrabber.lua:481>
[string "=[C]"]: in function `OnOpen'
[string "@Blizzard_EncounterJournal/Blizzard_EncounterJournal.lua"]:586: in function <...zzard_EncounterJournal/Blizzard_EncounterJournal.lua:575>
[string "=[C]"]: in function `Show'
[string "@FrameXML/UIParent.lua"]:2938: in function `SetUIPanel'
[string "@FrameXML/UIParent.lua"]:2838: in function `ShowUIPanel'
[string "@FrameXML/UIParent.lua"]:2646: in function <FrameXML/UIParent.lua:2642>
[string "=[C]"]: in function `SetAttribute'
[string "@FrameXML/UIParent.lua"]:3248: in function `ShowUIPanel'
[string "@Blizzard_EncounterJournal/Blizzard_EncounterJournal.lua"]:2390: in function `EncounterJournal_OpenJournal'
[string "@Blizzard_SharedMapDataProviders/EncounterJournalDataProvider.lua"]:145: in function `OnMouseClickAction'
[string "@Blizzard_MapCanvas/MapCanvas_DataProviderBase.lua"]:156: in function `OnClick'
[string "@Blizzard_MapCanvas/Blizzard_MapCanvas.lua"]:154: in function <...aceBlizzard_MapCanvas/Blizzard_MapCanvas.lua:151>

Ssesmar2 01-06-24 09:44 AM

fixed it.
/close


All times are GMT -6. The time now is 08:18 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI