load StateDriver libraries & update files as needed (Needs more testing)

This commit is contained in:
Crum
2018-06-07 01:28:29 -05:00
parent cd7ea3556e
commit 26ca83f608
10 changed files with 910 additions and 109 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="templates.lua"/>
<Include file="templates.xml"/>
<Script file="init.lua"/>
<Script file="private.lua"/>
<Script file="ouf.lua"/>
@@ -16,7 +16,7 @@
<Cooldown name="oUF_CooldownFrameTemplate" inherits="CooldownFrameTemplate" drawEdge="true" virtual="true"/>
<!--
Sub-object as a child of the parent unit frame:
<Button name="oUF_HeaderTargetTemplate" inherits="SecureUnitButtonTemplate" virtual="true">
<Frames>
@@ -57,5 +57,5 @@
</Button>
</Frames>
</Button>
-->
</Ui>
+22 -22
View File
@@ -59,7 +59,7 @@ local function onAttributeChanged(self, name, value)
if(not self.onlyProcessChildren) then
updateActiveUnit(self, "OnAttributeChanged")
end
--[[
if(self.unit and self.unit == value) then
return
else
@@ -67,7 +67,7 @@ local function onAttributeChanged(self, name, value)
iterateChildren(self:GetChildren())
end
end
]]
end
end
@@ -331,7 +331,7 @@ local function initObject(unit, style, styleFunc, header, ...)
styleFunc(object, objectUnit, not header)
--object:SetScript("OnAttributeChanged", onAttributeChanged)
object:SetScript("OnAttributeChanged", onAttributeChanged)
object:SetScript("OnShow", function() onShow(this) end)
activeElements[object] = {}
@@ -359,7 +359,7 @@ local function walkObject(object, unit)
-- Check if we should leave the main frame blank.
if(object.onlyProcessChildren) then
object.hasChildren = true
--object:SetScript("OnAttributeChanged", onAttributeChanged)
object:SetScript("OnAttributeChanged", onAttributeChanged)
return initObject(unit, style, styleFunc, header, object:GetChildren())
end
@@ -542,8 +542,8 @@ do
end
self.menu = togglemenu
--self:SetAttribute("type1", "target")
--self:SetAttribute("type2", "menu")
self:SetAttribute("type1", "target")
self:SetAttribute("type2", "menu")
self.guessUnit = unit
self.unit = "player"
-- self.onlyProcessChildren =true
@@ -552,18 +552,18 @@ do
styleProxy(nil, self:GetName())
end
local setAttribute = function(self, name, value)
if self.attributes[name] ~= value then
self.attributes[name] = value
-- local setAttribute = function(self, name, value)
-- if self.attributes[name] ~= value then
-- self.attributes[name] = value
if self:IsVisible() then
SecureGroupHeader_Update(self)
end
end
end
local getAttribute = function(self, name)
return self.attributes[name]
end
-- if self:IsVisible() then
-- SecureGroupHeader_Update(self)
-- end
-- end
-- end
-- local getAttribute = function(self, name)
-- return self.attributes[name]
-- end
--[[ oUF:SpawnHeader(overrideName, template, visibility, ...)
Used to create a group header and apply the currently active style to it.
@@ -594,10 +594,10 @@ do
header:Hide()
header.attributes = {}
header.SetAttribute = setAttribute
header.GetAttribute = getAttribute
-- header.SetAttribute = SetAttribute
-- header.GetAttribute = GetAttribute
--header:SetAttribute("template", "SecureUnitButtonTemplate")
header:SetAttribute("template", "SecureUnitButtonTemplate")
for i = 1, getn(arg), 2 do
local att, val = select(i, unpack(arg))
if(not att) then break end
@@ -620,7 +620,7 @@ do
end
--[[if(visibility) then
if(visibility) then
local type, list = split(" ", visibility, 2)
if(list and type == "custom") then
RegisterStateDriver(header, "visibility", list)
@@ -630,7 +630,7 @@ do
RegisterStateDriver(header, "visibility", condition)
header.visibility = condition
end
end]]
end
return header
end