From 1c7016a90b3006fbc75f083902bcd686333ac4c8 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Wed, 27 Aug 2014 10:13:32 +0200 Subject: [PATCH] We only have one event now, no need for the event handler --- Molinari.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Molinari.lua b/Molinari.lua index 6138c0f..c053671 100644 --- a/Molinari.lua +++ b/Molinari.lua @@ -1,7 +1,4 @@ local Molinari = CreateFrame('Button', (...), UIParent, 'SecureActionButtonTemplate, SecureHandlerStateTemplate, AutoCastShineTemplate') -Molinari:SetScript('OnEvent', function(self, event, ...) self[event](self, ...) end) -Molinari:RegisterEvent('PLAYER_LOGIN') - RegisterStateDriver(Molinari, 'visible', '[nomod:alt] hide; show') Molinari:SetAttribute('_onstate-visible', [[ if(newstate == 'hide' and self:IsShown()) then @@ -66,7 +63,8 @@ local function ApplyButton(itemLink, spell, r, g, b) end end -function Molinari:PLAYER_LOGIN() +Molinari:RegisterEvent('PLAYER_LOGIN') +Molinari:SetScript('OnEvent', function(self) local MILLING = GetSpellInfo() local PROSPECTING = GetSpellInfo(31252) local DISENCHANTING = GetSpellInfo(13262) @@ -106,4 +104,4 @@ function Molinari:PLAYER_LOGIN() sparks:SetHeight(sparks:GetHeight() * 3) sparks:SetWidth(sparks:GetWidth() * 3) end -end +end) -- 1.7.9.5