File conf/make/src.mk changed (mode: 100644) (index 3584a89..2451c75) |
... |
... |
${srcdir}src/ChorusUnitAffectingCombatFrameTemplate.lua \ |
30 |
30 |
${srcdir}src/ChorusUnitBackdropTemplate.lua \ |
${srcdir}src/ChorusUnitBackdropTemplate.lua \ |
31 |
31 |
${srcdir}src/ChorusUnitBackgroundTemplate.lua \ |
${srcdir}src/ChorusUnitBackgroundTemplate.lua \ |
32 |
32 |
${srcdir}src/ChorusUnitButtonTemplate.lua \ |
${srcdir}src/ChorusUnitButtonTemplate.lua \ |
|
33 |
|
${srcdir}src/ChorusUnitClassPowerFrameTemplate.lua \ |
33 |
34 |
${srcdir}src/ChorusUnitFrameTemplate.lua \ |
${srcdir}src/ChorusUnitFrameTemplate.lua \ |
34 |
35 |
${srcdir}src/ChorusUnitGroupRoleFrameTemplate.lua \ |
${srcdir}src/ChorusUnitGroupRoleFrameTemplate.lua \ |
35 |
36 |
${srcdir}src/ChorusUnitHealthFrameTemplate.lua \ |
${srcdir}src/ChorusUnitHealthFrameTemplate.lua \ |
|
... |
... |
${srcdir}src/ChorusUnitAffectingCombatFrameTemplate.xml \ |
74 |
75 |
${srcdir}src/ChorusUnitBackdropTemplate.xml \ |
${srcdir}src/ChorusUnitBackdropTemplate.xml \ |
75 |
76 |
${srcdir}src/ChorusUnitBackgroundTemplate.xml \ |
${srcdir}src/ChorusUnitBackgroundTemplate.xml \ |
76 |
77 |
${srcdir}src/ChorusUnitButtonTemplate.xml \ |
${srcdir}src/ChorusUnitButtonTemplate.xml \ |
|
78 |
|
${srcdir}src/ChorusUnitClassPowerFrameTemplate.xml \ |
77 |
79 |
${srcdir}src/ChorusUnitFrameTemplate.xml \ |
${srcdir}src/ChorusUnitFrameTemplate.xml \ |
78 |
80 |
${srcdir}src/ChorusUnitGroupRoleFrameTemplate.xml \ |
${srcdir}src/ChorusUnitGroupRoleFrameTemplate.xml \ |
79 |
81 |
${srcdir}src/ChorusUnitHealthFrameTemplate.xml \ |
${srcdir}src/ChorusUnitHealthFrameTemplate.xml \ |
File src/Chorus.xml changed (mode: 100644) (index bc8c178..bbac0d5) |
13 |
13 |
<Include file="ChorusUnitHealthStatusBarTemplate.xml"/> |
<Include file="ChorusUnitHealthStatusBarTemplate.xml"/> |
14 |
14 |
<Include file="ChorusUnitPowerFrameTemplate.xml"/> |
<Include file="ChorusUnitPowerFrameTemplate.xml"/> |
15 |
15 |
<Include file="ChorusUnitPowerStatusBarTemplate.xml"/> |
<Include file="ChorusUnitPowerStatusBarTemplate.xml"/> |
|
16 |
|
<Include file="ChorusUnitClassPowerFrameTemplate.xml"/> |
16 |
17 |
<Include file="ChorusCastFrameTemplate.xml"/> |
<Include file="ChorusCastFrameTemplate.xml"/> |
17 |
18 |
<Include file="ChorusComboPointsStatusBarTemplate.xml"/> |
<Include file="ChorusComboPointsStatusBarTemplate.xml"/> |
18 |
19 |
<Include file="ChorusUnitNameFrameTemplate.xml"/> |
<Include file="ChorusUnitNameFrameTemplate.xml"/> |
File src/ChorusHugeUnitFrameTemplate.xml changed (mode: 100644) (index 88c8efe..e0e23d0) |
104 |
104 |
</Anchor> |
</Anchor> |
105 |
105 |
</Anchors> |
</Anchors> |
106 |
106 |
</Frame> |
</Frame> |
107 |
|
<StatusBar name="$parentPowerStatusBar" inherits="ChorusUnitPowerStatusBarTemplate"> |
|
108 |
|
<Size> |
|
109 |
|
<AbsDimension x="200" y="174"/> |
|
110 |
|
</Size> |
|
111 |
|
<Anchors> |
|
112 |
|
<Anchor point="TOPRIGHT"> |
|
113 |
|
<Offset x="0" y="-40"/> |
|
114 |
|
</Anchor> |
|
115 |
|
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="TOPLEFT"> |
|
116 |
|
<Offset x="0" y="-56"/> |
|
117 |
|
</Anchor> |
|
118 |
|
</Anchors> |
|
119 |
|
</StatusBar> |
|
120 |
|
<Frame name="$parentPowerFrame" inherits="ChorusUnitPowerLargeFrameTemplate"> |
|
|
107 |
|
<Frame name="$parentUnitClassPowerFrame" inherits="ChorusUnitClassPowerFrameTemplate"> |
121 |
108 |
<Anchors> |
<Anchors> |
122 |
|
<Anchor point="TOPRIGHT"> |
|
123 |
|
<Offset x="0" y="-40"/> |
|
|
109 |
|
<Anchor point="TOPRIGHT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMRIGHT"> |
|
110 |
|
<Offset x="0" y="0"/> |
124 |
111 |
</Anchor> |
</Anchor> |
125 |
|
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="TOPLEFT"> |
|
126 |
|
<Offset x="0" y="-56"/> |
|
|
112 |
|
<Anchor point="BOTTOMLEFT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMLEFT"> |
|
113 |
|
<Offset x="0" y="-16"/> |
127 |
114 |
</Anchor> |
</Anchor> |
128 |
115 |
</Anchors> |
</Anchors> |
129 |
116 |
</Frame> |
</Frame> |
File src/ChorusUnitClassPowerFrameTemplate.lua added (mode: 100644) (index 0000000..ba7515a) |
|
1 |
|
--[[-- |
|
2 |
|
@submodule chorus |
|
3 |
|
]] |
|
4 |
|
|
|
5 |
|
local Chorus = Chorus |
|
6 |
|
|
|
7 |
|
local function eventProcessorFactory(unitClassPowerFrame) |
|
8 |
|
local t = {unitClassPowerFrame:GetChildren()} |
|
9 |
|
|
|
10 |
|
return function(self) |
|
11 |
|
local thisUnit = SecureButton_GetUnit(self) |
|
12 |
|
|
|
13 |
|
if UnitExists(thisUnit) and UnitIsConnected(thisUnit) then |
|
14 |
|
self:Show() |
|
15 |
|
else |
|
16 |
|
self:Hide() |
|
17 |
|
return |
|
18 |
|
end |
|
19 |
|
|
|
20 |
|
local i = 0 |
|
21 |
|
while(i < #t) do |
|
22 |
|
i = i + 1 |
|
23 |
|
local f = t[i] |
|
24 |
|
f:Hide() |
|
25 |
|
end |
|
26 |
|
|
|
27 |
|
local _, thisClass = UnitClass(thisUnit) |
|
28 |
|
|
|
29 |
|
local defaultFrame = self.DEFAULT or _G[self:GetName() .. 'DefaultPowerFrame'] |
|
30 |
|
assert(defaultFrame ~= nil) |
|
31 |
|
|
|
32 |
|
local selectedFrame = self[thisClass] or defaultFrame |
|
33 |
|
selectedFrame:Show() |
|
34 |
|
end |
|
35 |
|
end |
|
36 |
|
|
|
37 |
|
local function main(unitClassPowerFrame) |
|
38 |
|
unitClassPowerFrame:RegisterEvent('PARTY_CONVERTED_TO_RAID') |
|
39 |
|
unitClassPowerFrame:RegisterEvent('PARTY_MEMBERS_CHANGED') |
|
40 |
|
unitClassPowerFrame:RegisterEvent('PARTY_MEMBER_DISABLE') |
|
41 |
|
unitClassPowerFrame:RegisterEvent('PARTY_MEMBER_ENABLE') |
|
42 |
|
unitClassPowerFrame:RegisterEvent('PLAYER_ALIVE') |
|
43 |
|
unitClassPowerFrame:RegisterEvent('PLAYER_FOCUS_CHANGED') |
|
44 |
|
unitClassPowerFrame:RegisterEvent('PLAYER_LOGIN') |
|
45 |
|
unitClassPowerFrame:RegisterEvent('PLAYER_TARGET_CHANGED') |
|
46 |
|
unitClassPowerFrame:RegisterEvent('RAID_ROSTER_UPDATE') |
|
47 |
|
|
|
48 |
|
unitClassPowerFrame:RegisterEvent('UNIT_DISPLAYPOWER') |
|
49 |
|
|
|
50 |
|
local callback = eventProcessorFactory(unitClassPowerFrame) |
|
51 |
|
unitClassPowerFrame:SetScript('OnEvent', callback) |
|
52 |
|
end |
|
53 |
|
|
|
54 |
|
Chorus.unitClassPowerMain = function(...) |
|
55 |
|
return main(...) |
|
56 |
|
end |
File src/ChorusUnitClassPowerFrameTemplate.xml added (mode: 100644) (index 0000000..aa228db) |
|
1 |
|
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
|
3 |
|
<Script file="ChorusUnitClassPowerFrameTemplate.lua"/> |
|
4 |
|
<Frame name="ChorusBasePowerFrameTemplate" virtual="true"> |
|
5 |
|
<Size> |
|
6 |
|
<AbsDimension x="200" y="16"/> |
|
7 |
|
</Size> |
|
8 |
|
<Attributes> |
|
9 |
|
<Attribute name="useparent-unit" type="boolean" value="true"/> |
|
10 |
|
</Attributes> |
|
11 |
|
</Frame> |
|
12 |
|
<Frame name="ChorusDefaultPowerFrameTemplate" inherits="ChorusBasePowerFrameTemplate" virtual="true"> |
|
13 |
|
<Frames> |
|
14 |
|
<Frame name="$parentPowerFrame" inherits="ChorusUnitPowerLargeFrameTemplate" setAllPoints="true"/> |
|
15 |
|
<StatusBar name="$parentPowerStatusBar" inherits="ChorusUnitPowerStatusBarTemplate" setAllPoints="true"/> |
|
16 |
|
</Frames> |
|
17 |
|
</Frame> |
|
18 |
|
<Frame name="ChorusDruidPowerFrameTemplate" inherits="ChorusBasePowerFrameTemplate" virtual="true"> |
|
19 |
|
<Frames> |
|
20 |
|
<Frame name="$parentPowerFrame" inherits="ChorusUnitPowerLargeFrameTemplate"> |
|
21 |
|
<Anchors> |
|
22 |
|
<Anchor point="BOTTOMLEFT"> |
|
23 |
|
<Offset x="0" y="6"/> |
|
24 |
|
</Anchor> |
|
25 |
|
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT"> |
|
26 |
|
<Offset x="0" y="0"/> |
|
27 |
|
</Anchor> |
|
28 |
|
</Anchors> |
|
29 |
|
</Frame> |
|
30 |
|
<StatusBar name="$parentPowerStatusBar" inherits="ChorusUnitPowerStatusBarTemplate"> |
|
31 |
|
<Anchors> |
|
32 |
|
<Anchor point="BOTTOMLEFT"> |
|
33 |
|
<Offset x="0" y="6"/> |
|
34 |
|
</Anchor> |
|
35 |
|
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT"> |
|
36 |
|
<Offset x="0" y="0"/> |
|
37 |
|
</Anchor> |
|
38 |
|
</Anchors> |
|
39 |
|
</StatusBar> |
|
40 |
|
<!-- Skip the exact mana number for now. --> |
|
41 |
|
<!-- |
|
42 |
|
<Frame name="$parentManaFrame" inherits="ChorusUnitPowerLargeFrameTemplate,ChorusUnitPowerManaFrameTemplate"> |
|
43 |
|
<Anchors> |
|
44 |
|
<Anchor point="BOTTOMLEFT"> |
|
45 |
|
<Offset x="0" y="0"/> |
|
46 |
|
</Anchor> |
|
47 |
|
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT"> |
|
48 |
|
<Offset x="0" y="6"/> |
|
49 |
|
</Anchor> |
|
50 |
|
</Anchors> |
|
51 |
|
</Frame> |
|
52 |
|
--> |
|
53 |
|
<StatusBar name="$parentManaStatusBar" inherits="ChorusUnitPowerManaStatusBarTemplate"> |
|
54 |
|
<Anchors> |
|
55 |
|
<Anchor point="BOTTOMLEFT"> |
|
56 |
|
<Offset x="0" y="0"/> |
|
57 |
|
</Anchor> |
|
58 |
|
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT"> |
|
59 |
|
<Offset x="0" y="6"/> |
|
60 |
|
</Anchor> |
|
61 |
|
</Anchors> |
|
62 |
|
</StatusBar> |
|
63 |
|
</Frames> |
|
64 |
|
<Attributes> |
|
65 |
|
<Attribute name="chorus-unitclass" type="string" value="DRUID"/> |
|
66 |
|
</Attributes> |
|
67 |
|
</Frame> |
|
68 |
|
<Frame name="ChorusDeathKnightPowerFrameTemplate" inherits="ChorusBasePowerFrameTemplate" virtual="true"> |
|
69 |
|
<!-- TODO Add death knight power frame. --> |
|
70 |
|
<Attributes> |
|
71 |
|
<Attribute name="chorus-unitclass" type="string" value="DEATHKNIGHT"/> |
|
72 |
|
</Attributes> |
|
73 |
|
</Frame> |
|
74 |
|
<Frame name="ChorusUnitClassPowerFrameTemplate" inherits="ChorusBasePowerFrameTemplate" virtual="true"> |
|
75 |
|
<Frames> |
|
76 |
|
<Frame name="$parentDefaultPowerFrame" inherits="ChorusDefaultPowerFrameTemplate" parentKey="DEFAULT" hidden="true" setAllPoints="true"/> |
|
77 |
|
<Frame name="$parentDruidPowerFrame" inherits="ChorusDruidPowerFrameTemplate" parentKey="DRUID" hidden="true" setAllPoints="true"/> |
|
78 |
|
</Frames> |
|
79 |
|
<Scripts> |
|
80 |
|
<OnLoad>Chorus.unitClassPowerMain(self);</OnLoad> |
|
81 |
|
</Scripts> |
|
82 |
|
</Frame> |
|
83 |
|
</Ui> |