View Single Post
08-29-11, 06:22 PM   #20
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by dreamcatcher View Post
Ok well I'm confused. The option to show or hide micro names from the gui is working but only if i do a reload after selecting it in the gui.
Why are you hooking 'ActionButton_Update' twice? I'd hook it once, call Style() function from the hook, and call Style() function in UpdateStuff()

Code:
function UpdateActionButtonStyle()
    for _, icon in pairs({
        self:GetName(),
        'MultiCastRecallSpellButton',
        'MultiCastSummonSpellButton',
    }) do
        local macroname = _G[self:GetName()..'Name']
        if (db.HideMacronames) then
            macroname:SetAlpha(0)
        end
    end
end

function DreamTweaks:UpdateStuff()
	UpdateActionButtonStyle()
	-- etc
end

function StickThisIntoAFunctionSomewhere()
	hooksecurefunc("ActionButton_Update", UpdateActionButtonStyle)
end
  Reply With Quote