ColorPickerFrame.xml

ColorPickerFrame.xml (9.0.1.36272; unchanged since 9.0.1.36230)
  1. <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/
  2. ..\FrameXML\UI.xsd">
  3.   <ColorSelect name="ColorPickerFrame" toplevel="true" parent="UIParent" movable="true" enableMouse="true" enableKeyboard="true" hidden="true" frameStrata="DIALOG">
  4.     <Size x="365" y="200"/>
  5.     <Anchors>
  6.       <Anchor point="CENTER"/>
  7.     </Anchors>
  8.     <Layers>
  9.       <Layer level="ARTWORK">
  10.         <Texture name="ColorSwatch">
  11.           <Size x="32" y="32"/>
  12.           <Anchors>
  13.             <Anchor point="TOPLEFT" x="225" y="-32"/>
  14.           </Anchors>
  15.           <Color r="1.0" g="1.0" b="1.0" a="1.0"/>
  16.         </Texture>
  17.       </Layer>
  18.     </Layers>
  19.     <Frames>
  20.       <Frame parentKey="Border" inherits="DialogBorderTemplate"/>
  21.       <Frame parentKey="Header" inherits="DialogHeaderTemplate">
  22.         <KeyValues>
  23.           <KeyValue key="textString" value="COLOR_PICKER" type="global"/>
  24.         </KeyValues>
  25.       </Frame>
  26.       <Button name="ColorPickerCancelButton" inherits="GameMenuButtonTemplate" text="CANCEL">
  27.         <Anchors>
  28.           <Anchor point="BOTTOMRIGHT" x="-10" y="10"/>
  29.         </Anchors>
  30.         <Scripts>
  31.           <OnClick>
  32.             HideUIPanel(self:GetParent());
  33.             if ( ColorPickerFrame.cancelFunc ) then
  34.               ColorPickerFrame.cancelFunc(ColorPickerFrame.previousValues);
  35.             end
  36.             PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON);
  37.           </OnClick>
  38.         </Scripts>
  39.       </Button>
  40.       <Button name="ColorPickerOkayButton" inherits="GameMenuButtonTemplate" text="OKAY">
  41.         <Anchors>
  42.           <Anchor point="RIGHT" relativeTo="ColorPickerCancelButton" relativePoint="LEFT" x="0" y="0"/>
  43.         </Anchors>
  44.         <Scripts>
  45.           <OnClick>
  46.             HideUIPanel(self:GetParent());
  47.             ColorPickerFrame.func();
  48.             if ( ColorPickerFrame.opacityFunc ) then
  49.               ColorPickerFrame.opacityFunc();
  50.             end
  51.             PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON);
  52.           </OnClick>
  53.         </Scripts>
  54.       </Button>
  55.       <Slider name="OpacitySliderFrame" orientation="VERTICAL" minValue="0" maxValue="1" valueStep="0.01" defaultValue="1" inherits="BackdropTemplate">
  56.         <Size x="16" y="128"/>
  57.         <Anchors>
  58.           <Anchor point="TOPLEFT" relativeTo="ColorSwatch" relativePoint="TOPRIGHT" x="32" y="0"/>
  59.         </Anchors>
  60.         <KeyValues>
  61.           <KeyValue key="backdropInfo" value="BACKDROP_SLIDER_8_8" type="global"/>
  62.         </KeyValues>
  63.         <Layers>
  64.           <Layer level="ARTWORK">
  65.             <FontString name="$parentText" inherits="GameFontNormalSmall">
  66.               <Anchors>
  67.                 <Anchor point="BOTTOM" relativePoint="TOP"/>
  68.               </Anchors>
  69.             </FontString>
  70.             <FontString inherits="GameFontNormalHuge" text="-">
  71.               <Anchors>
  72.                 <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" x="8" y="3"/>
  73.               </Anchors>
  74.               <Color r="1" g="1" b="1" />
  75.             </FontString>
  76.             <FontString inherits="GameFontNormalHuge" text="+">
  77.               <Anchors>
  78.                 <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" x="6" y="-3"/>
  79.               </Anchors>
  80.               <Color r="1" g="1" b="1" />
  81.             </FontString>
  82.           </Layer>
  83.         </Layers>
  84.         <Scripts>
  85.           <OnValueChanged>
  86.             if ( ColorPickerFrame.opacityFunc ) then
  87.               ColorPickerFrame.opacityFunc();
  88.             end
  89.           </OnValueChanged>
  90.         </Scripts>
  91.         <ThumbTexture file="Interface\Buttons\UI-SliderBar-Button-Vertical">
  92.           <Size x="32" y="32"/>
  93.         </ThumbTexture>
  94.       </Slider>
  95.     </Frames>
  96.     <Scripts>
  97.       <OnShow>
  98.         if ( self.hasOpacity ) then
  99.           OpacitySliderFrame:Show();
  100.           OpacitySliderFrame:SetValue(self.opacity);
  101.           self:SetWidth(365);
  102.         else
  103.           OpacitySliderFrame:Hide();
  104.           self:SetWidth(305);
  105.         end
  106.       </OnShow>
  107.       <OnColorSelect>
  108.         ColorSwatch:SetColorTexture(r, g, b);
  109.         if ( self.func ) then
  110.           self.func();
  111.         end
  112.       </OnColorSelect>
  113.       <OnKeyDown>
  114.         if ( GetBindingFromClick(key) == "TOGGLEGAMEMENU" ) then
  115.           HideUIPanel(self);
  116.           if ( ColorPickerFrame.cancelFunc ) then
  117.             ColorPickerFrame.cancelFunc(ColorPickerFrame.previousValues);
  118.           end
  119.         end
  120.       </OnKeyDown>
  121.     </Scripts>
  122.     <ColorWheelTexture name="ColorPickerWheel">
  123.       <Size x="128" y="128"/>
  124.       <Anchors>
  125.         <Anchor point="TOPLEFT" x="16" y="-32"/>
  126.       </Anchors>
  127.     </ColorWheelTexture>
  128.     <ColorWheelThumbTexture file="Interface\Buttons\UI-ColorPicker-Buttons">
  129.       <Size x="10" y="10"/>
  130.       <TexCoords left="0" right="0.15625" top="0" bottom="0.625"/>
  131.     </ColorWheelThumbTexture>
  132.     <ColorValueTexture>
  133.       <Size x="32" y="128"/>
  134.       <Anchors>
  135.         <Anchor point="LEFT" relativeTo="ColorPickerWheel" relativePoint="RIGHT" x="24" y="0"/>
  136.       </Anchors>
  137.     </ColorValueTexture>
  138.     <ColorValueThumbTexture file="Interface\Buttons\UI-ColorPicker-Buttons">
  139.       <Size x="48" y="14"/>
  140.       <TexCoords left="0.25" right="1.0" top="0" bottom="0.875"/>
  141.     </ColorValueThumbTexture>
  142.   </ColorSelect>
  143.   <Frame name="OpacityFrame" toplevel="true" parent="UIParent" movable="true" enableMouse="true" hidden="true" clampedToScreen="true">
  144.     <Size x="80" y="180"/>
  145.     <Anchors>
  146.       <Anchor point="TOPRIGHT" x="0" y="0"/>
  147.     </Anchors>
  148.     <Frames>
  149.       <Frame parentKey="Border" inherits="DialogBorderTemplate"/>
  150.       <Slider name="OpacityFrameSlider" orientation="VERTICAL" minValue="0" maxValue="1" valueStep="0.01" defaultValue="1" inherits="BackdropTemplate">
  151.         <Size x="16" y="128"/>
  152.         <Anchors>
  153.           <Anchor point="TOP" x="-10" y="-35"/>
  154.         </Anchors>
  155.         <KeyValues>
  156.           <KeyValue key="backdropInfo" value="BACKDROP_SLIDER_8_8" type="global"/>
  157.         </KeyValues>
  158.         <Layers>
  159.           <Layer level="ARTWORK">
  160.             <FontString name="$parentText" inherits="GameFontNormalSmall" text="OPACITY">
  161.               <Anchors>
  162.                 <Anchor point="TOP" relativeTo="OpacityFrame" x="0" y="-15"/>
  163.               </Anchors>
  164.             </FontString>
  165.             <FontString inherits="GameFontNormalHuge" text="-">
  166.               <Anchors>
  167.                 <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" x="8" y="3"/>
  168.               </Anchors>
  169.               <Color r="1" g="1" b="1" />
  170.             </FontString>
  171.             <FontString inherits="GameFontNormalHuge" text="+">
  172.               <Anchors>
  173.                 <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" x="6" y="-3"/>
  174.               </Anchors>
  175.               <Color r="1" g="1" b="1" />
  176.             </FontString>
  177.           </Layer>
  178.         </Layers>
  179.         <Scripts>
  180.           <OnValueChanged>
  181.             if ( OpacityFrame.opacityFunc ) then
  182.               OpacityFrame.opacityFunc();
  183.             end
  184.           </OnValueChanged>
  185.         </Scripts>
  186.         <ThumbTexture file="Interface\Buttons\UI-SliderBar-Button-Vertical">
  187.           <Size x="32" y="32"/>
  188.         </ThumbTexture>
  189.       </Slider>
  190.       <Button name="OpacityFrameCloseButton" parent="UIParent" setAllPoints="true" hidden="true">
  191.         <Scripts>
  192.           <OnLoad>
  193.             self:SetFrameLevel(self:GetFrameLevel()-1);
  194.             self:RegisterForClicks("LeftButtonDown", "RightButtonDown");
  195.           </OnLoad>
  196.           <OnClick>
  197.             OpacityFrame:Hide();
  198.             if ( OpacityFrame.saveOpacityFunc ) then
  199.               OpacityFrame.saveOpacityFunc();
  200.             end
  201.           </OnClick>
  202.         </Scripts>
  203.       </Button>
  204.     </Frames>
  205.     <Scripts>
  206.       <OnShow>
  207.         OpacityFrameCloseButton:Show();
  208.       </OnShow>
  209.       <OnHide>
  210.         OpacityFrameCloseButton:Hide();
  211.       </OnHide>
  212.     </Scripts>
  213.   </Frame>
  214. </Ui>