File src/Chorus.xml changed (mode: 100644) (index 50f7609..14ef12a) |
7 |
7 |
<Include file="ChorusFont.xml"/> |
<Include file="ChorusFont.xml"/> |
8 |
8 |
<Include file="ChorusAuraButtonTemplate.xml"/> |
<Include file="ChorusAuraButtonTemplate.xml"/> |
9 |
9 |
<Include file="ChorusAuraFrameTemplate.xml"/> |
<Include file="ChorusAuraFrameTemplate.xml"/> |
|
10 |
|
<Include file="ChorusAuraTooltipFrameTemplate.xml"/> |
10 |
11 |
<Include file="ChorusProgressFrameTemplate.xml"/> |
<Include file="ChorusProgressFrameTemplate.xml"/> |
11 |
12 |
<Include file="ChorusHealthFrameTemplate.xml"/> |
<Include file="ChorusHealthFrameTemplate.xml"/> |
12 |
13 |
<Include file="ChorusPowerFrameTemplate.xml"/> |
<Include file="ChorusPowerFrameTemplate.xml"/> |
File src/ChorusAuraTooltipFrameTemplate.lua added (mode: 100644) (index 0000000..459de89) |
|
1 |
|
local Chorus = Chorus |
|
2 |
|
|
|
3 |
|
local function auraTooltipUpdate(self) |
|
4 |
|
local u = SecureButton_GetUnit(self) |
|
5 |
|
if u and UnitExists(u) and UnitIsConnected(u) then |
|
6 |
|
self:Show() |
|
7 |
|
else |
|
8 |
|
self:Hide() |
|
9 |
|
return |
|
10 |
|
end |
|
11 |
|
|
|
12 |
|
local t = {self:GetChildren()} |
|
13 |
|
local i = 0 |
|
14 |
|
while (i < #t) do |
|
15 |
|
i = i + 1 |
|
16 |
|
local b = t[i] |
|
17 |
|
if not b then |
|
18 |
|
break |
|
19 |
|
end |
|
20 |
|
local callback = b:GetScript('OnEvent') |
|
21 |
|
if callback then |
|
22 |
|
callback(b, 'UNIT_AURA', u) |
|
23 |
|
end |
|
24 |
|
end |
|
25 |
|
end |
|
26 |
|
|
|
27 |
|
local function auraTooltipFrameMain(self) |
|
28 |
|
assert(self ~= nil) |
|
29 |
|
|
|
30 |
|
self:SetScript('OnAttributeChanged', function(self0, name, value) |
|
31 |
|
if 'unit' == name and not value then |
|
32 |
|
auraTooltipUpdate(self0) |
|
33 |
|
end |
|
34 |
|
end) |
|
35 |
|
end |
|
36 |
|
|
|
37 |
|
Chorus.auraTooltipFrameMain = function(...) |
|
38 |
|
return auraTooltipFrameMain(...) |
|
39 |
|
end |
File src/ChorusAuraTooltipFrameTemplate.xml added (mode: 100644) (index 0000000..bda664f) |
|
1 |
|
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
|
3 |
|
<Script file="ChorusAuraTooltipFrameTemplate.lua"/> |
|
4 |
|
<Frame name="ChorusAuraTooltipFrameAuraFrameTemplate" inherits="ChorusAuraFrameTemplate" virtual="true"> |
|
5 |
|
<Size> |
|
6 |
|
<AbsDimension x="180" y="180"/> |
|
7 |
|
</Size> |
|
8 |
|
<!-- Allocate `ChorusAuraButtonTemplate` instances dynamically at runtime, |
|
9 |
|
instead of declaring them in this descriptor with `Frames` tag. |
|
10 |
|
See ChorusAuraFrameTemplate.lua. --> |
|
11 |
|
</Frame> |
|
12 |
|
<Frame name="ChorusAuraTooltipFrameTemplate" frameStrata="TOOLTIP" hidden="true" virtual="true"> |
|
13 |
|
<Size> |
|
14 |
|
<AbsDimension x="192" y="384"/> |
|
15 |
|
</Size> |
|
16 |
|
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true"> |
|
17 |
|
<EdgeSize> |
|
18 |
|
<AbsValue val="16"/> |
|
19 |
|
</EdgeSize> |
|
20 |
|
<TileSize> |
|
21 |
|
<AbsValue val="16"/> |
|
22 |
|
</TileSize> |
|
23 |
|
<BackgroundInsets> |
|
24 |
|
<AbsInset left="5" right="5" top="5" bottom="5"/> |
|
25 |
|
</BackgroundInsets> |
|
26 |
|
</Backdrop> |
|
27 |
|
<Frames> |
|
28 |
|
<Frame name="$parentUnitNameFrame" inherits="ChorusUnitNameFrameTemplate"> |
|
29 |
|
<Anchors> |
|
30 |
|
<Anchor point="TOPRIGHT"> |
|
31 |
|
<Offset x="0" y="0"/> |
|
32 |
|
</Anchor> |
|
33 |
|
<Anchor point="TOPLEFT"> |
|
34 |
|
<Offset x="0" y="0"/> |
|
35 |
|
</Anchor> |
|
36 |
|
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="TOPLEFT"> |
|
37 |
|
<Offset x="0" y="-24"/> |
|
38 |
|
</Anchor> |
|
39 |
|
<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT"> |
|
40 |
|
<Offset x="0" y="-24"/> |
|
41 |
|
</Anchor> |
|
42 |
|
</Anchors> |
|
43 |
|
<Attributes> |
|
44 |
|
<Attribute name="unit" type="string" value="player"/> |
|
45 |
|
</Attributes> |
|
46 |
|
</Frame> |
|
47 |
|
<Frame name="$parentBuffFrame" inherits="ChorusAuraTooltipFrameAuraFrameTemplate"> |
|
48 |
|
<Anchors> |
|
49 |
|
<Anchor point="TOPLEFT"> |
|
50 |
|
<Offset x="6" y="-24"/> |
|
51 |
|
</Anchor> |
|
52 |
|
</Anchors> |
|
53 |
|
<Attributes> |
|
54 |
|
<Attribute name="filter" type="string" value="HELPFUL"/> |
|
55 |
|
</Attributes> |
|
56 |
|
</Frame> |
|
57 |
|
<Frame name="$parentDebuffFrame" inherits="ChorusAuraTooltipFrameAuraFrameTemplate"> |
|
58 |
|
<Anchors> |
|
59 |
|
<Anchor point="TOPLEFT" relativeTo="$parentBuffFrame" relativePoint="BOTTOMLEFT"> |
|
60 |
|
<Offset x="0" y="0"/> |
|
61 |
|
</Anchor> |
|
62 |
|
</Anchors> |
|
63 |
|
<Attributes> |
|
64 |
|
<Attribute name="filter" type="string" value="HARMFUL"/> |
|
65 |
|
</Attributes> |
|
66 |
|
</Frame> |
|
67 |
|
</Frames> |
|
68 |
|
<Scripts> |
|
69 |
|
<OnLoad>Chorus.auraTooltipFrameMain(self);</OnLoad> |
|
70 |
|
</Scripts> |
|
71 |
|
<Attributes> |
|
72 |
|
<Attribute name="useparent-unit" type="boolean" value="true"/> |
|
73 |
|
</Attributes> |
|
74 |
|
</Frame> |
|
75 |
|
<Frame name="ChorusAuraTooltipFrame" frameStrata="TOOLTIP" hidden="true" inherits="ChorusAuraTooltipFrameTemplate"> |
|
76 |
|
<Anchors> |
|
77 |
|
<Anchor point="CENTER"> |
|
78 |
|
<Offset x="0" y="0"/> |
|
79 |
|
</Anchor> |
|
80 |
|
</Anchors> |
|
81 |
|
<Attributes> |
|
82 |
|
<Attribute name="unit" type="string" value="player"/> |
|
83 |
|
</Attributes> |
|
84 |
|
</Frame> |
|
85 |
|
<!-- FIXME Aura tooltip toggle button must work in combat. Use `SecureActionButtonTemplate`. --> |
|
86 |
|
<Button name="ChorusAuraTooltipFrameToggleButtonTemplate" virtual="true"> |
|
87 |
|
<Scripts> |
|
88 |
|
<OnLoad> |
|
89 |
|
self:RegisterForClicks('AnyUp') |
|
90 |
|
--[[ Ensure that the property is a reference to an identity, and not a string literal. ]]-- |
|
91 |
|
self:SetAttribute('attribute-frame', ChorusAuraTooltipFrame) |
|
92 |
|
</OnLoad> |
|
93 |
|
<OnClick> |
|
94 |
|
local tooltipFrame = SecureButton_GetAttribute(self, 'attribute-frame'); |
|
95 |
|
if tooltipFrame and tooltipFrame:IsShown() then |
|
96 |
|
tooltipFrame:Hide() |
|
97 |
|
return |
|
98 |
|
end |
|
99 |
|
local u = SecureButton_GetUnit(self); |
|
100 |
|
if u and UnitExists(u) and UnitIsConnected(u) and (UnitAura(u, 1) or UnitAura(u, 1, 'HARMFUL')) then |
|
101 |
|
tooltipFrame:SetAttribute('unit', u); |
|
102 |
|
tooltipFrame:Show(); |
|
103 |
|
end |
|
104 |
|
</OnClick> |
|
105 |
|
</Scripts> |
|
106 |
|
<Attributes> |
|
107 |
|
<Attribute name="useparent-unit" type="boolean" value="true"/> |
|
108 |
|
</Attributes> |
|
109 |
|
</Button> |
|
110 |
|
</Ui> |
File src/ChorusUnitButtonTemplate.xml changed (mode: 100644) (index 7afa94b..0a01dd2) |
332 |
332 |
</Anchor> |
</Anchor> |
333 |
333 |
</Anchors> |
</Anchors> |
334 |
334 |
</Frame> |
</Frame> |
|
335 |
|
<Button name="$parentAuraTooltipToggleButton" inherits="ChorusAuraTooltipFrameToggleButtonTemplate"> |
|
336 |
|
<Size> |
|
337 |
|
<AbsDimension x="150" y="32"/> |
|
338 |
|
</Size> |
|
339 |
|
<Anchors> |
|
340 |
|
<Anchor point="BOTTOMLEFT"> |
|
341 |
|
<Offset x="0" y="0"/> |
|
342 |
|
</Anchor> |
|
343 |
|
</Anchors> |
|
344 |
|
</Button> |
335 |
345 |
</Frames> |
</Frames> |
336 |
346 |
</Button> |
</Button> |
337 |
347 |
<Button name="ChorusHugeUnitButtonTemplate" inherits="ChorusUnitButtonTemplate" virtual="true"> |
<Button name="ChorusHugeUnitButtonTemplate" inherits="ChorusUnitButtonTemplate" virtual="true"> |
|
463 |
473 |
</Anchor> |
</Anchor> |
464 |
474 |
</Anchors> |
</Anchors> |
465 |
475 |
</Frame> |
</Frame> |
466 |
|
|
|
|
476 |
|
<Button name="$parentAuraTooltipToggleButton" inherits="ChorusAuraTooltipFrameToggleButtonTemplate"> |
|
477 |
|
<Size> |
|
478 |
|
<AbsDimension x="256" y="64"/> |
|
479 |
|
</Size> |
|
480 |
|
<Anchors> |
|
481 |
|
<Anchor point="BOTTOMLEFT"> |
|
482 |
|
<Offset x="0" y="0"/> |
|
483 |
|
</Anchor> |
|
484 |
|
</Anchors> |
|
485 |
|
</Button> |
467 |
486 |
</Frames> |
</Frames> |
468 |
487 |
</Button> |
</Button> |
469 |
488 |
</Ui> |
</Ui> |