File src/Chorus.xml changed (mode: 100644) (index 0caa6a7..7bc96db) |
8 |
8 |
<Include file="ChorusHealthFrameTemplate.xml"/> |
<Include file="ChorusHealthFrameTemplate.xml"/> |
9 |
9 |
<Include file="ChorusPowerFrameTemplate.xml"/> |
<Include file="ChorusPowerFrameTemplate.xml"/> |
10 |
10 |
<Include file="ChorusUnitNameFrameTemplate.xml"/> |
<Include file="ChorusUnitNameFrameTemplate.xml"/> |
11 |
|
<Include file="ChorusRaidUnitButtonTemplate.xml"/> |
|
12 |
11 |
<Include file="ChorusRangeFrameTemplate.xml"/> |
<Include file="ChorusRangeFrameTemplate.xml"/> |
|
12 |
|
<Include file="ChorusThreatFrameTemplate.xml"/> |
|
13 |
|
<Include file="ChorusRaidUnitButtonTemplate.xml"/> |
13 |
14 |
<Include file="ChorusRaidFrame.xml"/> |
<Include file="ChorusRaidFrame.xml"/> |
14 |
15 |
<Include file="ChorusTestFrame.xml"/> |
<Include file="ChorusTestFrame.xml"/> |
15 |
16 |
</Ui> |
</Ui> |
File src/ChorusRaidUnitButtonTemplate.lua changed (mode: 100644) (index b8d47a1..8a951ca) |
... |
... |
function Chorus.raidUnitButtonMain(self) |
52 |
52 |
|
|
53 |
53 |
Chorus.raidUnitButtonAttributeChangedProcessor(self, 'unit', self:GetAttribute('unit')) |
Chorus.raidUnitButtonAttributeChangedProcessor(self, 'unit', self:GetAttribute('unit')) |
54 |
54 |
--[[ TODO Add menu popup for unit frames ]]-- |
--[[ TODO Add menu popup for unit frames ]]-- |
55 |
|
--[[ TODO Add range indicator ]]-- |
|
56 |
|
--[[ TODO Add threat indicator ]]-- |
|
57 |
55 |
--[[ TODO Add role indicator ]]-- |
--[[ TODO Add role indicator ]]-- |
|
56 |
|
--[[ TODO Add raid mark indicator ]]-- |
58 |
57 |
end |
end |
File src/ChorusRaidUnitButtonTemplate.xml changed (mode: 100644) (index 5ff787e..19db816) |
41 |
41 |
</Anchor> |
</Anchor> |
42 |
42 |
</Anchors> |
</Anchors> |
43 |
43 |
</StatusBar> |
</StatusBar> |
44 |
|
<Frame name="$parentRangeFrame" inherits="ChorusRangeFrameTemplate"> |
|
|
44 |
|
<StatusBar name="$parentPowerFrame" inherits="ChorusPowerFrameTemplate"> |
45 |
45 |
<Anchors> |
<Anchors> |
46 |
|
<Anchor point="BOTTOMRIGHT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMRIGHT"> |
|
|
46 |
|
<Anchor point="TOPLEFT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMLEFT"> |
47 |
47 |
<Offset> |
<Offset> |
48 |
48 |
<AbsDimension x="0" y="0"/> |
<AbsDimension x="0" y="0"/> |
49 |
49 |
</Offset> |
</Offset> |
50 |
50 |
</Anchor> |
</Anchor> |
|
51 |
|
<Anchor point="BOTTOMRIGHT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMRIGHT"> |
|
52 |
|
<Offset> |
|
53 |
|
<AbsDimension x="0" y="-6"/> |
|
54 |
|
</Offset> |
|
55 |
|
</Anchor> |
51 |
56 |
</Anchors> |
</Anchors> |
52 |
|
</Frame> |
|
53 |
|
<StatusBar name="$parentPowerFrame" inherits="ChorusPowerFrameTemplate"> |
|
|
57 |
|
</StatusBar> |
|
58 |
|
<Frame name="$parentThreatFrame" inherits="ChorusThreatFrameTemplate"> |
54 |
59 |
<Anchors> |
<Anchors> |
55 |
|
<Anchor point="TOPLEFT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMLEFT"> |
|
|
60 |
|
<Anchor point="TOPLEFT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMLEFT"> |
56 |
61 |
<Offset> |
<Offset> |
57 |
62 |
<AbsDimension x="0" y="0"/> |
<AbsDimension x="0" y="0"/> |
58 |
63 |
</Offset> |
</Offset> |
59 |
64 |
</Anchor> |
</Anchor> |
60 |
|
<Anchor point="BOTTOMRIGHT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMRIGHT"> |
|
|
65 |
|
</Anchors> |
|
66 |
|
</Frame> |
|
67 |
|
<Frame name="$parentRangeFrame" inherits="ChorusRangeFrameTemplate"> |
|
68 |
|
<Anchors> |
|
69 |
|
<Anchor point="TOPRIGHT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMRIGHT"> |
61 |
70 |
<Offset> |
<Offset> |
62 |
|
<AbsDimension x="0" y="-6"/> |
|
|
71 |
|
<AbsDimension x="0" y="0"/> |
63 |
72 |
</Offset> |
</Offset> |
64 |
73 |
</Anchor> |
</Anchor> |
65 |
74 |
</Anchors> |
</Anchors> |
66 |
|
</StatusBar> |
|
|
75 |
|
</Frame> |
67 |
76 |
<Frame name="$parentBuffFrame" inherits="ChorusAuraFrameTemplate"> |
<Frame name="$parentBuffFrame" inherits="ChorusAuraFrameTemplate"> |
68 |
77 |
<Size> |
<Size> |
69 |
78 |
<AbsDimension x="144" y="24"/> |
<AbsDimension x="144" y="24"/> |
70 |
79 |
</Size> |
</Size> |
71 |
80 |
<Anchors> |
<Anchors> |
72 |
|
<Anchor point="TOPLEFT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMLEFT"> |
|
|
81 |
|
<Anchor point="TOPLEFT" relativeTo="$parentThreatFrame" relativePoint="BOTTOMLEFT"> |
73 |
82 |
<Offset> |
<Offset> |
74 |
83 |
<AbsDimension x="0" y="0"/> |
<AbsDimension x="0" y="0"/> |
75 |
84 |
</Offset> |
</Offset> |
File src/ChorusThreatFrameTemplate.lua added (mode: 100644) (index 0000000..762666c) |
|
1 |
|
local GetThreatStatusColor = GetThreatStatusColor |
|
2 |
|
local UnitThreatSituation = UnitThreatSituation |
|
3 |
|
|
|
4 |
|
local Chorus = Chorus |
|
5 |
|
|
|
6 |
|
local function threatFrameEventProcessor(self) |
|
7 |
|
assert(self ~= nil) |
|
8 |
|
|
|
9 |
|
local unitButton = self:GetParent() |
|
10 |
|
assert(unitButton ~= nil) |
|
11 |
|
|
|
12 |
|
local u = self.unit or self:GetAttribute('unit') |
|
13 |
|
if not u and unitButton then |
|
14 |
|
u = unitButton.unit or unitButton:GetAttribute('unit') |
|
15 |
|
end |
|
16 |
|
u = u or 'none' |
|
17 |
|
assert(u ~= nil) |
|
18 |
|
|
|
19 |
|
if UnitExists(u) and UnitIsConnected(u) then |
|
20 |
|
self:Show() |
|
21 |
|
else |
|
22 |
|
self:Hide() |
|
23 |
|
return |
|
24 |
|
end |
|
25 |
|
|
|
26 |
|
local r = 0 |
|
27 |
|
local g = 0 |
|
28 |
|
local b = 0 |
|
29 |
|
local a = 0 |
|
30 |
|
local threatStatus = UnitThreatSituation(u) |
|
31 |
|
if threatStatus then |
|
32 |
|
r, g, b = GetThreatStatusColor(threatStatus) |
|
33 |
|
a = 1 |
|
34 |
|
end |
|
35 |
|
local artwork = self.artwork |
|
36 |
|
assert (artwork ~= nil) |
|
37 |
|
artwork:SetVertexColor(r, g, b, a) |
|
38 |
|
end |
|
39 |
|
|
|
40 |
|
local function threatFrameMain(self) |
|
41 |
|
assert(self ~= nil) |
|
42 |
|
|
|
43 |
|
local artwork = _G[self:GetName() .. 'Artwork'] |
|
44 |
|
assert(artwork ~= nil) |
|
45 |
|
self.artwork = artwork |
|
46 |
|
|
|
47 |
|
self:RegisterEvent('UNIT_THREAT_SITUATION_UPDATE') |
|
48 |
|
self:RegisterEvent('PLAYER_ENTERING_WORLD') |
|
49 |
|
self:SetScript('OnEvent', threatFrameEventProcessor) |
|
50 |
|
end |
|
51 |
|
|
|
52 |
|
Chorus.threatFrameMain = function(...) |
|
53 |
|
return threatFrameMain(...) |
|
54 |
|
end |
File src/ChorusThreatFrameTemplate.xml added (mode: 100644) (index 0000000..d55b8c4) |
|
1 |
|
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
|
3 |
|
<Script file="ChorusThreatFrameTemplate.lua"/> |
|
4 |
|
<Frame name="ChorusThreatFrameTemplate" virtual="true"> |
|
5 |
|
<Size> |
|
6 |
|
<AbsDimension x="16" y="16" /> |
|
7 |
|
</Size> |
|
8 |
|
<Layers> |
|
9 |
|
<Layer level="ARTWORK"> |
|
10 |
|
<Texture name="$parentArtwork" file="Interface\RaidFrame\UI-RaidFrame-Threat" setAllPoints="true"/> |
|
11 |
|
</Layer> |
|
12 |
|
</Layers> |
|
13 |
|
<Scripts> |
|
14 |
|
<OnLoad>Chorus.threatFrameMain(self);</OnLoad> |
|
15 |
|
</Scripts> |
|
16 |
|
</Frame> |
|
17 |
|
</Ui> |