Log:
ag_UnitFrames: Ace3 branch - All options working in /aguf config window
Modified:
branches/ag_UnitFrames/Ace3/ag_Options.lua
branches/ag_UnitFrames/Ace3/ag_UnitClass.lua
branches/ag_UnitFrames/Ace3/ag_UnitFrames.lua
branches/ag_UnitFrames/Ace3/modules/auras/auras.lua
branches/ag_UnitFrames/Ace3/modules/castbar/castbar.lua
branches/ag_UnitFrames/Ace3/modules/combattext/combattext.lua
branches/ag_UnitFrames/Ace3/modules/healthbar/healthbar.lua
branches/ag_UnitFrames/Ace3/modules/highlight/highlight.lua
branches/ag_UnitFrames/Ace3/modules/petxpbar/petxpbar.lua
branches/ag_UnitFrames/Ace3/modules/portrait/portrait.lua
branches/ag_UnitFrames/Ace3/modules/powerbar/powerbar.lua
branches/ag_UnitFrames/Ace3/modules/rangecheck/rangecheck.lua
branches/ag_UnitFrames/Ace3/modules/xprepbar/xprepbar.lua
Modified: branches/ag_UnitFrames/Ace3/ag_Options.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/ag_Options.lua (original)
+++ branches/ag_UnitFrames/Ace3/ag_Options.lua Sat Nov 3 19:52:53 2007
@@ -42,21 +42,21 @@
end
local function setUnitFrameStyle(info, value)
- local pair = info.arg
- aUF.db.profile.units[pair[1]].FrameStyle = value
- aUF:CallUnitMethods("ApplyTheme",true,pair[1],"type")
- aUF:CallUnitMethods("BorderBackground",nil,pair[1],"type")
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- aUF:CreateStringMenus(pair[1])
+ local class = info[(#info + ((type(info.arg) == "number" and info.arg) or -2))]
+ aUF.db.profile.units[class].FrameStyle = aUF.indexLayouts[value]
+ aUF:CallUnitMethods("ApplyTheme",true,class,"type")
+ aUF:CallUnitMethods("BorderBackground",nil,class,"type")
+ aUF:CallUnitMethods("UpdateAll",nil,class,"type")
+-- aUF:CreateStringMenus(class)
for k,v in pairs(aUF.subgroups) do
v:UpdateWidth()
end
end
local function setUnitBorderStyle(info, value)
- local pair = info.arg
- aUF.db.profile.units[pair[1]].BorderStyle = value
- aUF:CallUnitMethods("BorderBackground",nil,pair[1],"type")
+ local class = info[(#info + ((type(info.arg) == "number" and info.arg) or -2))]
+ aUF.db.profile.units[class].BorderStyle = value
+ aUF:CallUnitMethods("BorderBackground",nil,class,"type")
end
local function setUnitWidth(info, value)
@@ -79,10 +79,12 @@
end
end
-local function setUnitThemeOption(info, value)
- aUF.db.profile.units[info.arg[1]][info.arg[2]] = value
- aUF:CallUnitMethods("ApplyTheme",nil,info.arg[1],"type")
- aUF:CallUnitMethods("UpdateAll",nil,info.arg[1],"type")
+local function setFontOption(info, value)
+ local class = info[(#info + ((type(info.arg) == "number" and info.arg) or -2))]
+ local tbl = SM:List("font")
+ aUF.db.profile.units[class][info[#info]] = tbl[value]
+ aUF:CallUnitMethods("ApplyTheme",nil,class,"type")
+ aUF:CallUnitMethods("UpdateAll",nil,class,"type")
end
-----------------------------------------------------------------------------------------------------------------------------------------------------
@@ -202,9 +204,9 @@
name = L["Bar Texture"],
type = "select",
desc = L["Selects the global status bar texture."],
- get = getOption,
set = function(key, value)
- aUF.db.profile.BarStyle = value
+ local tbl = SM:List("statusbar")
+ aUF.db.profile.BarStyle = tbl[value]
aUF:CallUnitMethods("ExecModuleMethods","OnSetBarTexture")
end,
arg = "BarStyle",
@@ -225,31 +227,50 @@
---- populate unit menu -----------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------
-function options:AddUnitOptions(type)
+function options:AddUnitOptions(class)
local path = aUF.Options.table.args.Units
- path.args[type] = {
- name = L[type],
+ path.args[class] = {
+ name = L[class],
type = "group",
desc = "desc",
order = 20,
childGroups = "tab",
- hidden = function() return not(aUF.db.profile.units[type].enabled) end,
+ hidden = function() return not(aUF.db.profile.units[class].enabled) end,
get = function(info)
- if info.arg then
- return aUF.db.profile.units[info.arg[1]][info.arg[2]]
- end
- end,
+ if info.arg and type(info.arg) == "number" then
+ return aUF.db.profile.units[info[#info+info.arg]][info[#info]]
+ else
+ return aUF.db.profile.units[info[#info-2]][info[#info]]
+ end
+ end,
set = function(info, value)
- aUF.db.profile.units[info.arg[1]][info.arg[2]] = value
+ if info.arg and type(info.arg) == "number" then
+ aUF.db.profile.units[info[#info+info.arg]][info[#info]] = value
+ else
+ aUF.db.profile.units[info[#info-2]][info[#info]] = value
+ end
end,
+ handler = {
+ UpdateSet = function(self, info, value)
+ local class = info[(#info + ((type(info.arg) == "number" and info.arg) or -2))]
+ aUF.db.profile.units[class][info[#info]] = value
+ aUF:CallUnitMethods("UpdateAll",nil,class,"type")
+ end,
+ LayoutSet = function(self, info, value)
+ local class = info[(#info + ((type(info.arg) == "number" and info.arg) or -2))]
+ aUF.db.profile.units[class][info[#info]] = value
+ aUF:CallUnitMethods("ApplyTheme",nil,class,"type")
+ aUF:CallUnitMethods("UpdateAll",nil,class,"type")
+ end
+ },
plugins = {},
args = {
Header = {
type = 'header',
order = 1,
- name = L[type],
+ name = L[class],
},
- FrameAttributes = {
+ FrameStyle = {
name = "Frame Attributes",
type = "group",
order = 1,
@@ -261,17 +282,17 @@
values = aUF.indexLayouts,
usage = "",
set = setUnitFrameStyle,
- arg = { type, "FrameStyle" },
+-- arg = { class, "FrameStyle" },
order = 2,
},
BorderStyle = {
name = Lf["borders"],
type = "select",
desc = Lf["BordersDesc"],
- values = {"Classic", "Nurfed", "Hidden"},
+ values = {Rounded = "Rounded", Square = "Square", Hidden = "Hidden"},
usage = "",
set = setUnitBorderStyle,
- arg = { type, "BorderStyle" },
+-- arg = { class, "BorderStyle" },
order = 3,
},
Width = {
@@ -282,7 +303,7 @@
max = 400,
step = 1,
set = setUnitWidth,
- arg = { type, "Width" },
+-- arg = { class, "Width" },
order = 5,
},
Scale = {
@@ -294,7 +315,7 @@
step = 0.05,
isPercent = true,
set = setUnitScale,
- arg = { type, "Scale" },
+-- arg = { class, "Scale" },
order = 7,
},
},
@@ -311,11 +332,9 @@
desc = "Sets the override font type",
values = SM:List("font"),
usage = "",
- get = getUnitOption,
- set = setUnitThemeOption,
- arg = { type, "fontOverrideType" },
+ set = setFontOption,
order = 8,
- disabled = function() if not (aUF.db.profile.units[type].fontOverride) then return true end end,
+ disabled = function(info) if not (aUF.db.profile.units[info[#info-2]].fontOverride) then return true end end,
},
fontOverrideSize = {
name = "Font Size",
@@ -324,19 +343,16 @@
min = -10,
max = 10,
step = 1,
- get = function() return 1 end,
- set = setUnitThemeOption,
- arg = { type, "fontOverrideSize" },
+ set = "LayoutSet",
order = 9,
- disabled = function() if not (aUF.db.profile.units[type].fontOverride) then return true end end,
+ disabled = function(info) if not (aUF.db.profile.units[info[#info-2]].fontOverride) then return true end end,
},
fontOverride = {
name = "Font Override",
type = "toggle",
desc = "Enables overriding of font type/size",
- get = getUnitOption,
- set = setUnitThemeOption,
- arg = { type, "fontOverride" },
+ set = "LayoutSet",
+-- get = function(info) aUF:Print(aUF.db.profile.units[info[#info-2]][info[#info]]) return aUF.db.profile.units[info[#info-2]][info[#info]] end,
order = 10,
},
}
@@ -347,14 +363,13 @@
desc = "desc",
order = 3,
args = {
- LongStatusbars = {
- name = Lf["longbars"],
- type = "toggle",
- desc = Lf["LongBarsDesc"],
- get = getUnitOption,
- set = setUnitThemeOption,
- arg = { type, "LongStatusbars" },
- },
+-- LongStatusbars = {
+-- name = Lf["Extend Bars"],
+-- type = "toggle",
+-- desc = Lf["Extends the status bars to the full width of the unit frame for some layouts"],
+-- set = "LayoutSet",
+-- order = 1,
+-- },
},
plugins = {},
}
@@ -367,14 +382,14 @@
moduleOptions[name] = v:OnRegisterOptions()
end
tbl = moduleOptions[name]
- if tbl and type == v.inherit or not (v.inherit) then
+ if tbl and class == v.inherit or not (v.inherit) then
local subConfig = v.subConfig
if subConfig then
- path.args[type].args[subConfig].plugins[name] = {}
- path.args[type].args[subConfig].plugins[name][name] = tbl
+ path.args[class].args[subConfig].plugins[name] = {}
+ path.args[class].args[subConfig].plugins[name][name] = tbl
else
- path.args[type].plugins[name] = {}
- path.args[type].plugins[name][name] = tbl
+ path.args[class].plugins[name] = {}
+ path.args[class].plugins[name][name] = tbl
end
end
end
Modified: branches/ag_UnitFrames/Ace3/ag_UnitClass.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/ag_UnitClass.lua (original)
+++ branches/ag_UnitFrames/Ace3/ag_UnitClass.lua Sat Nov 3 19:52:53 2007
@@ -405,7 +405,7 @@
end
local m
if self.database.fontOverrideType then
- m = media:Fetch("font", self.database.fontOverrideType)
+ m = media:Fetch("font", self.database.fontOverrideType)
end
if value.Font then
self[key]:SetFont((self.database.fontOverride and m) or value.Font, (self.database.fontOverride and (self.database.fontOverrideSize or 0) + value.FontSize) or value.FontSize)
@@ -736,67 +736,6 @@
end
end
---[[
-function aUF.classes.aUFunit.prototype:RegisterString(k)
- local style = self.database[k.."Style"]
- local format = self.database[k.."Format"]
- if style == "Hide" then
- self[k]:SetText("")
- elseif DogTag and style == "Custom" then
- DogTag:RegisterFontString(self[k],self.frame,self.unit,format)
- elseif self[k].events then
- for j,i in pairs(self[k].events) do
- if not self[k].updateFunc then
- self[k].updateFunc = function()
- local string = k
- local object = self
- if self[k]:IsShown() and self[k].func then
- self[k].func(aUF,object,k)
- end
- end
- end
- self:ObjectRegisterEvent(i, self[k].updateFunc)
- end
- end
-end
-
-function aUF.classes.aUFunit.prototype:UnregisterString(k)
- local string = self[k]
- if DogTag then
- DogTag:UnregisterFontString(string)
- end
- if string.events then
- for j,i in pairs(string.events) do
- if string.updateFunc then
- self:ObjectUnregisterEvent(i, string.updateFunc)
- end
- end
- end
-end
-
-function aUF.classes.aUFunit.prototype:UnregisterStrings()
- if self.strings then
- for k,v in pairs(self.strings) do
- self:UnregisterString(k)
- end
- end
-end
-
-function aUF.classes.aUFunit.prototype:UpdateTextStrings()
- for k,v in pairs(self.strings) do
- if self[k]:IsShown() then
- local style = self.database[k.."Style"]
- if DogTag and style == "Custom" then
- DogTag:UpdateFontString(self[k])
- elseif self[k].func then
- self[k].func(aUF,self,k)
- end
- end
- end
-end
-
- ]]
-
-----------------------
-- MOUSE INTERACTION --
-----------------------
Modified: branches/ag_UnitFrames/Ace3/ag_UnitFrames.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/ag_UnitFrames.lua (original)
+++ branches/ag_UnitFrames/Ace3/ag_UnitFrames.lua Sat Nov 3 19:52:53 2007
@@ -33,7 +33,6 @@
RaidGrouping = "subgroup",
PartyGrouping = "withplayer",
PetGrouping = "withplayer",
- BorderStyle = "Hidden",
BarStyle = "Aluminium",
CurrentRaidSet = "1",
@@ -94,13 +93,17 @@
ClassTextStyle = "Default",
NameLabelFormat = "",
ClassTextFormat = "",
-
+ BorderStyle = "Hidden",
+ fontOverride = false,
+ fontOverrideSize = 0,
FrameStyle = "ABF",
LongStatusbars = false,
Scale = 1.15,
RaidColorName = false,
Width = 165,
enabled = true,
+ ShowMana = true,
+ CastBar = true,
strings = {
NameLabel = "name afkdnd",
ClassText = "level class race",
@@ -108,6 +111,12 @@
ManaText = "curmp",
}
},
+ player = {
+ ShowXP = true,
+ },
+ pet = {
+ ShowXP = true,
+ },
party = {
enabled = true,
},
@@ -115,6 +124,7 @@
enabled = false,
Scale = 1,
Width = 110,
+ ShowMana = false,
strings = {
HealthText = "percenthp",
}
@@ -123,6 +133,7 @@
enabled = false,
Scale = 0.85,
Width = 110,
+ ShowMana = false,
strings = {
HealthText = "percenthp",
}
@@ -135,7 +146,8 @@
}
},
focustarget = {
- enabled = false,
+ enabled = false,
+ ShowMana = false,
strings = {
HealthText = "percenthp curhp",
ClassText = "mobtype level class race",
@@ -145,6 +157,7 @@
Scale = 1,
RaidColorName = false,
Width = 135,
+ ShowMana = false,
strings = {
HealthText = "percenthp",
ClassText = "mobtype level class race",
@@ -155,6 +168,7 @@
RaidColorName = false,
Width = 110,
enabled = false,
+ ShowMana = false,
strings = {
HealthText = "percenthp",
ClassText = "mobtype level class race",
@@ -163,7 +177,8 @@
partypet = {
Scale = 1,
RaidColorName = false,
- Width = 125,
+ Width = 125,
+ ShowMana = false,
strings = {
HealthText = "percenthp",
}
@@ -172,7 +187,8 @@
Scale = 1,
RaidColorName = false,
Width = 135,
- enabled = false,
+ enabled = false,
+ ShowMana = false,
strings = {
HealthText = "percenthp",
ClassText = "mobtype level class race",
@@ -471,8 +487,8 @@
}
aUF.Borders = {
- Classic = {texture = "Interface\\Tooltips\\UI-Tooltip-Border",size = 16,insets = 5},
- Nurfed = {texture = "Interface\\DialogFrame\\UI-DialogBox-Border",size = 16,insets = 5},
+ Rounded = {texture = "Interface\\Tooltips\\UI-Tooltip-Border",size = 16,insets = 5},
+ Square = {texture = "Interface\\DialogFrame\\UI-DialogBox-Border",size = 16,insets = 5},
Hidden = {texture = "",size = 0,insets = 3},
}
Modified: branches/ag_UnitFrames/Ace3/modules/auras/auras.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/modules/auras/auras.lua (original)
+++ branches/ag_UnitFrames/Ace3/modules/auras/auras.lua Sat Nov 3 19:52:53 2007
@@ -96,8 +96,38 @@
end
end
-local getUnitOption = function() return 1 end
+local function setUnitAuraPosition(info, value)
+ local class = info[(#info + ((type(info.arg) == "number" and info.arg) or -2))]
+ aUF.db.profile.units[class].AuraPos = value
+ aUF:CallUnitMethods("UpdateAuras",true,class,"type")
+ aUF:CallUnitMethods("AuraPosition",true,class,"type")
+end
+
+local function setUnitAuraOption(info, value)
+ local class = info[(#info + ((type(info.arg) == "number" and info.arg) or -2))]
+ aUF.db.profile.units[info[#info-2]][info[#info]] = value
+ aUF:CallUnitMethods("SetAuraCount",nil,class,"type")
+ aUF:CallUnitMethods("AuraPosition",nil,class,"type")
+ aUF:CallUnitMethods("UpdateAuras",nil,class,"type")
+end
+
+local function setUnitAuraDebuffColor(info, value)
+ local class = info[(#info + ((type(info.arg) == "number" and info.arg) or -2))]
+ aUF.db.profile.units[class].AuraDebuffC = value
+ aUF:CallUnitMethods("UpdateAuras",true,class,"type")
+end
+
+local function getUnitAuraFilter(info)
+ local class = info[(#info + ((type(info.arg) == "number" and info.arg) or -2))]
+ return aUF.db.profile.units[class].AuraFilter == 1
+end
+local function setUnitAuraFilter(info, value)
+ local class = info[(#info + ((type(info.arg) == "number" and info.arg) or -2))]
+ aUF.db.profile.units[class].AuraFilter = value and 1 or 0
+ aUF:CallUnitMethods("UpdateAuras",true,class,"type")
+end
+
function aUF_auras:OnRegisterOptions()
local config = {
hidden = function() return not (aUF_auras:IsActive()) end,
@@ -109,7 +139,6 @@
name = L["Position"],
type = "select",
desc = L["Position Description"],
- get = getUnitOption,
set = setUnitAuraPosition,
values = {Right = "Right", Left = "Left", Above = "Above", Below = "Below",Inside = "Inside",Hidden = "Hidden"},
order = 41,
@@ -121,7 +150,6 @@
min = 1,
max = 4,
step = 1,
- get = getUnitOption,
set = setUnitAuraOption,
order = 42,
},
@@ -132,7 +160,6 @@
min = 8,
max = 24,
step = 1,
- get = getUnitOption,
set = setUnitAuraOption,
order = 43,
},
@@ -140,7 +167,6 @@
name = L["Enable Highlights"],
type = "toggle",
desc = L["Debuff Coloring Description"],
- get = getUnitOption,
set = setUnitAuraDebuffColor,
order = 44,
},
@@ -148,16 +174,14 @@
name = L["Filter Auras"],
type = "toggle",
desc = L["Filters auras relevant to your class"],
- get = getUnitAuraFilter,
+ get = getUnitAuraFilter,
set = setUnitAuraFilter,
order = 45,
- passValue = class,
},
AuraPreferBuff = {
name = L["Prioritize Buffs"],
type = "toggle",
desc = L["Prioritize buffs above debuffs"],
- get = getUnitOption,
set = setUnitOption,
order = 46
},
@@ -165,7 +189,6 @@
name = L["Enable Cooldown"],
type = "toggle",
desc = L["Shows a cooldown dial on auras"],
- get = getUnitOption,
set = setUnitAuraOption,
order = 46
},
Modified: branches/ag_UnitFrames/Ace3/modules/castbar/castbar.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/modules/castbar/castbar.lua (original)
+++ branches/ag_UnitFrames/Ace3/modules/castbar/castbar.lua Sat Nov 3 19:52:53 2007
@@ -50,7 +50,6 @@
end
end
-local class = "player"
function aUF_castbar:OnRegisterOptions()
local config = {
inline = true,
@@ -59,18 +58,12 @@
desc = L["Castbar Description"],
type = 'group',
args = {
- showPortrait = {
+ CastBar = {
name = L["Enable Castbar"],
type = "toggle",
desc = L["Displays a casting bar for the unit"],
- get = function(pair)
- return aUF.db.profile.units[pair[1]][pair[2]]
- end,
- set = function(pair, value)
- aUF.db.profile.units[pair[1]][pair[2]] = value
- aUF:CallUnitMethods("ApplyTheme",nil,pair[1],"type")
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- end,
+ set = "LayoutSet",
+ arg = -3,
},
},
}
Modified: branches/ag_UnitFrames/Ace3/modules/combattext/combattext.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/modules/combattext/combattext.lua (original)
+++ branches/ag_UnitFrames/Ace3/modules/combattext/combattext.lua Sat Nov 3 19:52:53 2007
@@ -11,6 +11,7 @@
if not aUF_combattext.schedule then
aUF_combattext.schedule = "aUF_combattext-" .. tostring(math.random())
-- aUF_combattext:ScheduleRepeatingEvent(aUF_combattext.schedule, aUF_combattext.UpdatePool, 0.05, aUF_combattext)
+ aUF_combattext.schedule = aUF.ScheduleRepeatingEvent(aUF_combattext, aUF_combattext.schedule, aUF_combattext.UpdatePool, 0.05)
end
end })
@@ -24,7 +25,6 @@
})
end
-local class = "player"
function aUF_combattext:OnRegisterOptions()
local config = {
hidden = function() return not (aUF_combattext:IsActive()) end,
@@ -32,19 +32,11 @@
desc = L["Combat Text Description"],
type = 'group',
args = {
- showPortrait = {
+ ShowCombat = {
name = L["Enable Combat Text"],
type = "toggle",
desc = L["Displays a text overlay with combat information"],
- get = function(pair)
- return aUF.db.profile.units[pair[1]][pair[2]]
- end,
- set = function(pair, value)
- aUF.db.profile.units[pair[1]][pair[2]] = value
- aUF:CallUnitMethods("ApplyTheme",nil,pair[1],"type")
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- end,
- passValue = { class, "ShowCombat" },
+ set = "LayoutSet",
}
}
}
@@ -118,7 +110,7 @@
function aUF.classes.aUFunit.prototype:UnitCombat(event, unit)
if unit ~= self.unit then return end
- if not ( self.database.ShowCombat ) then return end
+ if not ( self.database.ShowCombat ) then return end
self:CombatFeedback_OnCombatEvent(arg1, arg2, arg3, arg4, arg5)
end
Modified: branches/ag_UnitFrames/Ace3/modules/healthbar/healthbar.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/modules/healthbar/healthbar.lua (original)
+++ branches/ag_UnitFrames/Ace3/modules/healthbar/healthbar.lua Sat Nov 3 19:52:53 2007
@@ -19,7 +19,6 @@
self.subConfig = "Bars"
end
-local class = "player"
function aUF_healthbar:OnRegisterOptions()
local config = {
inline = true,
@@ -27,34 +26,20 @@
desc = L["Healthbar"],
type = 'group',
args = {
- ColorByClass = {
+ ClassColorBars = {
name = L["Color by class"],
type = "toggle",
desc = L["Colors the healthbar by player class"],
- get = function(pair)
- return aUF.db.profile.units[pair[1]][pair[2]]
- end,
- set = function(pair, value)
- aUF.db.profile.units[pair[1]][pair[2]] = value
- aUF:CallUnitMethods("ApplyTheme",nil,pair[1],"type")
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- end,
- passValue = { class, "ClassColorBars" },
+ set = "LayoutSet",
+ arg = -3,
},
TargetShowHostile = {
name = L["Color by Hostility"],
type = "toggle",
desc = L["Colors the healthbar by target hostility"],
- get = function(pair)
- return aUF.db.profile.units[pair[1]][pair[2]]
- end,
- set = function(pair, value)
- aUF.db.profile.units[pair[1]][pair[2]] = value
- aUF:CallUnitMethods("ApplyTheme",nil,pair[1],"type")
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- end,
- passValue = { class, "TargetShowHostile" },
- hidden = function() local class = class return class ~= "target" end,
+ set = "LayoutSet",
+-- hidden = function() local class = class return class ~= "target" end,
+ arg = -3,
}
}
}
Modified: branches/ag_UnitFrames/Ace3/modules/highlight/highlight.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/modules/highlight/highlight.lua (original)
+++ branches/ag_UnitFrames/Ace3/modules/highlight/highlight.lua Sat Nov 3 19:52:53 2007
@@ -12,7 +12,6 @@
})
end
-local class = "player"
function aUF_highlight:OnRegisterOptions()
local config = {
hidden = function() return not (aUF_highlight:IsActive()) end,
@@ -20,18 +19,11 @@
desc = L["Highlight"],
type = 'group',
args = {
- HideMana = {
+ HighlightSelected = {
name = L["Enable highlights"],
type = "toggle",
desc = L["Highlights the frame when selected"],
- get = function(pair)
- return aUF.db.profile.units[pair[1]][pair[2]]
- end,
- set = function(pair, value)
- aUF.db.profile.units[pair[1]][pair[2]] = value
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- end,
- passValue = { class, "HighlightSelected" },
+ set = "UpdateSet",
}
}
}
Modified: branches/ag_UnitFrames/Ace3/modules/petxpbar/petxpbar.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/modules/petxpbar/petxpbar.lua (original)
+++ branches/ag_UnitFrames/Ace3/modules/petxpbar/petxpbar.lua Sat Nov 3 19:52:53 2007
@@ -19,7 +19,6 @@
self.subConfig = "Bars"
end
-local class = "player"
function aUF_petxpbar:OnRegisterOptions()
local config = {
inline = true,
@@ -28,19 +27,12 @@
desc = L["Experience Description"],
type = 'group',
args = {
- HideMana = {
+ ShowXP = {
name = L["Enable Experiencebar"],
type = "toggle",
desc = L["Enables the Experiencebar"],
- get = function(pair)
- return aUF.db.profile.units[pair[1]][pair[2]]
- end,
- set = function(pair, value)
- aUF.db.profile.units[pair[1]][pair[2]] = value
- aUF:CallUnitMethods("ApplyTheme",nil,pair[1],"type")
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- end,
- passValue = { class, "ShowXP" },
+ set = "LayoutSet",
+ arg = -3,
},
},
}
Modified: branches/ag_UnitFrames/Ace3/modules/portrait/portrait.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/modules/portrait/portrait.lua (original)
+++ branches/ag_UnitFrames/Ace3/modules/portrait/portrait.lua Sat Nov 3 19:52:53 2007
@@ -12,8 +12,6 @@
})
end
-local class = "player"
-
function aUF_portrait:OnRegisterOptions()
config = {
hidden = function() return not (aUF_portrait:IsActive()) end,
@@ -21,19 +19,11 @@
desc = L["Portrait"],
type = 'group',
args = {
- showPortrait = {
+ Portrait = {
name = L["Enable Portrait"],
type = "toggle",
desc = L["Draws a portrait of the character"],
- get = function(pair)
- return aUF.db.profile.units[pair[1]][pair[2]]
- end,
- set = function(pair, value)
- aUF.db.profile.units[pair[1]][pair[2]] = value
- aUF:CallUnitMethods("ApplyTheme",nil,pair[1],"type")
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- end,
- passValue = { class, "Portrait" },
+ set = "LayoutSet",
},
},
}
Modified: branches/ag_UnitFrames/Ace3/modules/powerbar/powerbar.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/modules/powerbar/powerbar.lua (original)
+++ branches/ag_UnitFrames/Ace3/modules/powerbar/powerbar.lua Sat Nov 3 19:52:53 2007
@@ -33,7 +33,6 @@
self.subConfig = "Bars"
end
-local class = "player"
function aUF_powerbar:OnRegisterOptions()
local config = {
inline = true,
@@ -42,28 +41,12 @@
desc = L["Powerbar Description"],
type = 'group',
args = {
- HideMana = {
+ ShowMana = {
name = L["Enable Manabar"],
type = "toggle",
desc = L["Enables the manabar"],
- get = function(pair)
- local value = aUF.db.profile.units[pair[1]][pair[2]]
- if value == true then
- return false
- else
- return true
- end
- end,
- set = function(pair, value)
- if value == true then
- aUF.db.profile.units[pair[1]][pair[2]] = false
- else
- aUF.db.profile.units[pair[1]][pair[2]] = true
- end
- aUF:CallUnitMethods("ApplyTheme",nil,pair[1],"type")
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- end,
- passValue = { class, "HideMana" },
+ set = "LayoutSet",
+ arg = -3,
},
},
}
@@ -151,7 +134,7 @@
end
function aUF_powerbar:OnParseLayout(object)
- if not (object.database.HideMana) then
+ if object.database.ShowMana then
object.powertype = nil
if not object.ManaBar_BG then
object.ManaBar = newFrame("StatusBar", object.frame)
Modified: branches/ag_UnitFrames/Ace3/modules/rangecheck/rangecheck.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/modules/rangecheck/rangecheck.lua (original)
+++ branches/ag_UnitFrames/Ace3/modules/rangecheck/rangecheck.lua Sat Nov 3 19:52:53 2007
@@ -49,7 +49,6 @@
})
end
-local class = "player"
function aUF_rangecheck:OnRegisterOptions()
local config = {
hidden = function() return not (aUF_rangecheck:IsActive()) end,
@@ -57,18 +56,11 @@
desc = L["Range Check Description"],
type = 'group',
args = {
- showPortrait = {
+ rangeCheck = {
name = L["Enable Range Check"],
type = "toggle",
desc = L["Fades out of range units"],
- get = function(pair)
- return aUF.db.profile.units[pair[1]][pair[2]]
- end,
- set = function(pair, value)
- aUF.db.profile.units[pair[1]][pair[2]] = value
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- end,
- passValue = { class, "rangeCheck" },
+ set = "UpdateSet",
},
},
}
@@ -78,8 +70,8 @@
function aUF_rangecheck:OnRegisterEvents(object)
if object.database.rangeCheck and self:IsActive() then
if not self.schedule then
- self.schedule = "aUF_rangecheck-" .. tostring(math.random())
- self:ScheduleRepeatingEvent(self.schedule, self.UpdatePool, 0.7, self)
+ self.schedule = "aUF_rangecheck-" .. tostring(math.random())
+ self.schedule = aUF.ScheduleRepeatingEvent(self, self.schedule, self.UpdatePool, 0.7)
end
pool[object] = true
else
Modified: branches/ag_UnitFrames/Ace3/modules/xprepbar/xprepbar.lua
==============================================================================
--- branches/ag_UnitFrames/Ace3/modules/xprepbar/xprepbar.lua (original)
+++ branches/ag_UnitFrames/Ace3/modules/xprepbar/xprepbar.lua Sat Nov 3 19:52:53 2007
@@ -24,7 +24,6 @@
hooksecurefunc("ReputationWatchBar_Update",self.UpdateRepEvent)
end
-local class = "player"
function aUF_xprepbar:OnRegisterOptions()
local config = {
inline = true,
@@ -33,19 +32,12 @@
desc = L["Experience Description"],
type = 'group',
args = {
- HideMana = {
+ ShowXP = {
name = L["Enable Experiencebar"],
type = "toggle",
desc = L["Enables the Experiencebar"],
- get = function(pair)
- return aUF.db.profile.units[pair[1]][pair[2]]
- end,
- set = function(pair, value)
- aUF.db.profile.units[pair[1]][pair[2]] = value
- aUF:CallUnitMethods("ApplyTheme",nil,pair[1],"type")
- aUF:CallUnitMethods("UpdateAll",nil,pair[1],"type")
- end,
- passValue = { class, "ShowXP" },
+ set = "LayoutSet",
+ arg = -3,
},
},
}
@@ -139,7 +131,7 @@
object.disabledFrames.XPBar_Rest = true
object.disabledFrames.XPBar = true
end
- else
+ elseif object.database.ShowXP then
if not object.XPBar_BG then
object.XPBar_BG = newFrame("Texture", object.frame, "BORDER")
object.XPBar_BG:SetDrawLayer("BORDER")