File src/Chorus.xml changed (mode: 100644) (index 7bc96db..873ba45) |
10 |
10 |
<Include file="ChorusUnitNameFrameTemplate.xml"/> |
<Include file="ChorusUnitNameFrameTemplate.xml"/> |
11 |
11 |
<Include file="ChorusRangeFrameTemplate.xml"/> |
<Include file="ChorusRangeFrameTemplate.xml"/> |
12 |
12 |
<Include file="ChorusThreatFrameTemplate.xml"/> |
<Include file="ChorusThreatFrameTemplate.xml"/> |
|
13 |
|
<Include file="ChorusRaidTargetIconFrameTemplate.xml"/> |
13 |
14 |
<Include file="ChorusRaidUnitButtonTemplate.xml"/> |
<Include file="ChorusRaidUnitButtonTemplate.xml"/> |
14 |
15 |
<Include file="ChorusRaidFrame.xml"/> |
<Include file="ChorusRaidFrame.xml"/> |
15 |
16 |
<Include file="ChorusTestFrame.xml"/> |
<Include file="ChorusTestFrame.xml"/> |
File src/ChorusRaidTargetIconFrameTemplate.lua added (mode: 100644) (index 0000000..78e29ea) |
|
1 |
|
local Chorus = Chorus |
|
2 |
|
|
|
3 |
|
--[[ See FrameXML/TargetFrame.lua:682 ]]-- |
|
4 |
|
local SetRaidTargetIconTexture = SetRaidTargetIconTexture |
|
5 |
|
|
|
6 |
|
local function raidTargetIconFrameEventProcessor(self) |
|
7 |
|
local p = self:GetParent() |
|
8 |
|
|
|
9 |
|
local u = self.unit or self:GetAttribute('unit') |
|
10 |
|
if p and not u then |
|
11 |
|
u = p.unit or p:GetAttribute('unit') |
|
12 |
|
end |
|
13 |
|
u = u or 'none' |
|
14 |
|
|
|
15 |
|
assert(u ~= nil) |
|
16 |
|
assert('string' == type(u)) |
|
17 |
|
u = string.lower(strtrim(u)) |
|
18 |
|
assert(string.len(u) >= 1) |
|
19 |
|
assert(string.len(u) <= 256) |
|
20 |
|
|
|
21 |
|
if UnitExists(u) and UnitIsConnected(u) then |
|
22 |
|
self:Show() |
|
23 |
|
else |
|
24 |
|
self:Hide() |
|
25 |
|
return |
|
26 |
|
end |
|
27 |
|
|
|
28 |
|
local raidIconIndex = GetRaidTargetIndex(u) |
|
29 |
|
if not raidIconIndex then |
|
30 |
|
self:Hide() |
|
31 |
|
return |
|
32 |
|
end |
|
33 |
|
|
|
34 |
|
local artwork = self.artwork or _G[self:GetName() .. 'Artwork'] |
|
35 |
|
assert(artwork ~= nil) |
|
36 |
|
|
|
37 |
|
SetRaidTargetIconTexture(artwork, raidIconIndex) |
|
38 |
|
end |
|
39 |
|
|
|
40 |
|
function Chorus.raidTargetIconFrameMain(self) |
|
41 |
|
assert(self ~= nil) |
|
42 |
|
|
|
43 |
|
local artwork = _G[self:GetName() .. 'Artwork'] |
|
44 |
|
assert(artwork ~= nil) |
|
45 |
|
self.artwork = artwork |
|
46 |
|
|
|
47 |
|
--artwork:SetSize(RAID_TARGET_ICON_DIMENSION, RAID_TARGET_ICON_DIMENSION) |
|
48 |
|
SetRaidTargetIconTexture(artwork, 0) |
|
49 |
|
|
|
50 |
|
self:SetScript('OnEvent', raidTargetIconFrameEventProcessor) |
|
51 |
|
|
|
52 |
|
self:RegisterEvent('ADDON_LOADED') |
|
53 |
|
self:RegisterEvent('PARTY_CONVERTED_TO_RAID') |
|
54 |
|
self:RegisterEvent('PARTY_MEMBERS_CHANGED') |
|
55 |
|
self:RegisterEvent('PLAYER_FOCUS_CHANGED') |
|
56 |
|
self:RegisterEvent('PLAYER_LOGIN') |
|
57 |
|
self:RegisterEvent('PLAYER_TARGET_CHANGED') |
|
58 |
|
self:RegisterEvent('RAID_ROSTER_UPDATE') |
|
59 |
|
self:RegisterEvent('RAID_TARGET_UPDATE') |
|
60 |
|
end |
File src/ChorusRaidTargetIconFrameTemplate.xml added (mode: 100644) (index 0000000..04a7f3c) |
|
1 |
|
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
|
3 |
|
<Script file="ChorusRaidTargetIconFrameTemplate.lua"/> |
|
4 |
|
<Frame name="ChorusRaidTargetIconFrameTemplate" virtual="true"> |
|
5 |
|
<Size> |
|
6 |
|
<AbsDimension x="16" y="16" /> |
|
7 |
|
</Size> |
|
8 |
|
<Layers> |
|
9 |
|
<Layer level="ARTWORK"> |
|
10 |
|
<Texture name="$parentArtwork" file="Interface\TargetingFrame\UI-RaidTargetingIcons" setAllPoints="true"/> |
|
11 |
|
</Layer> |
|
12 |
|
</Layers> |
|
13 |
|
<Scripts> |
|
14 |
|
<OnLoad>Chorus.raidTargetIconFrameMain(self);</OnLoad> |
|
15 |
|
</Scripts> |
|
16 |
|
</Frame> |
|
17 |
|
</Ui> |
File src/ChorusRaidUnitButtonTemplate.xml changed (mode: 100644) (index 19db816..f5c692a) |
55 |
55 |
</Anchor> |
</Anchor> |
56 |
56 |
</Anchors> |
</Anchors> |
57 |
57 |
</StatusBar> |
</StatusBar> |
58 |
|
<Frame name="$parentThreatFrame" inherits="ChorusThreatFrameTemplate"> |
|
|
58 |
|
<Frame name="$parentRaidTargetIconFrame" inherits="ChorusRaidTargetIconFrameTemplate"> |
59 |
59 |
<Anchors> |
<Anchors> |
60 |
60 |
<Anchor point="TOPLEFT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMLEFT"> |
<Anchor point="TOPLEFT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMLEFT"> |
61 |
61 |
<Offset> |
<Offset> |
|
64 |
64 |
</Anchor> |
</Anchor> |
65 |
65 |
</Anchors> |
</Anchors> |
66 |
66 |
</Frame> |
</Frame> |
|
67 |
|
<Frame name="$parentThreatFrame" inherits="ChorusThreatFrameTemplate"> |
|
68 |
|
<Anchors> |
|
69 |
|
<Anchor point="TOPLEFT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMLEFT"> |
|
70 |
|
<Offset> |
|
71 |
|
<AbsDimension x="16" y="0"/> |
|
72 |
|
</Offset> |
|
73 |
|
</Anchor> |
|
74 |
|
</Anchors> |
|
75 |
|
</Frame> |
67 |
76 |
<Frame name="$parentRangeFrame" inherits="ChorusRangeFrameTemplate"> |
<Frame name="$parentRangeFrame" inherits="ChorusRangeFrameTemplate"> |
68 |
77 |
<Anchors> |
<Anchors> |
69 |
78 |
<Anchor point="TOPRIGHT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMRIGHT"> |
<Anchor point="TOPRIGHT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMRIGHT"> |
|
78 |
87 |
<AbsDimension x="144" y="24"/> |
<AbsDimension x="144" y="24"/> |
79 |
88 |
</Size> |
</Size> |
80 |
89 |
<Anchors> |
<Anchors> |
81 |
|
<Anchor point="TOPLEFT" relativeTo="$parentThreatFrame" relativePoint="BOTTOMLEFT"> |
|
|
90 |
|
<Anchor point="TOPLEFT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMLEFT"> |
82 |
91 |
<Offset> |
<Offset> |
83 |
|
<AbsDimension x="0" y="0"/> |
|
|
92 |
|
<AbsDimension x="0" y="-16"/> |
84 |
93 |
</Offset> |
</Offset> |
85 |
94 |
</Anchor> |
</Anchor> |
86 |
95 |
</Anchors> |
</Anchors> |