vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | <Ui xmlns="http://www.blizzard.com/wow/ui/" |
2 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||
3 | xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\FrameXML\UI.xsd"> |
||
4 | <Frame name="StatRingsHealth" parent="UIParent" inherits="StatRingsRingTemplate"> |
||
5 | <Anchors> |
||
6 | <Anchor point="TOPLEFT" relativeTo="Moog_HudLeft" relativePoint="TOPLEFT"> |
||
7 | <Offset> |
||
8 | <AbsDimension x="-15" y="0"/> |
||
9 | </Offset> |
||
10 | </Anchor> |
||
11 | </Anchors> |
||
12 | <Scripts> |
||
13 | <OnLoad> |
||
14 | StatRings_RegisterRing(this, "Health"); |
||
15 | StatRingsRingTemplate_OnLoad(); |
||
16 | this.isInCombat = false; |
||
17 | this:SetAlpha(0.1); |
||
18 | |||
19 | this:RegisterEvent("PLAYER_ENTERING_WORLD"); |
||
20 | this:RegisterEvent("UNIT_HEALTH"); |
||
21 | this:RegisterEvent("UNIT_MAXHEALTH"); |
||
22 | this:RegisterEvent("PLAYER_ENTER_COMBAT"); |
||
23 | this:RegisterEvent("PLAYER_LEAVE_COMBAT"); |
||
24 | this:RegisterEvent("PLAYER_REGEN_ENABLED"); |
||
25 | this:RegisterEvent("PLAYER_REGEN_DISABLED"); |
||
26 | this:RegisterEvent("PLAYER_LEVEL_UP"); |
||
27 | |||
28 | this:UpdateColor({["r"] = 0.1, ["g"] = 0.9, ["b"] = 0.0}); |
||
29 | this:SetMax(UnitHealthMax("player")); |
||
30 | this:SetValue(UnitHealth("player")); |
||
31 | |||
32 | function this:UpdateAlpha() |
||
33 | --if not getglobal(this:GetName().."MoveAnchor"):IsVisible() then |
||
34 | if this.isInCombat then |
||
35 | StatRingsTest_SetAlpha(self, 0.5); |
||
36 | elseif this.startValue < this.maxValue then |
||
37 | StatRingsTest_SetAlpha(self, 0.5); |
||
38 | elseif not this.isInCombat then |
||
39 | StatRingsTest_SetAlpha(self, 0.1); |
||
40 | end |
||
41 | --end |
||
42 | end |
||
43 | this:AddUpdateFunction(this.UpdateAlpha); |
||
44 | </OnLoad> |
||
45 | <OnEvent> |
||
46 | if (event == "PLAYER_ENTERING_WORLD") then |
||
47 | this:UpdateColor({["r"] = 0.1, ["g"] = 0.9, ["b"] = 0.0}); |
||
48 | this:SetMax(UnitHealthMax("player")); |
||
49 | this:SetValue(UnitHealth("player"), UnitHealthMax("player")); |
||
50 | return; |
||
51 | elseif event == "PLAYER_ENTER_COMBAT" or event == "PLAYER_REGEN_DISABLED" then |
||
52 | this.isInCombat = true; |
||
53 | this.alphaState = -1; |
||
54 | elseif event == "PLAYER_LEAVE_COMBAT" or event == "PLAYER_REGEN_ENABLED" then |
||
55 | this.isInCombat = false; |
||
56 | this.alphaState = -1; |
||
57 | elseif event == "PLAYER_LEVEL_UP" then |
||
58 | this:SetMax(UnitHealthMax("player")); |
||
59 | end |
||
60 | if arg1 == "player" then |
||
61 | if (event == "UNIT_MAXHEALTH") then |
||
62 | this:SetMax(UnitHealthMax(arg1)); |
||
63 | else |
||
64 | this:SetValue(UnitHealth(arg1)); |
||
65 | end |
||
66 | end |
||
67 | </OnEvent> |
||
68 | </Scripts> |
||
69 | </Frame> |
||
70 | </Ui> |