Quantcast
<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="ww_configDisplayOptions" inherits="ww_borderedFrame" hidden="true">
		<Anchors>
			<Anchor point="TOPLEFT"/>
			<Anchor point="BOTTOMRIGHT"/>
		</Anchors>
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentHeader" parentKey="header" inherits="ww_headerFont"/>
			</Layer>
			<Layer level="BACKGROUND">
				<Texture setAllPoints="true">
					<!--Plain black background with 80% alpha-->
					<Color r="0" g="0" b="0" a="0.8"/>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Frame name="$parentShowWeights" parentKey="showWeights" inherits="ww_modifierKeyDropDown">
				<Anchors>
					<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentHeader">
						<Offset>
							<AbsDimension x="0" y="-10"/>
						</Offset>
					</Anchor>
					<Anchor point="LEFT">
						<Offset>
							<AbsDimension x="9" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.label:SetText(ww_localization["SHOW_WTS"])
						self.dropdown:SetText("showWeights")
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame name="$parentShowIdealWeights" parentKey="showIdealWeights" inherits="ww_modifierKeyDropDown">
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentShowWeights">
						<Offset>
							<AbsDimension x="20" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.label:SetText(ww_localization["SHOW_IDEAL_WTS"])
						self.dropdown:SetText("showIdealWeights")
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame name="$parentShowEnhancements" parentKey="showEnhancements" inherits="ww_modifierKeyDropDown">
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentShowIdealWeights">
						<Offset>
							<AbsDimension x="20" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.label:SetText(ww_localization["SHOW_IDEAL_ENHANCEMENTS"])
						self.dropdown:SetText("showEnhancements")
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame name="$parentShowAlternateEnhancements" parentKey="showAlternateEnhancements" inherits="ww_modifierKeyDropDown">
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentShowEnhancements">
						<Offset>
							<AbsDimension x="20" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.label:SetText(ww_localization["SHOW_ALT_IDEAL_ENHANCEMENTS"])
						self.dropdown:SetText("showAlternateEnhancements")
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame name="$parentShowEnhancementStats" parentKey="showEnhancementStats" inherits="ww_modifierKeyDropDown">
				<Anchors>
					<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentShowAlternateEnhancements"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.label:SetText(ww_localization["SHOW_IDEAL_ENHANCEMENT_STATS"])
						self.dropdown:SetText("showEnhancementStats")
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame name="$parentShowDebugInfo" parentKey="showDebugInfo" inherits="ww_modifierKeyDropDown">
				<Anchors>
					<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowEnhancementStats"/>
					<Anchor point="LEFT">
						<Offset>
							<AbsDimension x="9" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.label:SetText(ww_localization["SHOW_DEBUG"])
						self.dropdown:SetText("showDebugInfo")
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame name="$parentShowEnhancementsWhen" parentKey="showEnhancementsWhen" inherits="ww_labeledElement">
				<Anchors>
					<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowDebugInfo"/>
					<Anchor point="LEFT">
						<Offset>
							<AbsDimension x="9" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Size>
					<AbsDimension x="0" y="30"/>
				</Size>
				<Frames>
					<Button name="$parentDropdown" parentKey="dropdown" inherits="UIDropDownMenuTemplate">
						<Anchors>
							<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parentLabel">
								<Offset>
									<AbsDimension x="-15" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
						<Scripts>
							<OnLoad>
								UIDropDownMenu_JustifyText(self, "LEFT")
							</OnLoad>
							<OnShow>
								UIDropDownMenu_Initialize(self, ww_ShowEnhancementsWhenDropDownInitialize)
								UIDropDownMenu_SetSelectedValue(self, ww_vars.options.tooltip.showEnhancementsWhen)
							</OnShow>
						</Scripts>
					</Button>
				</Frames>
				<Scripts>
					<OnLoad>
						self.label:SetText(ww_localization["SHOW_ENHANCEMENTS_WHEN"])
					</OnLoad>
				</Scripts>
			</Frame>
			<CheckButton name="$parentHideTooltipHints" parentKey="hideTooltipHints" inherits="ww_checkButton">
				<Anchors>
					<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowEnhancementsWhen"/>
				</Anchors>
				<Scripts>
					<OnClick>
						if self:GetChecked() then
							ww_vars.options.tooltip.hideHints = true
						else
							ww_vars.options.tooltip.hideHints = false
						end
					</OnClick>
					<OnLoad>
						self.shouldBeChecked = function() return ww_vars.options.tooltip.hideHints end
						self.ttText = ww_localization["HIDE_HINTS_TT"]
						self:SetText(ww_localization["HIDE_HINTS"])
					</OnLoad>
				</Scripts>
			</CheckButton>
			<Frame name="$parentShowClassNames" parentKey="showClassNames" inherits="ww_labeledElement">
				<Anchors>
					<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentHideTooltipHints"/>
					<Anchor point="LEFT">
						<Offset>
							<AbsDimension x="9" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Size>
					<AbsDimension x="0" y="30"/>
				</Size>
				<Frames>
					<Button name="$parentDropdown" parentKey="dropdown" inherits="UIDropDownMenuTemplate">
						<Anchors>
							<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parentLabel">
								<Offset>
									<AbsDimension x="-15" y="0"/>
								</Offset>
							</Anchor>
						</Anchors>
						<Scripts>
							<OnLoad>
								UIDropDownMenu_JustifyText(self, "LEFT")
							</OnLoad>
							<OnShow>
								UIDropDownMenu_Initialize(self, ww_ShowClassNameDropDownInitialize)
								UIDropDownMenu_SetSelectedValue(self, ww_vars.options.tooltip.showClassNames)
							</OnShow>
						</Scripts>
					</Button>
				</Frames>
				<Scripts>
					<OnLoad>
						self.label:SetText(ww_localization["SHOW_CLASS"])
					</OnLoad>
				</Scripts>
			</Frame>
			<CheckButton name="$parentShowZeroScores" parentKey="showZeroScores" inherits="ww_checkButton">
				<Anchors>
					<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowClassNames"/>
				</Anchors>
				<Scripts>
					<OnClick>
						if self:GetChecked() then
							ww_vars.options.tooltip.showZeroScores = true
						else
							ww_vars.options.tooltip.showZeroScores = false
						end
					</OnClick>
					<OnLoad>
						self.shouldBeChecked = function() return ww_vars.options.tooltip.showZeroScores end
						self.ttText = ww_localization["SHOW_ZEROES_TT"]
						self:SetText(ww_localization["SHOW_ZEROES"])
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="$parentShowDifference" parentKey="showDifference" inherits="ww_checkButton">
				<Anchors>
					<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowZeroScores"/>
				</Anchors>
				<Scripts>
					<OnClick>
						if self:GetChecked() then
							ww_vars.options.tooltip.showDifferences = true
						else
							ww_vars.options.tooltip.showDifferences = false
						end
					</OnClick>
					<OnLoad>
						self.shouldBeChecked = function() return ww_vars.options.tooltip.showDifferences end
						self.ttText = ww_localization["SHOW_DIFF_TT"]
						self:SetText(ww_localization["SHOW_DIFF"])
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="$parentNormalizeWeights" parentKey="normalizeWeights" inherits="ww_checkButton">
				<Anchors>
					<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowDifference"/>
				</Anchors>
				<Scripts>
					<OnClick>
						if self:GetChecked() then
							ww_vars.options.tooltip.normalizeWeights = true
						else
							ww_vars.options.tooltip.normalizeWeights = false
						end
						ww_weightCache = setmetatable({}, ww_weightCacheMetatable)
						ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
					</OnClick>
					<OnLoad>
						self.shouldBeChecked = function() return ww_vars.options.tooltip.normalizeWeights end
						self.ttText = ww_localization["NORMALIZE_TT"]
						self:SetText(ww_localization["NORMALIZE"])
					</OnLoad>
				</Scripts>
			</CheckButton>
		</Frames>
		<Scripts>
			<OnLoad>
				self.header:SetText(ww_localization["DISPLAY_OPTS"])
				self.name = ww_localization["DISPLAY_NAME"]
				self.parent = "WeightsWatcher"
				self.default = function()
						ww_vars.options.tooltip = ww_defaultVars.options.tooltip
						ww_weightCache = setmetatable({}, ww_weightCacheMetatable)
						ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
					end
				local checkBoxes = {
					"hideHints",
					"showZeroScores",
					"showDifferences",
					"normalizeWeights",
					hideHints = self.hideTooltipHints,
					showZeroScores = self.showZeroScores,
					showDifferences = self.showDifference,
					normalizeWeights = self.normalizeWeights,
				}
				self.refresh = function()
						for _, option in ipairs(checkBoxes) do
							local checkBox = checkBoxes[option]
							checkBox:SetChecked(checkBox.shouldBeChecked())
							if checkBox.shouldBeEnabled then
								if checkBox.shouldBeEnabled() then
									checkBox:Enable()
								else
									checkBox:Disable()
								end
							end
						end
					end
				InterfaceOptions_AddCategory(self)
			</OnLoad>
		</Scripts>
	</Frame>
</Ui>