<Ui>
	<Texture name="CPKeyboardFill" virtual="true"
		file="Interface\AddOns\ConsolePort_Keyboard\Assets\Palette"/>
	<Texture name="CPKeyboardRounded" virtual="true"
		file="Interface\AddOns\ConsolePort_Keyboard\Assets\Char" />

	<Texture name="CPKeyboardRingMask" virtual="true"
		file="Interface\AddOns\ConsolePort_Keyboard\Assets\PaletteMask" 
		hWrapMode="CLAMPTOWHITE" vWrapMode="CLAMPTOWHITE"/>
	<Texture name="CPKeyboardCharMask" virtual="true"
		file="Interface\AddOns\ConsolePort_Keyboard\Assets\CharMask" 
		hWrapMode="CLAMPTOWHITE" vWrapMode="CLAMPTOWHITE"/>

	<!-- Templates -->
	<CheckButton name="CPKeyboardChar" virtual="true" registerForClicks="AnyUp">
		<Size x="24" y="24"/>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="Background" inherits="CPKeyboardRounded">
					<Anchors>
						<Anchor point="TOPLEFT" x="-4" y="4"/>
						<Anchor point="BOTTOMRIGHT" x="4" y="-4"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<FontString inherits="GameFontHighlightLarge" justifyH="CENTER" parentKey="Text" setAllPoints="true"/>
				<Texture parentKey="Ring" inherits="CPKeyboardRounded" alpha="0.75" hidden="true">
					<Anchors>
						<Anchor point="TOPLEFT" x="-4" y="4"/>
						<Anchor point="BOTTOMRIGHT" x="4" y="-4"/>
					</Anchors>
				</Texture>
				<MaskTexture parentKey="RingMask" inherits="CPKeyboardCharMask" >
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Ring" x="1" y="-1"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Ring" x="-1" y="1"/>
					</Anchors>
					<MaskedTextures>
						<MaskedTexture childKey="Ring"/>
					</MaskedTextures>
				</MaskTexture>
			</Layer>
		</Layers>
	</CheckButton>

	<Frame name="CPKeyboardWordButton" virtual="true">
		<Size x="140" y="20"/>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="Hilite" file="Interface\QuestFrame\UI-QuestTitleHighlight" setAllPoints="true" alphaMode="ADD"/>
			</Layer>
			<Layer level="ARTWORK">
				<FontString parentKey="Text" inherits="ChatFontNormal" justifyH="CENTER" setAllPoints="true"/>
			</Layer>
		</Layers>
	</Frame>

	<PieMenu name="CPKeyboardSet" virtual="true" registerForClicks="AnyUp">
		<Size x="90" y="90"/>
	</PieMenu>

	<!-- Keyboard frame -->
	<PieMenu name="ConsolePortKeyboard" parent="UIParent" hidden="true" frameStrata="TOOLTIP" clampedToScreen="true" movable="true" registerForDrag="LeftButton">
		<Size x="160" y="160"/>
		<Anchors>
			<Anchor point="CENTER" x="250"/>
		</Anchors>
		<Layers>
			<Layer level="BACKGROUND" textureSubLevel="1">
				<Texture parentKey="Fill" inherits="CPKeyboardFill" alpha="0.5">
					<Anchors>
						<Anchor point="TOPLEFT" x="-64" y="64"/>
						<Anchor point="BOTTOMRIGHT" x="64" y="-64"/>
					</Anchors>
				</Texture>
				<MaskTexture parentKey="FillMask" inherits="CPKeyboardRingMask">
					<Anchors>
						<Anchor point="TOPLEFT" x="30" y="-30"/>
						<Anchor point="BOTTOMRIGHT" x="-30" y="30"/>
					</Anchors>
					<MaskedTextures>
						<MaskedTexture childKey="Fill"/>
					</MaskedTextures>
				</MaskTexture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="2">
				<Texture parentKey="Edge" inherits="CPKeyboardFill" alpha="0.5">
					<Anchors>
						<Anchor point="TOPLEFT" x="-64" y="64"/>
						<Anchor point="BOTTOMRIGHT" x="64" y="-64"/>
					</Anchors>
				</Texture>
				<MaskTexture parentKey="EdgeMask" inherits="CPKeyboardRingMask">
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Edge" x="1" y="-1"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Edge" x="-1" y="1"/>
					</Anchors>
					<MaskedTextures>
						<MaskedTexture childKey="Edge"/>
					</MaskedTextures>
				</MaskTexture>
				<Texture parentKey="Donut" inherits="CPKeyboardFill" alpha="0.5">
					<Anchors>
						<Anchor point="TOPLEFT" x="30" y="-30"/>
						<Anchor point="BOTTOMRIGHT" x="-30" y="30"/>
					</Anchors>
				</Texture>
				<MaskTexture parentKey="DonutMask" inherits="CPKeyboardRingMask">
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Donut" x="1" y="-1"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Donut" x="-1" y="1"/>
					</Anchors>
					<MaskedTextures>
						<MaskedTexture childKey="Donut"/>
					</MaskedTextures>
				</MaskTexture>
			</Layer>
		</Layers>
		<Frames>
			<Frame parentKey="WordSuggester" frameLevel="1">
				<Size x="150" y="200"/>
				<Anchors>
					<Anchor point="LEFT" relativePoint="RIGHT" x="40"/>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture parentKey="Fill" inherits="CPKeyboardRounded" setAllPoints="true" scale="0.5" rotation="180">
							<TextureSliceMargins left="32" right="32" top="32" bottom="32"/>
						</Texture>
						<MaskTexture parentKey="FillMask" inherits="CPKeyboardRingMask">
							<Anchors>
								<Anchor point="TOPLEFT" relativeKey="$parent.$parent" x="-70" y="70"/>
								<Anchor point="BOTTOMRIGHT" relativeKey="$parent.$parent" x="70" y="-70"/>
							</Anchors>
							<MaskedTextures>
								<MaskedTexture childKey="Fill"/>
							</MaskedTextures>
						</MaskTexture>
					</Layer>
				</Layers>
				<Frames>
					<Frame parentKey="Mime" clipChildren="true">
						<Size y="20"/>
						<Anchors>
							<Anchor point="TOPLEFT" x="16" y="-6"/>
							<Anchor point="TOPRIGHT" x="-16" y="-6"/>
						</Anchors>
						<Layers>
							<Layer level="ARTWORK">	
								<Texture parentKey="Cursor">
									<Anchors>
										<Anchor point="CENTER"/>
									</Anchors>
									<Size x="1" y="10"/>
									<Color r="1" g="1" b="1" a="1"/>
									<Animations>
										<AnimationGroup parentKey="FlashAnim" setToFinalAlpha="true" looping="REPEAT">
											<Alpha parentKey="FadeIn" duration="0.25" fromAlpha="0" toAlpha="1" order="1"/>
											<Alpha parentKey="FadeOut" duration="0.25" fromAlpha="1" toAlpha="0" order="2"/>
											<Scripts>
												<OnLoad>
													self:Play();
												</OnLoad>
											</Scripts>
										</AnimationGroup>
									</Animations>
								</Texture>
								<FontString parentKey="Text" inherits="ChatFontNormal"/>
							</Layer>
						</Layers>
					</Frame>
					<Frame parentKey="Background" useParentLevel="true">
						<Anchors>
							<Anchor point="TOPLEFT" relativeKey="$parent.Mime" x="-12" y="2"/>
							<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Mime" x="12" y="-2"/>
						</Anchors>
						<Layers>
							<Layer level="BACKGROUND">
								<Texture parentKey="Box" inherits="CPAtlas" scale="0.8">
									<KeyValues>
										<KeyValue key="atlas" value="glues-gamemode-bg" type="string"/>
									</KeyValues>
									<Anchors>
										<Anchor point="TOPLEFT" x="0" y="0"/>
										<Anchor point="BOTTOMRIGHT" x="0" y="0"/>
									</Anchors>
								</Texture>
								<MaskTexture parentKey="FillMask" inherits="CPKeyboardRingMask">
									<Anchors>
										<Anchor point="TOPLEFT" relativeKey="$parent.$parent.$parent" x="-80" y="80"/>
										<Anchor point="BOTTOMRIGHT" relativeKey="$parent.$parent.$parent" x="80" y="-80"/>
									</Anchors>
									<MaskedTextures>
										<MaskedTexture childKey="Box"/>
									</MaskedTextures>
								</MaskTexture>
							</Layer>
						</Layers>
					</Frame>
				</Frames>
			</Frame>
			<Frame parentKey="Controls" frameLevel="1" inherits="CPKeyboardSet">
				<Anchors>
					<Anchor point="CENTER"/>
				</Anchors>
			</Frame>
		</Frames>
	</PieMenu>
</Ui>
