File src/Chorus.xml changed (mode: 100644) (index bdcba4f..3acb861) |
23 |
23 |
<Include file="ChorusUnitGroupRoleFrameTemplate.xml"/> |
<Include file="ChorusUnitGroupRoleFrameTemplate.xml"/> |
24 |
24 |
<Include file="ChorusUnitButtonTemplate.xml"/> |
<Include file="ChorusUnitButtonTemplate.xml"/> |
25 |
25 |
<Include file="ChorusUnitFrameTemplate.xml"/> |
<Include file="ChorusUnitFrameTemplate.xml"/> |
|
26 |
|
<Include file="ChorusUnitBackdropTemplate.xml"/> |
26 |
27 |
<Include file="ChorusHugeUnitFrameTemplate.xml"/> |
<Include file="ChorusHugeUnitFrameTemplate.xml"/> |
27 |
28 |
<Include file="ChorusLargeUnitFrameTemplate.xml"/> |
<Include file="ChorusLargeUnitFrameTemplate.xml"/> |
28 |
29 |
<Include file="ChorusSmallUnitFrameTemplate.xml"/> |
<Include file="ChorusSmallUnitFrameTemplate.xml"/> |
File src/ChorusHugeUnitFrameTemplate.xml changed (mode: 100644) (index d8b5f27..c29d5c5) |
1 |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
2 |
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
3 |
|
<Frame name="ChorusHugeUnitFrameTemplate" virtual="true"> |
|
|
3 |
|
<Frame name="ChorusHugeUnitFrameTemplate" inherits="ChorusUnitFrameTemplate" virtual="true"> |
4 |
4 |
<Size> |
<Size> |
5 |
5 |
<AbsDimension x="200" y="150"/> |
<AbsDimension x="200" y="150"/> |
6 |
6 |
</Size> |
</Size> |
7 |
7 |
<Frames> |
<Frames> |
|
8 |
|
<!-- Backdrop. --> |
|
9 |
|
<Frame name="$parentBackdrop" inherits="ChorusUnitBackdropTemplate" setAllPoints="true"/> |
8 |
10 |
<!-- Clickable area. --> |
<!-- Clickable area. --> |
9 |
11 |
<Button name="$parentSecureUnitButton" inherits="ChorusUnitButtonTemplate" setAllPoints="true"> |
<Button name="$parentSecureUnitButton" inherits="ChorusUnitButtonTemplate" setAllPoints="true"> |
10 |
12 |
<Anchors> |
<Anchors> |
File src/ChorusSmallUnitFrameTemplate.xml changed (mode: 100644) (index 7149f95..7cc140b) |
1 |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
2 |
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
3 |
|
<Frame name="ChorusSmallUnitFrameTemplate" virtual="true"> |
|
|
3 |
|
<Frame name="ChorusSmallUnitFrameTemplate" inherits="ChorusUnitFrameTemplate" virtual="true"> |
4 |
4 |
<Size> |
<Size> |
5 |
5 |
<AbsDimension x="96" y="32"/> |
<AbsDimension x="96" y="32"/> |
6 |
6 |
</Size> |
</Size> |
7 |
7 |
<Frames> |
<Frames> |
|
8 |
|
<!-- Backdrop. --> |
|
9 |
|
<Frame name="$parentBackdrop" inherits="ChorusUnitBackdropTemplate" setAllPoints="true"/> |
8 |
10 |
<!-- Clickable area. --> |
<!-- Clickable area. --> |
9 |
11 |
<Button name="$parentSecureUnitButton" inherits="ChorusUnitButtonTemplate" setAllPoints="true"/> |
<Button name="$parentSecureUnitButton" inherits="ChorusUnitButtonTemplate" setAllPoints="true"/> |
10 |
12 |
<!-- Header --> |
<!-- Header --> |
File src/ChorusUnitBackdropTemplate.lua added (mode: 100644) (index 0000000..23773dc) |
|
1 |
|
local SecureButton_GetUnit = SecureButton_GetUnit |
|
2 |
|
|
|
3 |
|
local function unitBackdropEventProcessor(unitBackdrop) |
|
4 |
|
assert(unitBackdrop ~= nil) |
|
5 |
|
|
|
6 |
|
local unitDesignation = unitBackdrop:GetAttribute('unit') |
|
7 |
|
if not unitDesignation then |
|
8 |
|
unitDesignation = SecureButton_GetUnit(unitBackdrop) |
|
9 |
|
end |
|
10 |
|
assert(unitDesignation ~= nil) |
|
11 |
|
|
|
12 |
|
if UnitExists(unitDesignation) then |
|
13 |
|
unitBackdrop:Show() |
|
14 |
|
else |
|
15 |
|
unitBackdrop:Hide() |
|
16 |
|
end |
|
17 |
|
|
|
18 |
|
if UnitIsUnit(unitDesignation, 'target') then |
|
19 |
|
unitBackdrop:SetBackdropBorderColor(178 / 255, 34 / 255, 34 / 255, 1) |
|
20 |
|
elseif UnitIsUnit(unitDesignation, 'focus') then |
|
21 |
|
unitBackdrop:SetBackdropBorderColor(72 / 255, 118 / 255, 1, 1) |
|
22 |
|
elseif UnitIsUnit(unitDesignation, 'player') then |
|
23 |
|
unitBackdrop:SetBackdropBorderColor(1, 225 / 255, 0, 1) |
|
24 |
|
else |
|
25 |
|
unitBackdrop:SetBackdropBorderColor(1, 1, 1, 1) |
|
26 |
|
end |
|
27 |
|
end |
|
28 |
|
|
|
29 |
|
function Chorus.unitBackdropMain(unitBackdrop) |
|
30 |
|
assert(unitBackdrop ~= nil) |
|
31 |
|
|
|
32 |
|
unitBackdrop:SetBackdropBorderColor(1, 1, 1, 1) |
|
33 |
|
unitBackdrop:SetBackdropColor(0, 0, 0, 0.8) |
|
34 |
|
|
|
35 |
|
local p = unitBackdrop:GetParent() |
|
36 |
|
if p then |
|
37 |
|
local offset = 6 |
|
38 |
|
unitBackdrop:SetPoint('TOPRIGHT', offset, offset) |
|
39 |
|
unitBackdrop:SetPoint('TOPLEFT', -offset, offset) |
|
40 |
|
unitBackdrop:SetPoint('BOTTOMLEFT', -offset, -offset) |
|
41 |
|
unitBackdrop:SetPoint('BOTTOMRIGHT', offset, -offset) |
|
42 |
|
end |
|
43 |
|
|
|
44 |
|
unitBackdrop:RegisterEvent('ADDON_LOADED') |
|
45 |
|
unitBackdrop:RegisterEvent('PARTY_CONVERTED_TO_RAID') |
|
46 |
|
unitBackdrop:RegisterEvent('PARTY_MEMBERS_CHANGED') |
|
47 |
|
unitBackdrop:RegisterEvent('PLAYER_FOCUS_CHANGED') |
|
48 |
|
unitBackdrop:RegisterEvent('PLAYER_TARGET_CHANGED') |
|
49 |
|
unitBackdrop:RegisterEvent('RAID_ROSTER_UPDATE') |
|
50 |
|
unitBackdrop:SetScript('OnEvent', unitBackdropEventProcessor) |
|
51 |
|
unitBackdrop:SetScript('OnAttributeChanged', unitBackdropEventProcessor) |
|
52 |
|
end |
File src/ChorusUnitBackdropTemplate.xml added (mode: 100644) (index 0000000..579bf0c) |
|
1 |
|
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
|
3 |
|
<Script file="ChorusUnitBackdropTemplate.lua"/> |
|
4 |
|
<Frame name="ChorusUnitBackdropTemplate" virtual="true" protected="false"> |
|
5 |
|
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true"> |
|
6 |
|
<BackgroundInsets> |
|
7 |
|
<AbsInset left="4" right="4" top="4" bottom="4"/> |
|
8 |
|
</BackgroundInsets> |
|
9 |
|
<TileSize> |
|
10 |
|
<AbsValue val="36"/> |
|
11 |
|
</TileSize> |
|
12 |
|
<EdgeSize> |
|
13 |
|
<AbsValue val="24"/> |
|
14 |
|
</EdgeSize> |
|
15 |
|
</Backdrop> |
|
16 |
|
<Attributes> |
|
17 |
|
<Attribute name="useparent-unit" type="boolean" value="true"/> |
|
18 |
|
</Attributes> |
|
19 |
|
<Scripts> |
|
20 |
|
<OnLoad>Chorus.unitBackdropMain(self);</OnLoad> |
|
21 |
|
</Scripts> |
|
22 |
|
</Frame> |
|
23 |
|
</Ui> |