diff Init.lua @ 13:9455693fc290

Init - recall XML display state on reload ObjectiveFrame - quest coloring by relative level - quest coloring by daily/weekly/complete status - remember starting scroll value between reload - limit anchor points to edges for regions affected by style attributes ObjectiveInfo - AutoQuest outline definitions - Pull Quest title and tag data in addition to WatchInfo ObjectiveStyle - ensure consistent style table - hardcode certain attributes for sanity XML - ensure consistent naming conventions for heading and content elements - ensure hardcore anchors are based on edges - expansion of file structure to deal with complexities of dynamic widgets and style caching ObjectiveUI - determine primary style by block handler when restoring original style - moved framescript to 'ObjectiveWidgets' lua
author Nenue
date Sat, 02 Apr 2016 17:46:52 -0400
parents 3397aae1f44d
children ed642234f017
line wrap: on
line diff
--- a/Init.lua	Sat Apr 02 05:01:54 2016 -0400
+++ b/Init.lua	Sat Apr 02 17:46:52 2016 -0400
@@ -386,6 +386,17 @@
 --- Generic handlers for keeping track of XML-defined frames
 B.OnLoad = function(self)
   tinsert(checkForConfig, self)
+  self.Minimize = function(self, forceDown)
+    if not self:IsVisible() then
+       return
+    end
+    local state = (forceDown and 1 or (B.Conf.FrameState[self:GetName()] == 1 and 2 or 1))
+    local stateFunc = (state  == 1) and 'Hide' or 'Show'
+    for i, region in pairs(self.minimizeFrames) do
+      region[stateFunc](region)
+    end
+    B.Conf.FrameState[self:GetName()] = state
+  end
 end
 
 B.InitXMLFrame = function(self)
@@ -395,12 +406,25 @@
   if not B.Conf.FramePosition then
     B.Conf.FramePosition = {}
   end
+  if not B.Conf.FrameState then
+    B.Conf.FrameState = {}
+  end
+
   if B.Conf.FramePosition[self:GetName()] then
     print('restoring frame position', unpack(B.Conf.FramePosition[self:GetName()]))
     self:ClearAllPoints()
     local anchorTo, relativePoint, x, y = unpack(B.Conf.FramePosition[self:GetName()])
     self:SetPoint(anchorTo, UIParent, relativePoint, x, y)
   end
+  local state = B.Conf.FrameState[self:GetName()] and B.Conf.FrameState[self:GetName()] or 2
+  if state == 0 then
+    self:Hide()
+  elseif state == 1 then
+    self.Minimize(self, true)
+  elseif state == 2 then
+    self:Show()
+  end
+  B.Conf.FrameState[self:GetName()] = state
 end
 
 B.OnDragStart = function(self)