diff Devian.xml @ 47:eb7544afd77a

dock frame implementation fixes to /dvc command
author Nenue
date Mon, 04 Jan 2016 05:42:44 -0500
parents dcc57a7cabc9
children 2bf7eb1844cb
line wrap: on
line diff
--- a/Devian.xml	Sun Jan 03 15:49:35 2016 -0500
+++ b/Devian.xml	Mon Jan 04 05:42:44 2016 -0500
@@ -25,16 +25,12 @@
     </Gradient>
   </Texture>
 
-  <Button virtual="true" name="DevianDDButton" alphaMode="BLEND">
-    <Scripts>
-      <OnClick>
-        ToggleDropDownMenu(1, nil, self:GetParent().menuFrame, self, 0, 0);
-      </OnClick>
-    </Scripts>
+
+  <Button virtual="true" name="DevianButton" alphaMode="BLEND">
     <Size x="32" y="16" />
     <Layers>
       <Layer level="ARTWORK">
-        <Texture parentKey="icon" file="Interface\Addons\Devian\menu-button.blp" setAllPoints="true" alphaMode="ADD">
+        <Texture name="$parentIcon" parentKey="icon" file="Interface\Addons\Devian\menu-button.blp" setAllPoints="true" alphaMode="ADD">
           <Color a="1" r="1" g="1" b="1" />
           <TexCoords top="0.47" left="0" bottom="0.9" right="1" />
         </Texture>
@@ -42,7 +38,20 @@
     </Layers>
   </Button>
 
+  <Button virtual="true" name="DevianDDButton" inherits="DevianButton" alphaMode="BLEND">
+    <Scripts>
+      <OnClick>
+        ToggleDropDownMenu(1, nil, self:GetParent().menuFrame, self, 0, 0);
+      </OnClick>
+    </Scripts>
+  </Button>
 
+  <Font name="DevianText" font="Interface\Addons\Devian\font\SourceCodePro-Regular.ttf" outline="NORMAL" virtual="true">
+    <FontHeight>
+      <AbsValue val="13" />
+    </FontHeight>
+    <Color r="1" g="1" b="1" a="1" />
+  </Font>
 
   <Frame name="DevianDDMenu" virtual="true" inherits="UIDropDownMenuTemplate" id="1">
     <Scripts>
@@ -62,7 +71,7 @@
       <Anchor point="TOPLEFT" y="-20" />
       <Anchor point="BOTTOMRIGHT" />
     </Anchors>
-    <FontString  font="Interface\Addons\Devian\font\SourceCodePro-Regular.ttf" wordwrap="true"
+    <FontString inherits="DevianFont" wordwrap="true"
                  justifyH="LEFT"
                  indented="true"
                  setAllPoints="true">
@@ -211,28 +220,115 @@
 
   <Frame
       name="DevianDock"
-      parent="UIParent" hidden="true">
+      parent="UIParent"
+      enableMouse="true"
+      alpha="0.1"
+      hidden="true"
+      frameStrata="LOW">
+    <Scripts>
+      <OnEnter>
+        Devian.DockHighlight(self)
+      </OnEnter>
+      <OnLeave>
+        Devian.DockHighlight(self)
+      </OnLeave>
+      <OnMouseDown>
+        print('click', button, 'down')
+      </OnMouseDown>
+      <OnMouseUp>
+        print('click', button, 'up')
+      </OnMouseUp>
+    </Scripts>
     <Anchors>
-      <Anchor point="TOP" relativePoint="TOP" />
+      <Anchor point="TOP" relativePoint="TOP" x="0" y="1" />
     </Anchors>
-    <Size x="400" y="40" />
+    <Size x="32" y="20" />
     <Layers>
       <Layer level="ARTWORK">
-        <Texture name="$parentBar" setAllPoints="true" parentKey="bar" alphaMode="MOD">
+        <Texture name="$parentBar" parent="DevianDock" setAllPoints="true" parentKey="bar" alphaMode="BLEND">
           <Color r="1" g="1" b="1" a="1" />
           <Gradient orientation="VERTICAL">
             <MaxColor r="0" g="0" b="0" a="1" />
-            <MinColor r="1" g="1" b="1" a="1" />
+            <MinColor r="0" g="0" b="0" a="0" />
           </Gradient>
         </Texture>
 
       </Layer>
       <Layer level="OVERLAY">
 
-        <Button name="$parentMenuButton"  parentKey="dropmenu" inherits="DevianDDButton" enableMouse="true">
-
-        </Button>
       </Layer>
     </Layers>
   </Frame>
+
+  <Button name="DevianBeacon" hidden="true" inherits="DevianButton" virtual="true" enableMouse="true" alpha="1" frameStrata="MEDIUM">
+    <Size x="64" y="32" />
+    <TexCoords top="0" left="0" bottom="1" right="1" />
+
+    <Scripts>
+      <OnShow>
+        if self.console.index ~= DevianDB.current_channel then
+          UIFrameFadeIn(self,DevianDB.dock_onshow_fade_time, DevianDB.dock_onshow_fade_from, DevianDB.dock_onshow_fade_to)
+          UIFrameFadeIn(self.caption,DevianDB.dock_onshow_fade_time, DevianDB.dock_onshow_fade_from, 0)
+        end
+      </OnShow>
+      <OnMouseDown>
+        --print("click", self:GetName(), button, self.console.index)
+        if button == "LeftButton" then
+          if IsShiftKeyDown() then
+            Devian:Console_Toggle(self.console.index, 0)
+          else
+            Devian:Console_Toggle(self.console.index)
+            if self.console.enabled then
+              if self.console.minimized then
+                self.console:MinMax()
+              end
+              self.console:ToFront()
+            else
+            end
+          end
+        elseif button == "RightButton" then
+          self.console:MinMax()
+        end
+        self.console:Save()
+      </OnMouseDown>
+      <OnEnter>
+        Devian.DockHighlight(self)
+      </OnEnter>
+      <OnLeave>
+        Devian.DockHighlight(self)
+      </OnLeave>
+    </Scripts>
+    <Layers>
+      <Layer level="OVERLAY">
+      </Layer>
+    </Layers>
+    <Frames>
+      <Frame name="$parentText" parentKey="caption" alpha="0" blendMode="BLEND">
+        <Size x="200" y="30" />
+        <Anchors>
+          <Anchor point="BOTTOM" relativePoint="BOTTOM" x="0" y="0" />
+        </Anchors>
+        <Layers>
+          <Layer level="OVERLAY">
+            <FontString text="Test String" inherits="DevianText" parentKey="name" setAllPoints="true">
+              <Color r="1" g="1" b="1" a="1" />
+              <Shadow>
+                <Color r="0" g="0" b="0" a="1" />
+                <Offset x="0" y="-2" />
+              </Shadow>
+              <Animations>
+                <AnimationGroup>
+                  <Scale scaleX="1.4" scaleY="1.4" looping="NONE">
+                    <Origin point="CENTER" x="0" y="0" />
+
+                  </Scale>
+                </AnimationGroup>
+              </Animations>
+            </FontString>
+          </Layer>
+        </Layers>
+      </Frame>
+    </Frames>
+  </Button>
+
 </Ui>
\ No newline at end of file