File src/ChorusUnitBackgroundTemplate.lua changed (mode: 100644) (index 0081d28..ebe0798) |
... |
... |
local function unitBackgroundEventProcessor(unitBackground) |
15 |
15 |
unitBackground:Show() |
unitBackground:Show() |
16 |
16 |
else |
else |
17 |
17 |
unitBackground:Hide() |
unitBackground:Hide() |
|
18 |
|
return |
|
19 |
|
end |
|
20 |
|
|
|
21 |
|
local textureEnemy = unitBackground.textureEnemy |
|
22 |
|
assert(textureEnemy ~= nil) |
|
23 |
|
|
|
24 |
|
local textureFriend = unitBackground.textureFriend |
|
25 |
|
assert(textureFriend ~= nil) |
|
26 |
|
|
|
27 |
|
local textureNeutral = unitBackground.textureNeutral |
|
28 |
|
assert(textureNeutral ~= nil) |
|
29 |
|
|
|
30 |
|
if UnitIsFriend('player', u) then |
|
31 |
|
textureFriend:Show() |
|
32 |
|
textureEnemy:Hide() |
|
33 |
|
textureNeutral:Hide() |
|
34 |
|
elseif UnitIsEnemy('player', u) then |
|
35 |
|
textureFriend:Show() |
|
36 |
|
textureEnemy:Show() |
|
37 |
|
textureNeutral:Hide() |
|
38 |
|
elseif UnitIsTapped(u) then |
|
39 |
|
textureFriend:Show() |
|
40 |
|
textureEnemy:Show() |
|
41 |
|
textureNeutral:Hide() |
|
42 |
|
else |
|
43 |
|
textureFriend:Hide() |
|
44 |
|
textureEnemy:Hide() |
|
45 |
|
textureNeutral:Show() |
18 |
46 |
end |
end |
19 |
47 |
end |
end |
20 |
48 |
|
|
|
... |
... |
This frame is composed with unit frames and unit buttons. |
29 |
57 |
local function unitBackgroundMain(unitBackground) |
local function unitBackgroundMain(unitBackground) |
30 |
58 |
assert(unitBackground ~= nil) |
assert(unitBackground ~= nil) |
31 |
59 |
|
|
|
60 |
|
local n = unitBackground:GetName() or '' |
|
61 |
|
unitBackground.textureFriend = _G[string.format('%sTexture1', n)] |
|
62 |
|
unitBackground.textureEnemy = _G[string.format('%sTexture2', n)] |
|
63 |
|
unitBackground.textureNeutral = _G[string.format('%sTexture3', n)] |
|
64 |
|
|
32 |
65 |
unitBackground:RegisterEvent('ADDON_LOADED') |
unitBackground:RegisterEvent('ADDON_LOADED') |
33 |
66 |
unitBackground:RegisterEvent('PARTY_CONVERTED_TO_RAID') |
unitBackground:RegisterEvent('PARTY_CONVERTED_TO_RAID') |
34 |
67 |
unitBackground:RegisterEvent('PARTY_MEMBERS_CHANGED') |
unitBackground:RegisterEvent('PARTY_MEMBERS_CHANGED') |
|
... |
... |
local function unitBackgroundMain(unitBackground) |
36 |
69 |
unitBackground:RegisterEvent('PLAYER_LOGIN') |
unitBackground:RegisterEvent('PLAYER_LOGIN') |
37 |
70 |
unitBackground:RegisterEvent('PLAYER_TARGET_CHANGED') |
unitBackground:RegisterEvent('PLAYER_TARGET_CHANGED') |
38 |
71 |
unitBackground:RegisterEvent('RAID_ROSTER_UPDATE') |
unitBackground:RegisterEvent('RAID_ROSTER_UPDATE') |
|
72 |
|
unitBackground:RegisterEvent('ZONE_CHANGED') |
39 |
73 |
|
|
40 |
74 |
unitBackground:SetScript('OnEvent', unitBackgroundEventProcessor) |
unitBackground:SetScript('OnEvent', unitBackgroundEventProcessor) |
41 |
75 |
end |
end |
File src/ChorusUnitBackgroundTemplate.xml changed (mode: 100644) (index 717b7d9..a3e05c5) |
4 |
4 |
<Frame name="ChorusUnitBackgroundTemplate" virtual="true" protected="false" setAllPoints="true"> |
<Frame name="ChorusUnitBackgroundTemplate" virtual="true" protected="false" setAllPoints="true"> |
5 |
5 |
<Layers> |
<Layers> |
6 |
6 |
<Layer level="BACKGROUND"> |
<Layer level="BACKGROUND"> |
7 |
|
<Texture name="$parentTexture" setAllPoints="true"> |
|
|
7 |
|
<Texture name="$parentTexture1" setAllPoints="true"> |
8 |
8 |
<Color r="0" g="0" b="0" a="0.34"/> |
<Color r="0" g="0" b="0" a="0.34"/> |
9 |
9 |
</Texture> |
</Texture> |
|
10 |
|
<Texture name="$parentTexture2" setAllPoints="true" hidden="true"> |
|
11 |
|
<Color r="0.7" g="0.14" b="0.14" a="0.34"/> |
|
12 |
|
</Texture> |
|
13 |
|
<Texture name="$parentTexture3" setAllPoints="true" hidden="true"> |
|
14 |
|
<Color r="1" g="0.84" b="0" a="0.34"/> |
|
15 |
|
</Texture> |
10 |
16 |
</Layer> |
</Layer> |
11 |
17 |
</Layers> |
</Layers> |
12 |
18 |
<Attributes> |
<Attributes> |