Mercurial > wow > buffalo2
diff Modules/WorldState.lua @ 90:6e2cb847c3c6
Implement a mixin template for the basic visual config widgets.
author | Nenue |
---|---|
date | Mon, 24 Oct 2016 18:28:40 -0400 |
parents | 74e714637d6a |
children | caded2668701 |
line wrap: on
line diff
--- a/Modules/WorldState.lua Fri Oct 21 18:03:35 2016 -0400 +++ b/Modules/WorldState.lua Mon Oct 24 18:28:40 2016 -0400 @@ -7,6 +7,11 @@ local WorldStateBlockMixin = {} VeneerOrderHallMixin = { anchorPoint = 'TOP', + anchorFrom = 'TOP', + anchorX = 0, + anchorY = 0, + addonTrigger = 'Blizzard_OrderHallUI', + addonFrame = 'OrderHallCommandBar', } VeneerWorldStateCurrencyMixin = { } @@ -66,8 +71,6 @@ self:RegisterEvent('PLAYER_ENTERING_WORLD') self:RegisterEvent('PLAYER_REGEN_ENABLED') self:RegisterEvent('PLAYER_REGEN_DISABLED') - self:RegisterEvent('ZONE_CHANGED_NEW_AREA') - self:RegisterEvent('ADDON_LOADED') Veneer:AddHandler(self, self.anchorPoint, true) SLASH_VENEERWORLDSTATE1 = "/vws" SLASH_VENEERWORLDSTATE2 = "/worldstate" @@ -78,13 +81,7 @@ function VeneerWorldStateMixin:OnEvent(event, arg) print(event, arg) - if event == 'ZONE_CHANGED_NEW_AREA' or event == 'ADDON_LOADED' then - if OrderHallCommandBar then - self:UnregisterEvent('ZONE_CHANGED_NEW_AREA') - self:UnregisterEvent('ADDON_LOADED') - Veneer:AddHandler(VeneerOrderHallHandler, 'TOP', true) - end - elseif event == 'PLAYER_ENTERING_WORLD' then + if event == 'PLAYER_ENTERING_WORLD' then self:Update() elseif event == 'PLAYER_REGEN_ENABLED' then self:SetShown(true) @@ -149,6 +146,11 @@ self:SetShown(true) end +function VeneerOrderHallMixin:OnLoad() + + Veneer:AddHandler(VeneerOrderHallHandler, 'TOP', true) +end + function VeneerOrderHallMixin:OnEvent(event, ...) print('|cFF00AAFF'..self:GetName()..'|r:'.. event, ...) @@ -156,13 +158,17 @@ end function VeneerOrderHallMixin:OnShow() - print('|cFF00AAFF'..self:GetName()..'|r:OnShow()', OrderHallCommandBar:IsShown(), self:IsShown()) - self:Update() + if OrderHallCommandBar then + print('|cFF00AAFF'..self:GetName()..'|r:OnShow()', OrderHallCommandBar:IsShown(), self:IsShown()) + self:Update() + end Veneer:InternalReanchor(self) end function VeneerOrderHallMixin:OnHide() - print('|cFF00AAFF'..self:GetName()..'|r:OnHide()', OrderHallCommandBar:IsShown(), self:IsShown()) + if OrderHallCommandBar then + print('|cFF00AAFF'..self:GetName()..'|r:OnHide()', OrderHallCommandBar:IsShown(), self:IsShown()) + end Veneer:Reanchor() end