diff Dock.lua @ 33:e6650821a2c0

Debugging pass on console code.
author Nenue
date Sun, 27 Dec 2015 02:30:46 -0500
parents c6a2c2df4790
children dcc57a7cabc9
line wrap: on
line diff
--- a/Dock.lua	Sat Dec 26 21:51:57 2015 -0500
+++ b/Dock.lua	Sun Dec 27 02:30:46 2015 -0500
@@ -9,78 +9,9 @@
 local _G = _G
 local db = DevianDB
 
+local function Dock_MenuClick() end
 
 local function Dock_MouseDown(self, button, up)
-  local parent = self.dockedTo and D.console[self.dockedTo] or self
-  local docked = parent.docked
-  if docked == nil then
-    docked = {}
-  end
-  local worklist = {}
-  for _, i in pairs(docked) do
-    table.insert(worklist, D.console[i])
-  end
-
-  if not up then
-    if button ~= 'RightButton' then
-      if parent.titlebar:IsMouseOver() or not parent.isDocked then
-        parent:ToFront()
-      else
-        parent.out:Hide()
-      end
-
-      if parent.out.grip:IsMouseOver() then
-        parent:StartSizing()
-      else
-        parent:StartMoving()
-      end
-    else
-      parent:MinMax()
-    end
-
-  else
-    if button ~= 'RightButton' then
-      if parent.titlebar:IsMouseOver() then
-        parent.out:Show()
-      end
-      parent:StopMovingOrSizing()
-    end
-  end
-
-  local fixparent = true
-  for _, frame in pairs(worklist) do
-    if not up then
-      if button ~= 'RightButton' then
-        if frame.titlebar:IsMouseOver() then
-          frame:ToFront()
-          fixparent = nil
-        else
-          frame.out:Hide()
-        end
-        if parent.out.grip:IsMouseOver() then
-          frame:StartSizing()
-        else
-          frame:StartMoving()
-        end
-      end
-    else
-      if button ~= 'RightButton' then
-        frame:StopMovingOrSizing()
-        frame:SetPoint('TOPLEFT', parent, 'TOPLEFT')
-        frame:SetPoint('BOTTOMRIGHT', parent, 'BOTTOMRIGHT')
-        frame.x = nil
-        frame.y = nil
-        frame.width = nil
-        frame.height = nil
-        frame:Save()
-
-      end
-    end
-  end
-
-  if fixparent then
-    parent.out:Show()
-  end
 end
 local function Dock_MouseUp (self, button)
   Dock_MouseDown(self, button, true)
@@ -130,7 +61,8 @@
     frame.y = nil
     frame.width = nil
     frame.height = nil
-    frame.oldscript = frame:GetScript('OnMousedown')
+    frame.scriptsMD = frame:GetScript('OnMouseDown')
+    frame.scriptsMU = frame:GetScript('OnMouseUp')
     frame:SetScript('OnMouseDown', nil)
     frame:SetScript('OnMouseUp', nil)
     frame:Save()