<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="ZHunterAIStrip.lua"/>

	<Button name="ZHunterAIStripDisplay" parent="UIParent" enableMouse="true" movable="true" inherits="ActionButtonTemplate" frameStrata="DIALOG" hidden="true">
		<Size>
			<AbsDimension x="22.5" y="22.5"/>
		</Size>
		<Anchors>
			<Anchor point="CENTER">
				<Offset>
					<AbsDimension x="0" y="0"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Layers>
			<Layer level="OVERLAY">
				<Texture name="$parentAutoCastable" file="Interface\Buttons\UI-AutoCastableOverlay">
					<Size>
						<AbsDimension x="43.5" y="43.5"/>
					</Size>
					<Anchors>
						<Anchor point="CENTER">
							<Offset>
								<AbsDimension x="0" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>		
			</Layer>
		</Layers>
		<Frames>
			<Model name="$parentAutoCast" file="Interface\Buttons\UI-AutoCastButton.mdx" scale="0.9" hidden="true" setAllPoints="true">
				<Scripts>
					<OnLoad>
						this:SetSequence(0);
						this:SetSequenceTime(0, 0);
					</OnLoad>
				</Scripts>
			</Model>
		</Frames>
		<Scripts>
			<OnLoad>
				this:RegisterEvent("VARIABLES_LOADED")
				this:RegisterForDrag("LeftButton")
				this:RegisterForClicks("LeftButtonUp", "RightButtonUp")
				ZHunterAIStripDisplayIcon:SetTexture("Interface\\Icons\\Ability_Creature_Cursed_02")
			</OnLoad>
			<OnEvent>
				if ZHunterMod_Saved["ZHunterAIStrip"]["display"] then
					this:Show()
				end
			</OnEvent>
			<OnClick>
				if arg1 == "LeftButton" then
					if not UnitAffectingCombat("player") then
						ZHunterAIStrip_UnequipAll()
					else
						ZHunterAIStrip_UnequipAll(1)
					end
				elseif arg1 == "RightButton" then
					if ZHunterAIStrip_On then
						ZHunterAIStrip_On = nil
						ZHunterAIStripDisplayAutoCast:Hide()
					else
						ZHunterAIStrip_On = 1
						ZHunterAIStripDisplayAutoCast:Show()
					end
				end
			</OnClick>
			<OnEnter>
				GameTooltip:SetOwner(this, "ANCHOR_TOPLEFT");
				GameTooltip:SetText("ZHunterAIStrip", 1, 1, 1)
				GameTooltip:AddLine("Left-Click to Strip now.")
				GameTooltip:AddLine("Right-Click to toggle auto-strip")
				GameTooltip:Show()
			</OnEnter>
			<OnLeave>
				GameTooltip:Hide()
			</OnLeave>
			<OnMouseUp>
				if ( this.isMoving ) then
					this:StopMovingOrSizing()
					this.isMoving = false
				end
			</OnMouseUp>
			<OnDragStart>
				if IsAltKeyDown() then
					this:StartMoving()
					this.isMoving = true
				end
			</OnDragStart>
			<OnDragStop>
				this:StopMovingOrSizing()
				this.isMoving = false
			</OnDragStop>
		</Scripts>
		<NormalTexture name="$parentNormalTexture" file="Interface\Buttons\UI-Quickslot2">
			<Size>
				<AbsDimension x="40.5" y="40.5"/>
			</Size>
			<Anchors>
				<Anchor point="CENTER">
					<Offset>
						<AbsDimension x="0" y="-1"/>
					</Offset>
				</Anchor>
			</Anchors>
		</NormalTexture>
	</Button>
</Ui>