<!-- MoonWell -->
<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">
	<!-- if you change something here you probably want to change the frame version too -->

	<Script file="..\FrameXML\GraphicsQualityLevels.lua"/>
	<Script file="OptionsPanelTemplates.lua"/>
	<Script file="VideoOptionsPanels.lua"/>

	<CheckButton name="VideoOptionsSmallCheckButtonTemplate" inherits="OptionsSmallCheckButtonTemplate" virtual="true">
		<Scripts>
			<OnClick>
				if ( self:GetChecked() ) then
					PlaySound("igMainMenuOptionCheckBoxOn");
				else
					PlaySound("igMainMenuOptionCheckBoxOff");
				end
				BlizzardOptionsPanel_CheckButton_OnClick(self);			
				VideoOptionsFrameApply:Enable();
			</OnClick>
		</Scripts>
	</CheckButton>
	
	<!-- Resolution Panel -->

	<Frame name="VideoOptionsResolutionPanel" hidden="false" parent="VideoOptionsFramePanelContainer">
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentTitle" text="RESOLUTION_LABEL" inherits="OptionsFontLarge" justifyH="LEFT" justifyV="TOP">
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="16" y="-16"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentSubText" text="RESOLUTION_SUBTEXT" inherits="OptionsFontHighlightSmall" nonspacewrap="true" maxLines="3" justifyH="LEFT" justifyV="TOP">
					<Size>
						<AbsDimension y="32" x="0"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT">
							<Offset>
								<AbsDimension x="0" y="-8"/>
							</Offset>
						</Anchor>
						<Anchor point="RIGHT">
							<Offset>
								<AbsDimension x="-32" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				VideoOptionsResolutionPanel_OnLoad(self);
			</OnLoad>
		</Scripts>	
		<Frames>
			<Frame name="$parentResolutionDropDown" inherits="GlueDropDownMenuTemplate" enableMouse="true">
    			<Size x="140" y="20"/>
    			<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" 
              			edgeFile="Interface\Tooltips\ui-tooltip-border-mawBlack" 
              			tile="true">
        			<EdgeSize val="12"/>
        			<BackgroundInsets left="3" right="3" top="3" bottom="3"/>
        			<Color r="0" g="0" b="0" a="1"/>
    			</Backdrop>
    			<Anchors>
        			<Anchor point="TOPLEFT">
            			<Offset x="18" y="-82"/>
        			</Anchor>
    			</Anchors>
    			<Layers>
        			<Layer level="BACKGROUND">
            			<FontString name="$parentLabel" inherits="OptionsFontSmall" text="RESOLUTION">
                			<Anchors>
                    			<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
                        			<Offset x="10" y="0"/>
                    			</Anchor>
                			</Anchors>
            			</FontString>
        			</Layer>
    			</Layers>
    			<Scripts>
        			<OnLoad>
            			self.type = CONTROLTYPE_DROPDOWN;
            			BlizzardOptionsPanel_RegisterControl(self, self:GetParent());                    
            			VideoOptionsResolutionPanelResolutionDropDown_OnLoad(self);
			
            			local btn = _G[self:GetName().."Button"];
            			btn:ClearAllPoints();
            			btn:SetPoint("RIGHT", self, "RIGHT", -5, 0);
            			btn:SetSize(12, 12);

            			local text = _G[self:GetName().."Text"];
            			text:ClearAllPoints();
            			text:SetPoint("LEFT", self, "LEFT", 8, 1);
            			text:SetPoint("RIGHT", btn, "LEFT", -10, -2);

            			_G[self:GetName().."Left"]:Hide();
            			_G[self:GetName().."Middle"]:Hide();
            			_G[self:GetName().."Right"]:Hide();
        			</OnLoad>
        			<OnEnter>
            			OptionsTooltip:SetOwner(self);
            			OptionsTooltip:SetText(OPTION_TOOLTIP_USE_RESOLUTION);
        			</OnEnter>
        			<OnLeave>
           			 OptionsTooltip:Hide();
        			</OnLeave>
    			</Scripts>
			</Frame>
			<Frame name="$parentRefreshDropDown" inherits="GlueDropDownMenuTemplate" id="2">
    			<Size x="50" y="20"/>
    			<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" 
              			edgeFile="Interface\Tooltips\ui-tooltip-border-mawBlack"
              			tile="true">
        			<EdgeSize val="12"/>
        			<BackgroundInsets left="3" right="3" top="3" bottom="3"/>
        			<Color r="0" g="0" b="0" a="1"/>
    			</Backdrop>
    			<Anchors>
        			<Anchor point="TOPLEFT" relativeTo="$parentResolutionDropDown" relativePoint="BOTTOMLEFT">
            			<Offset x="0" y="-16"/>
        			</Anchor>
    			</Anchors>
    			<Layers>
        			<Layer level="BACKGROUND">
            			<FontString name="$parentLabel" inherits="OptionsFontSmall" text="REFRESH_RATE">
                			<Anchors>
                    			<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
                        			<Offset x="10" y="0"/>
                    			</Anchor>
                			</Anchors>
            			</FontString>
        			</Layer>
    			</Layers>
			    <Scripts>
			        <OnLoad>
			            self.type = CONTROLTYPE_DROPDOWN;
			            BlizzardOptionsPanel_RegisterControl(self, self:GetParent());                        
			            VideoOptionsResolutionPanelRefreshDropDown_OnLoad(self);

			            local btn = _G[self:GetName().."Button"];
            			btn:ClearAllPoints();
            			btn:SetPoint("RIGHT", self, "RIGHT", -45, 0);
            			btn:SetSize(12, 12);

            			local text = _G[self:GetName().."Text"];
            			text:ClearAllPoints();
            			text:SetPoint("LEFT", self, "LEFT", 8, 1);
            			text:SetPoint("RIGHT", btn, "LEFT", -15, -2);

            			_G[self:GetName().."Left"]:Hide();
            			_G[self:GetName().."Middle"]:Hide();
            			_G[self:GetName().."Right"]:Hide();
        			</OnLoad>
        			<OnEnter>
            			OptionsTooltip:SetOwner(self);
            			OptionsTooltip:SetText(OPTION_TOOLTIP_USE_REFRESH);
        			</OnEnter>
        			<OnLeave>
            			OptionsTooltip:Hide();
        			</OnLeave>
    			</Scripts>
			</Frame>
			<Frame name="$parentMultiSampleDropDown" inherits="GlueDropDownMenuTemplate" id="4">
    			<Size x="140" y="20"/>
    			<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" 
              			edgeFile="Interface\Tooltips\ui-tooltip-border-mawBlack" 
              			tile="true">
        			<EdgeSize val="12"/>
        			<BackgroundInsets left="3" right="3" top="3" bottom="3"/>
        			<Color r="0" g="0" b="0" a="1"/>
    			</Backdrop>
    			<Anchors>
        			<Anchor point="LEFT" relativeTo="$parentResolutionDropDown" relativePoint="RIGHT">
            			<Offset x="0" y="0"/>
        			</Anchor>
    			</Anchors>
    			<Layers>
        			<Layer level="BACKGROUND">
            			<FontString name="$parentLabel" inherits="OptionsFontSmall" text="MULTISAMPLE">
                			<Anchors>
                    			<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
                        			<Offset x="10" y="0"/>
                    			</Anchor>
                			</Anchors>
            			</FontString>
        			</Layer>
    			</Layers>
    			<Scripts>
        			<OnLoad>
            			self.type = CONTROLTYPE_DROPDOWN;
            			BlizzardOptionsPanel_RegisterControl(self, self:GetParent());    
            			VideoOptionsResolutionPanelMultiSampleDropDown_OnLoad(self);

            			local btn = _G[self:GetName().."Button"];
            			btn:ClearAllPoints();
            			btn:SetPoint("RIGHT", self, "RIGHT", -5, 0);
            			btn:SetSize(12, 12);

            			local text = _G[self:GetName().."Text"];
            			text:ClearAllPoints();
            			text:SetPoint("LEFT", self, "LEFT", 8, 1);
            			text:SetPoint("RIGHT", btn, "LEFT", -10, -2);

            			_G[self:GetName().."Left"]:Hide();
            			_G[self:GetName().."Middle"]:Hide();
            			_G[self:GetName().."Right"]:Hide();
        			</OnLoad>
        			<OnEnter>
            			OptionsTooltip:SetOwner(self);
            			OptionsTooltip:SetText(OPTION_TOOLTIP_MULTISAMPLING);
        			</OnEnter>
        			<OnLeave>
            			OptionsTooltip:Hide();
        			</OnLeave>
    			</Scripts>
			</Frame>
			<CheckButton name="$parentVSync" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentRefreshDropDown" relativePoint="BOTTOMLEFT">
						<Offset x="16" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxVSync";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>				
			<CheckButton name="$parentTripleBuffer" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentVSync" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="16" y="-4"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxTripleBuffer";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsResolutionPanelVSync, self);
            
            		self:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check");
        		</OnLoad>
    		</Scripts>
    		<Anchors>
        		<Anchor point="LEFT" relativeTo="$parentVSync" relativePoint="RIGHT">
            		<Offset x="164" y="0"/>
        		</Anchor>
    		</Anchors>
			</CheckButton>
			<CheckButton name="$parentHardwareCursor" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentTripleBuffer" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="-16" y="-4"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxCursor";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
            
            		self:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check");
        		</OnLoad>
    		</Scripts>
    		<Anchors>
        		<Anchor point="LEFT" relativeTo="$parentVSync" relativePoint="RIGHT">
            		<Offset x="164" y="0"/>
        		</Anchor>
    		</Anchors>
			</CheckButton>
			<CheckButton name="$parentFixInputLag" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentHardwareCursor" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-4"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxFixLag";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
            
            		self:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check");
        		</OnLoad>
    		</Scripts>
    		<Anchors>
        		<Anchor point="LEFT" relativeTo="$parentVSync" relativePoint="RIGHT">
            		<Offset x="164" y="0"/>
        		</Anchor>
    		</Anchors>
			</CheckButton>
			<CheckButton name="$parentWindowed" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentVSync" relativePoint="RIGHT">
						<Offset x="164" y="0"/>
					</Anchor>
				</Anchors>
				<Scripts>
        		<OnLoad>
            		self.type = CONTROLTYPE_CHECKBOX;
            		self.cvar = "gxWindow";
            		self.restart = true;
            		self.setFunc = VideoOptionsResolutionPanel_SetWindowed;
            		BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
            
            		self:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check");
        		</OnLoad>
    		</Scripts>
    		<Anchors>
        		<Anchor point="LEFT" relativeTo="$parentVSync" relativePoint="RIGHT">
            		<Offset x="164" y="0"/>
        		</Anchor>
    		</Anchors>
			</CheckButton>
			<CheckButton name="$parentMaximized" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentWindowed" relativePoint="BOTTOMLEFT">
						<Offset x="16" y="-4"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxMaximize";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsResolutionPanelWindowed, self);
            
            		self:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check");
        		</OnLoad>
    		</Scripts>
    		<Anchors>
        		<Anchor point="LEFT" relativeTo="$parentVSync" relativePoint="RIGHT">
            		<Offset x="164" y="0"/>
        		</Anchor>
    		</Anchors>
			</CheckButton>		
			<CheckButton name="$parentDisableResize" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentMaximized" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-4"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "windowResizeLock";
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsResolutionPanelWindowed, self);
						if ( IsMacClient() ) then
							self:Hide();
						end
            
            		self:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check");
        		</OnLoad>
    		</Scripts>
    		<Anchors>
        		<Anchor point="LEFT" relativeTo="$parentVSync" relativePoint="RIGHT">
            		<Offset x="164" y="0"/>
        		</Anchor>
    		</Anchors>
			</CheckButton>	
			<Frame name="$parentBrightness" inherits="OptionsBoxTemplate">
				<Size x="380" y="96"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentFixInputLag" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-20"/>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<Texture name="$parentGrayScale" file="Interface\OptionsFrame\21stepgrayscale">
							<Size x="356" y="32"/>
							<Anchors>
								<Anchor point="BOTTOMLEFT">
									<Offset x="12" y="12"/>
								</Anchor>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetBackdropBorderColor(0.4, 0.4, 0.4);
						self:SetBackdropColor(0.15, 0.15, 0.15);
						_G[self:GetName().."Title"]:SetText(OPTIONS_BRIGHTNESS);
					</OnLoad>
				</Scripts>
			</Frame>			
			<CheckButton name="$parentDesktopGamma" inherits="OptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentBrightness" relativePoint="TOPLEFT">
						<Offset x="12" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "desktopGamma";
						self.setFunc = VideoOptionsResolutionPanel_SetGamma;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnClick>
						BlizzardOptionsPanel_CheckButton_OnClick(self);
						if ( self:GetParent():IsShown() ) then
							local value;
							if ( self:GetChecked() ) then
								value = 1;
							else
								value = 0;
								SetGamma(VideoOptionsResolutionPanelGammaSlider:GetValue());
							end
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						VideoOptionsFrameApply:Enable();
					</OnClick>
				</Scripts>
			</CheckButton>		
			<Slider name="$parentGammaSlider" inherits="OptionsSliderTemplate">
				<Size x="154" y="17"/>
				<Anchors>
					<Anchor point="TOPRIGHT" relativeTo="$parentBrightness" relativePoint="TOPRIGHT">
						<Offset>
							<AbsDimension x="-16" y="-16"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.label = "gamma";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							SetGamma(value);
						end
						self.GetCurrentValue = function (self) return GetGamma(); end;
						_G[self:GetName().."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							SetGamma(value);
						end
						VideoOptionsFrameApply:Enable();
					</OnValueChanged>
				</Scripts>
			</Slider>	
		</Frames>
	</Frame>	

	<!-- Effects Panel -->

	<Frame name="VideoOptionsEffectsPanel" parent="VideoOptionsFramePanelContainer" hidden="true">
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentTitle" text="EFFECTS_LABEL" inherits="OptionsFontLarge" justifyH="LEFT" justifyV="TOP">
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="16" y="-16"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentSubText" text="EFFECTS_SUBTEXT" inherits="OptionsFontHighlightSmall" nonspacewrap="true" maxLines="3" justifyH="LEFT" justifyV="TOP">
					<Size>
						<AbsDimension y="32" x="0"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT">
							<Offset>
								<AbsDimension x="0" y="-8"/>
							</Offset>
						</Anchor>
						<Anchor point="RIGHT">
							<Offset>
								<AbsDimension x="-32" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				VideoOptionsEffectsPanel_OnLoad(self);
			</OnLoad>
		</Scripts>	
		<Frames>
			<Frame name="$parentQuality" inherits="OptionsBoxTemplate">
				<Size x="380" y="88"/>
				<Anchors>
					<Anchor point="TOPLEFT">
						<Offset x="16" y="-72"/>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<FontString name="$parentLabel" inherits="OptionsFontLeft" text="LOW">
							<Anchors>
								<Anchor point="TOPLEFT">
									<Offset x="16" y="-8"/>
								</Anchor>
								<Anchor point="RIGHT">
									<Offset x="-16" y="0"/>
								</Anchor>
							</Anchors>
						</FontString>
						<FontString name="$parentSubText" inherits="OptionsFontHighlightSmallLeftTop" text="This is a description of what happens when you set the quality slider to its Low setting.">
							<Size x="350" y="42"/>
							<Anchors>
								<Anchor point="TOPLEFT" relativeTo="$parentLabel" relativePoint="BOTTOMLEFT">
									<Offset x="0" y="-2"/>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						self:SetBackdropBorderColor(0.4, 0.4, 0.4);
						self:SetBackdropColor(0.15, 0.15, 0.15);
						_G[self:GetName().."Title"]:Hide();
					</OnLoad>
				</Scripts>
			</Frame>		
			<Slider name="$parentQualitySlider" inherits="OptionsSliderTemplate">
				<Size x="348" y="17"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT" relativeTo="$parentQuality" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="16" y="16"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="ARTWORK">
						<FontString name="$parentCustom" inherits="OptionsFontHighlightSmall" text="CUSTOM">
							<Anchors>
								<Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT">
									<Offset>
										<AbsDimension x="4" y="3"/>
									</Offset>
								</Anchor>
							</Anchors>
						</FontString>
					</Layer>
				</Layers>
				<Scripts>
					<OnLoad>
						local name = self:GetName();
						_G[name.."High"]:SetPoint("TOPRIGHT", "$parent", "BOTTOMRIGHT", -65, 3);
						_G[name.."High"]:SetText(VIDEO_QUALITY_LABEL5);
						_G[name.."Text"]:SetFontObject("OptionsFontSmall");

						self.type = CONTROLTYPE_SLIDER;
						self.label = "quality";
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged>
						self.newValue = value;
						if ( self:GetParent():IsShown() ) then
							VideoOptionsEffectsPanel_SetVideoQuality(value);
						end
					</OnValueChanged>
				</Scripts>
			</Slider>	
			<Slider name="$parentViewDistance" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentQuality" relativePoint="BOTTOMLEFT">
						<Offset x="2" y="-20"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "farclip";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>		
			<Slider name="$parentTerrainDetail" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentViewDistance" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.label = "TerrainMip";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							SetTerrainMip(value);
						end
						self.GetCurrentValue = function (self) return GetTerrainMip() end;
						_G[self:GetName().."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>			
			<Slider name="$parentParticleDensity" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentTerrainDetail" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						local name = self:GetName();
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "particleDensity";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[name.."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>		
			<Slider name="$parentShadowQuality" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentParticleDensity" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						local name = self:GetName();
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "extShadowQuality";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[name.."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>			
			<Slider name="$parentEnvironmentDetail" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentViewDistance" relativePoint="TOPRIGHT">
						<Offset x="20" y="0"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "environmentDetail";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>		
			<Slider name="$parentClutterDensity" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentEnvironmentDetail" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "groundEffectDensity";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>		
			<Slider name="$parentClutterRadius" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentClutterDensity" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "groundEffectDist";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>					
			<Slider name="$parentTextureResolution" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentEnvironmentDetail" relativePoint="TOPRIGHT">
						<Offset x="20" y="0"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "BaseMip";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							local min, max = self:GetMinMaxValues();
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, max - value + min); --With this cvar, lower is actually better quality.
						end
						self.GetCurrentValue = function (self)
							local value = BlizzardOptionsPanel_GetCVarSafe(self.cvar);
							local min, max = self:GetMinMaxValues();
							return min - value + max;
						end
						_G[self:GetName().."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>	
			<Slider name="$parentTextureFiltering" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentTextureResolution" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "textureFilteringMode";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>				
			<Slider name="$parentWeatherIntensity" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentTextureFiltering" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "weatherDensity";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>	
			<Slider name="$parentPlayerTexture" inherits="OptionsSliderTemplate">
				<Size x="112" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentWeatherIntensity" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-24"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "componentTextureLevel";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[self:GetName().."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
					<OnValueChanged function="VideoOptionsEffectsPanelSlider_OnValueChanged"/>
				</Scripts>
			</Slider>	
			<Frame name="$parentShaders" inherits="OptionsBoxTemplate">
				<Size x="380" y="76"/>
				<Anchors>
					<Anchor point="BOTTOMLEFT">
						<Offset x="16" y="8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetBackdropBorderColor(0.4, 0.4, 0.4);
						self:SetBackdropColor(0.15, 0.15, 0.15);
						_G[self:GetName().."Title"]:SetText("");
					</OnLoad>
				</Scripts>
			</Frame>	
			<CheckButton name="$parentSpecularLighting" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentShaders" relativePoint="TOPLEFT">
						<Offset x="12" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "specular";
						self.restart = true;
						self.setFunc = VideoOptionsEffectsPanel_UpdateVideoQuality;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>	
			<CheckButton name="$parentFullScreenGlow" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentSpecularLighting" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "ffxGlow";
						self.setFunc = VideoOptionsEffectsPanel_UpdateVideoQuality;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>		
			<CheckButton name="$parentDeathEffect" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentShaders">
						<Offset x="180" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "ffxDeath";
						self.setFunc = VideoOptionsEffectsPanel_UpdateVideoQuality;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="$parentProjectedTextures" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentDeathEffect" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-8"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "projectedTextures";
						self.setFunc = VideoOptionsEffectsPanel_UpdateVideoQuality;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>
		</Frames>
	</Frame>
	<Frame name="VideoOptionsStereoPanel" parent="VideoOptionsFramePanelContainer" hidden="true">
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="$parentTitle" text="STEREO_VIDEO_LABEL" inherits="OptionsFontLeft" justifyH="LEFT" justifyV="TOP">
					<Anchors>
						<Anchor point="TOPLEFT">
							<Offset>
								<AbsDimension x="16" y="-16"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentSubText" text="STEREO_VIDEO_SUBTEXT" inherits="OptionsFontHighlightSmall" nonspacewrap="true" maxLines="3" justifyH="LEFT" justifyV="TOP">
					<Size>
						<AbsDimension y="32" x="0"/>
					</Size>
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT">
							<Offset>
								<AbsDimension x="0" y="-8"/>
							</Offset>
						</Anchor>
						<Anchor point="RIGHT">
							<Offset>
								<AbsDimension x="-32" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				VideoOptionsStereoPanel_OnLoad(self);
			</OnLoad>
		</Scripts>	
		<Frames>		
			<CheckButton name="$parentEnabled" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="TOP">
						<Offset x="-125" y="-92"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxStereoEnabled";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="$parentHardwareCursor" inherits="VideoOptionsSmallCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentEnabled" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="135" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						self.type = CONTROLTYPE_CHECKBOX;
						self.cvar = "gxCursor";
						self.restart = true;
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
					</OnLoad>
				</Scripts>
			</CheckButton>
			<Slider name="$parentConvergence" inherits="OptionsSliderTemplate">
				<Size x="270" y="17"/>
				<Anchors>
					<Anchor point="TOP" relativePoint="TOP">
						<Offset x="0" y="-150"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						local name = self:GetName();
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "gxStereoConvergence";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[name.."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsStereoPanelEnabled, self);
					</OnLoad>
					<OnValueChanged>
						self.newValue = self:GetValue();
						BlizzardOptionsPanel_SetCVarSafe(self.cvar, self:GetValue());
						VideoOptionsFrameApply:Enable();
					</OnValueChanged>
				</Scripts>
			</Slider>
			<Slider name="$parentEyeSeparation" inherits="OptionsSliderTemplate">
				<Size x="270" y="17"/>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentConvergence" relativePoint="BOTTOMLEFT">
						<Offset x="0" y="-70"/>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						local name = self:GetName();
						self.type = CONTROLTYPE_SLIDER;
						self.cvar = "gxStereoSeparation";
						self.SetDisplayValue = self.SetValue;
						self.SetValue = function (self, value)
							self:SetDisplayValue(value);
							BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
						end
						_G[name.."Text"]:SetFontObject("OptionsFontSmall");
						BlizzardOptionsPanel_RegisterControl(self, self:GetParent());
						BlizzardOptionsPanel_SetupDependentControl(VideoOptionsStereoPanelEnabled, self);
					</OnLoad>
					<OnValueChanged>
						self.newValue = self:GetValue();
						BlizzardOptionsPanel_SetCVarSafe(self.cvar, self:GetValue());
						VideoOptionsFrameApply:Enable();
					</OnValueChanged>
				</Scripts>
			</Slider>		
		</Frames>
	</Frame>
</Ui>

