From 924b58a92d276bafcee888499734899103b48e54 Mon Sep 17 00:00:00 2001 From: shagu Date: Wed, 20 Sep 2017 21:56:53 +0200 Subject: [PATCH] unitframes: abort after complete frame creation --- api/unitframes.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 85d19d6d..36411b35 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -71,11 +71,6 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick) f.config = config or pfUI_config.unitframes.fallback f.tick = tick - if f.config.visible ~= "1" then - f:Hide() - return f - end - f:SetFrameStrata("BACKGROUND") f.hp = CreateFrame("Frame",nil, f) @@ -166,6 +161,11 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick) f.powerCenterText:SetPoint("TOPLEFT",f.power.bar, "TOPLEFT", 2*default_border, 1) f.powerCenterText:SetPoint("BOTTOMRIGHT",f.power.bar, "BOTTOMRIGHT", -2*default_border, 0) + if f.config.visible ~= "1" then + f:Hide() + return f + end + f:RegisterForClicks('LeftButtonUp', 'RightButtonUp', 'MiddleButtonUp', 'Button4Up', 'Button5Up')