Hi all,
because this is a period quite calm in game for me now I'd like to take some time to fix, rewrite, or coding better some of my addons
I'd like to ask if this is written well (even if it works
Lua Code:
local ADDON = ...
-- bla bla bla ..
local frame = CreateFrame("FRAME")
frame:RegisterEvent("ZONE_CHANGED_NEW_AREA")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
frame:RegisterEvent("ADDON_LOADED")
frame:SetScript("OnEvent", function(self, event, ...)
if event == "ADDON_LOADED" and ... == ADDON then
-- bla bla bla
elseif event=="COMBAT_LOG_EVENT_UNFILTERED" then
timeStamp, event, _, sourceGUID, sourceName, _, _, destGUID, destName, _, _, prefixParam1, prefixParam2, _, suffixParam1, suffixParam2 = ...
-- bla bla bla
end
what I like to understand if the construct "...==ADDON" is fine ... or I should to get the addon name parsing the ... but it could be expensive.
Or I should create a dedicated frame only for the ADDON_LOADED event and then parse in this way ...
Lua Code:
frame:SetScript("OnEvent", function(self, event, addon)
if event == "ADDON_LOADED" and addon == ADDON then
Thanks .