From 50b8697c1685a8b5da8ea225f1630e2788c211b8 Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Sat, 10 Aug 2019 01:05:35 -0700 Subject: [PATCH] Fix bad this ref, update event name, and fix enable bug --- DruidBar.lua | 4 ++-- DruidBar.xml | 4 ++-- Options.lua | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/DruidBar.lua b/DruidBar.lua index 1407649..0273090 100644 --- a/DruidBar.lua +++ b/DruidBar.lua @@ -5,7 +5,7 @@ function DruidBar_OnLoad() DruidBarUpdateFrame:RegisterEvent("UNIT_AURA"); DruidBarUpdateFrame:RegisterEvent("UNIT_MAXPOWER"); DruidBarUpdateFrame:RegisterEvent("COMBAT_LOG_EVENT"); - DruidBarUpdateFrame:RegisterEvent("VARIABLES_LOADED"); + DruidBarUpdateFrame:RegisterEvent("ADDON_LOADED"); DruidBarUpdateFrame:RegisterEvent("UNIT_POWER_UPDATE"); DruidBarUpdateFrame:RegisterEvent("INSTANCE_BOOT_STOP"); DruidBarUpdateFrame:RegisterEvent("INSTANCE_BOOT_START"); @@ -53,7 +53,7 @@ function DruidBar_OnEvent(self, event,...) return; end - if event == "VARIABLES_LOADED" then + if event == "ADDON_LOADED" then Load_Variables(className); elseif className and className == "DRUID" and DruidBarKey.Enabled then -- Show DruidBarUpdateFrame if hidden diff --git a/DruidBar.xml b/DruidBar.xml index c0e4cdb..abba531 100644 --- a/DruidBar.xml +++ b/DruidBar.xml @@ -96,9 +96,9 @@ end - if ( this.isMoving ) then + if self.isMoving then self:GetParent():StopMovingOrSizing(); - this.isMoving = false; + self.isMoving = false; end diff --git a/Options.lua b/Options.lua index 5546198..1655d32 100644 --- a/Options.lua +++ b/Options.lua @@ -46,6 +46,9 @@ function DRUIDBAROptions_Toggle() DruidBarKey.Enabled = false; else DruidBarKey.Enabled = true; + -- Show DruidBarUpdateFrame if hidden + -- Incase no other event triggers the redraw, we do this now + if not DruidBarUpdateFrame:IsVisible() then DruidBarUpdateFrame:Show(); end end DRUIDBAR_FrameSet(); end -- 1.7.9.5