<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">
    <!-- © 2019 Peter Yu All Rights Reserved -->
    <!--Call: 	self.AnimFrame.Anim:SetScale(scale)   self.AnimFrame.Anim.Bling:Play()-->

	<Frame name="NarciArtFrameTemplate" frameLevel="20" virtual="true">
		<Anchors>
			<Anchor point="TOPLEFT" relativeKey="$parent" relativePoint="TOPLEFT"/>
			<Anchor point="BOTTOMRIGHT" relativeKey="$parent" relativePoint="BOTTOMRIGHT"/>
		</Anchors>	
	</Frame>

	<Frame name="NarciIDFrameTemplate" parentKey="IDFrame" hidden="false" frameLevel="12" virtual="true">
		<Size x="12" y="12"/>
		<Layers>
			<Layer level="OVERLAY">
				<FontString inherits="NarciIndicatorLetter" justifyH="CENTER" justifyV="MIDDLE" parentKey="Label" text="">
					<Color r="0.6" g="0.6" b="0.6"/>
					<Size y="12"/>
					<Anchors>
						<Anchor point="BOTTOM" relativeKey="$parent" relativePoint="BOTTOM" x="0" y="0"/>
					</Anchors>
				</FontString>
				<Texture setAllPoints="true" parentKey="GradientM">
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Label" relativePoint="TOPLEFT" x="6"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Label" relativePoint="BOTTOMRIGHT" x="-6"/>
					</Anchors>
					<Color r="0" g="0" b="0" a="0.6"/>
				</Texture>
				<Texture setAllPoints="true" parentKey="GradientL">
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Label" relativePoint="TOPLEFT" x="-6"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.GradientM" relativePoint="BOTTOMLEFT"/>
					</Anchors>
					<Color r="0" g="0" b="0" a="0.6"/>
					<Gradient orientation="HORIZONTAL">
						<MinColor r="1" g="1" b="1" a="0"/>
						<MaxColor r="1" g="1" b="1" a="1"/>
					</Gradient>
				</Texture>
				<Texture setAllPoints="true" parentKey="GradientR">
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.GradientM" relativePoint="TOPRIGHT"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Label" relativePoint="BOTTOMRIGHT" x="6"/>
					</Anchors>
					<Color r="0" g="0" b="0" a="0.6"/>
					<Gradient orientation="HORIZONTAL">
						<MinColor r="1" g="1" b="1" a="1"/>
						<MaxColor r="1" g="1" b="1" a="0"/>
					</Gradient>
				</Texture>
			</Layer>
		</Layers>
	</Frame>

	<Frame name="NarciFrameWithShadowTemplate" virtual="true">
		<Backdrop edgeFile="Interface\AddOns\Narcissus\Art\Tooltip\Tooltip-White-Border" tile="true">
			<EdgeSize>
				<AbsValue val="24"/>
			</EdgeSize>
			<TileSize>
				<AbsValue val="24"/>
			</TileSize>
			<BackgroundInsets>
				<AbsInset left="0" right="0" top="0" bottom="0"/>
			</BackgroundInsets>
		</Backdrop>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture setAllPoints="true" parentKey="inset" hidden="true">
					<Color r="1" g="1" b="1" a="0"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="11.5" y="-11.5"/>
						<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-11.5" y="11.5"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
	</Frame>

    <Frame name="NarciClickFeedbackTemplate" parentKey="AnimFrame" clipChildren="true" virtual="true">
        <Anchors>
            <Anchor point="TOPLEFT" x="0" y="0"/>
            <Anchor point="BOTTOMRIGHT" x="0" y="0"/>
        </Anchors>			
        <Layers>
            <Layer level="ARTWORK" textureSubLevel="3">
                <Texture file="Interface\AddOns\Narcissus\Art\BasicShapes\Circle" parentKey="Anim" hidden="false" alphaMode="ADD" Alpha="0">
                    <Size x="36" y="36"/>
                    <Anchors>
                        <Anchor point="CENTER" relativeKey="$parent" relativePoint="CENTER" x="0" y="0"/>
                    </Anchors>
                    <Animations>
                        <AnimationGroup parentKey="Bling" smoothing="IN_OUT">
                            <Alpha fromAlpha="0" toAlpha="0.3" duration="0.2" order="1"/>
                            <Scale scaleX="6" scaleY="6" duration="1.1" order="1"/>	
                            <Alpha startDelay="0.2" fromAlpha="0.3" toAlpha="0" duration="0.8" order="1"/>		
                            <Scripts>
                                <OnPlay>
                                    local mx, my = self:GetParent():GetParent():GetCenter();
                                    local px, py = GetCursorPosition()
                                    local scale = self:GetParent():GetParent():GetEffectiveScale()
                                    px, py = px/scale, py/scale
                                    self:GetParent():SetPoint("CENTER", px-mx, py-my)
                                    self:GetParent():Show();
                                </OnPlay>
                                <OnStop>
                                    self:GetParent():Hide();
                                </OnStop>
                                <OnFinished>
                                    self:GetParent():Hide();
                                </OnFinished>
                            </Scripts>
                        </AnimationGroup>
                    </Animations>
                </Texture>
            </Layer>
        </Layers>
    </Frame>

	<Frame name="NarciAnimContainerFrame" hidden="true" virtual="true">
		<Scripts>
			<OnLoad>
				self.OppoDirection = false;
				self.Width = self:GetParent():GetWidth();
				self.TimeSinceLastUpdate = 0;

				self.AnchorPoint, self.relativeTo, self.relativePoint, self.EndPoint, self.EndPointY = self:GetParent():GetPoint();
				self.EndPointBAK = self.EndPoint;
			</OnLoad>
			<OnShow>
				--print(self.OppoDirection)
				self:GetParent():Show()
				Anchor1, _, _, self.StartPoint, self.StartPointY = self:GetParent():GetPoint();
				--print(Anchor1.." "..self.StartPoint)
			</OnShow>
			<OnHide>
				self.TimeSinceLastUpdate = 0;
				self.OppoDirection = not self.OppoDirection;
			</OnHide>
		</Scripts>
	</Frame>

	<Frame name="NarciUpdateFrameTemplate" hidden="true" virtual="true">
		<Scripts>
			<OnLoad>
				self.TimeSinceLastUpdate = 0;
			</OnLoad>
			<OnHide>
				self.TimeSinceLastUpdate = 0;
			</OnHide>
		</Scripts>
	</Frame>

	<Texture name="NarciTopShadowTemplate" parentKey="TopGradient" setAllPoints="true" virtual="true">
		<Color a="1" r="1" g="1" b="1"/>
		<Size y="4"/>
		<Anchors>
			<Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"/>
			<Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="0" y="0"/>
		</Anchors>
		<Gradient orientation="VERTICAL">
			<MinColor a="0" r="0.0" g="0.0" b="0.0"/>
			<MaxColor a="0.6" r="0" g="0" b="0"/>
		</Gradient>
	</Texture>

	<Texture name="NarciTopLeftShadowNoneAnchorTemplate" parentKey="LeftGradient" setAllPoints="true" virtual="true">
		<Color a="1" r="1" g="1" b="1"/>
		<Size x="8"/>
		<Gradient orientation="HORIZONTAL">
			<MinColor a="0.0" r="0.0" g="0.0" b="0.0"/>
			<MaxColor a="0.4" r="0" g="0" b="0"/>
		</Gradient>
	</Texture>

	<Texture name="NarciTopLeftShadowTemplate" parentKey="LeftGradient" setAllPoints="true" virtual="true">
		<Color a="1" r="1" g="1" b="1"/>
		<Size x="8"/>
		<Anchors>
			<Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="0"/>
			<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" x="0" y="0"/>
		</Anchors>
		<Gradient orientation="HORIZONTAL">
			<MinColor a="0.0" r="0.0" g="0.0" b="0.0"/>
			<MaxColor a="0.4" r="0" g="0" b="0"/>
		</Gradient>
	</Texture>

	<Texture name="NarciBottomShadowTemplate" inherits="NarciTopShadowTemplate" parentKey="BottomGradient" setAllPoints="true" virtual="true">
		<Anchors>
			<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="0" y="0"/>
			<Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT" x="0" y="0"/>
		</Anchors>
	</Texture>

	<Slider name="NarciHorizontalSliderTemplate" orientation="HORIZONTAL" enableMouse="true" virtual="true">
		<HitRectInsets>
			<AbsInset left="-4" right="-4" top="-8" bottom="-8"/>
		</HitRectInsets>
		<ThumbTexture parentKey="Thumb" name="$parentThumb" setAllPoints="true" rotation="45">
			<Size x="12" y="12"/>
            <Color r="0" g="0" b="0" a="0.0"/>
		</ThumbTexture>
		<Layers>
			<Layer level="BACKGROUND" textureSubLevel="1">
				<Texture setAllPoints="true" snapToPixelGrid="false">
					<Color r="0.3" g="0.3" b="0.3" a="1"/>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="2">
				<Texture setAllPoints="true" parentKey="Border" snapToPixelGrid="false">
					<Color r="0" g="0" b="0" a="0.9"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="1" y="-1"/>
						<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-1" y="1"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="4">
				<Texture parentKey="VirtualThumb" setAllPoints="true" rotation="45">
					<Color r="0" g="0" b="0" a="1"/>
                    <Size x="10" y="10"/>
					<Anchors>
						<Anchor point="CENTER" relativePoint="CENTER" x="0" y="0"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="3">
				<Texture setAllPoints="true" rotation="45" parentKey="ThumbBorder">
					<Color r="0.3" g="0.3" b="0.3" a="1"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.VirtualThumb" relativePoint="TOPLEFT" x="-2" y="2"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.VirtualThumb" relativePoint="BOTTOMRIGHT" x="2" y="-2"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="OVERLAY">
				<FontString parentKey="KeyLabel" inherits="NarciIndicatorLetter" text="0" hidden="false" ignoreParentScale="true" justifyH="CENTER" justifyV="TOP">
					<Anchors>
						<Anchor point="TOP" relativeKey="$parent.VirtualThumb" relativePoint="BOTTOM" x="0" y="-6"/>
					</Anchors>
				</FontString>
				<FontString parentKey="KeyLabel2" inherits="NarciIndicatorLetter" text="0" hidden="true" ignoreParentScale="true" justifyH="LEFT" justifyV="MIDDLE">
					<Anchors>
						<Anchor point="LEFT" relativeKey="$parent" relativePoint="RIGHT" x="6" y="0"/>
					</Anchors>
				</FontString>
				<FontString parentKey="Label" inherits="NarciPrefFontWhiteMild" justifyH="RIGHT" justifyV="CENTER" text="Label">
					<Size x="0" y="0"/>
					<Anchors>
						<Anchor point="RIGHT" relativeKey="$parent" relativePoint="LEFT" x="-12" y="0"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnEnter>
				self.ThumbBorder:SetColorTexture(1, 1, 1);
			</OnEnter>
			<OnLeave>
				self.ThumbBorder:SetColorTexture(0.3, 0.3, 0.3);
			</OnLeave>
		</Scripts>
	</Slider>

	<Slider name="NarciVerticalSliderTemplate" orientation="VERTICAL" enableMouse="true" virtual="true">
		<HitRectInsets>
			<AbsInset left="-8" right="-8" top="-4" bottom="-4"/>
		</HitRectInsets>
		<ThumbTexture parentKey="Thumb" name="$parentThumb" setAllPoints="true" rotation="45">
			<Size x="12" y="12"/>
            <Color r="0" g="0" b="0" a="0.0"/>
		</ThumbTexture>
		<Layers>
			<Layer level="BACKGROUND" textureSubLevel="1">
				<Texture setAllPoints="true" snapToPixelGrid="false">
					<Color r="0.3" g="0.3" b="0.3" a="1"/>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="2">
				<Texture setAllPoints="true" parentKey="Border" snapToPixelGrid="false">
					<Color r="0" g="0" b="0" a="0.9"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="1" y="-1"/>
						<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-1" y="1"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="4">
				<Texture parentKey="VirtualThumb" setAllPoints="true" rotation="45">
					<Color r="0" g="0" b="0" a="1"/>
                    <Size x="10" y="10"/>
					<Anchors>
						<Anchor point="CENTER" relativePoint="CENTER" x="0" y="0"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="3">
				<Texture setAllPoints="true" rotation="45" parentKey="ThumbBorder">
					<Color r="0.3" g="0.3" b="0.3" a="1"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.VirtualThumb" relativePoint="TOPLEFT" x="-2" y="2"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.VirtualThumb" relativePoint="BOTTOMRIGHT" x="2" y="-2"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="OVERLAY">
				<FontString parentKey="KeyLabel" inherits="NarciIndicatorLetter" text="0" hidden="false" ignoreParentScale="true" justifyH="CENTER" justifyV="TOP">
					<Anchors>
						<Anchor point="TOP" relativeKey="$parent.VirtualThumb" relativePoint="BOTTOM" x="0" y="-6"/>
					</Anchors>
				</FontString>
				<FontString parentKey="KeyLabel2" inherits="NarciIndicatorLetter" text="0" hidden="true" ignoreParentScale="true" justifyH="LEFT" justifyV="MIDDLE">
					<Anchors>
						<Anchor point="LEFT" relativeKey="$parent" relativePoint="RIGHT" x="6" y="0"/>
					</Anchors>
				</FontString>
				<FontString parentKey="Label" inherits="NarciPrefFontWhiteMild" justifyH="RIGHT" justifyV="CENTER" text="Label">
					<Size x="0" y="0"/>
					<Anchors>
						<Anchor point="RIGHT" relativeKey="$parent" relativePoint="LEFT" x="-12" y="0"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnEnter>
				self.ThumbBorder:SetColorTexture(1, 1, 1);
			</OnEnter>
			<OnLeave>
				self.ThumbBorder:SetColorTexture(0.3, 0.3, 0.3);
			</OnLeave>
		</Scripts>
	</Slider>

    <Slider name="NarciHorizontalSliderWithMarksTemplate" inherits="NarciHorizontalSliderTemplate" virtual="true">
        <Scripts>
            <OnShow function="NarciAPI_OptimizeBorderThickness"/>
            <OnLoad function="NarciAPI_SliderWithSteps_OnLoad"/>
        </Scripts>
    </Slider>

	<Button name="NarciCloseButtonTemplate" virtual="true">
		<Size x="12" y="12"/>
		<HitRectInsets>
			<AbsInset left="-9" right="-9" top="-9" bottom="-9"/>
		</HitRectInsets>
		<Layers>
			<Layer level="OVERLAY" textureSubLevel="4">
				<Texture file="Interface\AddOns\Narcissus\ART\Tooltip\CloseButton" Alpha="1">
					<TexCoords left="0" right="0.5" top="0" bottom="1"/>
				</Texture>
			</Layer>
			<Layer level="OVERLAY" textureSubLevel="5">
				<Texture file="Interface\AddOns\Narcissus\ART\Tooltip\CloseButton" Alpha="0.2" alphaMode="ADD">
					<TexCoords left="0.5" right="1" top="0" bottom="1"/>
				</Texture>
			</Layer>
		</Layers>
		<HighlightTexture file="Interface\AddOns\Narcissus\Art\Tooltip\CloseButton" Alpha="0.5" alphaMode="ADD">
			<Size x="12" y="12"/>
			<Anchors>
				<Anchor point="CENTER"/>
			</Anchors>
			<TexCoords left="0.5" right="1" top="0" bottom="1"/>
		</HighlightTexture>	
		<Scripts>
			<OnClick>
				NarciAPI_FadeFrame(self:GetParent(), 0.2, "OUT");
			</OnClick>
			<OnEnter>
				--GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT",0,15);
				--GameTooltip:SetText(CLOSE);
			</OnEnter>
			<OnLeave>
				--GameTooltip:Hide();
			</OnLeave>
		</Scripts>
	</Button>

	<Button name="NarciCheckButtonTemplate" virtual="true">
		<Size>
			<AbsDimension x="16" y="16"/>
		</Size>
		<HitRectInsets>
			<AbsInset left="-4" right="-144" top="-4" bottom="-4"/>
		</HitRectInsets>
		<Layers>
			<Layer level="BACKGROUND" textureSubLevel="1">
				<Texture setAllPoints="true" parentKey="Background">
					<Color r="0.3" g="0.3" b="0.3" a="1"/>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="2">
				<Texture setAllPoints="true" parentKey="Border">
					<Color r="0" g="0" b="0" a="0.9"/>
					<!--Anchors>
						<Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="1" y="-1"/>
						<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-1" y="1"/>
					</Anchors-->
				</Texture>
			</Layer>
			<Layer level="OVERLAY" textureSubLevel="4">
				<FontString inherits="NarciPrefFontWhiteMild" justifyH="LEFT" justifyV="MIDDLE" parentKey="Label">
					<Size x="0" y="0"/>
					<Anchors>
						<Anchor point="LEFT" relativeKey="$parent" relativePoint="RIGHT" x="8" y="0"/>
					</Anchors>
				</FontString>
				<Texture file="Interface\AddOns\Narcissus\Art\Widgets\Arrows\Tick" parentKey="Tick" hidden="true">
					<Anchors>
						<Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="-0"/>
						<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-0" y="0"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				self.IsOn = false;
				NarciAPI_OptimizeBorderThickness(self);
			</OnLoad>
			<OnClick>
				self.IsOn = not self.IsOn;
				if self.IsOn then
					self.Tick:Show();
				else
					self.Tick:Hide();
				end
			</OnClick>
			<OnEnter>
				self.Background:SetColorTexture(1, 1, 1);
			</OnEnter>
			<OnLeave>
				self.Background:SetColorTexture(0.3, 0.3, 0.3);
			</OnLeave>
		</Scripts>
	</Button>

	<Button name="NarciConfirmButtonTemplate" hidden="true" virtual="true">
		<Size>
			<AbsDimension x="16" y="16"/>
		</Size>
		<HitRectInsets>
			<AbsInset left="-4" right="-4" top="-4" bottom="-4"/>
		</HitRectInsets>
		<Layers>
			<Layer level="OVERLAY" textureSubLevel="1">
				<Texture setAllPoints="true" parentKey="Background">
					<Color r="0.9882" g="0.9294" b="0.0" a="1"/>
					<Animations>
						<AnimationGroup parentKey="bling" smoothing="OUT" looping="BOUNCE">
							<Alpha startDelay="0.15" fromAlpha="1" toAlpha="0" duration="0.65" order="1"/>
						</AnimationGroup>
					</Animations>
				</Texture>
				<MaskTexture file="Interface\AddOns\Narcissus\Art\Widgets\Arrows\Tick" parentKey="Tick" hidden="false" hWrapMode="CLAMPTOBLACKADDITIVE" vWrapMode="CLAMPTOBLACKADDITIVE">
					<Anchors>
						<Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="0" y="-0"/>
						<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-0" y="0"/>
					</Anchors>
					<MaskedTextures>
						<MaskedTexture childKey="Background"/>
					</MaskedTextures>
				</MaskTexture>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				self.IsOn = false;
				--NarciAPI_OptimizeBorderThickness(self);
			</OnLoad>
			<OnShow>
				self.Background.bling:Play()
			</OnShow>
			<OnEnter>
				self.Background:SetColorTexture(1, 1, 1);
				self.Background.bling:Stop();
			</OnEnter>
			<OnLeave>
				self.Background:SetColorTexture(0.9882, 0.9294, 0.0);
				self.Background.bling:Play();
			</OnLeave>
				<OnClick>
					local action = self:GetParent().action;
					local key = self:GetParent().key;
					if action and key then
						if SetBinding(key, action, 1) then
							local Color_Good_r = 124/255;
							local Color_Good_g = 197/255;
							local Color_Good_b = 118/255;
							self:GetParent().Description:SetText("|cff7cc576"..KEY_BOUND)
							self:GetParent().Highlight:SetColorTexture(Color_Good_r, Color_Good_g, Color_Good_b)
							SaveBindings(1);    --account wide
							self:Hide();
						end
					end
				</OnClick>
		</Scripts>
	</Button>

	<Button name="NarciBindingButtonTemplate" virtual="true" registerForClicks="LeftButtonUp, RightButtonUp">
		<HitRectInsets>
			<AbsInset left="-4" right="-4" top="-4" bottom="-4"/>
		</HitRectInsets>
		<Layers>
			<Layer level="BACKGROUND" textureSubLevel="1">
				<Texture setAllPoints="true" parentKey="Background">
					<Color r="0.3" g="0.3" b="0.3" a="1"/>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="2">
				<Texture setAllPoints="true" parentKey="Highlight" Alpha="0">
					<Color r="1" g="1" b="1" a="1"/>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="3">
				<Texture setAllPoints="true" parentKey="Border">
					<Color r="0" g="0" b="0" a="0.9"/>
					<Gradient orientation="VERTICAL">
						<MinColor a="1" r="0.8" g="0.8" b="0.8"/>
						<MaxColor a="1" r="1" g="1" b="1"/>
					</Gradient>
					<Anchors>
						<Anchor point="TOPLEFT" relativePoint="TOPLEFT" x="1" y="-1"/>
						<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" x="-1" y="1"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="OVERLAY" textureSubLevel="4">
				<FontString inherits="NarciPrefFontWhiteMild" justifyH="RIGHT" justifyV="MIDDLE" parentKey="Label">
					<Size x="0" y="0"/>
					<Anchors>
						<Anchor point="RIGHT" relativeKey="$parent" relativePoint="LEFT" x="-8" y="0"/>
					</Anchors>
				</FontString>
				<FontString inherits="NarciNonInteractiveFont" justifyH="LEFT" justifyV="TOP" parentKey="Description" ignoreParentScale="true" Alpha="0" spacing="2">
					<Size x="170" y="0"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent" relativePoint="BOTTOMLEFT" x="0" y="-6"/>
					</Anchors>
				</FontString>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="4">
				<Texture setAllPoints="true" parentKey="DescriptionBackground">
					<Color r="0" g="0" b="0" a="0"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Description" relativePoint="TOPLEFT" x="2" y="-2"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Description" relativePoint="BOTTOMRIGHT" x="-2" y="2"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<ButtonText inherits="NarciPrefFontWhiteLabel" justifyH="CENTER" justifyV="MIDDLE" parentKey="Value" text="NOT_BOUND">
			<Size x="0" y="0"/>
			<Anchors>
				<Anchor point="CENTER" relativeKey="$parent" relativePoint="CENTER" x="0" y="0"/>
			</Anchors>
		</ButtonText>
		<Frames>
			<Button parentKey="ConfirmButton" inherits="NarciConfirmButtonTemplate">
				<Size>
					<AbsDimension x="14" y="14"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeKey="$parent.Border" relativePoint="RIGHT" x="6" y="0"/>
				</Anchors>
			</Button>
		</Frames>
		<Scripts>
			<OnLoad>
				self.IsOn = false;
			</OnLoad>
			<OnEnter>
				self.Background:SetColorTexture(1, 1, 1);
			</OnEnter>
			<OnLeave>
				self.Background:SetColorTexture(0.3, 0.3, 0.3);
			</OnLeave>
			<OnHide>
				self.Description:SetAlpha(0);
				self.DescriptionBackground:SetAlpha(0);
				self.Background:SetColorTexture(0.3, 0.3, 0.3);
				self.ConfirmButton:Hide();
			</OnHide>
		</Scripts>
	</Button>

	<Frame name="NarciHeaderWithShadowTemplate" hidden="false" virtual="true" parentKey="Header">
		<Size x="74" y="24"/>
        <Layers>
            <Layer level="BACKGROUND" textureSubLevel="1">
                <Texture file="Interface\AddOns\Narcissus\Art\Tooltip\DropShadow" parentKey="Shadow" Alpha="0.8">
					<TexCoords left="0.53515625" right="1" top="0" bottom="0.38671875"/>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativeKey="$parent" relativePoint="TOPLEFT" x="-2" y="2"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent" relativePoint="BOTTOMRIGHT" x="8" y="-8"/>
                    </Anchors>
                </Texture>
			</Layer>			
            <Layer level="BACKGROUND" textureSubLevel="2">
				<Texture setAllPoints="true" parentKey="BackgroundTop">
					<Color a="1" r="1" g="1" b="1"/>
					<Gradient orientation="VERTICAL">
						<MinColor a="1" r="0.06" g="0.06" b="0.06"/>
						<MaxColor a="1" r="0.12" g="0.12" b="0.12"/>
					</Gradient>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativeKey="$parent" relativePoint="TOPLEFT" x="0" y="0"/>
                        <Anchor point="BOTTOMRIGHT" relativeKey="$parent" relativePoint="RIGHT" x="0" y="4"/>
                    </Anchors>
				</Texture>
				<Texture setAllPoints="true" parentKey="BackgroundBottom">
					<Color a="1" r="0.06" g="0.06" b="0.06"/>
                    <Anchors>
                        <Anchor point="TOPLEFT" relativeKey="$parent" relativePoint="LEFT" x="0" y="4"/>
                        <Anchor point="BOTTOMRIGHT" relativeKey="$parent" relativePoint="BOTTOMRIGHT" x="0" y="0"/>
                    </Anchors>
				</Texture>
            </Layer>
			<Layer level="OVERLAY">
				<FontString parentKey="Text" inherits="AAAItemLevel" justifyH="CENTER" justifyV="MIDDLE">
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>

		</Scripts>
	</Frame>

    <Button name="Narci_RoundButtonTemplate" virtual="true">
		<Size>
			<AbsDimension x="24" y="24"/>
		</Size>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="Color" setAllPoints="true">
					<Color r="0.2" g="0.2" b="0.2" a="1"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativePoint="TOPLEFT"/>
						<Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="OVERLAY">
				<Texture file="Interface\AddOns\Narcissus\Art\Widgets\LightSetup\RoundButton" parentKey="Border">
					<TexCoords left="0" right="0.5" top="0" bottom="1"/>
					<Size x="34" y="34"/>
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent" relativePoint="CENTER"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<Texture parentKey="Highlight" setAllPoints="true" hidden="true" alphaMode="ADD">
					<Color r="1" g="1" b="1" a="0.5"/>
				</Texture>
				<MaskTexture file="Interface\AddOns\Narcissus\Art\Widgets\LightSetup\RoundButton-Mask" hWrapMode="CLAMPTOBLACKADDITIVE" vWrapMode="CLAMPTOBLACKADDITIVE">
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Border" relativePoint="TOPLEFT"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Border" relativePoint="BOTTOMRIGHT"/>
					</Anchors>
					<MaskedTextures>
						<MaskedTexture childKey="Color"/>
						<MaskedTexture childKey="Highlight"/>
					</MaskedTextures>
				</MaskTexture>
			</Layer>
		</Layers>
        <Scripts>
			<OnLoad>
				self.IsOn = false;
			</OnLoad>
            <OnEnter>
                self.Highlight:Show();
            </OnEnter>
            <OnLeave>
				if self.IsOn then	return; end
                self.Highlight:Hide();
            </OnLeave>
        </Scripts>
    </Button>

	<Button name="Narci_GemSlot_Template" parentKey="GemSlot" hidden="true" virtual="true">
		<Size x="30" y="30"/>
		<HitRectInsets>
			<AbsInset left="8" right="8" top="4" bottom="4"/>
		</HitRectInsets>
		<Layers>
			<Layer level="BORDER" textureSubLevel="2">
				<Texture parentKey="GemBorder" hidden="false">
					<Size x="30" y="30"/>
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent" relativePoint="CENTER" x="0" y="0"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="BORDER" textureSubLevel="1">
				<Texture name="GemIcon" parentKey="GemIcon" hidden="true" textureSubLevel="1">
					<Size x="7" y="7"/>
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent.GemBorder" relativePoint="CENTER" x="3" y="0"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Animations>
			<AnimationGroup parentKey="animIn">
				<Alpha startDelay="0.1" fromAlpha="0" toAlpha="1" duration="0.2" order="1"/>
				<Scripts>
					<OnPlay>
						self:GetParent():Show();
					</OnPlay>
					<OnFinished>
						self:GetParent():SetAlpha(1);
					</OnFinished>
				</Scripts>
			</AnimationGroup>
			<AnimationGroup parentKey="animOut">
				<Alpha startDelay="0.1" fromAlpha="1" toAlpha="0" duration="0.2" order="1"/>
				<Scripts>
					<OnFinished>
						self:GetParent():Hide();
						self:GetParent():SetAlpha(0);
					</OnFinished>
				</Scripts>
			</AnimationGroup>
		</Animations>
	</Button>

	<Button name="Narci_AlertFrame" inherits="NarciFrameWithShadowTemplate" frameStrata="TOOLTIP" frameLevel="30" Alpha="0" clampedToScreen="true" registerForClicks="LeftButtonUp, RightButtonUp" virtual="true" hidden="true" mixin="NarciAlertFrameMixin">
		<Size x="240" y="60"/>
		<Backdrop edgeFile="Interface\AddOns\Narcissus\Art\Tooltip\Tooltip-Red" tile="true">
			<EdgeSize>
				<AbsValue val="24"/>
			</EdgeSize>
			<TileSize>
				<AbsValue val="24"/>
			</TileSize>
			<BackgroundInsets>
				<AbsInset left="0" right="0" top="0" bottom="0"/>
			</BackgroundInsets>
		</Backdrop>
		<Layers>
			<Layer level="OVERLAY">
				<FontString parentKey="Text" inherits="ItemLevelMedium" justifyH="CENTER" justifyV="TOP" text="Description" spacing="2">
					<Size x="0" y="0"/>	<!--220, 0-->
					<Color r="1" g="1" b="1" a="1"/>
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent" relativePoint="CENTER" x="0" y="0"/>
						<!--Anchor point="RIGHT" relativeKey="$parent" relativePoint="RIGHT" x="-10"/-->
					</Anchors>
				</FontString>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="10">
				<Texture parentKey="Background" setAllPoints="true" hidden="true">
					<Color a="1" r="1" g="1" b="1"/>
					<Gradient orientation="VERTICAL">
						<MinColor a="1" r="0.0" g="0.0" b="0.0"/>
						<MaxColor a="1" r="0.1" g="0.1" b="0.1"/>
					</Gradient>
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Text" relativePoint="TOPLEFT" x="-10" y="10"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Text" relativePoint="BOTTOMRIGHT" x="10" y="-10"/>
					</Anchors>
				</Texture>
				<Texture name="NarciTopShadowTemplate" parentKey="TopGradient" setAllPoints="true" hidden="true">
					<Color a="1" r="1" g="1" b="1"/>
					<Size y="8"/>
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Background" relativePoint="BOTTOMLEFT" x="0" y="0"/>
						<Anchor point="TOPRIGHT" relativeKey="$parent.Background" relativePoint="BOTTOMRIGHT" x="0" y="0"/>
					</Anchors>
					<Gradient orientation="VERTICAL">
						<MinColor a="0" r="0.0" g="0.0" b="0.0"/>
						<MaxColor a="0.4" r="0" g="0" b="0"/>
					</Gradient>
				</Texture>
				<Texture file="Interface\AddOns\Narcissus\Art\Tooltip\Tooltip-Pointer" nounload="true" hidden="true">
					<Size x="18" y="18"/>
					<Anchors>
						<Anchor point="TOP" relativeKey="$parent.Background" relativePoint="BOTTOM" x="0" y="1"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ART">
				<Texture setAllPoints="true" parentKey="Gradient">
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.inset" relativePoint="TOPLEFT"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.inset" relativePoint="BOTTOMRIGHT"/>
					</Anchors>
					<Color r="1" g="1" b="1" a="1"/>
					<Gradient orientation="VERTICAL">
						<MinColor r="0.05" g="0.05" b="0.05" a="1"/>
						<MaxColor r="0.12" g="0.12" b="0.12" a="1"/>
					</Gradient>
				</Texture>

				<Texture File="Interface\AddOns\Narcissus\Art\Tooltip\Tooltip-White-Arrow" nounload="true" parentKey="Pointer">
					<Size x="16" y="16"/>
					<TexCoords left="0.5" right="1" top="0" bottom="1"/>
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent.inset" relativePoint="BOTTOM"  x="0" y="0.5"/>
					</Anchors>				
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnHide>
				self:StopAnimating();
				self:Hide();
				self:SetAlpha(0);
				self.anchor = nil;
			</OnHide>
			<OnClick>
				self:Hide();
			</OnClick>
			<OnShow>
				if self.Text:GetWidth() > 220 then
					self.Text:SetWidth(220);
				end
				self:SetHeight(math.max(48, self.Text:GetHeight() + 36));
				self:SetWidth(self.Text:GetWidth() + 48);
			</OnShow>
		</Scripts>
	</Button>

	<Button name="Narci_AlertFrame_Autohide" inherits="Narci_AlertFrame">
		<HitRectInsets>
			<AbsInset left="0" right="0" top="0" bottom="24"/>
		</HitRectInsets>
		<Animations>
			<AnimationGroup parentKey="Counter">
				<Scale parentKey="Duration" duration="2" order="1"/>
				<Scripts>
					<OnFinished>
						NarciAPI_FadeFrame(self:GetParent(), 0.35, "OUT");
					</OnFinished>
				</Scripts>
			</AnimationGroup>
		</Animations>
		<Scripts>
			<OnLoad>
				self.Text:SetTextColor(1, 0, 0)
				local function OnUpdate(self)
					<!--If this frame get moved, hide it right away-->
					local _, y = self:GetCenter();
					if not self.y then
						self.y = y;
					else
						local diffY = math.abs(y - self.y);
						if diffY > 10 then
							self.Counter:Stop();
							self:SetScript("OnUpdate", function()
								return;
							end)
						end
					end
				end
				self.OnUpdateFunc = OnUpdate;
			</OnLoad>
			<OnShow>
				local t = 2;	--Duration changes with text length
				local TextWidth = self.Text:GetWidth();
				if TextWidth > 220 then
					self.Text:SetWidth(220);
					t = 1 + 1.5*TextWidth / 220;
					--print("Hide in "..t.."s")
				end
				
				self:SetHeight(math.max(48, self.Text:GetHeight() + 36));
				self:SetWidth(self.Text:GetWidth() + 48);
				self:StopAnimating();
				self.Counter:SetScript("OnStop", function(self)
					NarciAPI_FadeFrame(self:GetParent(), 0.35, "OUT");
				end)
				self.Counter.Duration:SetDuration(t);
				self.Counter:Play();
				self:SetFrameStrata("TOOLTIP");
				self:SetScript("OnUpdate", self.OnUpdateFunc);
			</OnShow>
			<OnEnter>
				self.Counter:SetScript("OnStop", function()
					return;
				end)
				self:StopAnimating();
			</OnEnter>
			<OnLeave>
				self:StopAnimating();
				if self:IsVisible() then
					self.Counter:SetScript("OnStop", function(self)
						NarciAPI_FadeFrame(self:GetParent(), 0.35, "OUT");
					end)
					self:SetScript("OnUpdate", self.OnUpdateFunc);
					self.Counter.Duration:SetDuration(2);
					self.Counter:Play();
				end
			</OnLeave>
			<OnHide>
				self.x, self.y = nil, nil;
				self:StopAnimating();
				self:Hide();
				self.Text:SetSize(0, 0);
				self.Text:SetText("")
				self:SetAlpha(0);
				self:ClearAllPoints();
				self:SetParent(nil);
				self.anchor = nil;
			</OnHide>
		</Scripts>
	</Button>

	<Button name="Narci_AlertFrame_Static" inherits="Narci_AlertFrame">
		<Scripts>
			<OnLoad>
				self.Text:SetTextColor(0.25, 0.78, 0.92);
			</OnLoad>
		</Scripts>
		<Frames>
			<Button inherits="NarciCloseButtonTemplate" scale="0.6">
				<Anchors>
					<Anchor point="TOPRIGHT" relativePoint="TOPRIGHT" x="-4" y="-4"/>
				</Anchors>
			</Button>
		</Frames>
	</Button>

	<EditBox name="NarciEditBoxTemplate" autoFocus="false" virtual="true">
		<Scripts>
			<OnEnter>
				if self:IsEnabled() then
					SetCursor("Interface/CURSOR/Cast.blp");
				end
			</OnEnter>
			<OnLeave>
				SetCursor("Interface/CURSOR/Point.blp");
			</OnLeave>
			<OnHide>
				self:ClearFocus();
				self:HighlightText(0,0);
			</OnHide>
			<OnEditFocusGained>
				Narci.UserIsInputing = true;
			</OnEditFocusGained>
			<OnEditFocusLost>
				Narci.UserIsInputing = false;
				self:HighlightText(0,0);
			</OnEditFocusLost>
			<OnEscapePressed>
				self:ClearFocus();
			</OnEscapePressed>
			<OnEnterPressed>
				self:ClearFocus();
			</OnEnterPressed>
			<OnTextChanged>
				NarciAPI_SmartEditBoxType(self);
			</OnTextChanged>
		</Scripts>		
	</EditBox>
</Ui>