Originally Posted by
SpaceDuck
Try this:
Code:
local frame = CreateFrame("FRAME");
function frame:OnEvent(self, event, ...)
if (event == "BONUS_ROLL_RESULT") then
local rewardType = ...;
if rewardType == "artifact_power" then
ForceQuit()
end
end
end
frame:RegisterEvent("BONUS_ROLL_RESULT");
I think you meant:
Code:
local frame = CreateFrame("FRAME");
function frame:OnEvent(self, event, ...)
if (self == "BONUS_ROLL_RESULT") then
local rewardType = event;
if rewardType == "artifact_power" then
ForceQuit()
end
end
end
frame:SetScript("OnEvent", frame.OnEvent);
frame:RegisterEvent("BONUS_ROLL_RESULT");
I'll let you figure out yourself why this would work, but what you posted wouldn't. It has something to do with explicit method declarations and syntactic sugar.