Nenue@90: -- Veneer Nenue@90: -- TalkingHead.lua Nenue@90: -- Created: 10/23/2016 5:18 AM Nenue@90: -- %file-revision% Nenue@90: -- Nenue@90: Nenue@90: Nenue@90: local print = DEVIAN_WORKSPACE and function(...) print('VnTalkingHead', ...) end or nop Nenue@90: Nenue@90: VeneerTalkingHeadMixin = { Nenue@90: Nenue@90: anchorPoint = 'BOTTOMLEFT', Nenue@90: anchorFrom = 'TOPLEFT', Nenue@90: anchorX = -4, Nenue@90: anchorY = 24, Nenue@90: anchorFrame = 'ChatFrame1', Nenue@90: addonTrigger = 'Blizzard_TalkingHeadUI' Nenue@90: Nenue@90: } Nenue@93: Nenue@93: local qf = {} Nenue@93: Nenue@93: Nenue@90: function VeneerTalkingHeadMixin:OnLoad() Nenue@90: Veneer:AddHandler(self, self.anchorPoint) Nenue@90: end Nenue@90: Nenue@90: function VeneerTalkingHeadMixin:Setup() Nenue@90: print('|cFF00AAFF'..self:GetName()..'|r:Setup()', TalkingHeadFrame:IsShown(), self:IsShown()) Nenue@90: Nenue@90: self:SetSize(TalkingHeadFrame:GetSize()) Nenue@90: self:SetParent(TalkingHeadFrame) Nenue@90: Nenue@90: hooksecurefunc(TalkingHeadFrame, 'SetPoint', function(...) Nenue@90: print('SetPoint', ...) Nenue@90: print(debugstack()) Nenue@90: end) Nenue@90: Nenue@90: self:SetShown(true) Nenue@90: self:ClearAnchor() Nenue@90: end Nenue@90: Nenue@90: function VeneerTalkingHeadMixin:ClearAnchor() Nenue@90: Nenue@90: UIPARENT_MANAGED_FRAME_POSITIONS["TalkingHeadFrame"] = nil Nenue@90: for i, alertSubSystem in pairs(AlertFrame.alertFrameSubSystems) do Nenue@90: if alertSubSystem.anchorFrame == TalkingHeadFrame then Nenue@90: tremove(AlertFrame.alertFrameSubSystems, i) Nenue@90: return Nenue@90: end Nenue@90: end Nenue@90: end Nenue@90: Nenue@90: function VeneerTalkingHeadMixin:OnShow() Nenue@90: if TalkingHeadFrame then Nenue@90: print('|cFF00AAFF'..self:GetName()..'|r:OnShow()', TalkingHeadFrame:IsShown(), self:IsShown()) Nenue@90: print(debugstack()) Nenue@90: self:Update() Nenue@90: end Nenue@90: end Nenue@90: Nenue@90: function VeneerTalkingHeadMixin:Reanchor() Nenue@90: self:ClearAllPoints() Nenue@90: self:SetPoint('BOTTOMLEFT', _G[self.anchorFrame], 'TOPLEFT', -4, 24) Nenue@90: self:SetPoint('RIGHT', _G[self.anchorFrame], 'RIGHT', 2, 0) Nenue@90: -- independent module, Nenue@90: end Nenue@90: Nenue@90: function VeneerTalkingHeadMixin:OnHide() Nenue@90: if TalkingHeadFrame then Nenue@90: print('|cFF00AAFF'..self:GetName()..'|r:OnHide()', TalkingHeadFrame:IsShown(), self:IsShown()) Nenue@90: end Nenue@90: Veneer:Reanchor() Nenue@90: end Nenue@90: Nenue@90: function VeneerTalkingHeadMixin:Update() Nenue@90: Nenue@90: print('|cFF00AAFF'..self:GetName()..'|r:OnShow()', TalkingHeadFrame:IsShown(), self:IsShown()) Nenue@90: TalkingHeadFrame:ClearAllPoints() Nenue@90: TalkingHeadFrame:SetAllPoints(self) Nenue@90: Nenue@90: Veneer:InternalReanchor(self) Nenue@90: end Nenue@90: