changeset 46:dcc57a7cabc9

re-adding Dock.lua to prep for revised implementation plans
author Nenue
date Sun, 03 Jan 2016 15:49:35 -0500
parents 5341e4d84622
children eb7544afd77a
files Devian.lua Devian.toc Devian.xml Dock.lua
diffstat 4 files changed, 44 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/Devian.lua	Wed Dec 30 07:05:38 2015 -0500
+++ b/Devian.lua	Sun Jan 03 15:49:35 2016 -0500
@@ -6,9 +6,10 @@
   print('Something has happened...')
 end
 Devian = LibStub("AceAddon-3.0"):NewAddon("Devian", "AceConsole-3.0", "AceEvent-3.0")
-Devian:SetDefaultModuleState(false)
+local D = _G.Devian
+D:SetDefaultModuleState(false)
+
 local MAJOR, MINOR = 'Devian-1.3', 'r@project-revision@'
-local D = _G.Devian
 local MSG_NEED_DEV_MODE = 'Must be in development mode to use this function.'
 local WORKSPACE_ON, WORKSPACE_OFF = 1, 2
 local PLAYER_REALM = UnitName("player") .. '-' .. GetRealmName()
@@ -317,7 +318,7 @@
 
     if type(var) == 'table' then
       if type(var.GetName) == 'function' then
-        var = '<table:'..var:GetName()..'>'
+        var = '<table:'..tostring(var:GetName())..'>'
       else
         var = '<'..tostring(var)..'>'
       end
@@ -453,7 +454,6 @@
     self.num_channels = self.num_channels + 1
   end
 
-
   for i, channel in pairs(db.channels) do
     if type(channel.docked) == 'table' then
       --oldprint('docking',i, unpack(channel.docked))
@@ -465,6 +465,9 @@
     self.console[db.current_channel]:ToFront()
     -- bring the current channel to the front
   end
+  self.dock = DevianDock
+
+
   setprinthandler(Message)
   print = function(...)
     _G.print('Dvn', ...)
--- a/Devian.toc	Wed Dec 30 07:05:38 2015 -0500
+++ b/Devian.toc	Sun Jan 03 15:49:35 2016 -0500
@@ -8,4 +8,5 @@
 Devian.xml
 Devian.lua
 UI.lua
-Config.lua
\ No newline at end of file
+Config.lua
+Dock.lua
\ No newline at end of file
--- a/Devian.xml	Wed Dec 30 07:05:38 2015 -0500
+++ b/Devian.xml	Sun Jan 03 15:49:35 2016 -0500
@@ -210,22 +210,29 @@
   </Frame>
 
   <Frame
-      name="DevianDockFrame"
-      inherits="DevianConsole"
-      virtual="true">
+      name="DevianDock"
+      parent="UIParent" hidden="true">
+    <Anchors>
+      <Anchor point="TOP" relativePoint="TOP" />
+    </Anchors>
+    <Size x="400" y="40" />
     <Layers>
       <Layer level="ARTWORK">
-        <Texture name="$parentHeader" parentKey="headerbar" inherits="DevianHeader">
-          <Anchors>
-            <Anchor point="TOPLEFT" />
-            <Size x="150" y="20" />
-          </Anchors>
+        <Texture name="$parentBar" setAllPoints="true" parentKey="bar" alphaMode="MOD">
+          <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" />
+          </Gradient>
         </Texture>
-        <!-- channel headers are moved here -->
+
+      </Layer>
+      <Layer level="OVERLAY">
+
+        <Button name="$parentMenuButton"  parentKey="dropmenu" inherits="DevianDDButton" enableMouse="true">
+
+        </Button>
       </Layer>
     </Layers>
-    <Frames>
-      <!-- channel scrollers are moved in here -->
-    </Frames>
   </Frame>
 </Ui>
\ No newline at end of file
--- a/Dock.lua	Wed Dec 30 07:05:38 2015 -0500
+++ b/Dock.lua	Sun Jan 03 15:49:35 2016 -0500
@@ -108,3 +108,19 @@
 end
 
 
+---
+function D:UpdateDock()
+  local num_active, num_inactive = 0, 0
+
+  for id, ch in pairs(self.console) do
+    if not self.dock[id] then
+      self.dock[id] = self.dock:CreateTexture('DockButton'..id, 'OVERLAY')
+    end
+
+    if ch.enabled then
+      num_active = num_active + 1
+    else
+      num_inactive = num_inactive + 1
+    end
+  end
+end
\ No newline at end of file