comparison 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
comparison
equal deleted inserted replaced
12:8238cddaddb1 13:9455693fc290
384 end 384 end
385 385
386 --- Generic handlers for keeping track of XML-defined frames 386 --- Generic handlers for keeping track of XML-defined frames
387 B.OnLoad = function(self) 387 B.OnLoad = function(self)
388 tinsert(checkForConfig, self) 388 tinsert(checkForConfig, self)
389 self.Minimize = function(self, forceDown)
390 if not self:IsVisible() then
391 return
392 end
393 local state = (forceDown and 1 or (B.Conf.FrameState[self:GetName()] == 1 and 2 or 1))
394 local stateFunc = (state == 1) and 'Hide' or 'Show'
395 for i, region in pairs(self.minimizeFrames) do
396 region[stateFunc](region)
397 end
398 B.Conf.FrameState[self:GetName()] = state
399 end
389 end 400 end
390 401
391 B.InitXMLFrame = function(self) 402 B.InitXMLFrame = function(self)
392 print('|cFF00FF00hello from '..self:GetName()) 403 print('|cFF00FF00hello from '..self:GetName())
393 404
394 self:RegisterForDrag('LeftButton') 405 self:RegisterForDrag('LeftButton')
395 if not B.Conf.FramePosition then 406 if not B.Conf.FramePosition then
396 B.Conf.FramePosition = {} 407 B.Conf.FramePosition = {}
397 end 408 end
409 if not B.Conf.FrameState then
410 B.Conf.FrameState = {}
411 end
412
398 if B.Conf.FramePosition[self:GetName()] then 413 if B.Conf.FramePosition[self:GetName()] then
399 print('restoring frame position', unpack(B.Conf.FramePosition[self:GetName()])) 414 print('restoring frame position', unpack(B.Conf.FramePosition[self:GetName()]))
400 self:ClearAllPoints() 415 self:ClearAllPoints()
401 local anchorTo, relativePoint, x, y = unpack(B.Conf.FramePosition[self:GetName()]) 416 local anchorTo, relativePoint, x, y = unpack(B.Conf.FramePosition[self:GetName()])
402 self:SetPoint(anchorTo, UIParent, relativePoint, x, y) 417 self:SetPoint(anchorTo, UIParent, relativePoint, x, y)
403 end 418 end
419 local state = B.Conf.FrameState[self:GetName()] and B.Conf.FrameState[self:GetName()] or 2
420 if state == 0 then
421 self:Hide()
422 elseif state == 1 then
423 self.Minimize(self, true)
424 elseif state == 2 then
425 self:Show()
426 end
427 B.Conf.FrameState[self:GetName()] = state
404 end 428 end
405 429
406 B.OnDragStart = function(self) 430 B.OnDragStart = function(self)
407 self.xA = self:GetLeft() 431 self.xA = self:GetLeft()
408 self.yA = self:GetBottom() 432 self.yA = self:GetBottom()