<Ui xmlns="http://www.blizzard.com/wow/ui/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\..\FrameXML\UI.xsd">
	<Frame name="StatRingsMana" parent="UIParent" inherits="StatRingsRingTemplate">
		<Anchors>
			<Anchor point="TOPLEFT" relativeTo="Nurfed_Hud" relativePoint="TOPRIGHT">
				<Offset>
					<AbsDimension x="0" y="0"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Scripts>
			<OnLoad>
				StatRings_RegisterRing(this, "Mana");
      			StatRingsRingTemplate_OnLoad();
				this:SetReversed(true);
      			
				this:SetAlpha(0.1);
        		
				this:RegisterEvent("PLAYER_ENTERING_WORLD");
				this:RegisterEvent("UNIT_MANA");
				this:RegisterEvent("UNIT_MAXMANA");
				this:RegisterEvent("UNIT_ENERGY");
				this:RegisterEvent("UNIT_MAXENERGY");
				this:RegisterEvent("UNIT_RAGE");
				this:RegisterEvent("UNIT_MAXRAGE");
				this:RegisterEvent("UNIT_DISPLAYPOWER");
				this:RegisterEvent("PLAYER_LEVEL_UP");
    			
				this:UpdateColor(ManaBarColor[UnitPowerType("player")]);
				this:SetMax(UnitManaMax("player"));
				this:SetValue(UnitMana("player"));

				function this:UpdateAlpha()
					if this.startValue &lt; this.maxValue then
						StatRingsTest_SetAlpha(self, 0.4);
					elseif this.startValue == this.maxValue then
						StatRingsTest_SetAlpha(self, 0.1);
					end
				end
				this:AddUpdateFunction(this.UpdateAlpha);
			</OnLoad>
			<OnEvent>
				if (event == "PLAYER_ENTERING_WORLD") then
					this:UpdateColor(ManaBarColor[UnitPowerType("player")]);
					this:SetMax(UnitManaMax("player"));
					this:SetValue(UnitMana("player"));
					return;
				elseif event == "PLAYER_LEVEL_UP" then
					this:SetMax(UnitManaMax("player"));
				end
				if (arg1 == "player") then 
				  	if (event == "UNIT_DISPLAYPOWER") then
				    	this:UpdateColor(ManaBarColor[UnitPowerType("player")]);
				    elseif event == "UNIT_MAXMANA" then
				    	this:SetMax(UnitManaMax("player"));
					else
						this:SetValue(UnitMana("player"));
					end
				end
			</OnEvent>
		</Scripts>
	</Frame>
</Ui>