Mercurial > wow > buffalo2
comparison Modules/TalkingHead.lua @ 123:b3c0258b419d v7.3.0-1
ArtifactPower:
- XP progress bar fixes
Currency:
- More argus stuff
- Block dimensions are calculated more consistently
TalkingHead
- Aesthetic changes
- Default right-click behaviour restored (hides the text box)
author | Nenue |
---|---|
date | Tue, 05 Sep 2017 02:56:33 -0400 |
parents | ea2c616a3b4f |
children |
comparison
equal
deleted
inserted
replaced
122:ea2c616a3b4f | 123:b3c0258b419d |
---|---|
5 -- | 5 -- |
6 | 6 |
7 local FRAME_PADDING = 2 | 7 local FRAME_PADDING = 2 |
8 | 8 |
9 local print = DEVIAN_WORKSPACE and function(...) print('VnTalkingHead', ...) end or nop | 9 local print = DEVIAN_WORKSPACE and function(...) print('VnTalkingHead', ...) end or nop |
10 local thf = TalkingHeadFrame | 10 local thf |
11 local m = { | 11 local m = { |
12 | 12 |
13 anchorPoint = 'TOPLEFT', | 13 anchorPoint = 'TOPLEFT', |
14 anchorFrom = 'TOPLEFT', | 14 anchorFrom = 'TOPLEFT', |
15 anchorX = 0, | 15 anchorX = 0, |
22 local qf = {} | 22 local qf = {} |
23 | 23 |
24 | 24 |
25 function m:OnLoad() | 25 function m:OnLoad() |
26 Veneer:AddHandler(self, self.anchorPoint) | 26 Veneer:AddHandler(self, self.anchorPoint) |
27 -- force this so we can implant | |
28 LoadAddOn('Blizzard_TalkingHeadUI') | 27 LoadAddOn('Blizzard_TalkingHeadUI') |
29 thf = TalkingHeadFrame | 28 thf = TalkingHeadFrame |
30 end | 29 end |
31 | 30 |
32 function m:Setup() | 31 function m:Setup() |
33 print('|cFF00AAFF'..self:GetName()..'|r:Setup()', thf:IsShown(), self:IsShown()) | 32 print('|cFF00AAFF'..self:GetName()..'|r:Setup()', thf:IsShown(), self:IsShown()) |
34 | 33 |
35 self:SetSize(thf:GetSize()) | |
36 | 34 |
37 --hooksecurefunc(thf, 'SetPoint', function(...) | 35 --hooksecurefunc(thf, 'SetPoint', function(...) |
38 -- print('SetPoint', ...) | 36 -- print('SetPoint', ...) |
39 -- print(debugstack()) | 37 -- print(debugstack()) |
40 --end) | 38 --end) |
41 | 39 |
42 | |
43 self.Name:SetAllPoints(thf.NameFrame.Name) | 40 self.Name:SetAllPoints(thf.NameFrame.Name) |
44 self.Text:SetAllPoints(thf.TextFrame.Text) | 41 self.Text:SetAllPoints(thf.TextFrame.Text) |
45 self.Portrait:SetAllPoints(thf.PortraitFrame.Portrait) | 42 self.Portrait:SetAllPoints(thf.PortraitFrame.Portrait) |
43 self:SetSize(thf:GetSize()) | |
46 | 44 |
47 self:ApplySettings() | 45 self:ApplySettings() |
48 | 46 |
49 self:SetShown(true) | 47 self:SetShown(true) |
50 self:ClearAnchor() | 48 self:ClearAnchor() |
51 end | 49 end |
52 | 50 |
53 function m:ApplySettings() | 51 function m:ApplySettings() |
52 if not thf then | |
53 return | |
54 end | |
54 | 55 |
55 thf.NameFrame.Name:ClearAllPoints() | 56 thf.NameFrame.Name:ClearAllPoints() |
56 thf.TextFrame.Text:ClearAllPoints() | 57 thf.TextFrame.Text:ClearAllPoints() |
57 thf.PortraitFrame.Portrait:ClearAllPoints() | 58 thf.PortraitFrame.Portrait:ClearAllPoints() |
58 | 59 |
76 thf:SetAllPoints(self) | 77 thf:SetAllPoints(self) |
77 | 78 |
78 end | 79 end |
79 | 80 |
80 function m:ClearAnchor() | 81 function m:ClearAnchor() |
82 if not thf then | |
83 return | |
84 end | |
81 | 85 |
82 UIPARENT_MANAGED_FRAME_POSITIONS["TalkingHeadFrame"] = nil | 86 UIPARENT_MANAGED_FRAME_POSITIONS["TalkingHeadFrame"] = nil |
83 for i, alertSubSystem in pairs(AlertFrame.alertFrameSubSystems) do | 87 for i, alertSubSystem in pairs(AlertFrame.alertFrameSubSystems) do |
84 if alertSubSystem.anchorFrame == thf then | 88 if alertSubSystem.anchorFrame == thf then |
85 tremove(AlertFrame.alertFrameSubSystems, i) | 89 tremove(AlertFrame.alertFrameSubSystems, i) |
109 end | 113 end |
110 Veneer:Reanchor() | 114 Veneer:Reanchor() |
111 end | 115 end |
112 | 116 |
113 function m:Update() | 117 function m:Update() |
118 if not thf then | |
119 return | |
120 end | |
114 | 121 |
115 Veneer:InternalReanchor(self) | 122 Veneer:InternalReanchor(self) |
116 end | 123 end |