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: local print = DEVIAN_WORKSPACE and function(...) print('VnTalkingHead', ...) end or nop Nenue@121: local thf = TalkingHeadFrame Nenue@121: local m = { Nenue@90: Nenue@90: anchorPoint = 'BOTTOMLEFT', Nenue@90: anchorFrom = 'TOPLEFT', Nenue@90: anchorX = -4, Nenue@102: anchorY = 96, Nenue@90: anchorFrame = 'ChatFrame1', Nenue@90: Nenue@90: } Nenue@121: VeneerTalkingHeadMixin = m Nenue@93: Nenue@93: local qf = {} Nenue@93: Nenue@93: Nenue@121: function m:OnLoad() Nenue@90: Veneer:AddHandler(self, self.anchorPoint) Nenue@121: -- force this so we can implant Nenue@121: LoadAddOn('Blizzard_TalkingHeadUI') Nenue@121: thf = TalkingHeadFrame Nenue@90: end Nenue@90: Nenue@121: function m:Setup() Nenue@121: print('|cFF00AAFF'..self:GetName()..'|r:Setup()', thf:IsShown(), self:IsShown()) Nenue@90: Nenue@121: self:SetSize(thf:GetSize()) Nenue@90: Nenue@121: hooksecurefunc(thf, '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@121: function m:ClearAnchor() Nenue@90: Nenue@90: UIPARENT_MANAGED_FRAME_POSITIONS["TalkingHeadFrame"] = nil Nenue@90: for i, alertSubSystem in pairs(AlertFrame.alertFrameSubSystems) do Nenue@121: if alertSubSystem.anchorFrame == thf then Nenue@90: tremove(AlertFrame.alertFrameSubSystems, i) Nenue@90: return Nenue@90: end Nenue@90: end Nenue@90: end Nenue@90: Nenue@121: function m:OnShow() Nenue@121: if thf then Nenue@121: print('|cFF00AAFF'..self:GetName()..'|r:OnShow()', thf:IsShown(), self:IsShown()) Nenue@90: print(debugstack()) Nenue@90: self:Update() Nenue@90: end Nenue@90: end Nenue@90: Nenue@121: function m: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@121: function m:OnHide() Nenue@121: if thf then Nenue@121: print('|cFF00AAFF'..self:GetName()..'|r:OnHide()', thf:IsShown(), self:IsShown()) Nenue@90: end Nenue@90: Veneer:Reanchor() Nenue@90: end Nenue@90: Nenue@121: function m:Update() Nenue@90: Nenue@121: print('|cFF00AAFF'..self:GetName()..'|r:OnShow()', thf:IsShown(), self:IsShown()) Nenue@121: thf:ClearAllPoints() Nenue@121: thf:SetAllPoints(self) Nenue@90: Nenue@90: Veneer:InternalReanchor(self) Nenue@90: end