<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">
	<Script file="Blizzard_GarrisonCapacitiveDisplay.lua"/>

	<Button name="GarrisonCapacitiveItemButtonTemplate" parentArray="Reagents" virtual="true">
		<Size x="147" y="41"/>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="Icon">
					<Size x="39" y="39"/>
					<Anchors>
						<Anchor point="TOPLEFT" x="0" y="0"/>
					</Anchors>
				</Texture>
				<Texture parentKey="NameFrame" atlas="Capacitance-General-ItemBorder" useAtlasSize="true">
					<Size x="128" y="64"/>
					<Anchors>
						<Anchor point="LEFT" relativeKey="$parent.Icon" relativePoint="RIGHT" x="2" y="0"/>
					</Anchors>
				</Texture>
				<FontString parentKey="Name" inherits="GameFontHighlight" justifyH="LEFT">
					<Size  x="90" y="36"/>
					<Anchors>
						<Anchor point="LEFT" relativeKey="$parent.NameFrame" x="6" y="0"/>
					</Anchors>
				</FontString>
			</Layer>
			<Layer level="ARTWORK">
				<FontString parentKey="Count" inherits="NumberFontNormal" justifyH="RIGHT">
					<Anchors>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Icon" x="-1" y="1"/>
					</Anchors>
					<Color r="1" b="1" g="1"/>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnClick>
				if ( IsModifiedClick("CHATLINK") ) then
	 				ChatEdit_InsertLink(C_Garrison.GetShipmentReagentItemLink(self:GetID()));
	 			end
	 		</OnClick>
	 		<OnEnter>
	 			if (self.itemId) then
	 				GameTooltip:SetOwner(self, "ANCHOR_RIGHT", 2, -80);
	 				GameTooltip:SetItemByID(self.itemId);
	 			end
	 		</OnEnter>
	 		<OnLeave>
	 			GameTooltip:Hide();
	 		</OnLeave>
	 	</Scripts>
	</Button>

	<Frame name="GarrisonCapacitiveWorkOrderTemplate" parentArray="WorkOrders" virtual="true">
		<Size x="32" y="32"/>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture atlas="Capacitance-General-WorkOrderEmpty">
					<Size x="32" y="32"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK" textureSubLevel="-1">
				<Texture parentKey="Icon">
					<Size x="30" y="30"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
					<TexCoords left="0.0625" right="0.9375" top="0.0625" bottom="0.9375"/>
				</Texture>
		 	</Layer>
			<Layer level="ARTWORK" textureSubLevel="1">
				<Texture parentKey="Border" atlas="Capacitance-General-WorkOrderBorder" hidden="true">
					<Size x="32" y="32"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<Texture parentKey="Arrow" atlas="Capacitance-General-WorkOrderArrow" useAtlasSize="true" hidden="true">
					<Anchors>
						<Anchor point="TOP" relativeKey="$parent.Border" relativePoint="BOTTOM"/>
					</Anchors>
				</Texture>
				<Texture parentKey="CompletedOverlay" setAllPoints="true" hidden="true">
					<Color r="255" g="210" b="0" a="0.5"/>
				</Texture>
				<Texture parentKey="QueuedOverlay" setAllPoints="true" hidden="true">
					<Color r="0" g="0" b="0" a="0.5"/>
				</Texture>
			</Layer>
			<Layer level="ARTWORK" textureSubLevel="2">
				<Texture parentKey="Checkmark" atlas="Capacitance-General-WorkOrderCheckMark" hidden="true">
					<Size x="32" y="32"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</Texture>
				<Texture parentKey="Active" atlas="Capacitance-General-WorkOrderActive" useAtlasSize="true" hidden="true">
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</Texture>
				<Texture parentKey="Lock" atlas="Capacitance-General-LockIcon" useAtlasSize="true" hidden="true">
					<Anchors>
						<Anchor point="CENTER" x="2" y="0"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnEnter function="GarrisonCapacitiveWorkOrder_OnEnter"/>
			<OnLeave function="GarrisonCapacitiveWorkOrder_OnLeave"/>
		</Scripts>
	</Frame>

	<Frame name="GarrisonCapacitiveDisplayFrame" parent="UIParent" inherits="ButtonFrameTemplate" hidden="true">
		<Anchors>
			<Anchor point="TOPLEFT" x="28" y="-108"/>
		</Anchors>
		<Frames>
			<Frame parentKey="CapacitiveDisplay">
				<Anchors>
					<Anchor point="TOPLEFT" relativeKey="$parent.Inset" relativePoint="TOPLEFT" x="3" y="-3" />
					<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Inset" relativePoint="BOTTOMRIGHT" x="-3" y="3" />
				</Anchors>
				<Layers>
					<Layer level="ARTWORK" textureSubLevel="-1">
						<Texture parentKey="IconBG" atlas="Capacitance-General-ItemBorder">
							<Size x="250" y="40"/>
							<Anchors>
								<Anchor point="TOP" x="24" y="-12"/>
							</Anchors>
						</Texture>
					</Layer>
					<Layer level="ARTWORK" textureSubLevel="1">
						<FontString parentKey="Description" inherits="GameFontHighlight" justifyH="LEFT">
							<Size x="296" y="0"/>
							<Anchors>
								<Anchor point="TOPLEFT" relativeKey="$parent.IconBG" relativePoint="BOTTOMLEFT" x="-48" y="-12"/>
							</Anchors>
						</FontString>
						<FontString parentKey="Reagents" inherits="GameFontNormalSmall" text="SPELL_REAGENTS">
							<Anchors>
								<Anchor point="TOPLEFT" relativeKey="$parent.Description" relativePoint="BOTTOMLEFT" x="0" y="-12"/>
							</Anchors>
						</FontString>
						<FontString parentKey="FollowerActive" inherits="GameFontNormal" text="CAPACITANCE_FOLLOWER_BONUS_ACTIVE" hidden="true">
							<Anchors>
								<Anchor point="BOTTOMLEFT" relativeTo="GarrisonCapacitiveDisplayFrame" relativePoint="BOTTOMLEFT" x="8" y="8"/>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Frames>
					<Frame parentKey="ShipmentIconFrame">
						<Size x="42" y="42"/>
						<Anchors>
							<Anchor point="RIGHT" relativeKey="$parent.IconBG" relativePoint="LEFT" x="-6" y="0"/>
						</Anchors>
						<Layers>
							<Layer level="ARTWORK">
								<Texture parentKey="Icon">
									<Size x="42" y="42"/>
									<Anchors>
										<Anchor point="CENTER"/>
									</Anchors>
								</Texture>
							</Layer>
							<Layer level="ARTWORK" textureSubLevel="1">
								<FontString parentKey="ShipmentName" inherits="GameFontNormal">
									<Anchors>
										<Anchor point="TOPLEFT" relativeKey="$parent.$parent.IconBG" relativePoint="TOPLEFT" x="6" y="-6"/>
									</Anchors>
								</FontString>
								<FontString parentKey="ShipmentsAvailable" inherits="GameFontHighlightSmall">
									<Anchors>
										<Anchor point="BOTTOMLEFT" relativeKey="$parent.$parent.IconBG" relativePoint="BOTTOMLEFT" x="6" y="6"/>
									</Anchors>
								</FontString>
							</Layer>
						</Layers>
						<Scripts>
							<OnEnter>
								if (self.itemId) then
									GameTooltip:SetOwner(self, "ANCHOR_RIGHT", 2, -80);
									GameTooltip:SetItemByID(self.itemId);
								end
							</OnEnter>
							<OnLeave>
								GameTooltip:Hide();
							</OnLeave>
						</Scripts>
					</Frame>
					<Button inherits="GarrisonCapacitiveItemButtonTemplate" id="1">
						<Anchors>
							<Anchor point="TOPLEFT" relativeKey="$parent.Reagents" relativePoint="BOTTOMLEFT" x="0" y="-4"/>
						</Anchors>
					</Button>
				</Frames>
			</Frame>
			<Frame parentKey="FinishedGlow" setAllPoints="true">
				<Animations>
					<AnimationGroup parentKey="FinishedAnim">
						<Alpha change="1" duration="0.1" order="1" />
						<Alpha startDelay="0.1" change="-1" duration="0.5" order="2" />
					</AnimationGroup>
				</Animations>
				<Layers>
					<Layer level="OVERLAY">
						<Texture parentKey="FinishedFlare" file="Interface\Reforging\Valor-Flare" alphaMode="ADD">
							<Size x="256" y="256"/>
							<Anchors>
								<Anchor point="TOPLEFT" y="-23"/>
								<Anchor point="BOTTOMRIGHT" y="26"/>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetAlpha(0);
					</OnLoad>
				</Scripts>
			</Frame>
			<Button parentKey="StartWorkOrderButton" inherits="MagicButtonTemplate" text="CAPACITANCE_START_WORK_ORDER">
				<Size x="160" y="22"/>
				<Anchors>
					<Anchor point="BOTTOMRIGHT"/>
				</Anchors>
				<Scripts>
					<OnClick function="GarrisonCapacitiveStartWorkOrder_OnClick"/>
				</Scripts>
			</Button>
		</Frames>
		<Scripts>
			<OnLoad function="GarrisonCapacitiveDisplayFrame_OnLoad"/>
			<OnEvent function="GarrisonCapacitiveDisplayFrame_OnEvent"/>
			<OnHide function="GarrisonCapacitiveDisplayFrame_OnHide"/>
		</Scripts>
	</Frame>
</Ui>