diff --git a/2/3/4/5/6/7/!Compatibility/!Compatibility.toc b/2/3/4/5/6/7/!Compatibility/!Compatibility.toc
index e4eeec8..eafe9f2 100644
--- a/2/3/4/5/6/7/!Compatibility/!Compatibility.toc
+++ b/2/3/4/5/6/7/!Compatibility/!Compatibility.toc
@@ -1,7 +1,8 @@
## Interface: 11200
## Title: !Compatibility
## Notes: Compatibility functions for Vanilla
-## Version: 1.0
+## Version: 1.1
+errorHandler.lua
api\api.xml
-debugTools.lua
\ No newline at end of file
+slashCommands.lua
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/api/api.xml b/2/3/4/5/6/7/!Compatibility/api/api.xml
index c16d74e..9bff75b 100644
--- a/2/3/4/5/6/7/!Compatibility/api/api.xml
+++ b/2/3/4/5/6/7/!Compatibility/api/api.xml
@@ -1,4 +1,5 @@
-
+
+
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/api/luaAPI.lua b/2/3/4/5/6/7/!Compatibility/api/luaAPI.lua
new file mode 100644
index 0000000..a2cfbd3
--- /dev/null
+++ b/2/3/4/5/6/7/!Compatibility/api/luaAPI.lua
@@ -0,0 +1,201 @@
+-- Cache global variables
+local assert = assert
+local error = error
+local geterrorhandler = geterrorhandler
+local pairs = pairs
+local pcall = pcall
+local tostring = tostring
+local type = type
+local unpack = unpack
+local ceil, floor = math.ceil, math.floor
+local find, format, gsub, sub = string.find, string.format, string.gsub, string.sub
+local getn, insert = table.getn, table.insert
+
+math.huge = 1/0
+string.gmatch = string.gfind
+
+function difftime(time2, time1)
+ assert(type(time2) == "number", format("bad argument #1 to 'difftime' (number expected, got %s)", time2 and type(time2) or "no value"))
+ assert(not time1 or type(time1) == "number", format("bad argument #2 to 'difftime' (number expected, got %s)", time1 and type(time1) or "no value"))
+
+ return time1 and time2 - time1 or time2
+end
+
+function select(n, ...)
+ assert(type(n) == "number" or type(n) == "string", format("bad argument #1 to 'select' (number expected, got %s)", n and type(n) or "no value"))
+
+ if type(n) == "string" and n == "#" then
+ if type(arg) == "table" then
+ return getn(arg)
+ else
+ return 1
+ end
+ end
+
+ local temp = {}
+
+ for i = n, getn(arg) do
+ insert(temp, arg[i])
+ end
+
+ return unpack(temp)
+end
+
+function math.modf(i)
+ assert(type(i) == "number", format("bad argument #1 to 'modf' (number expected, got %s)", i and type(i) or "no value"))
+
+ local int = i >= 0 and floor(i) or ceil(i)
+
+ return int, i - int
+end
+
+function string.join(delimiter, ...)
+ assert(type(delimiter) == "string" or type(delimiter) == "number", format("bad argument #1 to 'join' (string expected, got %s)", delimiter and type(delimiter) or "no value"))
+
+ local size = getn(arg)
+ if size == 0 then
+ return ""
+ end
+
+ local text = arg[1]
+ for i = 2, size do
+ text = text..delimiter..arg[i]
+ end
+
+ return text
+end
+strjoin = string.join
+
+function string.match(str, pattern, index)
+ assert(type(str) == "string" or type(str) == "number", format("bad argument #1 to 'match' (string expected, got %s)", str and type(str) or "no value"))
+ assert(type(pattern) == "string", format("bad argument #2 to 'match' (string expected, got %s)", pattern and type(pattern) or "no value"))
+
+ str = type(str) == "number" and tostring(str) or str
+ local _, _, match = find(index and sub(str, index) or str, "("..pattern..")")
+
+ return match
+end
+strmatch = string.match
+
+function string.split(delimiter, str)
+ assert(type(delimiter) == "string" or type(str) == "number", format("bad argument #1 to 'split' (string expected, got %s)", delimiter and type(delimiter) or "no value"))
+ assert(type(str) == "string", format("bad argument #2 to 'split' (string expected, got %s)", str and type(str) or "no value"))
+
+ local fields = {}
+ local pattern = format("([^%s]+)", delimiter)
+
+ str = type(str) == "number" and tostring(str) or str
+ gsub(str, pattern, function(c) fields[getn(fields) + 1] = c end)
+
+ return unpack(fields)
+end
+strsplit = string.split
+
+function string.trim(str, chars)
+ assert(type(str) == "string" or type(str) == "number", format("bad argument #1 to 'trim' (string expected, got %s)", delimiter and type(delimiter) or "no value"))
+
+ str = type(str) == "number" and tostring(str) or str
+--[[
+ if chars then
+ local size = string.len(chars)
+ local token = ""
+
+ for i = 1, size do
+ token = token .. string.sub(chars, i, i + 1) .. "*"
+
+ if size > 1 and i < size then
+ token = token.."|"
+ end
+ end
+
+ token = "["..token.."]"
+
+ local trimed = 1
+ while trimed == 1 do
+ str, trimed = string.gsub(str, "^"..token.."(._)"..token.."$", "")
+ end
+ else
+ -- remove leading/trailing [space][tab][return][newline]
+ str = string.gsub(str, "^%s*(.-)%s*$", "%1")
+ end
+
+ return str
+]]
+
+ return string.gsub(str, "^%s*(.-)%s*$", "%1")
+end
+strtrim = string.trim
+
+function table.wipe(t)
+ assert(type(t) == "table", format("bad argument #1 to 'wipe' (table expected, got %s)", t and type(t) or "no value"))
+
+ for k in pairs(t) do
+ t[k] = nil
+ end
+
+ return t
+end
+wipe = table.wipe
+
+local LOCAL_ToStringAllTemp = {}
+function tostringall(...)
+ local n = getn(arg)
+ -- Simple versions for common argument counts
+ if (n == 1) then
+ return tostring(arg[1])
+ elseif (n == 2) then
+ return tostring(arg[1]), tostring(arg[2])
+ elseif (n == 3) then
+ return tostring(arg[1]), tostring(arg[2]), tostring(arg[3])
+ elseif (n == 0) then
+ return
+ end
+
+ local needfix
+ for i = 1, n do
+ local v = arg[i]
+ if (type(v) ~= "string") then
+ needfix = i
+ break
+ end
+ end
+ if (not needfix) then return unpack(arg) end
+
+ wipe(LOCAL_ToStringAllTemp)
+ for i = 1, needfix - 1 do
+ LOCAL_ToStringAllTemp[i] = arg[i]
+ end
+ for i = needfix, n do
+ LOCAL_ToStringAllTemp[i] = tostring(arg[i])
+ end
+ return unpack(LOCAL_ToStringAllTemp)
+end
+
+local LOCAL_PrintHandler = function(...)
+ DEFAULT_CHAT_FRAME:AddMessage(strjoin(" ", tostringall(unpack(arg))))
+end
+
+function setprinthandler(func)
+ if (type(func) ~= "function") then
+ error("Invalid print handler")
+ else
+ LOCAL_PrintHandler = func
+ end
+end
+
+function getprinthandler() return LOCAL_PrintHandler end
+
+local function print_inner(...)
+ local ok, err = pcall(LOCAL_PrintHandler, unpack(arg))
+ if (not ok) then
+ local func = geterrorhandler()
+ func(err)
+ end
+end
+
+function print(...)
+ pcall(print_inner, unpack(arg))
+end
+
+SLASH_PRINT1 = "/print"
+SlashCmdList["PRINT"] = print
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/api/wowAPI.lua b/2/3/4/5/6/7/!Compatibility/api/wowAPI.lua
index c151208..482f3ac 100644
--- a/2/3/4/5/6/7/!Compatibility/api/wowAPI.lua
+++ b/2/3/4/5/6/7/!Compatibility/api/wowAPI.lua
@@ -1,39 +1,134 @@
---Cache global variables
-local _G = getfenv()
+-- Cache global variables
+local _G = _G
local assert = assert
-local error = error
+local date = date
+local pairs = pairs
+local tonumber = tonumber
local type = type
local unpack = unpack
-local date = date
-local gsub = string.gsub
+local format, gsub, lower, match, upper = string.format, string.gsub, string.lower, string.match, string.upper
+local getn = table.getn
+-- WoW API
+local GetQuestGreenRange = GetQuestGreenRange
+local GetRealZoneText = GetRealZoneText
+local IsInInstance = IsInInstance
+local UnitBuff = UnitBuff
+local UnitDebuff = UnitDebuff
+local UnitLevel = UnitLevel
+-- WoW Variables
+local DUNGEON_DIFFICULTY1 = DUNGEON_DIFFICULTY1
+local TIMEMANAGER_AM = gsub(TIME_TWELVEHOURAM, "^.-(%w+)$", "%1")
+local TIMEMANAGER_PM = gsub(TIME_TWELVEHOURPM, "^.-(%w+)$", "%1")
+-- Libs
+local LBC = LibStub("LibBabble-Class-3.0"):GetLookupTable()
+local LBZ = LibStub("LibBabble-Zone-3.0"):GetLookupTable()
-function hooksecurefunc(arg1, arg2, arg3)
- if type(arg1) == "string" then
- arg1, arg2, arg3 = _G, arg1, arg2
- end
+CLASS_SORT_ORDER = {
+ "WARRIOR",
+ "PALADIN",
+ "PRIEST",
+ "SHAMAN",
+ "DRUID",
+ "ROGUE",
+ "MAGE",
+ "WARLOCK",
+ "HUNTER"
+}
+MAX_CLASSES = getn(CLASS_SORT_ORDER)
- local orig = arg1[arg2]
- if type(orig) ~= "function" then
- error("The function "..arg2.." does not exist", 2)
- end
+LOCALIZED_CLASS_NAMES_MALE = {}
+LOCALIZED_CLASS_NAMES_FEMALE = {}
- arg1[arg2] = function(...)
- local tmp = {orig(unpack(arg))}
- arg3(unpack(arg))
- return unpack(tmp)
+CLASS_ICON_TCOORDS = {
+ ["WARRIOR"] = {0, 0.25, 0, 0.25},
+ ["MAGE"] = {0.25, 0.49609375, 0, 0.25},
+ ["ROGUE"] = {0.49609375, 0.7421875, 0, 0.25},
+ ["DRUID"] = {0.7421875, 0.98828125, 0, 0.25},
+ ["HUNTER"] = {0, 0.25, 0.25, 0.5},
+ ["SHAMAN"] = {0.25, 0.49609375, 0.25, 0.5},
+ ["PRIEST"] = {0.49609375, 0.7421875, 0.25, 0.5},
+ ["WARLOCK"] = {0.7421875, 0.98828125, 0.25, 0.5},
+ ["PALADIN"] = {0, 0.25, 0.5, 0.75}
+}
+
+QuestDifficultyColors = {
+ ["impossible"] = {r = 1.00, g = 0.10, b = 0.10},
+ ["verydifficult"] = {r = 1.00, g = 0.50, b = 0.25},
+ ["difficult"] = {r = 1.00, g = 1.00, b = 0.00},
+ ["standard"] = {r = 0.25, g = 0.75, b = 0.25},
+ ["trivial"] = {r = 0.50, g = 0.50, b = 0.50},
+ ["header"] = {r = 0.70, g = 0.70, b = 0.70}
+}
+
+function HookScript(frame, scriptType, handler)
+ assert(type(frame) == "table" and frame.GetScript and type(scriptType) == "string" and type(handler) == "function", "Usage: HookScript(frame, \"type\", function)")
+
+ local original_scipt = frame:GetScript(scriptType)
+ if original_scipt then
+ frame:SetScript(scriptType, function(...)
+ local original_return = {original_scipt(unpack(arg))}
+ handler(unpack(arg))
+
+ return unpack(original_return)
+ end)
+ else
+ frame:SetScript(scriptType, handler)
end
end
-local function noop() end
-function HookScript(frame, method, func)
- assert(frame, "HookScript: frame argument missing")
+function hooksecurefunc(arg1, arg2, arg3)
+ local isMethod = type(arg1) == "table" and type(arg2) == "string" and type(arg1[arg2]) == "function" and type(arg3) == "function"
+ assert(isMethod or (type(arg1) == "string" and type(_G[arg1]) == "function" and type(arg2) == "function"), "Usage: hooksecurefunc([table,] \"functionName\", hookfunc)")
- local orig = frame:GetScript(method) or noop
- frame:SetScript(method, function(...)
- local tmp = {orig(unpack(arg))}
- func(unpack(arg))
- return unpack(tmp)
- end)
+ if not isMethod then
+ arg1, arg2, arg3 = _G, arg1, arg2
+ end
+
+ local original_func = arg1[arg2]
+
+ arg1[arg2] = function(...)
+ local original_return = {original_func(unpack(arg))}
+ arg3(unpack(arg))
+
+ return unpack(original_return)
+ end
+end
+
+--[[ issecurevariable
+Returns 1, nil for undefined variables. This is because an undefined variable is secure since you have not tainted it.
+Returns 1, nil for all untainted variables (i.e. Blizzard variables).
+Returns nil for any global variable that is hooked insecurely (tainted), even unprotected ones like UnitName().
+Returns nil for all user defined global variables.
+If a table is passed first, it checks table.variable (e.g. issecurevariable(PlayerFrame, "Show") checks PlayerFrame["Show"] or PlayerFrame.Show (they are the same thing)).
+]]
+function issecurevariable(tab, var)
+-- assert(type(tab) == "table" and type(var) == "string", "Usage: issecurevariable([table,] \"variable\")")
+ return
+end
+
+function tContains(table, item)
+ local index = 1
+
+ while table[index] do
+ if item == table[index] then
+ return 1
+ end
+ index = index + 1
+ end
+
+ return
+end
+
+function UnitAura(unit, i, filter)
+ assert((type(unit) == "string" or type(unit) == "number") and (type(i) == "string" or type(i) == "number"), "Usage: UnitAura(\"unit\", index [, filter])")
+
+ if not filter or match(filter, "(HELPFUL)") then
+ local name, rank, aura, count, duration, maxDuration = UnitBuff(unit, i, filter)
+ return name, rank, aura, count, nil, duration or 0, maxDuration or 0
+ else
+ local name, rank, aura, count, dType, duration, maxDuration = UnitDebuff(unit, i, filter)
+ return name, rank, aura, count, dType, duration or 0, maxDuration or 0
+ end
end
function BetterDate(formatString, timeVal)
@@ -47,29 +142,8 @@ function BetterDate(formatString, timeVal)
return date(formatString, timeVal)
end
-RAID_CLASS_COLORS = {
- ["HUNTER"] = {r = 0.67, g = 0.83, b = 0.45},
- ["WARLOCK"] = {r = 0.58, g = 0.51, b = 0.79},
- ["PRIEST"] = {r = 1.0, g = 1.0, b = 1.0},
- ["PALADIN"] = {r = 0.96, g = 0.55, b = 0.73},
- ["MAGE"] = {r = 0.41, g = 0.8, b = 0.94},
- ["ROGUE"] = {r = 1.0, g = 0.96, b = 0.41},
- ["DRUID"] = {r = 1.0, g = 0.49, b = 0.04},
- ["WARRIOR"] = {r = 0.78, g = 0.61, b = 0.43},
-};
-
-QuestDifficultyColors = {
- ["impossible"] = {r = 1.00, g = 0.10, b = 0.10};
- ["verydifficult"] = {r = 1.00, g = 0.50, b = 0.25};
- ["difficult"] = {r = 1.00, g = 1.00, b = 0.00};
- ["standard"] = {r = 0.25, g = 0.75, b = 0.25};
- ["trivial"] = {r = 0.50, g = 0.50, b = 0.50};
- ["header"] = {r = 0.70, g = 0.70, b = 0.70};
-};
-
function GetQuestDifficultyColor(level)
local levelDiff = level - UnitLevel("player")
- local color
if levelDiff >= 5 then
return QuestDifficultyColors["impossible"]
elseif levelDiff >= 3 then
@@ -83,21 +157,204 @@ function GetQuestDifficultyColor(level)
end
end
-function EasyMenu(menuList, menuFrame, anchor, x, y, displayMode, autoHideDelay)
- if displayMode == "MENU" then
- menuFrame.displayMode = displayMode
- end
- UIDropDownMenu_Initialize(menuFrame, EasyMenu_Initialize, displayMode)
- ToggleDropDownMenu(1, nil, menuFrame, anchor, x, y, menuList)
-end
+function FillLocalizedClassList(tab, female)
+ assert(type(tab) == "table", "Usage: FillLocalizedClassList(classTable[, isFemale])")
-function EasyMenu_Initialize()
- print(level, info)
- for index = 1, getn(menuList) do
- local value = menuList[index]
- if value.text then
- value.index = index;
- UIDropDownMenu_AddButton(value, level)
+ for _, engClass in ipairs(CLASS_SORT_ORDER) do
+ if female then
+ tab[engClass] = LBC[engClass]
+ else
+ tab[engClass] = LBC[gsub(lower(engClass), "^%l", upper)]
end
end
+
+ return true
+end
+
+FillLocalizedClassList(LOCALIZED_CLASS_NAMES_MALE)
+FillLocalizedClassList(LOCALIZED_CLASS_NAMES_FEMALE, true)
+
+local zoneInfo = {
+ -- Battlegrounds
+ [LBZ["Warsong Gulch"]] = {mapID = 443, maxPlayers = 10},
+ [LBZ["Arathi Basin"]] = {mapID = 461, maxPlayers = 15},
+ [LBZ["Alterac Valley"]] = {mapID = 401, maxPlayers = 40},
+
+ -- Raids
+ [LBZ["Zul'Gurub"]] = {mapID = 309, maxPlayers = 20},
+ [LBZ["Onyxia's Lair"]] = {mapID = 249, maxPlayers = 40},
+ [LBZ["Molten Core"]] = {mapID = 409, maxPlayers = 40},
+ [LBZ["Ruins of Ahn'Qiraj"]] = {mapID = 509, maxPlayers = 20},
+ [LBZ["Temple of Ahn'Qiraj"]] = {mapID = 531, maxPlayers = 40},
+ [LBZ["Blackwing Lair"]] = {mapID = 469, maxPlayers = 40},
+ [LBZ["Naxxramas"]] = {mapID = 533, maxPlayers = 40},
+}
+
+local mapByID = {}
+for mapName in pairs(zoneInfo) do
+ mapByID[zoneInfo[mapName].mapID] = mapName
+end
+
+local function GetMaxPlayersByType(instanceType, zoneName)
+ if instanceType == "none" then
+ return 40
+ elseif instanceType == "party" then
+ return 5
+ elseif instanceType == "arena" then
+ return 5
+ elseif zoneName ~= "" and zoneInfo[zoneName] then
+ if instanceType == "pvp" then
+ return zoneInfo[zoneName].maxPlayers
+ elseif instanceType == "raid" then
+ return zoneInfo[zoneName].maxPlayers
+ end
+ else
+ return 0
+ end
+end
+
+function GetInstanceInfo()
+ local inInstance, instanceType = IsInInstance()
+ if not inInstance then return end
+
+ local name = GetRealZoneText()
+
+ local difficulty = 1
+ local difficultyName = DUNGEON_DIFFICULTY1
+ local maxPlayers = GetMaxPlayersByType(instanceType, name)
+
+ difficultyName = format("%d %s", maxPlayers, difficultyName)
+
+ return name, instanceType, difficulty, difficultyName, maxPlayers
+end
+
+function GetCurrentMapAreaID()
+ if not IsInInstance() then return end
+ local zoneName = GetRealZoneText()
+
+ if zoneName ~= "" and zoneInfo[zoneName] then
+ return zoneInfo[zoneName].mapID
+ else
+ return 0
+ end
+end
+
+function GetMapNameByID(id)
+ assert(type(id) == "string" or type(id) == "number", format("Bad argument #1 to \"GetMapNameByID\" (number expected, got %s)", id and type(id) or "no value"))
+
+ return mapByID[tonumber(id)]
+end
+
+local arrow
+function GetPlayerFacing()
+ if not arrow then
+ local obj = Minimap
+ for i = 1, obj:GetNumChildren() do
+ local child = select(i, obj:GetChildren())
+ if child and child.GetModel and child:GetModel() == "interface\\minimap\\minimaparrow.m2" then
+ arrow = child
+ break
+ end
+ end
+ end
+
+ return arrow and arrow:GetFacing()
+end
+
+function ToggleFrame(frame)
+ if frame:IsShown() then
+ HideUIPanel(frame)
+ else
+ ShowUIPanel(frame)
+ end
+end
+
+local function OnOrientationChanged(self, orientation)
+ self.texturePointer.verticalOrientation = orientation == "VERTICAL"
+
+ if self.texturePointer.verticalOrientation then
+ self.texturePointer:SetPoint("BOTTOMLEFT", self)
+ else
+ self.texturePointer:SetPoint("LEFT", self)
+ end
+end
+
+local function OnSizeChanged()
+ local width, height = ElvUF_Player.Health:GetWidth(), ElvUF_Player.Health:GetHeight()
+ this.texturePointer.width = width
+ this.texturePointer.height = height
+ this.texturePointer:SetWidth(width)
+ this.texturePointer:SetHeight(height)
+end
+
+local function OnValueChanged()
+ local _, max = this:GetMinMaxValues()
+ if this.texturePointer.verticalOrientation then
+ this.texturePointer:SetHeight(this.texturePointer.height * (arg1 / max))
+ else
+ this.texturePointer:SetWidth(this.texturePointer.width * (arg1 / max))
+ end
+end
+
+function CreateStatusBarTexturePointer(statusbar)
+ assert(type(statusbar) == "table", format("Bad argument #1 to \"CreateStatusBarTexturePointer\" (table expected, got %s)", statusbar and type(statusbar) or "no value"))
+ assert(statusbar.GetObjectType and statusbar:GetObjectType() == "StatusBar", "Bad argument #1 to \"CreateStatusBarTexturePointer\" (statusbar object expected)")
+
+ local f = statusbar:CreateTexture()
+ f.width = statusbar:GetWidth()
+ f.height = statusbar:GetHeight()
+ f.vertical = statusbar:GetOrientation() == "VERTICAL"
+ f:SetWidth(f.width)
+ f:SetHeight(f.height)
+
+ if f.verticalOrientation then
+ f:SetPoint("BOTTOMLEFT", statusbar)
+ else
+ f:SetPoint("LEFT", statusbar)
+ end
+
+ statusbar.texturePointer = f
+
+ statusbar:SetScript("OnSizeChanged", OnSizeChanged)
+ statusbar:SetScript("OnValueChanged", OnValueChanged)
+
+ hooksecurefunc(statusbar, "SetOrientation", OnOrientationChanged)
+
+ return f
+end
+
+local threatColors = {
+ [0] = {0.69, 0.69, 0.69},
+ [1] = {1, 1, 0.47},
+ [2] = {1, 0.6, 0},
+ [3] = {1, 0, 0}
+}
+
+function GetThreatStatusColor(statusIndex)
+ if not (type(statusIndex) == "number" and statusIndex >= 0 and statusIndex < 4) then
+ statusIndex = 0
+ end
+
+ return threatColors[statusIndex][1], threatColors[statusIndex][2], threatColors[statusIndex][3]
+end
+
+function GetThreatStatus(currentThreat, maxThreat)
+ assert(type(currentThreat) == "number" and type(maxThreat) == "number", "Usage: GetThreatStatus(currentThreat, maxThreat)")
+
+ if not maxThreat or maxThreat == 0 then
+ maxThreat = 0
+ maxThreat = 1
+ end
+
+ local threatPercent = currentThreat / maxThreat * 100
+
+ if threatPercent >= 100 then
+ return 3, threatPercent
+ elseif threatPercent < 100 and threatPercent >= 80 then
+ return 2, threatPercent
+ elseif threatPercent < 80 and threatPercent >= 50 then
+ return 1, threatPercent
+ else
+ return 0, threatPercent
+ end
end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/api/wowLua.lua b/2/3/4/5/6/7/!Compatibility/api/wowLua.lua
deleted file mode 100644
index 9b168e0..0000000
--- a/2/3/4/5/6/7/!Compatibility/api/wowLua.lua
+++ /dev/null
@@ -1,142 +0,0 @@
---Cache global variables
-local assert = assert
-local error = error
-local geterrorhandler = geterrorhandler
-local pairs = pairs
-local pcall = pcall
-local tostring = tostring
-local type = type
-local unpack = unpack
-local ceil, floor = math.ceil, math.floor
-local format, gsub = string.format, string.gsub
-local getn, insert = table.getn, table.insert
-
-function select(n, ...)
- assert(type(n) == "number" or type(n) == "string", "bad argument #1 to 'select' (number expected, got no value)")
-
- if type(n) == "string" and n == "#" then
- if type(arg) == "table" then
- return getn(arg)
- else
- return 1
- end
- end
-
- local temp = {}
-
- for i = n, getn(arg) do
- insert(temp, arg[i])
- end
-
- return unpack(temp)
-end
-
-function math.modf(i)
- assert(type(i) == "number", "bad argument #1 to 'modf' (number expected, got no value)")
-
- local int = i >= 0 and floor(i) or ceil(i)
-
- return int, i - int
-end
-
-function string.join(delimiter, ...)
--- assert(type(delimiter) == "number", "bad argument #1 to 'join' (string expected, got no value)")
-
- local size = getn(arg)
- if size == 0 then
- return ""
- end
-
- local text = arg[1]
- for i = 2, size do
- text = text..delimiter..arg[i]
- end
-
- return text
-end
-strjoin = string.join
-
-function string.split(delimiter, subject)
- assert(type(delimiter) == "string", "bad argument #1 to 'split' (string expected, got no value)")
-
- local delimiter, fields = delimiter or ":", {}
- local pattern = format("([^%s]+)", delimiter)
- gsub(subject, pattern, function(c) fields[getn(fields) + 1] = c end)
-
- return unpack(fields)
-end
-strsplit = string.split
-
-function table.wipe(t)
- assert(type(t) == "table", "bad argument #1 to 'wipe' (table expected, got no value)")
-
- for k in pairs(t) do
- t[k] = nil
- end
-
- return t
-end
-wipe = table.wipe
-
-local LOCAL_ToStringAllTemp = {}
-function tostringall(...)
- local n = getn(arg)
- -- Simple versions for common argument counts
- if (n == 1) then
- return tostring(arg[1])
- elseif (n == 2) then
- return tostring(arg[1]), tostring(arg[2])
- elseif (n == 3) then
- return tostring(arg[1]), tostring(arg[2]), tostring(arg[3])
- elseif (n == 0) then
- return
- end
-
- local needfix
- for i = 1, n do
- local v = arg[i]
- if (type(v) ~= "string") then
- needfix = i
- break
- end
- end
- if (not needfix) then return unpack(arg) end
-
- wipe(LOCAL_ToStringAllTemp)
- for i = 1, needfix - 1 do
- LOCAL_ToStringAllTemp[i] = arg[i]
- end
- for i = needfix, n do
- LOCAL_ToStringAllTemp[i] = tostring(arg[i])
- end
- return unpack(LOCAL_ToStringAllTemp)
-end
-
-local LOCAL_PrintHandler = function(...)
- DEFAULT_CHAT_FRAME:AddMessage(strjoin(" ", tostringall(unpack(arg))))
-end
-
-function setprinthandler(func)
- if (type(func) ~= "function") then
- error("Invalid print handler")
- else
- LOCAL_PrintHandler = func
- end
-end
-
-function getprinthandler() return LOCAL_PrintHandler end
-
-local function print_inner(...)
- local ok, err = pcall(LOCAL_PrintHandler, unpack(arg))
- if (not ok) then
- local func = geterrorhandler()
- func(err)
- end
-end
-
-function print(...)
- pcall(print_inner, unpack(arg))
-end
-
-SLASH_PRINT1 = "/print"
-SlashCmdList["PRINT"] = print
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/debugTools.lua b/2/3/4/5/6/7/!Compatibility/errorHandler.lua
similarity index 54%
rename from 2/3/4/5/6/7/!Compatibility/debugTools.lua
rename to 2/3/4/5/6/7/!Compatibility/errorHandler.lua
index 859cce0..b066f14 100644
--- a/2/3/4/5/6/7/!Compatibility/debugTools.lua
+++ b/2/3/4/5/6/7/!Compatibility/errorHandler.lua
@@ -1,10 +1,11 @@
---Cache global variables
+_G = getfenv()
+
+-- Cache global variables
local strmatch = strmatch
---WoW API
+-- WoW API
local GetCVar = GetCVar
local IsAddOnLoaded = IsAddOnLoaded
local LoadAddOn = LoadAddOn
-local UIParentLoadAddOn = UIParentLoadAddOn
local _ERROR_COUNT = 0
local _ERROR_LIMIT = 1000
@@ -15,7 +16,7 @@ function _ERRORMESSAGE_NEW(message)
LoadAddOn("!DebugTools")
local loaded = IsAddOnLoaded("!DebugTools")
--- if (GetCVar("scriptErrors") == 1) then
+ if (GetCVar("ShowErrors") == "1") then
if (not loaded or DEBUG_DEBUGTOOLS) then
ScriptErrors_Message:SetText(message)
ScriptErrors:Show()
@@ -25,9 +26,9 @@ function _ERRORMESSAGE_NEW(message)
else
ScriptErrorsFrame_OnError(message)
end
--- elseif (loaded) then
--- ScriptErrorsFrame_OnError(message, true)
--- end
+ elseif (loaded) then
+ ScriptErrorsFrame_OnError(message, true)
+ end
_ERROR_COUNT = _ERROR_COUNT + 1
if (_ERROR_COUNT == _ERROR_LIMIT) then
@@ -44,26 +45,4 @@ function message(text)
ScriptErrors_Message:SetText(text)
ScriptErrors:Show()
end
-end
-
-SLASH_FRAMESTACK1 = "/framestack"
-SLASH_FRAMESTACK2 = "/fstack"
-SlashCmdList["FRAMESTACK"] = function(msg)
- UIParentLoadAddOn("!DebugTools")
-
-
- FrameStackTooltip_Toggle(showHidden)
-end
-
-SLASH_EVENTTRACE1 = "/eventtrace"
-SLASH_EVENTTRACE2 = "/etrace"
-SlashCmdList["EVENTTRACE"] = function(msg)
- UIParentLoadAddOn("!DebugTools")
- EventTraceFrame_HandleSlashCmd(msg)
-end
-
-SLASH_DUMP1 = "/dump"
-SlashCmdList["DUMP"] = function(msg)
- UIParentLoadAddOn("!DebugTools")
- DevTools_DumpCommand(msg)
end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/libs/LibBabble-3.0.lua b/2/3/4/5/6/7/!Compatibility/libs/LibBabble-3.0.lua
new file mode 100644
index 0000000..1237228
--- /dev/null
+++ b/2/3/4/5/6/7/!Compatibility/libs/LibBabble-3.0.lua
@@ -0,0 +1,292 @@
+-- LibBabble-3.0 is hereby placed in the Public Domain
+-- Credits: ckknight
+local LIBBABBLE_MAJOR, LIBBABBLE_MINOR = "LibBabble-3.0", 2
+
+local LibBabble = LibStub:NewLibrary(LIBBABBLE_MAJOR, LIBBABBLE_MINOR)
+if not LibBabble then
+ return
+end
+
+local data = LibBabble.data or {}
+for k,v in pairs(LibBabble) do
+ LibBabble[k] = nil
+end
+LibBabble.data = data
+
+local tablesToDB = {}
+for namespace, db in pairs(data) do
+ for k,v in pairs(db) do
+ tablesToDB[v] = db
+ end
+end
+
+local function warn(message)
+ local _, ret = pcall(error, message, 3)
+ geterrorhandler()(ret)
+end
+
+local lookup_mt = { __index = function(self, key)
+ local db = tablesToDB[self]
+ local current_key = db.current[key]
+ if current_key then
+ self[key] = current_key
+ return current_key
+ end
+ local base_key = db.base[key]
+ local real_MAJOR_VERSION
+ for k,v in pairs(data) do
+ if v == db then
+ real_MAJOR_VERSION = k
+ break
+ end
+ end
+ if not real_MAJOR_VERSION then
+ real_MAJOR_VERSION = LIBBABBLE_MAJOR
+ end
+ if base_key then
+ warn(string.format("%s: Translation %q not found for locale %q", real_MAJOR_VERSION, key, GetLocale()))
+ rawset(self, key, base_key)
+ return base_key
+ end
+ warn(string.format("%s: Translation %q not found.", real_MAJOR_VERSION, key))
+ rawset(self, key, key)
+ return key
+end }
+
+local function initLookup(module, lookup)
+ local db = tablesToDB[module]
+ for k in pairs(lookup) do
+ lookup[k] = nil
+ end
+ setmetatable(lookup, lookup_mt)
+ tablesToDB[lookup] = db
+ db.lookup = lookup
+ return lookup
+end
+
+local function initReverse(module, reverse)
+ local db = tablesToDB[module]
+ for k in pairs(reverse) do
+ reverse[k] = nil
+ end
+ for k,v in pairs(db.current) do
+ reverse[v] = k
+ end
+ tablesToDB[reverse] = db
+ db.reverse = reverse
+ db.reverseIterators = nil
+ return reverse
+end
+
+local prototype = {}
+local prototype_mt = {__index = prototype}
+
+--[[---------------------------------------------------------------------------
+Notes:
+ * If you try to access a nonexistent key, it will warn but allow the code to pass through.
+Returns:
+ A lookup table for english to localized words.
+Example:
+ local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
+ local BL = B:GetLookupTable()
+ assert(BL["Some english word"] == "Some localized word")
+ DoSomething(BL["Some english word that doesn't exist"]) -- warning!
+-----------------------------------------------------------------------------]]
+function prototype:GetLookupTable()
+ local db = tablesToDB[self]
+
+ local lookup = db.lookup
+ if lookup then
+ return lookup
+ end
+ return initLookup(self, {})
+end
+--[[---------------------------------------------------------------------------
+Notes:
+ * If you try to access a nonexistent key, it will return nil.
+Returns:
+ A lookup table for english to localized words.
+Example:
+ local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
+ local B_has = B:GetUnstrictLookupTable()
+ assert(B_has["Some english word"] == "Some localized word")
+ assert(B_has["Some english word that doesn't exist"] == nil)
+-----------------------------------------------------------------------------]]
+function prototype:GetUnstrictLookupTable()
+ local db = tablesToDB[self]
+
+ return db.current
+end
+--[[---------------------------------------------------------------------------
+Notes:
+ * If you try to access a nonexistent key, it will return nil.
+ * This is useful for checking if the base (English) table has a key, even if the localized one does not have it registered.
+Returns:
+ A lookup table for english to localized words.
+Example:
+ local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
+ local B_hasBase = B:GetBaseLookupTable()
+ assert(B_hasBase["Some english word"] == "Some english word")
+ assert(B_hasBase["Some english word that doesn't exist"] == nil)
+-----------------------------------------------------------------------------]]
+function prototype:GetBaseLookupTable()
+ local db = tablesToDB[self]
+
+ return db.base
+end
+--[[---------------------------------------------------------------------------
+Notes:
+ * If you try to access a nonexistent key, it will return nil.
+ * This will return only one English word that it maps to, if there are more than one to check, see :GetReverseIterator("word")
+Returns:
+ A lookup table for localized to english words.
+Example:
+ local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
+ local BR = B:GetReverseLookupTable()
+ assert(BR["Some localized word"] == "Some english word")
+ assert(BR["Some localized word that doesn't exist"] == nil)
+-----------------------------------------------------------------------------]]
+function prototype:GetReverseLookupTable()
+ local db = tablesToDB[self]
+
+ local reverse = db.reverse
+ if reverse then
+ return reverse
+ end
+ return initReverse(self, {})
+end
+local blank = {}
+local weakVal = {__mode="v"}
+--[[---------------------------------------------------------------------------
+Arguments:
+ string - the localized word to chek for.
+Returns:
+ An iterator to traverse all English words that map to the given key
+Example:
+ local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
+ for word in B:GetReverseIterator("Some localized word") do
+ DoSomething(word)
+ end
+-----------------------------------------------------------------------------]]
+function prototype:GetReverseIterator(key)
+ local db = tablesToDB[self]
+ local reverseIterators = db.reverseIterators
+ if not reverseIterators then
+ reverseIterators = setmetatable({}, weakVal)
+ db.reverseIterators = reverseIterators
+ elseif reverseIterators[key] then
+ return pairs(reverseIterators[key])
+ end
+ local t
+ for k,v in pairs(db.current) do
+ if v == key then
+ if not t then
+ t = {}
+ end
+ t[k] = true
+ end
+ end
+ reverseIterators[key] = t or blank
+ return pairs(reverseIterators[key])
+end
+--[[---------------------------------------------------------------------------
+Returns:
+ An iterator to traverse all translations English to localized.
+Example:
+ local B = LibStub("LibBabble-Module-3.0") -- where Module is what you want.
+ for english, localized in B:Iterate() do
+ DoSomething(english, localized)
+ end
+-----------------------------------------------------------------------------]]
+function prototype:Iterate()
+ local db = tablesToDB[self]
+
+ return pairs(db.current)
+end
+
+-- #NODOC
+-- modules need to call this to set the base table
+function prototype:SetBaseTranslations(base)
+ local db = tablesToDB[self]
+ local oldBase = db.base
+ if oldBase then
+ for k in pairs(oldBase) do
+ oldBase[k] = nil
+ end
+ for k, v in pairs(base) do
+ oldBase[k] = v
+ end
+ base = oldBase
+ else
+ db.base = base
+ end
+ for k,v in pairs(base) do
+ if v == true then
+ base[k] = k
+ end
+ end
+end
+
+local function init(module)
+ local db = tablesToDB[module]
+ if db.lookup then
+ initLookup(module, db.lookup)
+ end
+ if db.reverse then
+ initReverse(module, db.reverse)
+ end
+ db.reverseIterators = nil
+end
+
+-- #NODOC
+-- modules need to call this to set the current table. if current is true, use the base table.
+function prototype:SetCurrentTranslations(current)
+ local db = tablesToDB[self]
+ if current == true then
+ db.current = db.base
+ else
+ local oldCurrent = db.current
+ if oldCurrent then
+ for k in pairs(oldCurrent) do
+ oldCurrent[k] = nil
+ end
+ for k, v in pairs(current) do
+ oldCurrent[k] = v
+ end
+ current = oldCurrent
+ else
+ db.current = current
+ end
+ end
+ init(self)
+end
+
+for namespace, db in pairs(data) do
+ setmetatable(db.module, prototype_mt)
+ init(db.module)
+end
+
+-- #NODOC
+-- modules need to call this to create a new namespace.
+function LibBabble:New(namespace, minor)
+ local module, oldminor = LibStub:NewLibrary(namespace, minor)
+ if not module then
+ return
+ end
+
+ if not oldminor then
+ local db = {
+ module = module,
+ }
+ data[namespace] = db
+ tablesToDB[module] = db
+ else
+ for k,v in pairs(module) do
+ module[k] = nil
+ end
+ end
+
+ setmetatable(module, prototype_mt)
+
+ return module
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/libs/LibBabble-Class-3.0.lua b/2/3/4/5/6/7/!Compatibility/libs/LibBabble-Class-3.0.lua
new file mode 100644
index 0000000..d26db4f
--- /dev/null
+++ b/2/3/4/5/6/7/!Compatibility/libs/LibBabble-Class-3.0.lua
@@ -0,0 +1,221 @@
+--[[
+Name: LibBabble-Class-3.0
+Revision: $Rev: 50 $
+Author(s): ckknight (ckknight@gmail.com)
+Website: http://ckknight.wowinterface.com/
+Dependencies: None
+License: MIT
+]]
+
+local MAJOR_VERSION = "LibBabble-Class-3.0"
+local MINOR_VERSION = 90000 + tonumber(string.match("$Revision: 50 $", "%d+"))
+
+if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
+local lib = LibStub("LibBabble-3.0"):New(MAJOR_VERSION, MINOR_VERSION)
+if not lib then return end
+
+local GAME_LOCALE = GetLocale()
+
+lib:SetBaseTranslations {
+ Warlock = true,
+ Warrior = true,
+ Hunter = true,
+ Mage = true,
+ Priest = true,
+ Druid = true,
+ Paladin = true,
+ Shaman = true,
+ Rogue = true,
+
+ WARLOCK = true,
+ WARRIOR = true,
+ HUNTER = true,
+ MAGE = true,
+ PRIEST = true,
+ DRUID = true,
+ PALADIN = true,
+ SHAMAN = true,
+ ROGUE = true,
+}
+
+if GAME_LOCALE == "enUS" then
+ lib:SetCurrentTranslations(true)
+elseif GAME_LOCALE == "deDE" then
+ lib:SetCurrentTranslations {
+ ["Warlock"] = "Hexenmeister",
+ ["Warrior"] = "Krieger",
+ ["Hunter"] = "Jäger",
+ ["Mage"] = "Magier",
+ ["Priest"] = "Priester",
+ ["Druid"] = "Druide",
+ ["Paladin"] = "Paladin",
+ ["Shaman"] = "Schamane",
+ ["Rogue"] = "Schurke",
+
+ ["WARLOCK"] = "Hexenmeisterin",
+ ["WARRIOR"] = "Kriegerin",
+ ["HUNTER"] = "Jägerin",
+ ["MAGE"] = "Magierin",
+ ["PRIEST"] = "Priesterin",
+ ["DRUID"] = "Druidin",
+ ["PALADIN"] = "Paladin",
+ ["SHAMAN"] = "Schamanin",
+ ["ROGUE"] = "Schurkin",
+ }
+elseif GAME_LOCALE == "frFR" then
+ lib:SetCurrentTranslations {
+ ["Warlock"] = "Démoniste",
+ ["Warrior"] = "Guerrier",
+ ["Hunter"] = "Chasseur",
+ ["Mage"] = "Mage",
+ ["Priest"] = "Prêtre",
+ ["Druid"] = "Druide",
+ ["Paladin"] = "Paladin",
+ ["Shaman"] = "Chaman",
+ ["Rogue"] = "Voleur",
+
+ ["WARLOCK"] = "Démoniste",
+ ["WARRIOR"] = "Guerrière",
+ ["HUNTER"] = "Chasseresse",
+ ["MAGE"] = "Mage",
+ ["PRIEST"] = "Prêtresse",
+ ["DRUID"] = "Druidesse",
+ ["PALADIN"] = "Paladin",
+ ["SHAMAN"] = "Chamane",
+ ["ROGUE"] = "Voleuse",
+ }
+elseif GAME_LOCALE == "zhCN" then
+ lib:SetCurrentTranslations {
+ ["Warlock"] = "术士",
+ ["Warrior"] = "战士",
+ ["Hunter"] = "猎人",
+ ["Mage"] = "法师",
+ ["Priest"] = "牧师",
+ ["Druid"] = "德鲁伊",
+ ["Paladin"] = "圣骑士",
+ ["Shaman"] = "萨满祭司",
+ ["Rogue"] = "潜行者",
+
+ ["WARLOCK"] = "术士",
+ ["WARRIOR"] = "战士",
+ ["HUNTER"] = "猎人",
+ ["MAGE"] = "法师",
+ ["PRIEST"] = "牧师",
+ ["DRUID"] = "德鲁伊",
+ ["PALADIN"] = "圣骑士",
+ ["SHAMAN"] = "萨满祭司",
+ ["ROGUE"] = "潜行者",
+ }
+elseif GAME_LOCALE == "zhTW" then
+ lib:SetCurrentTranslations {
+ ["Warlock"] = "術士",
+ ["Warrior"] = "戰士",
+ ["Hunter"] = "獵人",
+ ["Mage"] = "法師",
+ ["Priest"] = "牧師",
+ ["Druid"] = "德魯伊",
+ ["Paladin"] = "聖騎士",
+ ["Shaman"] = "薩滿",
+ ["Rogue"] = "盜賊",
+
+ ["WARLOCK"] = "術士",
+ ["WARRIOR"] = "戰士",
+ ["HUNTER"] = "獵人",
+ ["MAGE"] = "法師",
+ ["PRIEST"] = "牧師",
+ ["DRUID"] = "德魯伊",
+ ["PALADIN"] = "聖騎士",
+ ["SHAMAN"] = "薩滿",
+ ["ROGUE"] = "盜賊",
+ }
+elseif GAME_LOCALE == "koKR" then
+ lib:SetCurrentTranslations {
+ ["Warlock"] = "흑마법사",
+ ["Warrior"] = "전사",
+ ["Hunter"] = "사냥꾼",
+ ["Mage"] = "마법사",
+ ["Priest"] = "사제",
+ ["Druid"] = "드루이드",
+ ["Paladin"] = "성기사",
+ ["Shaman"] = "주술사",
+ ["Rogue"] = "도적",
+
+ ["WARLOCK"] = "흑마법사",
+ ["WARRIOR"] = "전사",
+ ["HUNTER"] = "사냥꾼",
+ ["MAGE"] = "마법사",
+ ["PRIEST"] = "사제",
+ ["DRUID"] = "드루이드",
+ ["PALADIN"] = "성기사",
+ ["SHAMAN"] = "주술사",
+ ["ROGUE"] = "도적",
+ }
+elseif GAME_LOCALE == "esES" then
+ lib:SetCurrentTranslations {
+ ["Warlock"] = "Brujo",
+ ["Warrior"] = "Guerrero",
+ ["Hunter"] = "Cazador",
+ ["Mage"] = "Mago",
+ ["Priest"] = "Sacerdote",
+ ["Druid"] = "Druida",
+ ["Paladin"] = "Paladín",
+ ["Shaman"] = "Chamán",
+ ["Rogue"] = "Pícaro",
+
+ ["WARLOCK"] = "Bruja",
+ ["WARRIOR"] = "Guerrera",
+ ["HUNTER"] = "Cazadora",
+ ["MAGE"] = "Maga",
+ ["PRIEST"] = "Sacerdotisa",
+ ["DRUID"] = "Druida",
+ ["PALADIN"] = "Paladín",
+ ["SHAMAN"] = "Chamán",
+ ["ROGUE"] = "Pícara",
+ }
+elseif GAME_LOCALE == "esMX" then
+ lib:SetCurrentTranslations {
+ ["Warlock"] = "Brujo",
+ ["Warrior"] = "Guerrero",
+ ["Hunter"] = "Cazador",
+ ["Mage"] = "Mago",
+ ["Priest"] = "Sacerdote",
+ ["Druid"] = "Druida",
+ ["Paladin"] = "Paladín",
+ ["Shaman"] = "Chamán",
+ ["Rogue"] = "Pícaro",
+
+ ["WARLOCK"] = "Bruja",
+ ["WARRIOR"] = "Guerrera",
+ ["HUNTER"] = "Cazadora",
+ ["MAGE"] = "Maga",
+ ["PRIEST"] = "Sacerdotisa",
+ ["DRUID"] = "Druida",
+ ["PALADIN"] = "Paladín",
+ ["SHAMAN"] = "Chamán",
+ ["ROGUE"] = "Pícara",
+ }
+elseif GAME_LOCALE == "ruRU" then
+ lib:SetCurrentTranslations {
+ ["Warlock"] = "Чернокнижник",
+ ["Warrior"] = "Воин",
+ ["Hunter"] = "Охотник",
+ ["Mage"] = "Маг",
+ ["Priest"] = "Жрец",
+ ["Druid"] = "Друид",
+ ["Paladin"] = "Паладин",
+ ["Shaman"] = "Шаман",
+ ["Rogue"] = "Разбойник",
+
+ ["WARLOCK"] = "Чернокнижница",
+ ["WARRIOR"] = "Воин",
+ ["HUNTER"] = "Охотница",
+ ["MAGE"] = "Маг",
+ ["PRIEST"] = "Жрица",
+ ["DRUID"] = "Друид",
+ ["PALADIN"] = "Паладин",
+ ["SHAMAN"] = "Шаманка",
+ ["ROGUE"] = "Разбойница",
+ }
+else
+ error(string.format("%s: Locale %q not supported", MAJOR_VERSION, GAME_LOCALE))
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/libs/LibBabble-Zone-3.0.lua b/2/3/4/5/6/7/!Compatibility/libs/LibBabble-Zone-3.0.lua
new file mode 100644
index 0000000..745fcbb
--- /dev/null
+++ b/2/3/4/5/6/7/!Compatibility/libs/LibBabble-Zone-3.0.lua
@@ -0,0 +1,1113 @@
+--[[
+Name: LibBabble-Zone-3.0
+Revision: $Rev: 107 $
+Maintainers: ckknight, nevcairiel, Ackis
+Website: http://www.wowace.com/projects/libbabble-zone-3-0/
+Dependencies: None
+License: MIT
+]]
+
+local MAJOR_VERSION = "LibBabble-Zone-3.0"
+--local MINOR_VERSION = 90000 + tonumber(("$Revision: 107 $"):match("%d+"))
+local MINOR_VERSION = 90000 + tonumber(string.match("$Revision: 107 $", "%d+"))
+
+if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
+local lib = LibStub("LibBabble-3.0"):New(MAJOR_VERSION, MINOR_VERSION)
+if not lib then return end
+
+local GAME_LOCALE = GetLocale()
+
+lib:SetBaseTranslations {
+ ["Azeroth"] = true,
+ ["Eastern Kingdoms"] = true,
+ ["Kalimdor"] = true,
+ ["Outland"] = true,
+ ["Cosmic map"] = true,
+
+ ["Ahn'Qiraj"] = true,
+ ["Alterac Mountains"] = true,
+ ["Alterac Valley"] = true,
+ ["Arathi Basin"] = true,
+ ["Arathi Highlands"] = true,
+ ["Ashenvale"] = true,
+ ["Auberdine"] = true,
+ ["Azshara"] = true,
+ ["Badlands"] = true,
+ ["The Barrens"] = true,
+ ["Blackfathom Deeps"] = true,
+ ["Blackrock Depths"] = true,
+ ["Blackrock Mountain"] = true,
+ ["Blackrock Spire"] = true,
+ ["Blackwing Lair"] = true,
+ ["Blasted Lands"] = true,
+ ["Booty Bay"] = true,
+ ["Burning Steppes"] = true,
+ ["Darkshore"] = true,
+ ["Darnassus"] = true,
+ ["The Deadmines"] = true,
+ ["Deadwind Pass"] = true,
+ ["Deeprun Tram"] = true,
+ ["Desolace"] = true,
+ ["Dire Maul"] = true,
+ ["Dire Maul (East)"] = true,
+ ["Dire Maul (West)"] = true,
+ ["Dire Maul (North)"] = true,
+ ["Dun Morogh"] = true,
+ ["Durotar"] = true,
+ ["Duskwood"] = true,
+ ["Dustwallow Marsh"] = true,
+ ["Eastern Plaguelands"] = true,
+ ["Elwynn Forest"] = true,
+ ["Everlook"] = true,
+ ["Felwood"] = true,
+ ["Feralas"] = true,
+ ["The Forbidding Sea"] = true,
+ ["Gadgetzan"] = true,
+ ["Gates of Ahn'Qiraj"] = true,
+ ["Gnomeregan"] = true,
+ ["The Great Sea"] = true,
+ ["Grom'gol Base Camp"] = true,
+ ["Hall of Legends"] = true,
+ ["Hillsbrad Foothills"] = true,
+ ["The Hinterlands"] = true,
+ ["Hyjal"] = true,
+ ["Hyjal Summit"] = true,
+ ["Ironforge"] = true,
+ ["Loch Modan"] = true,
+ ["Lower Blackrock Spire"] = true,
+ ["Maraudon"] = true,
+ ["Menethil Harbor"] = true,
+ ["Molten Core"] = true,
+ ["Moonglade"] = true,
+ ["Mulgore"] = true,
+ ["Naxxramas"] = true,
+ ["Onyxia's Lair"] = true,
+ ["Orgrimmar"] = true,
+ ["Ratchet"] = true,
+ ["Ragefire Chasm"] = true,
+ ["Razorfen Downs"] = true,
+ ["Razorfen Kraul"] = true,
+ ["Redridge Mountains"] = true,
+ ["Ruins of Ahn'Qiraj"] = true,
+ ["Scarlet Monastery"] = true,
+ ["Scholomance"] = true,
+ ["Searing Gorge"] = true,
+ ["Shadowfang Keep"] = true,
+ ["Silithus"] = true,
+ ["Silverpine Forest"] = true,
+ ["The Stockade"] = true,
+ ["Stonard"] = true,
+ ["Stonetalon Mountains"] = true,
+ ["Stormwind City"] = true,
+ ["Stormwind"] = true,
+ ["Stranglethorn Vale"] = true,
+ ["Stratholme"] = true,
+ ["Swamp of Sorrows"] = true,
+ ["Tanaris"] = true,
+ ["Teldrassil"] = true,
+ ["Temple of Ahn'Qiraj"] = true,
+ ["The Temple of Atal'Hakkar"] = true,
+ ["Theramore Isle"] = true,
+ ["Thousand Needles"] = true,
+ ["Thunder Bluff"] = true,
+ ["Tirisfal Glades"] = true,
+ ["Uldaman"] = true,
+ ["Un'Goro Crater"] = true,
+ ["Undercity"] = true,
+ ["Upper Blackrock Spire"] = true,
+ ["Wailing Caverns"] = true,
+ ["Warsong Gulch"] = true,
+ ["Western Plaguelands"] = true,
+ ["Westfall"] = true,
+ ["Wetlands"] = true,
+ ["Winterspring"] = true,
+ ["Zul'Farrak"] = true,
+ ["Zul'Gurub"] = true,
+
+ ["Champions' Hall"] = true,
+ ["Hall of Champions"] = true,
+ ["Blade's Edge Arena"] = true,
+ ["Nagrand Arena"] = true,
+ ["Ruins of Lordaeron"] = true,
+ ["Twisting Nether"] = true,
+ ["The Veiled Sea"] = true,
+ ["The North Sea"] = true,
+ ["Armory"] = true,
+ ["Library"] = true,
+ ["Cathedral"] = true,
+ ["Graveyard"] = true,
+}
+
+if GAME_LOCALE == "enUS" then
+ lib:SetCurrentTranslations(true)
+elseif GAME_LOCALE == "deDE" then
+ lib:SetCurrentTranslations {
+ ["Azeroth"] = "Azeroth",
+ ["Eastern Kingdoms"] = "Östliche Königreiche",
+ ["Kalimdor"] = "Kalimdor",
+ ["Outland"] = "Scherbenwelt",
+ ["Cosmic map"] = "Kosmische Karte",
+
+ ["Ahn'Qiraj"] = "Ahn'Qiraj",
+ ["Alterac Mountains"] = "Alteracgebirge",
+ ["Alterac Valley"] = "Alteractal",
+ ["Arathi Basin"] = "Arathibecken",
+ ["Arathi Highlands"] = "Arathihochland",
+ ["Ashenvale"] = "Eschental",
+ ["Auberdine"] = "Auberdine",
+ ["Azshara"] = "Azshara",
+ ["Badlands"] = "Ödland",
+ ["The Barrens"] = "Brachland",
+ ["Blackfathom Deeps"] = "Tiefschwarze Grotte",
+ ["Blackrock Depths"] = "Schwarzfelstiefen",
+ ["Blackrock Mountain"] = "Der Schwarzfels",
+ ["Blackrock Spire"] = "Schwarzfelsspitze",
+ ["Blackwing Lair"] = "Pechschwingenhort",
+ ["Blasted Lands"] = "Verwüstete Lande",
+ ["Booty Bay"] = "Beutebucht",
+ ["Burning Steppes"] = "Brennende Steppe",
+ ["Darkshore"] = "Dunkelküste",
+ ["Darnassus"] = "Darnassus",
+ ["The Deadmines"] = "Die Todesminen",
+ ["Deadwind Pass"] = "Gebirgspass der Totenwinde",
+ ["Deeprun Tram"] = "Die Tiefenbahn",
+ ["Desolace"] = "Desolace",
+ ["Dire Maul"] = "Düsterbruch",
+ ["Dire Maul (North)"] = "Düsterbruch (Nord)",
+ ["Dire Maul (East)"] = "Düsterbruch (Ost)",
+ ["Dire Maul (West)"] = "Düsterbruch (West)",
+ ["Dun Morogh"] = "Dun Morogh",
+ ["Durotar"] = "Durotar",
+ ["Duskwood"] = "Dämmerwald",
+ ["Dustwallow Marsh"] = "Düstermarschen",
+ ["Eastern Plaguelands"] = "Östliche Pestländer",
+ ["Elwynn Forest"] = "Wald von Elwynn",
+ ["Everlook"] = "Ewige Warte",
+ ["Felwood"] = "Teufelswald",
+ ["Feralas"] = "Feralas",
+ ["The Forbidding Sea"] = "Das verbotene Meer",
+ ["Gadgetzan"] = "Gadgetzan",
+ ["Gates of Ahn'Qiraj"] = "Tore von Ahn'Qiraj",
+ ["Gnomeregan"] = "Gnomeregan",
+ ["Grom'gol Base Camp"] = "Basislager von Grom'gol",
+ ["The Great Sea"] = "Das große Meer",
+ ["Hall of Legends"] = "Halle der Legenden",
+ ["Hillsbrad Foothills"] = "Vorgebirge des Hügellands",
+ ["The Hinterlands"] = "Hinterland",
+ ["Hyjal"] = "Hyjal",
+ ["Hyjal Summit"] = "Hyjalgipfel",
+ ["Ironforge"] = "Eisenschmiede",
+ ["Loch Modan"] = "Loch Modan",
+ ["Lower Blackrock Spire"] = "Untere Schwarzfelsspitze",
+ ["Maraudon"] = "Maraudon",
+ ["Menethil Harbor"] = "Hafen von Menethil",
+ ["Molten Core"] = "Geschmolzener Kern",
+ ["Moonglade"] = "Mondlichtung",
+ ["Mulgore"] = "Mulgore",
+ ["Naxxramas"] = "Naxxramas",
+ ["Onyxia's Lair"] = "Onyxias Hort",
+ ["Orgrimmar"] = "Orgrimmar",
+ ["Ratchet"] = "Ratschet",
+ ["Ragefire Chasm"] = "Der Flammenschlund",
+ ["Razorfen Downs"] = "Hügel der Klingenhauer",
+ ["Razorfen Kraul"] = "Kral der Klingenhauer",
+ ["Redridge Mountains"] = "Rotkammgebirge",
+ ["Ruins of Ahn'Qiraj"] = "Ruinen von Ahn'Qiraj",
+ ["Scarlet Monastery"] = "Das Scharlachrote Kloster",
+ ["Scholomance"] = "Scholomance",
+ ["Searing Gorge"] = "Sengende Schlucht",
+ ["Shadowfang Keep"] = "Burg Schattenfang",
+ ["Silithus"] = "Silithus",
+ ["Silverpine Forest"] = "Silberwald",
+ ["The Stockade"] = "Das Verlies",
+ ["Stonard"] = "Steinard",
+ ["Stonetalon Mountains"] = "Steinkrallengebirge",
+ ["Stormwind City"] = "Sturmwind",
+ ["Stormwind"] = "Sturmwind",
+ ["Stranglethorn Vale"] = "Schlingendorntal",
+ ["Stratholme"] = "Stratholme",
+ ["Swamp of Sorrows"] = "Sümpfe des Elends",
+ ["Tanaris"] = "Tanaris",
+ ["Teldrassil"] = "Teldrassil",
+ ["Temple of Ahn'Qiraj"] = "Tempel von Ahn'Qiraj",
+ ["The Temple of Atal'Hakkar"] = "Der Tempel von Atal'Hakkar",
+ ["Theramore Isle"] = "Insel Theramore",
+ ["Thousand Needles"] = "Tausend Nadeln",
+ ["Thunder Bluff"] = "Donnerfels",
+ ["Tirisfal Glades"] = "Tirisfal",
+ ["Uldaman"] = "Uldaman",
+ ["Un'Goro Crater"] = "Krater von Un'Goro",
+ ["Undercity"] = "Unterstadt",
+ ["Upper Blackrock Spire"] = "Obere Schwarzfelsspitze",
+ ["Wailing Caverns"] = "Die Höhlen des Wehklagens",
+ ["Warsong Gulch"] = "Kriegshymnenschlucht",
+ ["Western Plaguelands"] = "Westliche Pestländer",
+ ["Westfall"] = "Westfall",
+ ["Wetlands"] = "Sumpfland",
+ ["Winterspring"] = "Winterquell",
+ ["Zul'Farrak"] = "Zul'Farrak",
+ ["Zul'Gurub"] = "Zul'Gurub",
+
+ ["Champions' Hall"] = "Halle der Champions",
+ ["Hall of Champions"] = "Halle der Champions",
+ ["Blade's Edge Arena"] = "Arena des Schergrats",
+ ["Nagrand Arena"] = "Arena von Nagrand",
+ ["Ruins of Lordaeron"] = "Ruinen von Lordaeron",
+ ["Twisting Nether"] = "Wirbelnder Nether",
+ ["The Veiled Sea"] = "Das verhüllte Meer",
+ ["The North Sea"] = "Das nördliche Meer",
+ ["Armory"] = "Waffenkammer",
+ ["Library"] = "Bibliothek",
+ ["Cathedral"] = "Kathedrale",
+ ["Graveyard"] = "Friedhof",
+ }
+elseif GAME_LOCALE == "frFR" then
+ lib:SetCurrentTranslations {
+ ["Azeroth"] = "Azeroth",
+ ["Eastern Kingdoms"] = "Royaumes de l'est",
+ ["Kalimdor"] = "Kalimdor",
+ ["Outland"] = "Outreterre",
+ ["Cosmic map"] = "Carte cosmique",
+
+ ["Ahn'Qiraj"] = "Ahn'Qiraj",
+ ["Alterac Mountains"] = "Montagnes d'Alterac",
+ ["Alterac Valley"] = "Vallée d'Alterac",
+ ["Arathi Basin"] = "Bassin d'Arathi",
+ ["Arathi Highlands"] = "Hautes-terres d'Arathi",
+ ["Ashenvale"] = "Orneval",
+ ["Auberdine"] = "Auberdine",
+ ["Azshara"] = "Azshara",
+ ["Badlands"] = "Terres ingrates",
+ ["The Barrens"] = "Les Tarides",
+ ["Blackfathom Deeps"] = "Profondeurs de Brassenoire",
+ ["Blackrock Depths"] = "Profondeurs de Rochenoire",
+ ["Blackrock Mountain"] = "Mont Rochenoire",
+ ["Blackrock Spire"] = "Pic Rochenoire",
+ ["Blackwing Lair"] = "Repaire de l'Aile noire",
+ ["Blasted Lands"] = "Terres foudroyées",
+ ["Booty Bay"] = "Baie-du-Butin",
+ ["Burning Steppes"] = "Steppes ardentes",
+ ["Darkshore"] = "Sombrivage",
+ ["Darnassus"] = "Darnassus",
+ ["The Deadmines"] = "Les Mortemines",
+ ["Deadwind Pass"] = "Défilé de Deuillevent",
+ ["Deeprun Tram"] = "Tram des profondeurs",
+ ["Desolace"] = "Désolace",
+ ["Dire Maul"] = "Hache-tripes",
+ ["Dire Maul (East)"] = "Hache-tripes (Est)",
+ ["Dire Maul (West)"] = "Hache-tripes (Ouest)",
+ ["Dire Maul (North)"] = "Hache-tripes (Nord)",
+ ["Dun Morogh"] = "Dun Morogh",
+ ["Durotar"] = "Durotar",
+ ["Duskwood"] = "Bois de la Pénombre",
+ ["Dustwallow Marsh"] = "Marécage d'Âprefange",
+ ["Eastern Plaguelands"] = "Maleterres de l'est",
+ ["Elwynn Forest"] = "Forêt d'Elwynn",
+ ["Everlook"] = "Long-guet",
+ ["Felwood"] = "Gangrebois",
+ ["Feralas"] = "Féralas",
+ ["The Forbidding Sea"] = "La Mer interdite",
+ ["Gadgetzan"] = "Gadgetzan",
+ ["Gates of Ahn'Qiraj"] = "Portes d'Ahn'Qiraj",
+ ["Gnomeregan"] = "Gnomeregan",
+ ["Grom'gol Base Camp"] = "Campement Grom'gol",
+ ["The Great Sea"] = "La Grande mer",
+ ["Hall of Legends"] = "Hall des Légendes",
+ ["Hillsbrad Foothills"] = "Contreforts de Hautebrande",
+ ["The Hinterlands"] = "Les Hinterlands",
+ ["Hyjal"] = "Hyjal",
+ ["Hyjal Summit"] = "Sommet d'Hyjal",
+ ["Ironforge"] = "Forgefer",
+ ["Loch Modan"] = "Loch Modan",
+ ["Lower Blackrock Spire"] = "Pic de Rochenoire inférieur",
+ ["Maraudon"] = "Maraudon",
+ ["Menethil Harbor"] = "Port de Menethil",
+ ["Molten Core"] = "Cœur du Magma",
+ ["Moonglade"] = "Reflet-de-Lune",
+ ["Mulgore"] = "Mulgore",
+ ["Onyxia's Lair"] = "Repaire d'Onyxia",
+ ["Naxxramas"] = "Naxxramas",
+ ["Orgrimmar"] = "Orgrimmar",
+ ["Ratchet"] = "Cabestan",
+ ["Ragefire Chasm"] = "Gouffre de Ragefeu",
+ ["Razorfen Downs"] = "Souilles de Tranchebauge",
+ ["Razorfen Kraul"] = "Kraal de Tranchebauge",
+ ["Redridge Mountains"] = "Les Carmines",
+ ["Ruins of Ahn'Qiraj"] = "Ruines d'Ahn'Qiraj",
+ ["Scarlet Monastery"] = "Monastère écarlate",
+ ["Scholomance"] = "Scholomance",
+ ["Searing Gorge"] = "Gorge des Vents brûlants",
+ ["Shadowfang Keep"] = "Donjon d'Ombrecroc",
+ ["Silithus"] = "Silithus",
+ ["Silverpine Forest"] = "Forêt des Pins argentés",
+ ["The Stockade"] = "La Prison",
+ ["Stonard"] = "Pierrêche",
+ ["Stonetalon Mountains"] = "Les Serres-Rocheuses",
+ ["Stormwind City"] = "Hurlevent",
+ ["Stormwind"] = "Hurlevent",
+ ["Stranglethorn Vale"] = "Vallée de Strangleronce",
+ ["Stratholme"] = "Stratholme",
+ ["Swamp of Sorrows"] = "Marais des Chagrins",
+ ["Tanaris"] = "Tanaris",
+ ["Teldrassil"] = "Teldrassil",
+ ["Temple of Ahn'Qiraj"] = "Le temple d'Ahn'Qiraj",
+ ["The Temple of Atal'Hakkar"] = "Le temple d'Atal'Hakkar",
+ ["Theramore Isle"] = "Ile de Theramore",
+ ["Thousand Needles"] = "Mille pointes",
+ ["Thunder Bluff"] = "Les Pitons du Tonnerre",
+ ["Tirisfal Glades"] = "Clairières de Tirisfal",
+ ["Uldaman"] = "Uldaman",
+ ["Un'Goro Crater"] = "Cratère d'Un'Goro",
+ ["Undercity"] = "Fossoyeuse",
+ ["Upper Blackrock Spire"] = "Pic de Rochenoire supérieur",
+ ["Wailing Caverns"] = "Cavernes des lamentations",
+ ["Warsong Gulch"] = "Goulet des Chanteguerres",
+ ["Western Plaguelands"] = "Maleterres de l'ouest",
+ ["Westfall"] = "Marche de l'Ouest",
+ ["Wetlands"] = "Les Paluns",
+ ["Winterspring"] = "Berceau-de-l'Hiver",
+ ["Zul'Farrak"] = "Zul'Farrak",
+ ["Zul'Gurub"] = "Zul'Gurub",
+
+ ["Champions' Hall"] = "Hall des Champions",
+ ["Hall of Champions"] = "Hall des Champions",
+ ["Blade's Edge Arena"] = "Arène des Tranchantes",
+ ["Nagrand Arena"] = "Arène de Nagrand",
+ ["Ruins of Lordaeron"] = "Ruines de Lordaeron",
+ ["Twisting Nether"] = "Le Néant distordu",
+ ["The Veiled Sea"] = "La Mer voilée",
+ ["The North Sea"] = "La mer Boréale",
+ ["Armory"] = "Armurerie",
+ ["Library"] = "Bibliothèque",
+ ["Cathedral"] = "Cathédrale",
+ ["Graveyard"] = "Cimetière",
+ }
+elseif GAME_LOCALE == "zhCN" then
+ lib:SetCurrentTranslations {
+ ["Azeroth"] = "艾泽拉斯",
+ ["Eastern Kingdoms"] = "东部王国",
+ ["Kalimdor"] = "卡利姆多",
+ ["Outland"] = "外域",
+ ["Cosmic map"] = "全部地图",
+
+ ["Ahn'Qiraj"] = "安其拉",
+ ["Alterac Mountains"] = "奥特兰克山脉",
+ ["Alterac Valley"] = "奥特兰克山谷",
+ ["Arathi Basin"] = "阿拉希盆地",
+ ["Arathi Highlands"] = "阿拉希高地",
+ ["Ashenvale"] = "灰谷",
+ ["Auberdine"] = "奥伯丁",
+ ["Azshara"] = "艾萨拉",
+ ["Badlands"] = "荒芜之地",
+ ["The Barrens"] = "贫瘠之地",
+ ["Blackfathom Deeps"] = "黑暗深渊",
+ ["Blackrock Depths"] = "黑石深渊",
+ ["Blackrock Mountain"] = "黑石山",
+ ["Blackrock Spire"] = "黑石塔",
+ ["Blackwing Lair"] = "黑翼之巢",
+ ["Blasted Lands"] = "诅咒之地",
+ ["Booty Bay"] = "藏宝海湾",
+ ["Burning Steppes"] = "燃烧平原",
+ ["Darkshore"] = "黑海岸",
+ ["Darnassus"] = "达纳苏斯",
+ ["The Deadmines"] = "死亡矿井",
+ ["Deadwind Pass"] = "逆风小径",
+ ["Deeprun Tram"] = "矿道地铁",
+ ["Desolace"] = "凄凉之地",
+ ["Dire Maul"] = "厄运之槌",
+ ["Dire Maul (East)"] = "厄运之槌 (东)",
+ ["Dire Maul (West)"] = "厄运之槌 (西)",
+ ["Dire Maul (North)"] = "厄运之槌 (北)",
+ ["Dun Morogh"] = "丹莫罗",
+ ["Durotar"] = "杜隆塔尔",
+ ["Duskwood"] = "暮色森林",
+ ["Dustwallow Marsh"] = "尘泥沼泽",
+ ["Eastern Plaguelands"] = "东瘟疫之地",
+ ["Elwynn Forest"] = "艾尔文森林",
+ ["Everlook"] = "永望镇",
+ ["Felwood"] = "费伍德森林",
+ ["Feralas"] = "菲拉斯",
+ ["The Forbidding Sea"] = "禁忌之海",
+ ["Gadgetzan"] = "加基森",
+ ["Gates of Ahn'Qiraj"] = "安其拉之门",
+ ["Gnomeregan"] = "诺莫瑞根",
+ ["The Great Sea"] = "无尽之海",
+ ["Grom'gol Base Camp"] = "格罗姆高营地",
+ ["Hall of Legends"] = "传说大厅",
+ ["Hillsbrad Foothills"] = "希尔斯布莱德丘陵",
+ ["The Hinterlands"] = "辛特兰",
+ ["Hyjal"] = "海加尔山",
+ ["Hyjal Summit"] = "海加尔峰",
+ ["Ironforge"] = "铁炉堡",
+ ["Loch Modan"] = "洛克莫丹",
+ ["Lower Blackrock Spire"] = "黑石塔 (下层)",
+ ["Maraudon"] = "玛拉顿",
+ ["Menethil Harbor"] = "米奈希尔港",
+ ["Molten Core"] = "熔火之心",
+ ["Moonglade"] = "月光林地",
+ ["Mulgore"] = "莫高雷",
+ ["Naxxramas"] = "纳克萨玛斯",
+ ["Onyxia's Lair"] = "奥妮克希亚的巢穴",
+ ["Orgrimmar"] = "奥格瑞玛",
+ ["Ratchet"] = "棘齿城",
+ ["Ragefire Chasm"] = "怒焰裂谷",
+ ["Razorfen Downs"] = "剃刀高地",
+ ["Razorfen Kraul"] = "剃刀沼泽",
+ ["Redridge Mountains"] = "赤脊山",
+ ["Ruins of Ahn'Qiraj"] = "安其拉废墟",
+ ["Scarlet Monastery"] = "血色修道院",
+ ["Scholomance"] = "通灵学院",
+ ["Searing Gorge"] = "灼热峡谷",
+ ["Shadowfang Keep"] = "影牙城堡",
+ ["Silithus"] = "希利苏斯",
+ ["Silverpine Forest"] = "银松森林",
+ ["The Stockade"] = "监狱",
+ ["Stonard"] = "斯通纳德",
+ ["Stonetalon Mountains"] = "石爪山脉",
+ ["Stormwind City"] = "暴风城",
+ ["Stormwind"] = "暴风城",--TaxiNodesDBC
+ ["Stranglethorn Vale"] = "荆棘谷",
+ ["Stratholme"] = "斯坦索姆",
+ ["Swamp of Sorrows"] = "悲伤沼泽",
+ ["Tanaris"] = "塔纳利斯",
+ ["Teldrassil"] = "泰达希尔",
+ ["Temple of Ahn'Qiraj"] = "安其拉神殿",
+ ["The Temple of Atal'Hakkar"] = "阿塔哈卡神庙",
+ ["Theramore Isle"] = "塞拉摩岛",
+ ["Thousand Needles"] = "千针石林",
+ ["Thunder Bluff"] = "雷霆崖",
+ ["Tirisfal Glades"] = "提瑞斯法林地",
+ ["Uldaman"] = "奥达曼",
+ ["Un'Goro Crater"] = "安戈洛环形山",
+ ["Undercity"] = "幽暗城",
+ ["Upper Blackrock Spire"] = "黑石塔 (上层)",
+ ["Wailing Caverns"] = "哀嚎洞穴",
+ ["Warsong Gulch"] = "战歌峡谷",
+ ["Western Plaguelands"] = "西瘟疫之地",
+ ["Westfall"] = "西部荒野",
+ ["Wetlands"] = "湿地",
+ ["Winterspring"] = "冬泉谷",
+ ["Zul'Farrak"] = "祖尔法拉克",
+ ["Zul'Gurub"] = "祖尔格拉布",
+
+ ["Champions' Hall"] = "勇士大厅",
+ ["Hall of Champions"] = "勇士大厅",--WMOAreaTableDBC
+ ["Blade's Edge Arena"] = "刀锋山竞技场",
+ ["Nagrand Arena"] = "纳格兰竞技场",
+ ["Ruins of Lordaeron"] = "洛丹伦废墟",
+ ["Twisting Nether"] = "扭曲虚空",
+ ["The Veiled Sea"] = "迷雾之海",
+ ["The North Sea"] = "北海",
+ ["Armory"] = "军械库",
+ ["Library"] = "图书馆",
+ ["Cathedral"] = "教堂",
+ ["Graveyard"] = "墓地",
+ }
+elseif GAME_LOCALE == "zhTW" then
+ lib:SetCurrentTranslations {
+ ["Azeroth"] = "艾澤拉斯",
+ ["Eastern Kingdoms"] = "東部王國",
+ ["Kalimdor"] = "卡林多",
+ ["Outland"] = "外域",
+ ["Cosmic map"] = "宇宙地圖",
+
+ ["Ahn'Qiraj"] = "安其拉",
+ ["Alterac Mountains"] = "奧特蘭克山脈",
+ ["Alterac Valley"] = "奧特蘭克山谷",
+ ["Arathi Basin"] = "阿拉希盆地",
+ ["Arathi Highlands"] = "阿拉希高地",
+ ["Ashenvale"] = "梣谷",
+ ["Auberdine"] = "奧伯丁",
+ ["Azshara"] = "艾薩拉",
+ ["Badlands"] = "荒蕪之地",
+ ["The Barrens"] = "貧瘠之地",
+ ["Blackfathom Deeps"] = "黑暗深淵",
+ ["Blackrock Depths"] = "黑石深淵",
+ ["Blackrock Mountain"] = "黑石山",
+ ["Blackrock Spire"] = "黑石塔",
+ ["Blackwing Lair"] = "黑翼之巢",
+ ["Blasted Lands"] = "詛咒之地",
+ ["Booty Bay"] = "藏寶海灣",
+ ["Burning Steppes"] = "燃燒平原",
+ ["Darkshore"] = "黑海岸",
+ ["Darnassus"] = "達納蘇斯",
+ ["The Deadmines"] = "死亡礦坑",
+ ["Deadwind Pass"] = "逆風小徑",
+ ["Deeprun Tram"] = "礦道地鐵",
+ ["Desolace"] = "淒涼之地",
+ ["Dire Maul"] = "厄運之槌",
+ ["Dire Maul (East)"] = "厄運之槌 - 東",
+ ["Dire Maul (West)"] = "厄運之槌 - 西",
+ ["Dire Maul (North)"] = "厄運之槌 - 北",
+ ["Dun Morogh"] = "丹莫洛",
+ ["Durotar"] = "杜洛塔",
+ ["Duskwood"] = "暮色森林",
+ ["Dustwallow Marsh"] = "塵泥沼澤",
+ ["Eastern Plaguelands"] = "東瘟疫之地",
+ ["Elwynn Forest"] = "艾爾文森林",
+ ["Everlook"] = "永望鎮",
+ ["Felwood"] = "費伍德森林",
+ ["Feralas"] = "菲拉斯",
+ ["The Forbidding Sea"] = "禁忌之海",
+ ["Gadgetzan"] = "加基森",
+ ["Gates of Ahn'Qiraj"] = "安其拉之門",
+ ["Gnomeregan"] = "諾姆瑞根",
+ ["The Great Sea"] = "無盡之海",
+ ["Grom'gol Base Camp"] = "格羅姆高營地",
+ ["Hall of Legends"] = "傳說大廳",
+ ["Hillsbrad Foothills"] = "希爾斯布萊德丘陵",
+ ["The Hinterlands"] = "辛特蘭",
+ ["Hyjal"] = "海加爾山",
+ ["Hyjal Summit"] = "海加爾山",
+ ["Ironforge"] = "鐵爐堡",
+ ["Loch Modan"] = "洛克莫丹",
+ ["Lower Blackrock Spire"] = "低階黑石塔",
+ ["Maraudon"] = "瑪拉頓",
+ ["Menethil Harbor"] = "米奈希爾港",
+ ["Molten Core"] = "熔火之心",
+ ["Moonglade"] = "月光林地",
+ ["Mulgore"] = "莫高雷",
+ ["Naxxramas"] = "納克薩瑪斯",
+ ["Onyxia's Lair"] = "奧妮克希亞的巢穴",
+ ["Orgrimmar"] = "奧格瑪",
+ ["Ratchet"] = "棘齒城",
+ ["Ragefire Chasm"] = "怒焰裂谷",
+ ["Razorfen Downs"] = "剃刀高地",
+ ["Razorfen Kraul"] = "剃刀沼澤",
+ ["Redridge Mountains"] = "赤脊山",
+ ["Ruins of Ahn'Qiraj"] = "安其拉廢墟",
+ ["Scarlet Monastery"] = "血色修道院",
+ ["Scholomance"] = "通靈學院",
+ ["Searing Gorge"] = "灼熱峽谷",
+ ["Shadowfang Keep"] = "影牙城堡",
+ ["Silithus"] = "希利蘇斯",
+ ["Silverpine Forest"] = "銀松森林",
+ ["The Stockade"] = "監獄",
+ ["Stonard"] = "斯通納德",
+ ["Stonetalon Mountains"] = "石爪山脈",
+ ["Stormwind City"] = "暴風城",
+ --["Stormwind"] = true,
+ ["Stranglethorn Vale"] = "荊棘谷",
+ ["Stratholme"] = "斯坦索姆",
+ ["Swamp of Sorrows"] = "悲傷沼澤",
+ ["Tanaris"] = "塔納利斯",
+ ["Teldrassil"] = "泰達希爾",
+ ["Temple of Ahn'Qiraj"] = "安其拉神廟",
+ ["The Temple of Atal'Hakkar"] = "阿塔哈卡神廟",
+ ["Theramore Isle"] = "塞拉摩島",
+ ["Thousand Needles"] = "千針石林",
+ ["Thunder Bluff"] = "雷霆崖",
+ ["Tirisfal Glades"] = "提里斯法林地",
+ ["Uldaman"] = "奧達曼",
+ ["Un'Goro Crater"] = "安戈洛環形山",
+ ["Undercity"] = "幽暗城",
+ ["Upper Blackrock Spire"] = "高階黑石塔",
+ ["Wailing Caverns"] = "哀嚎洞穴",
+ ["Warsong Gulch"] = "戰歌峽谷",
+ ["Western Plaguelands"] = "西瘟疫之地",
+ ["Westfall"] = "西部荒野",
+ ["Wetlands"] = "濕地",
+ ["Winterspring"] = "冬泉谷",
+ ["Zul'Farrak"] = "祖爾法拉克",
+ ["Zul'Gurub"] = "祖爾格拉布",
+
+ ["Champions' Hall"] = "勇士大廳",
+ --["Hall of Champions"] = true,
+ ["Blade's Edge Arena"] = "劍刃競技場",
+ ["Nagrand Arena"] = "納葛蘭競技場",
+ ["Ruins of Lordaeron"] = "羅德隆廢墟",
+ ["Twisting Nether"] = "扭曲虛空",
+ ["The Veiled Sea"] = "迷霧之海",
+ ["The North Sea"] = "北方海岸",
+ ["Armory"] = "軍械庫",
+ ["Library"] = "圖書館",
+ ["Cathedral"] = "教堂",
+ ["Graveyard"] = "墓地",
+ }
+elseif GAME_LOCALE == "koKR" then
+ lib:SetCurrentTranslations {
+ ["Azeroth"] = "아제로스",
+ ["Eastern Kingdoms"] = "동부 왕국",
+ ["Kalimdor"] = "칼림도어",
+ ["Outland"] = "아웃랜드",
+ ["Cosmic map"] = "세계 지도",
+
+ ["Ahn'Qiraj"] = "안퀴라즈",
+ ["Alterac Mountains"] = "알터랙 산맥",
+ ["Alterac Valley"] = "알터랙 계곡",
+ ["Arathi Basin"] = "아라시 분지",
+ ["Arathi Highlands"] = "아라시 고원",
+ ["Ashenvale"] = "잿빛 골짜기",
+ ["Auberdine"] = "아우버다인",
+ ["Azshara"] = "아즈샤라",
+ ["Badlands"] = "황야의 땅",
+ ["The Barrens"] = "불모의 땅",
+ ["Blackfathom Deeps"] = "검은심연의 나락",
+ ["Blackrock Depths"] = "검은바위 나락",
+ ["Blackrock Mountain"] = "검은바위 산",
+ ["Blackrock Spire"] = "검은바위 첨탑",
+ ["Blackwing Lair"] = "검은날개 둥지",
+ ["Blasted Lands"] = "저주받은 땅",
+ ["Booty Bay"] = "무법항",
+ ["Burning Steppes"] = "불타는 평원",
+ ["Darkshore"] = "어둠의 해안",
+ ["Darnassus"] = "다르나서스",
+ ["The Deadmines"] = "죽음의 폐광",
+ ["Deadwind Pass"] = "죽음의 고개",
+ ["Deeprun Tram"] = "깊은굴 지하철",
+ ["Desolace"] = "잊혀진 땅",
+ ["Dire Maul"] = "혈투의 전장",
+ ["Dire Maul (East)"] = "혈투의 전장 동부",
+ ["Dire Maul (West)"] = "혈투의 전장 서부",
+ ["Dire Maul (North)"] = "혈투의 전장 북부",
+ ["Dun Morogh"] = "던 모로",
+ ["Durotar"] = "듀로타",
+ ["Duskwood"] = "그늘숲",
+ ["Dustwallow Marsh"] = "먼지진흙 습지대",
+ ["Eastern Plaguelands"] = "동부 역병지대",
+ ["Elwynn Forest"] = "엘윈 숲",
+ ["Everlook"] = "눈망루 마을",
+ ["Felwood"] = "악령의 숲",
+ ["Feralas"] = "페랄라스",
+ ["The Forbidding Sea"] = "성난폭풍 해안",
+ ["Gadgetzan"] = "가젯잔",
+ ["Gates of Ahn'Qiraj"] = "안퀴라즈 성문",
+ ["Gnomeregan"] = "놈리건",
+ ["The Great Sea"] = "대해",
+ ["Grom'gol Base Camp"] = "그롬골 주둔지",
+ ["Hall of Legends"] = "전설의 전당",
+ ["Hillsbrad Foothills"] = "힐스브래드 구릉지",
+ ["The Hinterlands"] = "동부 내륙지",
+ ["Hyjal"] = "하이잘",
+ ["Hyjal Summit"] = "하이잘 정상",
+ ["Ironforge"] = "아이언포지",
+ ["Loch Modan"] = "모단 호수",
+ ["Lower Blackrock Spire"] = "검은바위 첨탑 하층",
+ ["Maraudon"] = "마라우돈",
+ ["Menethil Harbor"] = "메네실 항구",
+ ["Molten Core"] = "화산 심장부",
+ ["Moonglade"] = "달의 숲",
+ ["Mulgore"] = "멀고어",
+ ["Naxxramas"] = "낙스라마스",
+ ["Onyxia's Lair"] = "오닉시아의 둥지",
+ ["Orgrimmar"] = "오그리마",
+ ["Ratchet"] = "톱니항",
+ ["Ragefire Chasm"] = "성난불길 협곡",
+ ["Razorfen Downs"] = "가시덩굴 구릉",
+ ["Razorfen Kraul"] = "가시덩굴 우리",
+ ["Redridge Mountains"] = "붉은마루 산맥",
+ ["Ruins of Ahn'Qiraj"] = "안퀴라즈 폐허",
+ ["Scarlet Monastery"] = "붉은십자군 수도원",
+ ["Scholomance"] = "스칼로맨스",
+ ["Searing Gorge"] = "이글거리는 협곡",
+ ["Shadowfang Keep"] = "그림자송곳니 성채",
+ ["Silithus"] = "실리더스",
+ ["Silverpine Forest"] = "은빛소나무 숲",
+ ["The Stockade"] = "스톰윈드 지하감옥",
+ ["Stonard"] = "스토나드",
+ ["Stonetalon Mountains"] = "돌발톱 산맥",
+ ["Stormwind City"] = "스톰윈드",
+ ["Stormwind"] = "스톰윈드",
+ ["Stranglethorn Vale"] = "가시덤불 골짜기",
+ ["Stratholme"] = "스트라솔름",
+ ["Swamp of Sorrows"] = "슬픔의 늪",
+ ["Tanaris"] = "타나리스",
+ ["Teldrassil"] = "텔드랏실",
+ ["Temple of Ahn'Qiraj"] = "안퀴라즈 사원",
+ ["The Temple of Atal'Hakkar"] = "아탈학카르 신전",
+ ["Theramore Isle"] = "테라모어 섬",
+ ["Thousand Needles"] = "버섯구름 봉우리",
+ ["Thunder Bluff"] = "썬더 블러프",
+ ["Tirisfal Glades"] = "티리스팔 숲",
+ ["Uldaman"] = "울다만",
+ ["Un'Goro Crater"] = "운고로 분화구",
+ ["Undercity"] = "언더시티",
+ ["Upper Blackrock Spire"] = "검은바위 첨탑 상층",
+ ["Wailing Caverns"] = "통곡의 동굴",
+ ["Warsong Gulch"] = "전쟁노래 협곡",
+ ["Western Plaguelands"] = "서부 역병지대",
+ ["Westfall"] = "서부 몰락지대",
+ ["Wetlands"] = "저습지",
+ ["Winterspring"] = "여명의 설원",
+ ["Zul'Farrak"] = "줄파락",
+ ["Zul'Gurub"] = "줄구룹",
+
+ ["Champions' Hall"] = "용사의 전당",
+ ["Hall of Champions"] = "용사의 전당",
+ ["Blade's Edge Arena"] = "칼날 투기장",
+ ["Nagrand Arena"] = "나그란드 투기장",
+ ["Ruins of Lordaeron"] = "로데론의 폐허",
+ ["Twisting Nether"] = "뒤틀린 황천",
+ ["The Veiled Sea"] = "장막의 바다",
+ ["The North Sea"] = "북해", -- check
+ ["Armory"] = "무기고",
+ ["Library"] = "도서관",
+ ["Cathedral"] = "대성당",
+ ["Graveyard"] = "묘지",
+ }
+elseif GAME_LOCALE == "esES" then
+ lib:SetCurrentTranslations {
+ ["Azeroth"] = "Azeroth",
+ ["Eastern Kingdoms"] = "Reinos del Este",
+ ["Kalimdor"] = "Kalimdor",
+ ["Outland"] = "Terrallende",
+ ["Cosmic map"] = "Mapa cósmico",
+
+ ["Ahn'Qiraj"] = "Ahn'Qiraj",
+ ["Alterac Mountains"] = "Montañas de Alterac",
+ ["Alterac Valley"] = "Valle de Alterac",
+ ["Arathi Basin"] = "Cuenca de Arathi",
+ ["Arathi Highlands"] = "Tierras Altas de Arathi",
+ ["Ashenvale"] = "Vallefresno",
+ ["Auberdine"] = "Auberdine",
+ ["Azshara"] = "Azshara",
+ ["Badlands"] = "Tierras Inhóspitas",
+ ["The Barrens"] = "Los Baldíos",
+ ["Blackfathom Deeps"] = "Cavernas de Brazanegra",
+ ["Blackrock Depths"] = "Profundidades de Roca Negra",
+ ["Blackrock Mountain"] = "Montaña Roca Negra",
+ ["Blackrock Spire"] = "Cumbre de Roca Negra",
+ ["Blackwing Lair"] = "Guarida Alanegra",
+ ["Blasted Lands"] = "Las Tierras Devastadas",
+ ["Booty Bay"] = "Bahía del Botín",
+ ["Burning Steppes"] = "Las Estepas Ardientes",
+ ["Darkshore"] = "Costa Oscura",
+ ["Darnassus"] = "Darnassus",
+ ["The Deadmines"] = "Las Minas de la Muerte",
+ ["Deadwind Pass"] = "Paso de la Muerte",
+ ["Deeprun Tram"] = "Tranvía Subterráneo",
+ ["Desolace"] = "Desolace",
+ ["Dire Maul"] = "La Masacre",
+ ["Dire Maul (East)"] = "La Masacre (Este)",
+ ["Dire Maul (West)"] = "La Masacre (Oeste)",
+ ["Dire Maul (North)"] = "La Masacre (Norte)",
+ ["Dun Morogh"] = "Dun Morogh",
+ ["Durotar"] = "Durotar",
+ ["Duskwood"] = "Bosque del Ocaso",
+ ["Dustwallow Marsh"] = "Marjal Revolcafango",
+ ["Eastern Plaguelands"] = "Tierras de la Peste del Este",
+ ["Elwynn Forest"] = "Bosque de Elwynn",
+ ["Everlook"] = "Vista Eterna",
+ ["Felwood"] = "Frondavil",
+ ["Feralas"] = "Feralas",
+ ["The Forbidding Sea"] = "Mar Adusto",
+ ["Gadgetzan"] = "Gadgetzan",
+ ["Gates of Ahn'Qiraj"] = "Puertas de Ahn'Qiraj",
+ ["Gnomeregan"] = "Gnomeregan",
+ ["The Great Sea"] = "Mare Magnum",
+ ["Grom'gol Base Camp"] = "Campamento Grom'gol",
+ ["Hall of Legends"] = "Sala de las Leyendas",
+ ["Hillsbrad Foothills"] = "Laderas de Trabalomas",
+ ["The Hinterlands"] = "Tierras del Interior",
+ ["Hyjal"] = "Hyjal",
+ ["Hyjal Summit"] = "Hyjal Summit",
+ ["Ironforge"] = "Forjaz",
+ ["Loch Modan"] = "Loch Modan",
+ ["Lower Blackrock Spire"] = "Cumbre inferior de Roca Negra",
+ ["Maraudon"] = "Maraudon",
+ ["Menethil Harbor"] = "Puerto de Menethil",
+ ["Molten Core"] = "Núcleo de Magma",
+ ["Moonglade"] = "Claro de la Luna",
+ ["Mulgore"] = "Mulgore",
+ ["Naxxramas"] = "Naxxramas",
+ ["Onyxia's Lair"] = "Guarida de Onyxia",
+ ["Orgrimmar"] = "Orgrimmar",
+ ["Ratchet"] = "Trinquete",
+ ["Ragefire Chasm"] = "Sima ígnea",
+ ["Razorfen Downs"] = "Zahúrda Rajacieno",
+ ["Razorfen Kraul"] = "Horado Rajacieno",
+ ["Redridge Mountains"] = "Montañas Crestagrana",
+ ["Ruins of Ahn'Qiraj"] = "Ruinas de Ahn'Qiraj",
+ ["Scarlet Monastery"] = "Monasterio Escarlata",
+ ["Scholomance"] = "Scholomance",
+ ["Searing Gorge"] = "La Garganta de Fuego",
+ ["Shadowfang Keep"] = "Castillo de Colmillo Oscuro",
+ ["Silithus"] = "Silithus",
+ ["Silverpine Forest"] = "Bosque de Argénteos",
+ ["The Stockade"] = "Las Mazmorras",
+ --["Stonard"] = "",
+ ["Stonetalon Mountains"] = "Sierra Espolón",
+ ["Stormwind City"] = "Ciudad de Ventormenta",
+ ["Stormwind"] = "Ventormenta",
+ ["Stranglethorn Vale"] = "Vega de Tuercespina",
+ ["Stratholme"] = "Stratholme",
+ ["Swamp of Sorrows"] = "Pantano de las Penas",
+ ["Tanaris"] = "Tanaris",
+ ["Teldrassil"] = "Teldrassil",
+ ["Temple of Ahn'Qiraj"] = "El Templo de Ahn'Qiraj",
+ ["The Temple of Atal'Hakkar"] = "El Templo de Atal'Hakkar",
+ ["Theramore Isle"] = "Isla Theramore",
+ ["Thousand Needles"] = "Las Mil Agujas",
+ ["Thunder Bluff"] = "Cima del Trueno",
+ ["Tirisfal Glades"] = "Claros de Tirisfal",
+ ["Uldaman"] = "Uldaman",
+ ["Un'Goro Crater"] = "Cráter de Un'Goro",
+ ["Undercity"] = "Entrañas",
+ ["Upper Blackrock Spire"] = "Cumbre de Roca Negra",
+ ["Wailing Caverns"] = "Cuevas de los Lamentos",
+ ["Warsong Gulch"] = "Garganta Grito de Guerra",
+ ["Western Plaguelands"] = "Tierras de la Peste del Oeste",
+ ["Westfall"] = "Páramos de Poniente",
+ ["Wetlands"] = "Los Humedales",
+ ["Winterspring"] = "Cuna del Invierno",
+ ["Zul'Farrak"] = "Zul'Farrak",
+ ["Zul'Gurub"] = "Zul'Gurub",
+
+ ["Champions' Hall"] = "Sala de los Campeones",
+ ["Hall of Champions"] = "Sala de los Campeones",
+ ["Blade's Edge Arena"] = "Arena Filospada",
+ ["Nagrand Arena"] = "Arena de Nagrand",
+ ["Ruins of Lordaeron"] = "Ruinas de Lordaeron", -- check
+ ["Twisting Nether"] = "El Vacío Abisal",
+ ["The Veiled Sea"] = "Mar de la Bruma",
+ ["The North Sea"] = "El Mar Norte",
+ ["Armory"] = "Armería",
+ ["Library"] = "Biblioteca",
+ ["Cathedral"] = "Catedral",
+ ["Graveyard"] = "Cementerio",
+ }
+elseif GAME_LOCALE == "esMX" then
+ lib:SetCurrentTranslations {
+ ["Azeroth"] = "Azeroth",
+ ["Eastern Kingdoms"] = "Reinos del Este",
+ ["Kalimdor"] = "Kalimdor",
+ ["Outland"] = "Terrallende",
+ ["Cosmic map"] = "Mapa cósmico",
+
+ ["Ahn'Qiraj"] = "Ahn'Qiraj",
+ ["Alterac Mountains"] = "Montañas de Alterac",
+ ["Alterac Valley"] = "Valle de Alterac",
+ ["Arathi Basin"] = "Cuenca de Arathi",
+ ["Arathi Highlands"] = "Tierras Altas de Arathi",
+ ["Ashenvale"] = "Vallefresno",
+ ["Auberdine"] = "Auberdine",
+ ["Azshara"] = "Azshara",
+ ["Badlands"] = "Tierras Inhóspitas",
+ ["The Barrens"] = "Los Baldíos",
+ ["Blackfathom Deeps"] = "Cavernas de Brazanegra",
+ ["Blackrock Depths"] = "Profundidades de Roca Negra",
+ ["Blackrock Mountain"] = "Montaña Roca Negra",
+ ["Blackrock Spire"] = "Cumbre de Roca Negra",
+ ["Blackwing Lair"] = "Guarida Alanegra",
+ ["Blasted Lands"] = "Las Tierras Devastadas",
+ ["Booty Bay"] = "Bahía del Botín",
+ ["Burning Steppes"] = "Las Estepas Ardientes",
+ ["Darkshore"] = "Costa Oscura",
+ ["Darnassus"] = "Darnassus",
+ ["The Deadmines"] = "Las Minas de la Muerte",
+ ["Deadwind Pass"] = "Paso de la Muerte",
+ ["Deeprun Tram"] = "Tranvía Subterráneo",
+ ["Desolace"] = "Desolace",
+ ["Dire Maul"] = "La Masacre",
+ ["Dire Maul (East)"] = "La Masacre (Este)",
+ ["Dire Maul (West)"] = "La Masacre (Oeste)",
+ ["Dire Maul (North)"] = "La Masacre (Norte)",
+ ["Dun Morogh"] = "Dun Morogh",
+ ["Durotar"] = "Durotar",
+ ["Duskwood"] = "Bosque del Ocaso",
+ ["Dustwallow Marsh"] = "Marjal Revolcafango",
+ ["Eastern Plaguelands"] = "Tierras de la Peste del Este",
+ ["Elwynn Forest"] = "Bosque de Elwynn",
+ ["Everlook"] = "Vista Eterna",
+ ["Felwood"] = "Frondavil",
+ ["Feralas"] = "Feralas",
+ ["The Forbidding Sea"] = "Mar Adusto",
+ ["Gadgetzan"] = "Gadgetzan",
+ ["Gates of Ahn'Qiraj"] = "Puertas de Ahn'Qiraj",
+ ["Gnomeregan"] = "Gnomeregan",
+ ["The Great Sea"] = "Mare Magnum",
+ ["Grom'gol Base Camp"] = "Campamento Grom'gol",
+ ["Hall of Legends"] = "Sala de las Leyendas",
+ ["Hillsbrad Foothills"] = "Laderas de Trabalomas",
+ ["The Hinterlands"] = "Tierras del Interior",
+ ["Hyjal"] = "Hyjal",
+ ["Hyjal Summit"] = "Hyjal Summit",
+ ["Ironforge"] = "Forjaz",
+ ["Loch Modan"] = "Loch Modan",
+ ["Lower Blackrock Spire"] = "Cumbre inferior de Roca Negra",
+ ["Maraudon"] = "Maraudon",
+ ["Menethil Harbor"] = "Puerto de Menethil",
+ ["Molten Core"] = "Núcleo de Magma",
+ ["Moonglade"] = "Claro de la Luna",
+ ["Mulgore"] = "Mulgore",
+ ["Naxxramas"] = "Naxxramas",
+ ["Onyxia's Lair"] = "Guarida de Onyxia",
+ ["Orgrimmar"] = "Orgrimmar",
+ ["Ratchet"] = "Trinquete",
+ ["Ragefire Chasm"] = "Sima ígnea",
+ ["Razorfen Downs"] = "Zahúrda Rajacieno",
+ ["Razorfen Kraul"] = "Horado Rajacieno",
+ ["Redridge Mountains"] = "Montañas Crestagrana",
+ ["Ruins of Ahn'Qiraj"] = "Ruinas de Ahn'Qiraj",
+ ["Scarlet Monastery"] = "Monasterio Escarlata",
+ ["Scholomance"] = "Scholomance",
+ ["Searing Gorge"] = "La Garganta de Fuego",
+ ["Shadowfang Keep"] = "Castillo de Colmillo Oscuro",
+ ["Silithus"] = "Silithus",
+ ["Silverpine Forest"] = "Bosque de Argénteos",
+ ["The Stockade"] = "Las Mazmorras",
+ --["Stonard"] = "",
+ ["Stonetalon Mountains"] = "Sierra Espolón",
+ ["Stormwind City"] = "Ciudad de Ventormenta",
+ ["Stormwind"] = "Ventormenta",
+ ["Stranglethorn Vale"] = "Vega de Tuercespina",
+ ["Stratholme"] = "Stratholme",
+ ["Swamp of Sorrows"] = "Pantano de las Penas",
+ ["Tanaris"] = "Tanaris",
+ ["Teldrassil"] = "Teldrassil",
+ ["Temple of Ahn'Qiraj"] = "El Templo de Ahn'Qiraj",
+ ["The Temple of Atal'Hakkar"] = "El Templo de Atal'Hakkar",
+ ["Theramore Isle"] = "Isla Theramore",
+ ["Thousand Needles"] = "Las Mil Agujas",
+ ["Thunder Bluff"] = "Cima del Trueno",
+ ["Tirisfal Glades"] = "Claros de Tirisfal",
+ ["Uldaman"] = "Uldaman",
+ ["Un'Goro Crater"] = "Cráter de Un'Goro",
+ ["Undercity"] = "Entrañas",
+ ["Upper Blackrock Spire"] = "Cumbre de Roca Negra",
+ ["Wailing Caverns"] = "Cuevas de los Lamentos",
+ ["Warsong Gulch"] = "Garganta Grito de Guerra",
+ ["Western Plaguelands"] = "Tierras de la Peste del Oeste",
+ ["Westfall"] = "Páramos de Poniente",
+ ["Wetlands"] = "Los Humedales",
+ ["Winterspring"] = "Cuna del Invierno",
+ ["Zul'Farrak"] = "Zul'Farrak",
+ ["Zul'Gurub"] = "Zul'Gurub",
+
+ ["Champions' Hall"] = "Sala de los Campeones",
+ ["Hall of Champions"] = "Sala de los Campeones",
+ ["Blade's Edge Arena"] = "Arena Filospada",
+ ["Nagrand Arena"] = "Arena de Nagrand",
+ ["Ruins of Lordaeron"] = "Ruinas de Lordaeron", -- check
+ ["Twisting Nether"] = "El Vacío Abisal",
+ ["The Veiled Sea"] = "Mar de la Bruma",
+ ["The North Sea"] = "El Mar Norte",
+ ["Armory"] = "Armería",
+ ["Library"] = "Biblioteca",
+ ["Cathedral"] = "Catedral",
+ ["Graveyard"] = "Cementerio",
+ }
+elseif GAME_LOCALE == "ruRU" then
+ lib:SetCurrentTranslations {
+ ["Azeroth"] = "Азерот",
+ ["Eastern Kingdoms"] = "Восточные королевства",
+ ["Kalimdor"] = "Калимдор",
+ ["Outland"] = "Запределье",
+ ["Cosmic map"] = "Карта Вселенной",
+
+ ["Ahn'Qiraj"] = "Ан'Кираж",
+ ["Alterac Mountains"] = "Альтеракские горы",
+ ["Alterac Valley"] = "Альтеракская долина",
+ ["Arathi Basin"] = "Низина Арати",
+ ["Arathi Highlands"] = "Нагорье Арати",
+ ["Ashenvale"] = "Ясеневый лес",
+ ["Auberdine"] = "Аубердин",
+ ["Azshara"] = "Азшара",
+ ["Badlands"] = "Бесплодные земли",
+ ["The Barrens"] = "Степи",
+ ["Blackfathom Deeps"] = "Непроглядная Пучина",
+ ["Blackrock Depths"] = "Глубины Черной горы",
+ ["Blackrock Mountain"] = "Черная гора",
+ ["Blackrock Spire"] = "Вершина Черной горы",
+ ["Blackwing Lair"] = "Логово Крыла Тьмы",
+ ["Blasted Lands"] = "Выжженные земли",
+ ["Booty Bay"] = "Пиратская Бухта",
+ ["Burning Steppes"] = "Пылающие степи",
+ ["Darkshore"] = "Темные берега",
+ ["Darnassus"] = "Дарнасс",
+ ["The Deadmines"] = "Мертвые копи",
+ ["Deadwind Pass"] = "Перевал Мертвого Ветра",
+ ["Deeprun Tram"] = "Подземный поезд",
+ ["Desolace"] = "Пустоши",
+ ["Dire Maul"] = "Забытый Город",
+ ["Dire Maul (East)"] = "Забытый Город: Восток",
+ ["Dire Maul (West)"] = "Забытый Город: Запад",
+ ["Dire Maul (North)"] = "Забытый Город: Север",
+ ["Dun Morogh"] = "Дун Морог",
+ ["Durotar"] = "Дуротар",
+ ["Duskwood"] = "Сумеречный лес",
+ ["Dustwallow Marsh"] = "Пылевые топи",
+ ["Eastern Plaguelands"] = "Восточное Лихоземье",
+ ["Elwynn Forest"] = "Элвиннский лес",
+ ["Everlook"] = "Круговзор",
+ ["Felwood"] = "Оскверненный лес",
+ ["Feralas"] = "Фералас",
+ ["The Forbidding Sea"] = "Зловещее море",
+ ["Gadgetzan"] = "Прибамбасск",
+ ["Gates of Ahn'Qiraj"] = "Врата Ан'Киража",
+ ["Gnomeregan"] = "Гномреган",
+ ["The Great Sea"] = "Великое море",
+ ["Grom'gol Base Camp"] = "Лагерь Гром'гол",
+ ["Hall of Legends"] = "Зал Легенд",
+ ["Hillsbrad Foothills"] = "Предгорья Хилсбрада",
+ ["The Hinterlands"] = "Внутренние земли",
+ ["Hyjal"] = "Хиджал",
+ ["Hyjal Summit"] = "Вершина Хиджала",
+ ["Ironforge"] = "Стальгорн",
+ ["Loch Modan"] = "Лок Модан",
+ ["Lower Blackrock Spire"] = "Нижний ярус Черной горы",
+ ["Maraudon"] = "Мародон",
+ ["Menethil Harbor"] = "Гавань Менетил",
+ ["Molten Core"] = "Огненные Недра",
+ ["Moonglade"] = "Лунная поляна",
+ ["Mulgore"] = "Мулгор",
+ ["Naxxramas"] = "Наксрамас",
+ ["Onyxia's Lair"] = "Логово Ониксии",
+ ["Orgrimmar"] = "Оргриммар",
+ ["Ratchet"] = "Кабестан",
+ ["Ragefire Chasm"] = "Огненная пропасть",
+ ["Razorfen Downs"] = "Курганы Иглошкурых",
+ ["Razorfen Kraul"] = "Лабиринты Иглошкурых",
+ ["Redridge Mountains"] = "Красногорье",
+ ["Ruins of Ahn'Qiraj"] = "Руины Ан'Киража",
+ ["Scarlet Monastery"] = "Монастырь Алого ордена",
+ ["Scholomance"] = "Некроситет",
+ ["Searing Gorge"] = "Тлеющее ущелье",
+ ["Shadowfang Keep"] = "Крепость Темного Клыка",
+ ["Silithus"] = "Силитус",
+ ["Silverpine Forest"] = "Серебряный бор",
+ ["The Stockade"] = "Тюрьма",
+ ["Stonard"] = "Каменор",
+ ["Stonetalon Mountains"] = "Когтистые горы",
+ ["Stormwind City"] = "Штормград",
+ ["Stormwind"] = "Штормград",
+ ["Stranglethorn Vale"] = "Тернистая долина",
+ ["Stratholme"] = "Стратхольм",
+ ["Swamp of Sorrows"] = "Болото Печали",
+ ["Tanaris"] = "Танарис",
+ ["Teldrassil"] = "Тельдрассил",
+ ["Temple of Ahn'Qiraj"] = "Храм Ан'Кираж",
+ ["The Temple of Atal'Hakkar"] = "Храм Атал'Хаккара",
+ ["Theramore Isle"] = "Остров Терамор",
+ ["Thousand Needles"] = "Тысяча Игл",
+ ["Thunder Bluff"] = "Громовой Утес",
+ ["Tirisfal Glades"] = "Тирисфальские леса",
+ ["Uldaman"] = "Ульдаман",
+ ["Un'Goro Crater"] = "Кратер Ун'Горо",
+ ["Undercity"] = "Подгород",
+ ["Upper Blackrock Spire"] = "Верхний ярус Черной горы",
+ ["Wailing Caverns"] = "Пещеры Стенаний",
+ ["Warsong Gulch"] = "Ущелье Песни Войны",
+ ["Western Plaguelands"] = "Западное Лихоземье",
+ ["Westfall"] = "Западный Край",
+ ["Wetlands"] = "Болотина",
+ ["Winterspring"] = "Зимние Ключи",
+ ["Zul'Farrak"] = "Зул'Фаррак",
+ ["Zul'Gurub"] = "Зул'Гуруб",
+
+ ["Champions' Hall"] = "Зал Защитника",
+ ["Hall of Champions"] = "Чертог Защитников",
+ ["Blade's Edge Arena"] = "Арена Острогорья",
+ ["Nagrand Arena"] = "Арена Награнда",
+ ["Ruins of Lordaeron"] = "Руины Лордерона",
+ ["Twisting Nether"] = "Круговерть Пустоты",
+ ["The Veiled Sea"] = "Сокрытое Море",
+ ["The North Sea"] = "Северное море",
+ ["Armory"] = "Оружейная",
+ ["Library"] = "Библиотека",
+ ["Cathedral"] = "Собор",
+ ["Graveyard"] = "Кладбище",
+ }
+else
+ error(string.format("%s: Locale %q not supported", MAJOR_VERSION, GAME_LOCALE))
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/libs/LibStub.lua b/2/3/4/5/6/7/!Compatibility/libs/LibStub.lua
new file mode 100644
index 0000000..e45950e
--- /dev/null
+++ b/2/3/4/5/6/7/!Compatibility/libs/LibStub.lua
@@ -0,0 +1,51 @@
+-- $Id: LibStub.lua 103 2014-10-16 03:02:50Z mikk $
+-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/addons/libstub/ for more info
+-- LibStub is hereby placed in the Public Domain
+-- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
+local LibStub = _G[LIBSTUB_MAJOR]
+
+-- Check to see is this version of the stub is obsolete
+if not LibStub or LibStub.minor < LIBSTUB_MINOR then
+ LibStub = LibStub or {libs = {}, minors = {} }
+ _G[LIBSTUB_MAJOR] = LibStub
+ LibStub.minor = LIBSTUB_MINOR
+
+ -- LibStub:NewLibrary(major, minor)
+ -- major (string) - the major version of the library
+ -- minor (string or number ) - the minor version of the library
+ --
+ -- returns nil if a newer or same version of the lib is already present
+ -- returns empty library object or old library object if upgrade is needed
+ function LibStub:NewLibrary(major, minor)
+ assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
+ minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
+
+ local oldminor = self.minors[major]
+ if oldminor and oldminor >= minor then return nil end
+ self.minors[major], self.libs[major] = minor, self.libs[major] or {}
+ return self.libs[major], oldminor
+ end
+
+ -- LibStub:GetLibrary(major, [silent])
+ -- major (string) - the major version of the library
+ -- silent (boolean) - if true, library is optional, silently return nil if its not found
+ --
+ -- throws an error if the library can not be found (except silent is set)
+ -- returns the library object if found
+ function LibStub:GetLibrary(major, silent)
+ if not self.libs[major] and not silent then
+ error(string.format("Cannot find a library instance of %q.", tostring(major)), 2)
+ end
+ return self.libs[major], self.minors[major]
+ end
+
+ -- LibStub:IterateLibraries()
+ --
+ -- Returns an iterator for the currently registered libraries
+ function LibStub:IterateLibraries()
+ return pairs(self.libs)
+ end
+
+ setmetatable(LibStub, { __call = LibStub.GetLibrary })
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/libs/libs.xml b/2/3/4/5/6/7/!Compatibility/libs/libs.xml
new file mode 100644
index 0000000..b37fb2c
--- /dev/null
+++ b/2/3/4/5/6/7/!Compatibility/libs/libs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!Compatibility/slashCommands.lua b/2/3/4/5/6/7/!Compatibility/slashCommands.lua
new file mode 100644
index 0000000..802ea59
--- /dev/null
+++ b/2/3/4/5/6/7/!Compatibility/slashCommands.lua
@@ -0,0 +1,51 @@
+-- Cache global variables
+local strmatch = strmatch
+
+local checked
+local function LoadDebugTools()
+ if checked then return end
+
+ local _, _, _, lod, _, reason = GetAddOnInfo("!DebugTools")
+ checked = true
+
+ if reason == "MISSING" then return end
+
+ if lod then
+ LoadAddOn("!DebugTools")
+ else
+ EnableAddOn("!DebugTools")
+ LoadAddOn("!DebugTools")
+ DisableAddOn("!DebugTools")
+ end
+end
+
+SLASH_FRAMESTACK1 = "/framestack"
+SLASH_FRAMESTACK2 = "/fstack"
+SlashCmdList["FRAMESTACK"] = function(msg)
+ LoadDebugTools()
+
+ if IsAddOnLoaded("!DebugTools") then
+ local showHiddenArg, showRegionsArg = strmatch(msg, "^%s*(%S+)%s+(%S+)%s*$")
+ if (not showHiddenArg or not showRegionsArg) then
+ showHiddenArg = strmatch(msg, "^%s*(%S+)%s*$")
+ showRegionsArg = "1"
+ end
+ local showHidden = showHiddenArg == "true" or showHiddenArg == "1"
+ local showRegions = showRegions == "true" or showRegionsArg == "1"
+
+ FrameStackTooltip_Toggle(showHidden, showRegions)
+ end
+end
+
+SLASH_EVENTTRACE1 = "/eventtrace"
+SLASH_EVENTTRACE2 = "/etrace"
+SlashCmdList["EVENTTRACE"] = function(msg)
+ LoadDebugTools()
+ EventTraceFrame_HandleSlashCmd(msg)
+end
+
+SLASH_DUMP1 = "/dump"
+SlashCmdList["DUMP"] = function(msg)
+ LoadDebugTools()
+ DevTools_DumpCommand(msg)
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/!DebugTools/!DebugTools.toc b/2/3/4/5/6/7/!DebugTools/!DebugTools.toc
index 9e204fa..bbd00f7 100644
--- a/2/3/4/5/6/7/!DebugTools/!DebugTools.toc
+++ b/2/3/4/5/6/7/!DebugTools/!DebugTools.toc
@@ -1,10 +1,11 @@
-## Interface: 20400
+## Interface: 11200
## Title: !DebugTools
## Notes: Tools for developing addons (Blizzard UI Debug Tools)
## Author: Blizzard Entertainment
## Special Thanks: Iriel, Kirov, Esamynn
## Version: 1.0
## Dependencies: !Compatibility
+## LoadOnDemand: 1
Compatibility.lua
Dump.lua
diff --git a/2/3/4/5/6/7/!DebugTools/Blizzard_DebugTools.lua b/2/3/4/5/6/7/!DebugTools/Blizzard_DebugTools.lua
index 5f6aa87..841a87f 100644
--- a/2/3/4/5/6/7/!DebugTools/Blizzard_DebugTools.lua
+++ b/2/3/4/5/6/7/!DebugTools/Blizzard_DebugTools.lua
@@ -1,4 +1,5 @@
-local _G = getfenv()
+local mod = math.mod
+local getn = table.getn
EVENT_TRACE_EVENT_HEIGHT = 16;
EVENT_TRACE_MAX_ENTRIES = 1000;
@@ -44,7 +45,7 @@ function EventTraceFrame_OnLoad(self)
self.lastIndex = 0;
self.visibleButtons = 0;
_EventTraceFrame = self;
- self:SetScript("OnSizeChanged", function() EventTraceFrame_OnSizeChanged(this, arg1, arg2) end);
+ self:SetScript("OnSizeChanged", function() EventTraceFrame_OnSizeChanged(this, this:GetWidth(), this:GetHeight()) end);
EventTraceFrame_OnSizeChanged(self, self:GetWidth(), self:GetHeight());
self:EnableMouse(true);
self:EnableMouseWheel(true);
@@ -99,18 +100,18 @@ function EventTraceFrame_OnEvent (self, event, ...)
local hours = math.floor(minutes / 60);
seconds = seconds - 60 * minutes;
minutes = minutes - 60 * hours;
- hours = math.mod(hours, 1000);
+ hours = mod(hours, 1000)
self.times[nextIndex] = string.format("%.2d:%.2d:%06.3f", hours, minutes, seconds);
self.timeSinceLast[nextIndex] = 0;
self.framesSinceLast[nextIndex] = 0;
self.eventids[nextIndex] = GetCurrentEventID();
- local numArgs = select("#", unpack(arg));
+ local numArgs = select("#", arg);
for i=1, numArgs do
if (not self.args[i]) then
self.args[i] = {};
end
- self.args[i][nextIndex] = select(i, unpack(arg));
+ self.args[i][nextIndex] = select(i, arg);
end
if (self.eventsToCapture) then
@@ -127,8 +128,8 @@ function EventTraceFrame_OnEvent (self, event, ...)
end
end
-function EventTraceFrame_OnShow()
- wipe(this.ignoredEvents);
+function EventTraceFrame_OnShow(self)
+ wipe(self.ignoredEvents);
local scrollBar = _G["EventTraceFrameScroll"];
local minValue, maxValue = scrollBar:GetMinMaxValues();
scrollBar:SetValue(maxValue);
@@ -140,7 +141,7 @@ end
function EventTraceFrame_OnSizeChanged (self, width, height)
local numButtonsToDisplay = math.floor((height - 36)/EVENT_TRACE_EVENT_HEIGHT);
- local numButtonsCreated = getn(self.buttons)
+ local numButtonsCreated = getn(self.buttons);
if (numButtonsCreated < numButtonsToDisplay) then
for i = numButtonsCreated + 1, numButtonsToDisplay do
@@ -162,7 +163,7 @@ function EventTraceFrame_OnSizeChanged (self, width, height)
EventTraceFrame_Update();
elseif (numButtonsToDisplay < self.visibleButtons) then
for i = numButtonsToDisplay + 1, self.visibleButtons do
- -- self.buttons[i]:Hide();
+ self.buttons[i]:Hide();
end
self.visibleButtons = numButtonsToDisplay;
end
@@ -493,9 +494,14 @@ function EventTraceFrameEventHideButton_OnClick (button)
EventTraceFrame_Update();
end
-local ERROR_FORMAT = "|cffffd200Message:|r|cffffffff %s|r\n|cffffd200Time:|r|cffffffff %s|r\n|cffffd200Count:|r|cffffffff %s|r\n|cffffd200Stack:|r|cffffffff %s|r";
+local ERROR_FORMAT = [[|cffffd200Message:|r|cffffffff %s|r
+|cffffd200Time:|r|cffffffff %s|r
+|cffffd200Count:|r|cffffffff %s|r
+|cffffd200Stack:|r|cffffffff %s|r]];
-local WARNING_AS_ERROR_FORMAT = "|cffffd200Message:|r|cffffffff %s|r\n|cffffd200Time:|r|cffffffff %s|r\n|cffffd200Count:|r|cffffffff %s|r";
+local WARNING_AS_ERROR_FORMAT = [[|cffffd200Message:|r|cffffffff %s|r
+|cffffd200Time:|r|cffffffff %s|r
+|cffffd200Count:|r|cffffffff %s|r]];
local WARNING_FORMAT = "Lua Warning:\n"..WARNING_AS_ERROR_FORMAT;
@@ -522,7 +528,7 @@ function ScriptErrorsFrame_OnLoad (self)
_ScriptErrorsFrame = self;
end
-function ScriptErrorsFrame_OnShow (self)
+function ScriptErrorsFrame_OnShow ()
ScriptErrorsFrame_Update();
end
@@ -583,7 +589,7 @@ function ScriptErrorsFrame_Update ()
if (prevText ~= text) then
editBox:SetText(text);
editBox:HighlightText(0);
- --editBox:SetCursorPosition(0);
+-- editBox:SetCursorPosition(0);
else
ScriptErrorsFrameScrollFrame:UpdateScrollChildRect();
end
@@ -663,7 +669,7 @@ function FrameStackTooltip_OnLoad(self)
self:RegisterEvent("DISPLAY_SIZE_CHANGED")
end
-function FrameStackTooltip_OnEvent(self, event, ...)
+function FrameStackTooltip_OnEvent(self, event)
if (event == "DISPLAY_SIZE_CHANGED") then
FrameStackTooltip_OnDisplaySizeChanged(self)
end
diff --git a/2/3/4/5/6/7/!DebugTools/Blizzard_DebugTools.xml b/2/3/4/5/6/7/!DebugTools/Blizzard_DebugTools.xml
index 885372d..582e455 100644
--- a/2/3/4/5/6/7/!DebugTools/Blizzard_DebugTools.xml
+++ b/2/3/4/5/6/7/!DebugTools/Blizzard_DebugTools.xml
@@ -57,9 +57,9 @@
local frameName = this:GetName();
- this.time = getglobal(frameName.."Time");
- this.event = getglobal(frameName.."Event");
- this.HideButton = getglobal(frameName.."HideButton");
+ this.time = _G[frameName.."Time"];
+ this.event = _G[frameName.."Event"];
+ this.HideButton = _G[frameName.."HideButton"];
this:GetHighlightTexture():SetAlpha(.15);
@@ -326,12 +326,12 @@
this:RegisterForDrag("LeftButton");
- local eventTraceFrame = getglobal("EventTraceFrame");
+ local eventTraceFrame = _G["EventTraceFrame"];
eventTraceFrame.moving = true;
eventTraceFrame:StartMoving();
- local eventTraceFrame = getglobal("EventTraceFrame");
+ local eventTraceFrame = _G["EventTraceFrame"];
eventTraceFrame.moving = nil;
eventTraceFrame:StopMovingOrSizing();
@@ -356,7 +356,7 @@
- this:SetFrameLevel(this:GetFrameLevel() + 1);
+ this:SetFrameLevel(self:GetFrameLevel() + 1);
this:SetValue(0);
this:SetValueStep(1);
@@ -375,7 +375,7 @@
EventTraceFrame_OnShow(this);
- EventTraceFrame_OnEvent(this, unpack(arg));
+ EventTraceFrame_OnEvent(this, event, arg);
EventTraceFrame_OnUpdate(this, arg1);
@@ -414,12 +414,12 @@
this:RegisterForDrag("LeftButton");
- local frame = getglobal("ScriptErrorsFrame");
+ local frame = _G["ScriptErrorsFrame"];
frame.moving = true;
frame:StartMoving();
- local frame = getglobal("ScriptErrorsFrame");
+ local frame = _G["ScriptErrorsFrame"];
frame.moving = nil;
frame:StopMovingOrSizing();
@@ -543,7 +543,7 @@
FrameStackTooltip_OnUpdate(this, arg1);
- FrameStackTooltip_OnEvent(this, unpack(arg));
+ FrameStackTooltip_OnEvent(this, arg);
diff --git a/2/3/4/5/6/7/!DebugTools/Compatibility.lua b/2/3/4/5/6/7/!DebugTools/Compatibility.lua
index afceeb2..5f3d0fe 100644
--- a/2/3/4/5/6/7/!DebugTools/Compatibility.lua
+++ b/2/3/4/5/6/7/!DebugTools/Compatibility.lua
@@ -1,11 +1,10 @@
---Cache global variables
-local _G = getfenv()
-local format, match = string.format, string.match
-local tinsert, tsort, twipe = table.insert, table.sort, table.wipe
+-- Cache global variables
local mod = math.mod
local pairs = pairs
local tostring = tostring
---WoW API
+local format, match = string.format, string.match
+local getn, tinsert, tsort, twipe = table.getn, table.insert, table.sort, table.wipe
+-- WoW API
local GetTime = GetTime
DEBUG_FRAMESTACK = "Frame Stack"
@@ -87,7 +86,11 @@ local function FrameStackSort(b, a)
return
end
- return a < b
+ if a and b then
+ return a < b
+ else
+ return
+ end
end
function UpdateFrameStack(tooltip, showHidden)
@@ -154,7 +157,7 @@ function UpdateFrameStack(tooltip, showHidden)
frameStackList[getn(frameStackList) + 1] = nil
- --tsort(frameStackList, FrameStackSort)
+ tsort(frameStackList, FrameStackSort)
tooltip:ClearLines()
tooltip:AddDoubleLine(DEBUG_FRAMESTACK, format("(%.2f,%.2f)", x, y), 1, 1, 1, 1, .82, 0)
@@ -174,12 +177,12 @@ function UpdateFrameStack(tooltip, showHidden)
end
if l ~= ol then
- cs = mod(cs, cn) + 1 or 0
+ cs = mod(cs, cn) + 1
ol = l
end
if not highlighted then
- local frameName = _G[n] --[[or match(n, "%((.+)%)$")]] or n
+ local frameName = _G[n] or match(n, "%((.+)%)$") or n
if frameName and frameName == highlightFrame then
tooltip:AddLine("-->" .. (a[cs] or "|cff444444") .. "<" .. l .. "> " .. n .. "|r")
highlighted = true
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/AceAddon-3.0/AceAddon-3.0.lua b/2/3/4/5/6/7/ElvUI/Libraries/AceAddon-3.0/AceAddon-3.0.lua
index be5ee53..329acfa 100644
--- a/2/3/4/5/6/7/ElvUI/Libraries/AceAddon-3.0/AceAddon-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI/Libraries/AceAddon-3.0/AceAddon-3.0.lua
@@ -35,6 +35,10 @@ local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceAddon then return end -- No Upgrade needed.
+local AceCore = LibStub("AceCore-3.0")
+local new, del = AceCore.new, AceCore.del
+local wipe, truncate = AceCore.wipe, AceCore.truncate
+
AceAddon.frame = AceAddon.frame or CreateFrame("Frame", "AceAddon30Frame") -- Our very own frame
AceAddon.addons = AceAddon.addons or {} -- addons in general
AceAddon.statuses = AceAddon.statuses or {} -- statuses of addon.
@@ -43,9 +47,9 @@ AceAddon.enablequeue = AceAddon.enablequeue or {} -- addons that are initialized
AceAddon.embeds = AceAddon.embeds or setmetatable({}, {__index = function(tbl, key) tbl[key] = {} return tbl[key] end }) -- contains a list of libraries embedded in an addon
-- Lua APIs
-local getn, tinsert, tconcat, tremove = table.getn, table.insert, table.concat, table.remove
-local fmt, tostring = string.format, tostring
-local select, pairs, next, type, unpack = select, pairs, next, type, unpack
+local tinsert, tconcat, tremove, tgetn = table.insert, table.concat, table.remove, table.getn
+local strfmt, tostring = string.format, tostring
+local pairs, next, type, unpack = pairs, next, type, unpack
local loadstring, assert, error = loadstring, assert, error
local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget
@@ -56,54 +60,7 @@ local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, r
--[[
xpcall safecall implementation
]]
-local xpcall = xpcall
-
-local function errorhandler(err)
- return geterrorhandler()(err)
-end
-
-local function CreateDispatcher(argCount)
- local code = [[
- local method, ARGS
- local function call() return method(ARGS) end
-
- local function dispatch(func, ...)
- method = func
- if not method then return end
- ARGS = unpack(arg)
- return xpcall(call, function(err) return geterrorhandler()(err) end)
- end
-
- return dispatch
- ]]
-
- local ARGS = {}
- for i = 1, argCount do
- ARGS[i] = "arg"..i
- end
-
- code = string.gsub(code, "ARGS", tconcat(ARGS, ", "))
- return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
-end
-
-local Dispatchers = setmetatable({}, {__index=function(self, argCount)
- local dispatcher = CreateDispatcher(argCount)
- rawset(self, argCount, dispatcher)
- return dispatcher
-end})
-Dispatchers[0] = function(func)
- return xpcall(func, errorhandler)
-end
-
-local function safecall(func, ...)
- -- we check to see if the func is passed is actually a function here and don't error when it isn't
- -- this safecall is used for optional functions like OnInitialize OnEnable etc. When they are not
- -- present execution should continue without hinderance
- if type(func) == "function" then
- --print(Dispatchers[getn(arg)](func, unpack(arg)))
- return func(unpack(arg))
- end
-end
+local safecall = AceCore.safecall
-- local functions that will be implemented further down
local Enable, Disable, EnableModule, DisableModule, Embed, NewModule, GetModule, GetName, SetDefaultModuleState, SetDefaultModuleLibraries, SetEnabledState, SetDefaultModulePrototype
@@ -113,7 +70,7 @@ local function addontostring( self ) return self.name end
-- Check if the addon is queued for initialization
local function queuedForInitialization(addon)
- for i = 1, getn(AceAddon.initializequeue) do
+ for i = 1, tgetn(AceAddon.initializequeue) do
if AceAddon.initializequeue[i] == addon then
return true
end
@@ -136,24 +93,34 @@ end
-- -- Create a Addon object based on the table of a frame
-- local MyFrame = CreateFrame("Frame")
-- MyAddon = LibStub("AceAddon-3.0"):NewAddon(MyFrame, "MyAddon", "AceEvent-3.0")
-function AceAddon:NewAddon(objectorname, ...)
+function AceAddon:NewAddon(objectorname,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+
local object,name
- local i=1
if type(objectorname)=="table" then
object=objectorname
- name=unpack(arg)
- i=2
+ name=a0
else
name=objectorname
end
-
if type(name)~="string" then
- error(("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - string expected got '%s'."):format(type(name)), 2)
+ error(strfmt("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - string expected got '%s'.", type(name)), 2)
end
if self.addons[name] then
- error(("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - Addon '%s' already exists."):format(name), 2)
+ error(strfmt("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - Addon '%s' already exists.", name), 2)
end
+ local args = new()
+ args[1] = a1
+ args[2] = a2
+ args[3] = a3
+ args[4] = a4
+ args[5] = a5
+ args[6] = a6
+ args[7] = a7
+ args[8] = a8
+ args[9] = a9
+ args[10] = a10
+
object = object or {}
object.name = name
@@ -170,14 +137,18 @@ function AceAddon:NewAddon(objectorname, ...)
object.orderedModules = {}
object.defaultModuleLibraries = {}
Embed( object ) -- embed NewModule, GetModule methods
- self:EmbedLibraries(object, unpack(arg))
+ if type(objectorname)=="table" then
+ self:EmbedLibraries(object,nil,args)
+ elseif a0 then
+ self:EmbedLibraries(object,a0,args)
+ end
+ del(args)
-- add to queue of addons to be initialized upon ADDON_LOADED
tinsert(self.initializequeue, object)
return object
end
-
--- Get the addon object by its name from the internal AceAddon registry.
-- Throws an error if the addon object cannot be found (except if silent is set).
-- @param name unique name of the addon object
@@ -187,7 +158,7 @@ end
-- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon")
function AceAddon:GetAddon(name, silent)
if not silent and not self.addons[name] then
- error(("Usage: GetAddon(name): 'name' - Cannot find an AceAddon '%s'."):format(tostring(name)), 2)
+ error(strfmt("Usage: GetAddon(name): 'name' - Cannot find an AceAddon '%s'.", tostring(name)), 2)
end
return self.addons[name]
end
@@ -200,10 +171,12 @@ end
-- @paramsig addon, [lib, ...]
-- @param addon addon object to embed the libs in
-- @param lib List of libraries to embed into the addon
-function AceAddon:EmbedLibraries(addon, ...)
- for i=1, getn(arg) do
- local libname = arg[i]
- self:EmbedLibrary(addon, libname, false, 4)
+function AceAddon:EmbedLibraries(addon,a1,arg)
+ if a1 then self:EmbedLibrary(addon, a1, false, 4) end
+ -- 10 is the max number of variable arguments in the function NewAddon and NewModule
+ for i=1,10 do
+ if not arg[i] then return end
+ self:EmbedLibrary(addon, arg[i], false, 4)
end
end
@@ -221,13 +194,13 @@ end
function AceAddon:EmbedLibrary(addon, libname, silent, offset)
local lib = LibStub:GetLibrary(libname, true)
if not lib and not silent then
- error(("Usage: EmbedLibrary(addon, libname, silent, offset): 'libname' - Cannot find a library instance of %q."):format(tostring(libname)), offset or 2)
+ error(strfmt("Usage: EmbedLibrary(addon, libname, silent, offset): 'libname' - Cannot find a library instance of %q.", tostring(libname)), offset or 2)
elseif lib and type(lib.Embed) == "function" then
lib:Embed(addon)
tinsert(self.embeds[addon], libname)
return true
elseif lib then
- error(("Usage: EmbedLibrary(addon, libname, silent, offset): 'libname' - Library '%s' is not Embed capable"):format(libname), offset or 2)
+ error(strfmt("Usage: EmbedLibrary(addon, libname, silent, offset): 'libname' - Library '%s' is not Embed capable", libname), offset or 2)
end
end
@@ -244,7 +217,7 @@ end
-- MyModule = MyAddon:GetModule("MyModule")
function GetModule(self, name, silent)
if not self.modules[name] and not silent then
- error(("Usage: GetModule(name, silent): 'name' - Cannot find module '%s'."):format(tostring(name)), 2)
+ error(strfmt("Usage: GetModule(name, silent): 'name' - Cannot find module '%s'.", tostring(name)), 2)
end
return self.modules[name]
end
@@ -267,26 +240,39 @@ local function IsModuleTrue(self) return true end
-- -- Create a module with a prototype
-- local prototype = { OnEnable = function(self) print("OnEnable called!") end }
-- MyModule = MyAddon:NewModule("MyModule", prototype, "AceEvent-3.0", "AceHook-3.0")
-function NewModule(self, name, prototype, ...)
- if type(name) ~= "string" then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - string expected got '%s'."):format(type(name)), 2) end
- if type(prototype) ~= "string" and type(prototype) ~= "table" and type(prototype) ~= "nil" then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'prototype' - table (prototype), string (lib) or nil expected got '%s'."):format(type(prototype)), 2) end
+function NewModule(self, name, prototype, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ if type(name) ~= "string" then error(strfmt("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - string expected got '%s'.", type(name)), 2) end
+ if type(prototype) ~= "string" and type(prototype) ~= "table" and type(prototype) ~= "nil" then error(strfmt("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'prototype' - table (prototype), string (lib) or nil expected got '%s'.", type(prototype)), 2) end
- if self.modules[name] then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - Module '%s' already exists."):format(name), 2) end
+ if self.modules[name] then error(strfmt("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - Module '%s' already exists.", name), 2) end
-- modules are basically addons. We treat them as such. They will be added to the initializequeue properly as well.
-- NewModule can only be called after the parent addon is present thus the modules will be initialized after their parent is.
- local module = AceAddon:NewAddon(fmt("%s_%s", self.name or tostring(self), name))
+ local module = AceAddon:NewAddon(strfmt("%s_%s", self.name or tostring(self), name))
module.IsModule = IsModuleTrue
module:SetEnabledState(self.defaultModuleState)
module.moduleName = name
+ local args = new()
+ args[1] = a1
+ args[2] = a2
+ args[3] = a3
+ args[4] = a4
+ args[5] = a5
+ args[6] = a6
+ args[7] = a7
+ args[8] = a8
+ args[9] = a9
+ args[10] = a10
+
if type(prototype) == "string" then
- AceAddon:EmbedLibraries(module, prototype, unpack(arg))
+ AceAddon:EmbedLibraries(module, prototype, args)
else
- AceAddon:EmbedLibraries(module, unpack(arg))
+ AceAddon:EmbedLibraries(module, nil, args)
end
- AceAddon:EmbedLibraries(module, unpack(self.defaultModuleLibraries))
+ del(args)
+ AceAddon:EmbedLibraries(module, nil, self.defaultModuleLibraries)
if not prototype or type(prototype) == "string" then
prototype = self.defaultModulePrototype or nil
@@ -298,7 +284,7 @@ function NewModule(self, name, prototype, ...)
setmetatable(module, mt) -- More of a Base class type feel.
end
- safecall(self.OnModuleCreated, self, module) -- Was in Ace2 and I think it could be a cool thing to have handy.
+ safecall(self.OnModuleCreated, 2, self, module) -- Was in Ace2 and I think it could be a cool thing to have handy.
self.modules[name] = module
tinsert(self.orderedModules, module)
@@ -399,11 +385,25 @@ end
-- MyAddon:SetDefaultModuleLibraries("AceEvent-3.0")
-- -- Create a module
-- MyModule = MyAddon:NewModule("MyModule")
-function SetDefaultModuleLibraries(self, ...)
+function SetDefaultModuleLibraries(self,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
if next(self.modules) then
error("Usage: SetDefaultModuleLibraries(...): cannot change the module defaults after a module has been registered.", 2)
end
- self.defaultModuleLibraries = {unpack(arg)}
+ local args = self.defaultModuleLibraries or {}
+
+ args[1] = a1
+ args[2] = a2
+ args[3] = a3
+ args[4] = a4
+ args[5] = a5
+ args[6] = a6
+ args[7] = a7
+ args[8] = a8
+ args[9] = a9
+ args[10] = a10
+ truncate(tmp,10)
+
+ self.defaultModuleLibraries = args
end
--- Set the default state in which new modules are being created.
@@ -446,7 +446,7 @@ function SetDefaultModulePrototype(self, prototype)
error("Usage: SetDefaultModulePrototype(prototype): cannot change the module defaults after a module has been registered.", 2)
end
if type(prototype) ~= "table" then
- error(("Usage: SetDefaultModulePrototype(prototype): 'prototype' - table expected got '%s'."):format(type(prototype)), 2)
+ error(strfmt("Usage: SetDefaultModulePrototype(prototype): 'prototype' - table expected got '%s'.", type(prototype)), 2)
end
self.defaultModulePrototype = prototype
end
@@ -530,12 +530,12 @@ end
-- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing.
-- @param addon addon object to intialize
function AceAddon:InitializeAddon(addon)
- safecall(addon.OnInitialize, addon)
+ safecall(addon.OnInitialize, 1, addon)
local embeds = self.embeds[addon]
- for i = 1, getn(embeds) do
+ for i = 1, tgetn(embeds) do
local lib = LibStub:GetLibrary(embeds[i], true)
- if lib then safecall(lib.OnEmbedInitialize, lib, addon) end
+ if lib then safecall(lib.OnEmbedInitialize, 2, lib, addon) end
end
-- we don't call InitializeAddon on modules specifically, this is handled
@@ -559,19 +559,19 @@ function AceAddon:EnableAddon(addon)
-- set the statuses first, before calling the OnEnable. this allows for Disabling of the addon in OnEnable.
self.statuses[addon.name] = true
- safecall(addon.OnEnable, addon)
+ safecall(addon.OnEnable, 1, addon)
-- make sure we're still enabled before continueing
if self.statuses[addon.name] then
local embeds = self.embeds[addon]
- for i = 1, getn(embeds) do
+ for i = 1, tgetn(embeds) do
local lib = LibStub:GetLibrary(embeds[i], true)
- if lib then safecall(lib.OnEmbedEnable, lib, addon) end
+ if lib then safecall(lib.OnEmbedEnable, 2, lib, addon) end
end
-- enable possible modules.
local modules = addon.orderedModules
- for i = 1, getn(modules) do
+ for i = 1, tgetn(modules) do
self:EnableAddon(modules[i])
end
end
@@ -594,18 +594,18 @@ function AceAddon:DisableAddon(addon)
-- set statuses first before calling OnDisable, this allows for aborting the disable in OnDisable.
self.statuses[addon.name] = false
- safecall( addon.OnDisable, addon )
+ safecall(addon.OnDisable, 1, addon)
-- make sure we're still disabling...
if not self.statuses[addon.name] then
local embeds = self.embeds[addon]
- for i = 1, getn(embeds) do
+ for i = 1, tgetn(embeds) do
local lib = LibStub:GetLibrary(embeds[i], true)
- if lib then safecall(lib.OnEmbedDisable, lib, addon) end
+ if lib then safecall(lib.OnEmbedDisable, 2, lib, addon) end
end
-- disable possible modules.
local modules = addon.orderedModules
- for i = 1, getn(modules) do
+ for i = 1, tgetn(modules) do
self:DisableAddon(modules[i])
end
end
@@ -636,13 +636,22 @@ function AceAddon:IterateAddonStatus() return pairs(self.statuses) end
function AceAddon:IterateEmbedsOnAddon(addon) return pairs(self.embeds[addon]) end
function AceAddon:IterateModulesOfAddon(addon) return pairs(addon.modules) end
-local IsLoggedIn
+
+local onEvent
+do
+local IsLoggedIn = false
-- Event Handling
-local function onEvent()
+function onEvent()
-- 2011-08-17 nevcairiel - ignore the load event of Blizzard_DebugTools, so a potential startup error isn't swallowed up
+ -- Ace3v: When the ADDON_LOADED event is triggerd, global arg1 is the loaded addon name
+ -- so onEvent(event, arg1) won't work because it will cover the global variables
if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then
-- if a addon loads another addon, recursion could happen here, so we need to validate the table on every iteration
- while(getn(AceAddon.initializequeue) > 0) do
+ -- Ace3v: When an Ace3 addons is loaded, then he initializeque should not be empty unless
+ -- the addon does not use the library. If an addon that does not use Ace3 library
+ -- is loaded, we will also receive the ADDON_LOADED event but in this case the
+ -- queue will be empty so we have nothing to do.
+ while(tgetn(AceAddon.initializequeue) > 0) do
local addon = tremove(AceAddon.initializequeue, 1)
-- this might be an issue with recursion - TODO: validate
if event == "ADDON_LOADED" then addon.baseName = arg1 end
@@ -655,13 +664,14 @@ local function onEvent()
end
if IsLoggedIn then
- while(getn(AceAddon.enablequeue) > 0) do
+ while(tgetn(AceAddon.enablequeue) > 0) do
local addon = tremove(AceAddon.enablequeue, 1)
AceAddon:EnableAddon(addon)
end
end
end
end
+end -- onEvent
AceAddon.frame:RegisterEvent("ADDON_LOADED")
AceAddon.frame:RegisterEvent("PLAYER_LOGIN")
@@ -670,4 +680,4 @@ AceAddon.frame:SetScript("OnEvent", onEvent)
-- upgrade embeded
for name, addon in pairs(AceAddon.addons) do
Embed(addon, true)
-end
\ No newline at end of file
+end
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/AceConsole-3.0/AceConsole-3.0.lua b/2/3/4/5/6/7/ElvUI/Libraries/AceConsole-3.0/AceConsole-3.0.lua
index 7e58920..e38bc8b 100644
--- a/2/3/4/5/6/7/ElvUI/Libraries/AceConsole-3.0/AceConsole-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI/Libraries/AceConsole-3.0/AceConsole-3.0.lua
@@ -16,87 +16,110 @@ local AceConsole, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConsole then return end -- No upgrade needed
+local AceCore = LibStub("AceCore-3.0")
+
AceConsole.embeds = AceConsole.embeds or {} -- table containing objects AceConsole is embedded in.
AceConsole.commands = AceConsole.commands or {} -- table containing commands registered
AceConsole.weakcommands = AceConsole.weakcommands or {} -- table containing self, command => func references for weak commands that don't persist through enable/disable
-- Lua APIs
-local tconcat, tostring, select = table.concat, tostring, select
+local tinsert, tconcat, tgetn, tsetn = table.insert, table.concat, table.getn, table.setn
+local tostring = tostring
local type, pairs, error = type, pairs, error
local format, strfind, strsub = string.format, string.find, string.sub
local max = math.max
+local strupper, strlower = string.upper, string.lower
-- WoW APIs
-local _G = getfenv()
+local _G = AceCore._G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: DEFAULT_CHAT_FRAME, SlashCmdList, hash_SlashCmdList
-
-local tmp={}
-local function Print(self,frame,...)
- local n=0
+local Print
+do
+local tmp = {}
+function Print(self, frame, arg)
if self ~= AceConsole then
- n=n+1
- tmp[n] = "|cff33ff99"..tostring( self ).."|r:"
+ tmp[1] = "|cff33ff99"..tostring(self).."|r:"
+ else
+ tmp[1] = ''
end
- for i=1, getn(arg) do
- n=n+1
- tmp[n] = tostring(arg[i])
+ if type(arg) == "string" then
+ frame:AddMessage(tmp[1]..arg)
+ else -- arg is table and may contain frame as first element if argument frame is nil
+ local b, e = frame and 1 or 2, tgetn(arg)
+ if e >= b then
+ frame = frame or arg[1]
+ for i=0,e-b do
+ tmp[2+i] = tostring(arg[b+i])
+ end
+ frame:AddMessage(tconcat(tmp," ",1,e-b+2)) -- explicitly, because the length is not affected by assignment
+ end
end
- frame:AddMessage( tconcat(tmp," ",1,n) )
end
+end -- Print
--- Print to DEFAULT_CHAT_FRAME or given ChatFrame (anything with an .AddMessage function)
-- @paramsig [chatframe ,] ...
-- @param chatframe Custom ChatFrame to print to (or any frame with an .AddMessage function)
-- @param ... List of any values to be printed
function AceConsole:Print(...)
- local frame = arg
+ local frame = arg[1]
if type(frame) == "table" and frame.AddMessage then -- Is first argument something with an .AddMessage member?
- return Print(self, frame, arg[2])
+ return Print(self, nil, arg)
else
return Print(self, DEFAULT_CHAT_FRAME, arg)
end
end
-
--- Formatted (using format()) print to DEFAULT_CHAT_FRAME or given ChatFrame (anything with an .AddMessage function)
-- @paramsig [chatframe ,] "format"[, ...]
-- @param chatframe Custom ChatFrame to print to (or any frame with an .AddMessage function)
-- @param format Format string - same syntax as standard Lua format()
-- @param ... Arguments to the format string
-function AceConsole:Printf(...)
- local frame = arg
- if type(frame) == "table" and frame.AddMessage then -- Is first argument something with an .AddMessage member?
- return Print(self, frame, format(arg[2]))
+function AceConsole:Printf(a1, ...)
+ local frame, succ, s
+ if type(a1) == "table" and a1.AddMessage then -- Is first argument something with an .AddMessage member?
+ frame, succ, s = a1, pcall(format, unpack(arg))
else
- return Print(self, DEFAULT_CHAT_FRAME, format(arg))
+ frame, succ, s = DEFAULT_CHAT_FRAME, pcall(format, a1, unpack(arg))
end
+ if not succ then error(s,2) end
+ return Print(self, frame, s)
end
+
--- Register a simple chat command
-- @param command Chat command to be registered WITHOUT leading "/"
-- @param func Function to call when the slash command is being used (funcref or methodname)
-- @param persist if false, the command will be soft disabled/enabled when aceconsole is used as a mixin (default: true)
function AceConsole:RegisterChatCommand( command, func, persist )
- if type(command)~="string" then error([[Usage: AceConsole:RegisterChatCommand( "command", func[, persist ]): 'command' - expected a string]], 2) end
+ if type(command)~="string" then error([[Usage: AceConsole:RegisterChatCommand(command, func[, persist ]): 'command' - expected a string]], 2) end
if persist==nil then persist=true end -- I'd rather have my addon's "/addon enable" around if the author screws up. Having some extra slash regged when it shouldnt be isn't as destructive. True is a better default. /Mikk
- local name = "ACECONSOLE_"..string.upper(command)
+ local name = "ACECONSOLE_"..strupper(command)
- if type( func ) == "string" then
+ local t = type(func)
+
+ if t == "string" then
+ -- Ace3v: prevent user from using AceConSole as self
+ if self == AceConsole then
+ error([[Usage: RegisterChatCommand(command, func[, persist]): 'self' - use your own 'self']], 2)
+ end
SlashCmdList[name] = function(input, editBox)
self[func](self, input, editBox)
end
- else
+ elseif t == "function" then
SlashCmdList[name] = func
+ else
+ error([[Usage: AceConsole:RegisterChatCommand(command, func[, persist ]): 'func' - expected a string or a function]], 2)
end
- _G["SLASH_"..name.."1"] = "/"..string.lower(command)
+ _G["SLASH_"..name.."1"] = "/"..strlower(command)
AceConsole.commands[command] = name
-- non-persisting commands are registered for enabling disabling
if not persist then
@@ -113,7 +136,6 @@ function AceConsole:UnregisterChatCommand( command )
if name then
SlashCmdList[name] = nil
_G["SLASH_" .. name .. "1"] = nil
- hash_SlashCmdList["/" .. command:upper()] = nil
AceConsole.commands[command] = nil
end
end
@@ -122,18 +144,16 @@ end
-- @return Iterator (pairs) over all commands
function AceConsole:IterateChatCommands() return pairs(AceConsole.commands) end
-
-local function nils(n, ...)
- if n>1 then
- return nil, nils(n-1, arg)
- elseif n==1 then
- return nil, arg
+local function nils(n,argc,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ if n >= 1 then
+ return nil, nils(n-1,argc,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ elseif not argc or argc == 0 then
+ return
else
- return arg
+ return a1, nils(0,argc-1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
end
end
-
--- Retreive one or more space-separated arguments from a string.
-- Treats quoted strings and itemlinks as non-spaced.
-- @param str The raw argument string
@@ -150,7 +170,7 @@ function AceConsole:GetArgs(str, numargs, startpos)
-- find start of new arg
pos = strfind(str, "[^ ]", pos)
if not pos then -- whoops, end of string
- return nils(numargs, 1e9)
+ return nils(numargs, 1, 1e9)
end
if numargs<1 then
@@ -205,7 +225,7 @@ function AceConsole:GetArgs(str, numargs, startpos)
end
-- search aborted, we hit end of string. return it all as one argument. (yes, even if it's an unterminated quote or hyperlink)
- return strsub(str, startpos), nils(numargs-1, 1e9)
+ return strsub(str, startpos), nils(numargs-1, 1, 1e9)
end
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/AceCore-3.0/AceCore-3.0.lua b/2/3/4/5/6/7/ElvUI/Libraries/AceCore-3.0/AceCore-3.0.lua
index a9fd40d..e8bf464 100644
--- a/2/3/4/5/6/7/ElvUI/Libraries/AceCore-3.0/AceCore-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI/Libraries/AceCore-3.0/AceCore-3.0.lua
@@ -202,4 +202,4 @@ function AceCore.truncate(t,e)
end
end
tsetn(t,e)
-end
\ No newline at end of file
+end
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/AceEvent-3.0/AceEvent-3.0.lua b/2/3/4/5/6/7/ElvUI/Libraries/AceEvent-3.0/AceEvent-3.0.lua
index 31109ff..9eb0e36 100644
--- a/2/3/4/5/6/7/ElvUI/Libraries/AceEvent-3.0/AceEvent-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI/Libraries/AceEvent-3.0/AceEvent-3.0.lua
@@ -2,7 +2,7 @@
-- All dispatching is done using **CallbackHandler-1.0**. AceEvent is a simple wrapper around
-- CallbackHandler, and dispatches all game events or addon message to the registrees.
--
--- **AceEvent-3.0** can be embeded into your addon, either explicitly by calling AceEvent:Embed(MyAddon) or by
+-- **AceEvent-3.0** can be embeded into your addon, either explicitly by calling AceEvent:Embed(MyAddon) or by
-- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
-- and can be accessed directly, without having to explicitly call AceEvent itself.\\
-- It is recommended to embed AceEvent, otherwise you'll have to specify a custom `self` on all calls you
@@ -18,29 +18,29 @@ if not AceEvent then return end
-- Lua APIs
local pairs = pairs
-local CallbackHandler = LibStub("CallbackHandler-1.0")
+local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0")
AceEvent.frame = AceEvent.frame or CreateFrame("Frame", "AceEvent30Frame") -- our event frame
AceEvent.embeds = AceEvent.embeds or {} -- what objects embed this lib
-- APIs and registry for blizzard events, using CallbackHandler lib
if not AceEvent.events then
- AceEvent.events = CallbackHandler:New(AceEvent,
+ AceEvent.events = CallbackHandler:New(AceEvent,
"RegisterEvent", "UnregisterEvent", "UnregisterAllEvents")
end
-function AceEvent.events:OnUsed(target, eventname)
+function AceEvent.events:OnUsed(target, eventname)
AceEvent.frame:RegisterEvent(eventname)
end
-function AceEvent.events:OnUnused(target, eventname)
+function AceEvent.events:OnUnused(target, eventname)
AceEvent.frame:UnregisterEvent(eventname)
end
-- APIs and registry for IPC messages, using CallbackHandler lib
if not AceEvent.messages then
- AceEvent.messages = CallbackHandler:New(AceEvent,
+ AceEvent.messages = CallbackHandler:New(AceEvent,
"RegisterMessage", "UnregisterMessage", "UnregisterAllMessages"
)
AceEvent.SendMessage = AceEvent.messages.Fire
@@ -126,4 +126,4 @@ end)
--- Finally: upgrade our old embeds
for target, v in pairs(AceEvent.embeds) do
AceEvent:Embed(target)
-end
\ No newline at end of file
+end
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/AceHook-3.0/AceHook-3.0.lua b/2/3/4/5/6/7/ElvUI/Libraries/AceHook-3.0/AceHook-3.0.lua
index ce6b2d6..7714848 100644
--- a/2/3/4/5/6/7/ElvUI/Libraries/AceHook-3.0/AceHook-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI/Libraries/AceHook-3.0/AceHook-3.0.lua
@@ -537,4 +537,4 @@ end
--- Upgrade our old embeded
for target, v in pairs( AceHook.embeded ) do
AceHook:Embed( target )
-end
\ No newline at end of file
+end
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/AceLocale-3.0/AceLocale-3.0.lua b/2/3/4/5/6/7/ElvUI/Libraries/AceLocale-3.0/AceLocale-3.0.lua
index 1b7fa46..896f372 100644
--- a/2/3/4/5/6/7/ElvUI/Libraries/AceLocale-3.0/AceLocale-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI/Libraries/AceLocale-3.0/AceLocale-3.0.lua
@@ -134,4 +134,4 @@ function AceLocale:GetLocale(application, silent)
error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
end
return AceLocale.apps[application]
-end
\ No newline at end of file
+end
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/AceSerializer-3.0/AceSerializer-3.0.lua b/2/3/4/5/6/7/ElvUI/Libraries/AceSerializer-3.0/AceSerializer-3.0.lua
index 75430bb..75ecd0c 100644
--- a/2/3/4/5/6/7/ElvUI/Libraries/AceSerializer-3.0/AceSerializer-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI/Libraries/AceSerializer-3.0/AceSerializer-3.0.lua
@@ -1,9 +1,9 @@
--- **AceSerializer-3.0** can serialize any variable (except functions or userdata) into a string format,
--- that can be send over the addon comm channel. AceSerializer was designed to keep all data intact, especially
+-- that can be send over the addon comm channel. AceSerializer was designed to keep all data intact, especially
-- very large numbers or floating point numbers, and table structures. The only caveat currently is, that multiple
-- references to the same table will be send individually.
--
--- **AceSerializer-3.0** can be embeded into your addon, either explicitly by calling AceSerializer:Embed(MyAddon) or by
+-- **AceSerializer-3.0** can be embeded into your addon, either explicitly by calling AceSerializer:Embed(MyAddon) or by
-- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
-- and can be accessed directly, without having to explicitly call AceSerializer itself.\\
-- It is recommended to embed AceSerializer, otherwise you'll have to specify a custom `self` on all calls you
@@ -40,7 +40,7 @@ local function SerializeStringHelper(ch) -- Used by SerializeValue for strings
return "\126\122"
elseif n<=32 then -- nonprint + space
return "\126"..strchar(n+64)
- elseif n==94 then -- value separator
+ elseif n==94 then -- value separator
return "\126\125"
elseif n==126 then -- our own escape character
return "\126\124"
@@ -54,12 +54,12 @@ end
local function SerializeValue(v, res, nres)
-- We use "^" as a value separator, followed by one byte for type indicator
local t=type(v)
-
+
if t=="string" then -- ^S = string (escaped to remove nonprints, "^"s, etc)
res[nres+1] = "^S"
res[nres+2] = gsub(v,"[%c \94\126\127]", SerializeStringHelper)
nres=nres+2
-
+
elseif t=="number" then -- ^N = number (just tostring()ed) or ^F (float components)
local str = tostring(v)
if tonumber(str)==v --[[not in 4.3 or str==serNaN]] then
@@ -79,7 +79,7 @@ local function SerializeValue(v, res, nres)
res[nres+4] = tostring(e-53) -- adjust exponent to counteract mantissa manipulation
nres=nres+4
end
-
+
elseif t=="table" then -- ^T...^t = table (list of key,value pairs)
nres=nres+1
res[nres] = "^T"
@@ -89,7 +89,7 @@ local function SerializeValue(v, res, nres)
end
nres=nres+1
res[nres] = "^t"
-
+
elseif t=="boolean" then -- ^B = true, ^b = false
nres=nres+1
if v then
@@ -97,15 +97,15 @@ local function SerializeValue(v, res, nres)
else
res[nres] = "^b" -- false
end
-
+
elseif t=="nil" then -- ^Z = nil (zero, "N" was taken :P)
nres=nres+1
res[nres] = "^Z"
-
+
else
error(MAJOR..": Cannot serialize a value of type '"..t.."'") -- can't produce error on right level, this is wildly recursive
end
-
+
return nres
end
@@ -127,7 +127,7 @@ function AceSerializer:Serialize(...)
end
serializeTbl[nres+1] = "^^" -- "^^" = End of serialized data
-
+
return tconcat(serializeTbl, "", 1, nres+1)
end
@@ -174,9 +174,9 @@ local function DeserializeValue(iter,single,ctl,data)
ctl,data = iter()
end
- if not ctl then
+ if not ctl then
error("Supplied data misses AceSerializer terminator ('^^')")
- end
+ end
if ctl=="^^" then
-- ignore extraneous data
@@ -184,7 +184,7 @@ local function DeserializeValue(iter,single,ctl,data)
end
local res
-
+
if ctl=="^S" then
res = gsub(data, "~.", DeserializeStringHelper)
elseif ctl=="^N" then
@@ -217,7 +217,7 @@ local function DeserializeValue(iter,single,ctl,data)
ctl,data = iter()
if ctl=="^t" then break end -- ignore ^t's data
k = DeserializeValue(iter,true,ctl,data)
- if k==nil then
+ if k==nil then
error("Invalid AceSerializer table format (no table end marker)")
end
ctl,data = iter()
@@ -230,7 +230,7 @@ local function DeserializeValue(iter,single,ctl,data)
else
error("Invalid AceSerializer control code '"..ctl.."'")
end
-
+
if not single then
return res,DeserializeValue(iter)
else
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/AceTimer-3.0/AceTimer-3.0.lua b/2/3/4/5/6/7/ElvUI/Libraries/AceTimer-3.0/AceTimer-3.0.lua
index 55f7a68..d08ec5e 100644
--- a/2/3/4/5/6/7/ElvUI/Libraries/AceTimer-3.0/AceTimer-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI/Libraries/AceTimer-3.0/AceTimer-3.0.lua
@@ -1,12 +1,12 @@
--- **AceTimer-3.0** provides a central facility for registering timers.
-- AceTimer supports one-shot timers and repeating timers. All timers are stored in an efficient
--- data structure that allows easy dispatching and fast rescheduling. Timers can be registered, rescheduled
+-- data structure that allows easy dispatching and fast rescheduling. Timers can be registered
-- or canceled at any time, even from within a running timer, without conflict or large overhead.\\
--- AceTimer is currently limited to firing timers at a frequency of 0.1s. This constant may change
--- in the future, but for now it seemed like a good compromise in efficiency and accuracy.
+-- AceTimer is currently limited to firing timers at a frequency of 0.01s as this is what the WoW timer API
+-- restricts us to.
--
-- All `:Schedule` functions will return a handle to the current timer, which you will need to store if you
--- need to cancel or reschedule the timer you just registered.
+-- need to cancel the timer you just registered.
--
-- **AceTimer-3.0** can be embeded into your addon, either explicitly by calling AceTimer:Embed(MyAddon) or by
-- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
@@ -15,54 +15,33 @@
-- make into AceTimer.
-- @class file
-- @name AceTimer-3.0
--- @release $Id: AceTimer-3.0.lua 895 2009-12-06 16:28:55Z nevcairiel $
+-- @release $Id: AceTimer-3.0.lua 1119 2014-10-14 17:23:29Z nevcairiel $
---[[
- Basic assumptions:
- * In a typical system, we do more re-scheduling per second than there are timer pulses per second
- * Regardless of timer implementation, we cannot guarantee timely delivery due to FPS restriction (may be as low as 10)
-
- This implementation:
- CON: The smallest timer interval is constrained by HZ (currently 1/10s).
- PRO: It will still correctly fire any timer slower than HZ over a length of time, e.g. 0.11s interval -> 90 times over 10 seconds
- PRO: In lag bursts, the system simly skips missed timer intervals to decrease load
- CON: Algorithms depending on a timer firing "N times per minute" will fail
- PRO: (Re-)scheduling is O(1) with a VERY small constant. It's a simple linked list insertion in a hash bucket.
- CAUTION: The BUCKETS constant constrains how many timers can be efficiently handled. With too many hash collisions, performance will decrease.
-
- Major assumptions upheld:
- - ALLOWS scheduling multiple timers with the same funcref/method
- - ALLOWS scheduling more timers during OnUpdate processing
- - ALLOWS unscheduling ANY timer (including the current running one) at any time, including during OnUpdate processing
-]]
-
-local MAJOR, MINOR = "AceTimer-3.0", 6
+local MAJOR, MINOR = "AceTimer-3.0", 17 -- Bump minor on changes
local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceTimer then return end -- No upgrade needed
-AceTimer.hash = AceTimer.hash or {} -- Array of [0..BUCKET-1] = linked list of timers (using .next member)
- -- Linked list gets around ACE-88 and ACE-90.
-AceTimer.selfs = AceTimer.selfs or {} -- Array of [self]={[handle]=timerobj, [handle2]=timerobj2, ...}
+local AceCore = LibStub("AceCore-3.0")
+local safecall = AceCore.safecall
+
+AceTimer.counter = AceTimer.counter or {}
+AceTimer.hash = AceTimer.hash or {} -- Array of [1..BUCKETS] = linked list of timers (using .next member)
+AceTimer.activeTimers = AceTimer.activeTimers or {} -- Active timer list
AceTimer.frame = AceTimer.frame or CreateFrame("Frame", "AceTimer30Frame")
+local counter = AceTimer.counter
+local activeTimers = AceTimer.activeTimers -- Upvalue our private data
+local timerFrame = AceTimer.frame
+
-- Lua APIs
-local assert, error, loadstring = assert, error, loadstring
-local setmetatable, rawset, rawget = setmetatable, rawset, rawget
-local select, pairs, type, next, tostring = select, pairs, type, next, tostring
-local floor, max, min = math.floor, math.max, math.min
-local tconcat = table.concat
+local type, unpack, next, error = type, unpack, next, error
+local floor, max, min, mod = math.floor, math.max, math.min, math.mod
+local tostring = tostring
-- WoW APIs
local GetTime = GetTime
--- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
--- List them here for Mikk's FindGlobals script
--- GLOBALS: DEFAULT_CHAT_FRAME, geterrorhandler
-
--- Simple ONE-SHOT timer cache. Much more efficient than a full compost for our purposes.
-local timerCache = nil
-
--[[
Timers will not be fired more often than HZ-1 times per second.
Keep at intended speed PLUS ONE or we get bitten by floating point rounding errors (n.5 + 0.1 can be n.599999)
@@ -70,6 +49,7 @@ local timerCache = nil
If this number is ever changed, all entries need to be rehashed on lib upgrade.
]]
local HZ = 11
+local minDelay = 1/(HZ-1)
--[[
Prime for good distribution
@@ -82,214 +62,122 @@ for i=1,BUCKETS do
hash[i] = hash[i] or false -- make it an integer-indexed array; it's faster than hashes
end
---[[
- xpcall safecall implementation
-]]
-local xpcall = xpcall
-
-local function errorhandler(err)
- return geterrorhandler()(err)
-end
-
-local function CreateDispatcher(argCount)
- local code = [[
- local method, ARGS
- local function call() return method(ARGS) end
-
- local function dispatch(func, ...)
- method = func
- if not method then return end
- ARGS = unpack(arg)
- return xpcall(call, function(err) return geterrorhandler()(err) end)
- end
-
- return dispatch
- ]]
-
- local ARGS = {}
- for i = 1, argCount do ARGS[i] = "arg"..i end
- code = gsub(code, "ARGS", tconcat(ARGS, ", "))
- return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
-end
-
-local Dispatchers = setmetatable({}, {
- __index=function(self, argCount)
- local dispatcher = CreateDispatcher(argCount)
- rawset(self, argCount, dispatcher)
- return dispatcher
+local new, del
+do
+local list = setmetatable({}, {__mode = "k"})
+function new(self, loop, func, delay, argc,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ local name = loop and "ScheduleRepeatingTimer" or "ScheduleTimer"
+ if self == AceTimer then
+ error(MAJOR..": " .. name .. "(callback, delay, argc, args...): use your own 'self'", 3)
end
-})
-Dispatchers[0] = function(func)
- return xpcall(func, errorhandler)
-end
-
-local function safecall(func, ...)
- return Dispatchers[getn(arg)](func, unpack(arg))
-end
-
-local lastint = floor(GetTime() * HZ)
-
--- --------------------------------------------------------------------
--- OnUpdate handler
---
--- traverse buckets, always chasing "now", and fire timers that have expired
-
-local function OnUpdate()
- local now = GetTime()
- local nowint = floor(now * HZ)
-
- -- Have we passed into a new hash bucket?
- if nowint == lastint then return end
-
- local soon = now + 1 -- +1 is safe as long as 1 < HZ < BUCKETS/2
-
- -- Pass through each bucket at most once
- -- Happens on e.g. instance loads, but COULD happen on high local load situations also
- for curint = (max(lastint, nowint - BUCKETS) + 1), nowint do -- loop until we catch up with "now", usually only 1 iteration
- local curbucket = (math.mod(curint, BUCKETS))+1
- -- Yank the list of timers out of the bucket and empty it. This allows reinsertion in the currently-processed bucket from callbacks.
- local nexttimer = hash[curbucket]
- hash[curbucket] = false -- false rather than nil to prevent the array from becoming a hash
-
- while nexttimer do
- local timer = nexttimer
- nexttimer = timer.next
- local when = timer.when
-
- if when < soon then
- -- Call the timer func, either as a method on given object, or a straight function ref
- local callback = timer.callback
- if type(callback) == "string" then
- safecall(timer.object[callback], timer.object, timer.arg)
- elseif callback then
- safecall(callback, timer.arg)
- else
- -- probably nilled out by CancelTimer
- timer.delay = nil -- don't reschedule it
- end
-
- local delay = timer.delay -- NOW make a local copy, can't do it earlier in case the timer cancelled itself in the callback
-
- if not delay then
- -- single-shot timer (or cancelled)
- AceTimer.selfs[timer.object][tostring(timer)] = nil
- timerCache = timer
- else
- -- repeating timer
- local newtime = when + delay
- if newtime < now then -- Keep lag from making us firing a timer unnecessarily. (Note that this still won't catch too-short-delay timers though.)
- newtime = now + delay
- end
- timer.when = newtime
-
- -- add next timer execution to the correct bucket
- local bucket = (math.mod(floor(newtime * HZ), BUCKETS)) + 1
- timer.next = hash[bucket]
- hash[bucket] = timer
- end
- else -- if when>=soon
- -- reinsert (yeah, somewhat expensive, but shouldn't be happening too often either due to hash distribution)
- timer.next = hash[curbucket]
- hash[curbucket] = timer
- end -- if whenhandle->timer registry
- local handle = tostring(timer)
+ local id = tostring(timer) -- user has only access to the id but not the table itself
+ activeTimers[id] = timer
- local selftimers = AceTimer.selfs[self]
- if not selftimers then
- selftimers = {}
- AceTimer.selfs[self] = selftimers
- end
- selftimers[handle] = timer
- selftimers.__ops = (selftimers.__ops or 0) + 1
+ counter[self] = (counter[self] or 0) + 1
- return handle
+ timerFrame:Show()
+ return id
end
+function del(t)
+ local id = tostring(t)
+ activeTimers[id] = nil
+ if not next(activeTimers) then
+ timerFrame:Hide()
+ end
+ local self = t.object
+ for k in pairs(t) do t[k] = nil end
+ list[t] = true
+ if counter[self] then
+ counter[self] = counter[self] - 1
+ else
+ counter[self] = nil
+ end
+end
+end -- new, del
+
--- Schedule a new one-shot timer.
-- The timer will fire once in `delay` seconds, unless canceled before.
-- @param callback Callback function for the timer pulse (funcref or method name).
-- @param delay Delay for the timer, in seconds.
--- @param arg An optional argument to be passed to the callback function.
+-- @param argc The numbers of arguments to be passed to the callback function
+-- @param a1,...,a10 The arguments
-- @usage
--- MyAddon = LibStub("AceAddon-3.0"):NewAddon("TimerTest", "AceTimer-3.0")
+-- MyAddOn = LibStub("AceAddon-3.0"):NewAddon("MyAddOn", "AceTimer-3.0")
--
--- function MyAddon:OnEnable()
+-- function MyAddOn:OnEnable()
-- self:ScheduleTimer("TimerFeedback", 5)
-- end
--
--- function MyAddon:TimerFeedback()
+-- function MyAddOn:TimerFeedback()
-- print("5 seconds passed")
-- end
-function AceTimer:ScheduleTimer(callback, delay, arg)
- return Reg(self, callback, delay, arg)
+function AceTimer:ScheduleTimer(func, delay, argc,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ return new(self, nil, func, delay, argc,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
end
--- Schedule a repeating timer.
-- The timer will fire every `delay` seconds, until canceled.
-- @param callback Callback function for the timer pulse (funcref or method name).
-- @param delay Delay for the timer, in seconds.
--- @param arg An optional argument to be passed to the callback function.
+-- @param argc The numbers of arguments to be passed to the callback function
+-- @param a1,...,a10 The arguments
-- @usage
--- MyAddon = LibStub("AceAddon-3.0"):NewAddon("TimerTest", "AceTimer-3.0")
+-- MyAddOn = LibStub("AceAddon-3.0"):NewAddon("MyAddOn", "AceTimer-3.0")
--
--- function MyAddon:OnEnable()
+-- function MyAddOn:OnEnable()
-- self.timerCount = 0
-- self.testTimer = self:ScheduleRepeatingTimer("TimerFeedback", 5)
-- end
--
--- function MyAddon:TimerFeedback()
+-- function MyAddOn:TimerFeedback()
-- self.timerCount = self.timerCount + 1
-- print(("%d seconds passed"):format(5 * self.timerCount))
-- -- run 30 seconds in total
@@ -297,131 +185,65 @@ end
-- self:CancelTimer(self.testTimer)
-- end
-- end
-function AceTimer:ScheduleRepeatingTimer(callback, delay, arg)
- return Reg(self, callback, delay, arg, true)
+function AceTimer:ScheduleRepeatingTimer(func, delay, argc,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ return new(self, true, func, delay, argc,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
end
---- Cancels a timer with the given handle, registered by the same addon object as used for `:ScheduleTimer`
--- Both one-shot and repeating timers can be canceled with this function, as long as the `handle` is valid
+--- Cancels a timer with the given id, registered by the same addon object as used for `:ScheduleTimer`
+-- Both one-shot and repeating timers can be canceled with this function, as long as the `id` is valid
-- and the timer has not fired yet or was canceled before.
--- @param handle The handle of the timer, as returned by `:ScheduleTimer` or `:ScheduleRepeatingTimer`
--- @param silent If true, no error is raised if the timer handle is invalid (expired or already canceled)
--- @return True if the timer was successfully cancelled.
-function AceTimer:CancelTimer(handle, silent)
- if not handle then return end -- nil handle -> bail out without erroring
- if type(handle) ~= "string" then
- error(MAJOR..": CancelTimer(handle): 'handle' - expected a string", 2) -- for now, anyway
- end
- local selftimers = AceTimer.selfs[self]
- local timer = selftimers and selftimers[handle]
- if silent then
- if timer then
- timer.callback = nil -- don't run it again
- timer.delay = nil -- if this is the currently-executing one: don't even reschedule
- -- The timer object is removed in the OnUpdate loop
- end
- return not not timer -- might return "true" even if we double-cancel. we'll live.
+-- @param id The id of the timer, as returned by `:ScheduleTimer` or `:ScheduleRepeatingTimer`
+function AceTimer:CancelTimer(id)
+ local timer = activeTimers[id]
+
+ if not timer then
+ return false
else
- if not timer then
- geterrorhandler()(MAJOR..": CancelTimer(handle[, silent]): '"..tostring(handle).."' - no such timer registered")
- return false
- end
- if not timer.callback then
- geterrorhandler()(MAJOR..": CancelTimer(handle[, silent]): '"..tostring(handle).."' - timer already cancelled or expired")
- return false
- end
- timer.callback = nil -- don't run it again
- timer.delay = nil -- if this is the currently-executing one: don't even reschedule
+ -- Ace3v: the timer will always be collected in the next update but not here
+ -- this is necessary for AceBucket to determinate if the bucket has been unregistered
+ -- in the callback
+ timer.status = nil
+ activeTimers[id] = nil
return true
end
end
--- Cancels all timers registered to the current addon object ('self')
function AceTimer:CancelAllTimers()
- if not(type(self) == "string" or type(self) == "table") then
- error(MAJOR..": CancelAllTimers(): 'self' - must be a string or a table",2)
+ if type(self) ~= "table" then
+ error(MAJOR..": CancelAllTimers(): 'self' - must be a table",2)
end
if self == AceTimer then
error(MAJOR..": CancelAllTimers(): supply a meaningful 'self'", 2)
end
- local selftimers = AceTimer.selfs[self]
- if selftimers then
- for handle,v in pairs(selftimers) do
- if type(v) == "table" then -- avoid __ops, etc
- AceTimer.CancelTimer(self, handle, true)
- end
+ for k,v in pairs(activeTimers) do
+ if v.object == self then
+ AceTimer.CancelTimer(self, k)
end
end
end
---- Returns the time left for a timer with the given handle, registered by the current addon object ('self').
--- This function will raise a warning when the handle is invalid, but not stop execution.
--- @param handle The handle of the timer, as returned by `:ScheduleTimer` or `:ScheduleRepeatingTimer`
--- @return The time left on the timer, or false if the handle is invalid.
-function AceTimer:TimeLeft(handle)
- if not handle then return end
- if type(handle) ~= "string" then
- error(MAJOR..": TimeLeft(handle): 'handle' - expected a string", 2) -- for now, anyway
- end
- local selftimers = AceTimer.selfs[self]
- local timer = selftimers and selftimers[handle]
+--- Returns the time left for a timer with the given id, registered by the current addon object ('self').
+-- This function will return 0 when the id is invalid.
+-- @param id The id of the timer, as returned by `:ScheduleTimer` or `:ScheduleRepeatingTimer`
+-- @return The time left on the timer.
+function AceTimer:TimeLeft(id)
+ local timer = activeTimers[id]
if not timer then
- geterrorhandler()(MAJOR..": TimeLeft(handle): '"..tostring(handle).."' - no such timer registered")
- return false
+ return 0
+ else
+ return timer.ends - GetTime()
end
- return timer.when - GetTime()
end
-
--- ---------------------------------------------------------------------
--- PLAYER_REGEN_ENABLED: Run through our .selfs[] array step by step
--- and clean it out - otherwise the table indices can grow indefinitely
--- if an addon starts and stops a lot of timers. AceBucket does this!
---
--- See ACE-94 and tests/AceTimer-3.0-ACE-94.lua
-
-local lastCleaned = nil
-
-local function OnEvent()
- if event~="PLAYER_REGEN_ENABLED" then
- return
+function AceTimer:TimerStatus(id)
+ local timer = activeTimers[id]
+ if not timer then
+ return nil
+ else
+ return timer.status
end
-
- -- Get the next 'self' to process
- local selfs = AceTimer.selfs
- local self = next(selfs, lastCleaned)
- if not self then
- self = next(selfs)
- end
- lastCleaned = self
- if not self then -- should only happen if .selfs[] is empty
- return
- end
-
- -- Time to clean it out?
- local list = selfs[self]
- if (list.__ops or 0) < 250 then -- 250 slosh indices = ~10KB wasted (worst case!). For one 'self'.
- return
- end
-
- -- Create a new table and copy all members over
- local newlist = {}
- local n=0
- for k,v in pairs(list) do
- newlist[k] = v
- if type(v)=="table" and v.callback then -- if the timer is actually live: count it
- n=n+1
- end
- end
- newlist.__ops = 0 -- Reset operation count
-
- -- And since we now have a count of the number of live timers, check that it's reasonable. Emit a warning if not.
- if n>BUCKETS then
- DEFAULT_CHAT_FRAME:AddMessage(MAJOR..": Warning: The addon/module '"..tostring(self).."' has "..n.." live timers. Surely that's not intended?")
- end
-
- selfs[self] = newlist
end
-- ---------------------------------------------------------------------
@@ -443,32 +265,115 @@ function AceTimer:Embed(target)
return target
end
--- AceTimer:OnEmbedDisable( target )
+-- AceTimer:OnEmbedDisable(target)
-- target (object) - target object that AceTimer is embedded in.
--
-- cancel all timers registered for the object
-function AceTimer:OnEmbedDisable( target )
+function AceTimer:OnEmbedDisable(target)
target:CancelAllTimers()
end
-
for addon in pairs(AceTimer.embeds) do
AceTimer:Embed(addon)
end
--- ---------------------------------------------------------------------
--- Debug tools (expose copies of internals to test suites)
-AceTimer.debug = AceTimer.debug or {}
-AceTimer.debug.HZ = HZ
-AceTimer.debug.BUCKETS = BUCKETS
+-- --------------------------------------------------------------------
+-- OnUpdate handler
+--
+-- traverse buckets, always chasing "now", and fire timers that have expired
+local lastint = floor(GetTime() * HZ)
+local function OnUpdate()
+ local now = GetTime()
+ local nowint = floor(now * HZ)
--- ---------------------------------------------------------------------
--- Finishing touchups
+ -- Have we passed into a new hash bucket?
+ if nowint == lastint then return end
-AceTimer.frame:SetScript("OnUpdate", OnUpdate)
-AceTimer.frame:SetScript("OnEvent", OnEvent)
-AceTimer.frame:RegisterEvent("PLAYER_REGEN_ENABLED")
+ local soon = now + 1 -- +1 is safe as long as 1 < HZ < BUCKETS/2
--- In theory, we could hide&show the frame based on there being timers or not.
--- However, this job is fairly expensive, and the chance that there will
--- actually be zero timers running is diminuitive to say the least.
\ No newline at end of file
+ -- Pass through each bucket at most once
+ -- Happens on e.g. instance loads, but COULD happen on high local load situations also
+ for curint = (max(lastint, nowint-BUCKETS) + 1), nowint do -- loop until we catch up with "now", usually only 1 iteratio
+ local curbucket = mod(curint,BUCKETS) + 1 -- Ace3v: both int so no floor here
+ -- Yank the list of timers out of the bucket and empty it. This allows reinsertion in the currently-processed bucket from callbacks.
+ local nexttimer = hash[curbucket]
+ hash[curbucket] = false -- false rather than nil to prevent the array from becoming a hash
+
+ while nexttimer do
+ local timer = nexttimer
+ nexttimer = timer.next
+ local status = timer.status
+ if not status then
+ del(timer)
+ else
+ local ends = timer.ends
+ if (status == "loop" or status == "once") and ends < soon then
+ local object = timer.object
+ local callback = timer.func
+ if type(callback) == "string" then
+ callback = (type(object) == "table") and object[callback]
+ if type(callback) == "function" then
+ safecall(callback, timer.argsCount+1, object,
+ timer[1], timer[2], timer[3], timer[4], timer[5],
+ timer[6], timer[7], timer[8], timer[9], timer[10])
+ else
+ status = "once"
+ end
+ elseif type(callback) == "function" then
+ safecall(callback, timer.argsCount,
+ timer[1], timer[2], timer[3], timer[4], timer[5],
+ timer[6], timer[7], timer[8], timer[9], timer[10])
+ else
+ -- probably nilled out by CancelTimer
+ status = "once" -- don't reschedule it
+ end
+
+ if status == "once" then
+ del(timer)
+ else
+ local delay = timer.delay
+ local newends = ends + delay
+ if newends < now then -- Keep lag from making us firing a timer unnecessarily. (Note that this still won't catch too-short-delay timers though.)
+ newends = now + delay
+ end
+ timer.ends = newends
+ -- add next timer execution to the correct bucket
+ local bucket = floor(mod(newends*HZ,BUCKETS)) + 1
+ timer.next = hash[bucket]
+ hash[bucket] = timer
+ end
+ else
+ -- reinsert (yeah, somewhat expensive, but shouldn't be happening too often either due to hash distribution)
+ timer.next = hash[curbucket]
+ hash[curbucket] = timer
+ end
+ end
+ end
+ end
+
+ lastint = nowint
+end
+
+local lastchecked = nil
+local function OnEvent()
+ if event ~= "PLAYER_REGEN_ENABLED" then return end
+
+ local addon = next(counter, lastchecked)
+ if not addon then
+ addon = next(counter)
+ end
+ lastchecked = addon
+ if not addon then -- should only happen if counter is empty
+ return
+ end
+
+ local n = counter[addon]
+ if n > BUCKETS then
+ DEFAULT_CHAT_FRAME:AddMessage(MAJOR..": Warning: The addon/module '"..tostring(addon).."' has "..tostring(n).." live timers. Surely that's not intended?")
+ end
+end
+
+timerFrame:SetScript("OnUpdate", OnUpdate)
+timerFrame:SetScript("OnEvent", OnEvent)
+timerFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
+timerFrame:Hide()
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/Load_Libraries.xml b/2/3/4/5/6/7/ElvUI/Libraries/Load_Libraries.xml
index d547024..911f35d 100644
--- a/2/3/4/5/6/7/ElvUI/Libraries/Load_Libraries.xml
+++ b/2/3/4/5/6/7/ElvUI/Libraries/Load_Libraries.xml
@@ -15,6 +15,7 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/happinessindicator.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/happinessindicator.lua
new file mode 100644
index 0000000..80e5f81
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/happinessindicator.lua
@@ -0,0 +1,116 @@
+--[[
+# Element: HappinessIndicator
+
+Handles the visibility and updating of player pet happiness.
+
+## Widget
+
+HappinessIndicator - A `Texture` used to display the current happiness level.
+The element works by changing the texture's vertex color.
+
+## Notes
+
+A default texture will be applied if the widget is a Texture and doesn't have a texture or a color set.
+
+## Examples
+
+ -- Position and size
+ local HappinessIndicator = self:CreateTexture(nil, 'OVERLAY')
+ HappinessIndicator:SetSize(16, 16)
+ HappinessIndicator:SetPoint('TOPRIGHT', self)
+
+ -- Register it with oUF
+ self.HappinessIndicator = HappinessIndicator
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local GetPetHappiness = GetPetHappiness
+local HasPetUI = HasPetUI
+
+local function Update(self, event, unit)
+ if(not unit or self.unit ~= unit) then return end
+
+ local element = self.HappinessIndicator
+
+ --[[ Callback: HappinessIndicator:PreUpdate()
+ Called before the element has been updated.
+
+ * self - the ComboPoints element
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate()
+ end
+
+ local _, hunterPet = HasPetUI()
+ local happiness, damagePercentage = GetPetHappiness()
+
+ if(hunterPet and happiness) then
+ if(happiness == 1) then
+ element:SetTexCoord(0.375, 0.5625, 0, 0.359375)
+ elseif(happiness == 2) then
+ element:SetTexCoord(0.1875, 0.375, 0, 0.359375)
+ elseif(happiness == 3) then
+ element:SetTexCoord(0, 0.1875, 0, 0.359375)
+ end
+
+ element:Show()
+ else
+ return element:Hide()
+ end
+
+ --[[ Callback: HappinessIndicator:PostUpdate(role)
+ Called after the element has been updated.
+
+ * self - the ComboPoints element
+ * unit - the unit for which the update has been triggered (string)
+ * happiness - the numerical happiness value of the pet (1 = unhappy, 2 = content, 3 = happy) (number)
+ * damagePercentage - damage modifier, happiness affects this (unhappy = 75%, content = 100%, happy = 125%) (number)
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(unit, happiness, damagePercentage)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: HappinessIndicator.Override(self, event, ...)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ * ... - the arguments accompanying the event
+ --]]
+ return (self.HappinessIndicator.Override or Update) (self, ...)
+end
+
+local function ForceUpdate(element)
+ return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
+end
+
+local function Enable(self)
+ local element = self.HappinessIndicator
+ if(element) then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+
+ self:RegisterEvent('UNIT_HAPPINESS', Path)
+
+ if(element:IsObjectType('Texture') and not element:GetTexture()) then
+ element:SetTexture([[Interface\PetPaperDollFrame\UI-PetHappiness]])
+ end
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.HappinessIndicator
+ if(element) then
+ element:Hide()
+
+ self:UnregisterEvent('UNIT_HAPPINESS', Path)
+ end
+end
+
+oUF:AddElement('HappinessIndicator', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/health.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/health.lua
new file mode 100644
index 0000000..6a9d705
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/health.lua
@@ -0,0 +1,292 @@
+--[[
+# Element: Health Bar
+
+Handles the updating of a status bar that displays the unit's health.
+
+## Widget
+
+Health - A `StatusBar` used to represent the unit's health.
+
+## Sub-Widgets
+
+.bg - A `Texture` used as a background. It will inherit the color of the main StatusBar.
+
+## Notes
+
+A default texture will be applied if the widget is a StatusBar and doesn't have a texture set.
+
+## Options
+
+.frequentUpdates - Indicates whether to use OnUpdate script instead of UNIT_HEALTH to update the bar (boolean)
+.smoothGradient - 9 color values to be used with the .colorSmooth option (table)
+
+The following options are listed by priority. The first check that returns true decides the color of the bar.
+
+.colorTapping - Use `self.colors.tapping` to color the bar if the unit isn't tapped by the player (boolean)
+.colorDisconnected - Use `self.colors.disconnected` to color the bar if the unit is offline (boolean)
+.colorHappiness - Use `self.colors.happiness` to color the bar if the unit is pet based on pet happiness (boolean)
+.colorClass - Use `self.colors.class[class]` to color the bar based on unit class. `class` is defined by the
+ second return of [UnitClass](http://wowprogramming.com/docs/api/UnitClass) (boolean)
+.colorClassNPC - Use `self.colors.class[class]` to color the bar if the unit is a NPC (boolean)
+.colorClassPet - Use `self.colors.class[class]` to color the bar if the unit is player controlled, but not a player
+ (boolean)
+.colorReaction - Use `self.colors.reaction[reaction]` to color the bar based on the player's reaction towards the
+ unit. `reaction` is defined by the return value of
+ [UnitReaction](http://wowprogramming.com/docs/api/UnitReaction) (boolean)
+.colorSmooth - Use `smoothGradient` if present or `self.colors.smooth` to color the bar with a smooth gradient
+ based on the player's current health percentage (boolean)
+.colorHealth - Use `self.colors.health` to color the bar. This flag is used to reset the bar color back to default
+ if none of the above conditions are met (boolean)
+
+## Sub-Widgets Options
+
+.multiplier - Used to tint the background based on the main widgets R, G and B values. Defaults to 1 (number)[0-1]
+
+## Attributes
+
+.disconnected - Indicates whether the unit is disconnected (boolean)
+
+## Examples
+
+ -- Position and size
+ local Health = CreateFrame('StatusBar', nil, self)
+ Health:SetHeight(20)
+ Health:SetPoint('TOP')
+ Health:SetPoint('LEFT')
+ Health:SetPoint('RIGHT')
+
+ -- Add a background
+ local Background = Health:CreateTexture(nil, 'BACKGROUND')
+ Background:SetAllPoints(Health)
+ Background:SetTexture(1, 1, 1, .5)
+
+ -- Options
+ Health.frequentUpdates = true
+ Health.colorTapping = true
+ Health.colorDisconnected = true
+ Health.colorClass = true
+ Health.colorReaction = true
+ Health.colorHealth = true
+
+ -- Make the background darker.
+ Background.multiplier = .5
+
+ -- Register it with oUF
+ Health.bg = Background
+ self.Health = Health
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local unpack = unpack
+
+local GetPetHappiness = GetPetHappiness
+local UnitClass = UnitClass
+local UnitHealth = UnitHealth
+local UnitHealthMax = UnitHealthMax
+local UnitIsConnected = UnitIsConnected
+local UnitIsPlayer = UnitIsPlayer
+local UnitIsTapped = UnitIsTapped
+local UnitIsTappedByPlayer = UnitIsTappedByPlayer
+local UnitIsUnit = UnitIsUnit
+local UnitPlayerControlled = UnitPlayerControlled
+local UnitReaction = UnitReaction
+
+local updateFrequentUpdates
+
+local function UpdateColor(element, unit, cur, max)
+ local parent = element.__owner
+
+ if element.frequentUpdates ~= element.__frequentUpdates then
+ element.__frequentUpdates = element.frequentUpdates
+ updateFrequentUpdates(parent, unit)
+ end
+
+ local r, g, b, t
+ if(element.colorTapping and not UnitPlayerControlled(unit) and (UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit))) then
+ t = parent.colors.tapped
+ elseif(element.colorDisconnected and element.disconnected) then
+ t = parent.colors.disconnected
+ elseif(element.colorHappiness and UnitIsUnit(unit, 'pet') and GetPetHappiness()) then
+ t = parent.colors.happiness[GetPetHappiness()]
+ elseif(element.colorClass and UnitIsPlayer(unit)) or
+ (element.colorClassNPC and not UnitIsPlayer(unit)) or
+ (element.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then
+ local _, class = UnitClass(unit)
+ t = parent.colors.class[class]
+ elseif(element.colorReaction and UnitReaction(unit, 'player')) then
+ t = parent.colors.reaction[UnitReaction(unit, 'player')]
+ elseif(element.colorSmooth) then
+ r, g, b = parent.ColorGradient(cur, max, unpack(element.smoothGradient or parent.colors.smooth))
+ elseif(element.colorHealth) then
+ t = parent.colors.health
+ end
+
+ if(t) then
+ r, g, b = t[1], t[2], t[3]
+ end
+
+ if(r or g or b) then
+ element:SetStatusBarColor(r, g, b)
+
+ local bg = element.bg
+ if(bg) then
+ local mu = bg.multiplier or 1
+ bg:SetVertexColor(r * mu, g * mu, b * mu)
+ end
+ end
+end
+
+local function Update(self, event, unit)
+ if(not unit or self.unit ~= unit) then return end
+ local element = self.Health
+
+ --[[ Callback: Health:PreUpdate(unit)
+ Called before the element has been updated.
+
+ * self - the Health element
+ * unit - the unit for which the update has been triggered (string)
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate(unit)
+ end
+
+ local cur, max = UnitHealth(unit), UnitHealthMax(unit)
+ local disconnected = not UnitIsConnected(unit)
+ element:SetMinMaxValues(0, max)
+
+ if(disconnected) then
+ element:SetValue(max)
+ else
+ element:SetValue(cur)
+ end
+
+ element.disconnected = disconnected
+
+ --[[ Override: Health:UpdateColor(unit, cur, max)
+ Used to completely override the internal function for updating the widgets' colors.
+
+ * self - the Health element
+ * unit - the unit for which the update has been triggered (string)
+ * cur - the unit's current health value (number)
+ * max - the unit's maximum possible health value (number)
+ --]]
+ element:UpdateColor(unit, cur, max)
+
+ --[[ Callback: Health:PostUpdate(unit, cur, max)
+ Called after the element has been updated.
+
+ * self - the Health element
+ * unit - the unit for which the update has been triggered (string)
+ * cur - the unit's current health value (number)
+ * max - the unit's maximum possible health value (number)
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(unit, cur, max)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: Health.Override(self, event, unit)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ * unit - the unit accompanying the event (string)
+ --]]
+ return (self.Health.Override or Update) (self, unpack(arg))
+end
+
+local function ForceUpdate(element)
+ return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
+end
+
+local function onHealthUpdate()
+ if(this.disconnected) then return end
+
+ local unit = this.__owner.unit
+ local health = UnitHealth(unit)
+
+ if(health ~= this.min) then
+ this.min = health
+
+ return Path(this.__owner, 'OnHealthUpdate', unit)
+ end
+end
+
+function updateFrequentUpdates(self, unit)
+ if(not unit or string.match(unit, '%w+target$')) then return end
+
+ local element = self.Health
+ if(element.frequentUpdates and not element:GetScript('OnUpdate')) then
+ element:SetScript('OnUpdate', onHealthUpdate)
+
+ if((unit == 'party' or string.match(unit, 'party%d?$'))) then
+ self:RegisterEvent('UNIT_HEALTH', Path)
+ elseif(self:IsEventRegistered("UNIT_HEALTH")) then
+ self:UnregisterEvent('UNIT_HEALTH', Path)
+ end
+ elseif(not element.frequentUpdates and element:GetScript('OnUpdate')) then
+ element:SetScript('OnUpdate', nil)
+
+ self:RegisterEvent('UNIT_HEALTH', Path)
+ end
+end
+
+local function Enable(self, unit)
+ local element = self.Health
+ if(element) then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+ element.__frequentUpdates = element.frequentUpdates
+ updateFrequentUpdates(self, unit)
+
+ if(element.frequentUpdates and (unit and not string.match(unit, '%w+target$'))) then
+ element:SetScript('OnUpdate', onHealthUpdate)
+
+ -- The party frames need this to handle disconnect states correctly.
+ if(unit == 'party') then
+ self:RegisterEvent('UNIT_HEALTH', Path)
+ end
+ else
+ self:RegisterEvent('UNIT_HEALTH', Path)
+ end
+
+ self:RegisterEvent('UNIT_MAXHEALTH', Path)
+ self:RegisterEvent('UNIT_CONNECTION', Path)
+ self:RegisterEvent('UNIT_FACTION', Path) -- For tapping
+ self:RegisterEvent('UNIT_HAPPINESS', Path)
+
+ if(element:IsObjectType('StatusBar') and not element:GetStatusBarTexture()) then
+ element:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]])
+ end
+
+ if(not element.UpdateColor) then
+ element.UpdateColor = UpdateColor
+ end
+
+ element:Show()
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.Health
+ if(element) then
+ if(element:GetScript('OnUpdate')) then
+ element:SetScript('OnUpdate', nil)
+ end
+
+ element:Hide()
+
+ self:UnregisterEvent('UNIT_HEALTH', Path)
+ self:UnregisterEvent('UNIT_MAXHEALTH', Path)
+ self:UnregisterEvent('UNIT_CONNECTION', Path)
+ self:UnregisterEvent('UNIT_FACTION', Path)
+ self:UnregisterEvent('UNIT_HAPPINESS', Path)
+ end
+end
+
+oUF:AddElement('Health', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/leaderindicator.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/leaderindicator.lua
new file mode 100644
index 0000000..7cc2878
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/leaderindicator.lua
@@ -0,0 +1,107 @@
+--[[
+# Element: Leader Indicator
+
+Toggles the visibility of an indicator based on the unit's leader status.
+
+## Widget
+
+LeaderIndicator - Any UI widget.
+
+## Notes
+
+A default texture will be applied if the widget is a Texture and doesn't have a texture or a color set.
+
+## Examples
+
+ -- Position and size
+ local LeaderIndicator = self:CreateTexture(nil, 'OVERLAY')
+ LeaderIndicator:SetSize(16, 16)
+ LeaderIndicator:SetPoint('BOTTOM', self, 'TOP')
+
+ -- Register it with oUF
+ self.LeaderIndicator = LeaderIndicator
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local UnitInParty = UnitInParty
+local UnitInRaid = UnitInRaid
+local UnitIsPartyLeader = UnitIsPartyLeader
+
+local function Update(self, event)
+ local element = self.LeaderIndicator
+
+ --[[ Callback: LeaderIndicator:PreUpdate()
+ Called before the element has been updated.
+
+ * self - the LeaderIndicator element
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate()
+ end
+
+ local unit = self.unit
+ local isLeader = (UnitInParty(unit) or UnitInRaid(unit)) and UnitIsPartyLeader(unit)
+ if(isLeader) then
+ element:Show()
+ else
+ element:Hide()
+ end
+
+ --[[ Callback: LeaderIndicator:PostUpdate(isLeader)
+ Called after the element has been updated.
+
+ * self - the LeaderIndicator element
+ * isLeader - indicates whether the element is shown (boolean)
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(isLeader)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: LeaderIndicator.Override(self, event, ...)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ * ... - the arguments accompanying the event
+ --]]
+ return (self.LeaderIndicator.Override or Update) (self, ...)
+end
+
+local function ForceUpdate(element)
+ return Path(element.__owner, 'ForceUpdate')
+end
+
+local function Enable(self)
+ local element = self.LeaderIndicator
+ if(element) then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+
+ self:RegisterEvent('PARTY_LEADER_CHANGED', Path)
+ self:RegisterEvent('PARTY_MEMBERS_CHANGED', Path)
+ self:RegisterEvent('RAID_ROSTER_UPDATE', Path)
+
+ if(element:IsObjectType('Texture') and not element:GetTexture()) then
+ element:SetTexture([[Interface\GroupFrame\UI-Group-LeaderIcon]])
+ end
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.LeaderIndicator
+ if(element) then
+ element:Hide()
+
+ self:UnregisterEvent('PARTY_LEADER_CHANGED', Path)
+ self:UnregisterEvent('PARTY_MEMBERS_CHANGED', Path)
+ self:UnregisterEvent('RAID_ROSTER_UPDATE', Path)
+ end
+end
+
+oUF:AddElement('LeaderIndicator', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/masterlooterindicator.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/masterlooterindicator.lua
new file mode 100644
index 0000000..86d2c54
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/masterlooterindicator.lua
@@ -0,0 +1,126 @@
+--[[
+# Element: Master Looter Indicator
+
+Toggles the visibility of an indicator based on the unit's master looter status.
+
+## Widget
+
+MasterLooterIndicator - Any UI widget.
+
+## Notes
+
+A default texture will be applied if the widget is a Texture and doesn't have a texture or a color set.
+
+## Examples
+
+ -- Position and size
+ local MasterLooterIndicator = self:CreateTexture(nil, 'OVERLAY')
+ MasterLooterIndicator:SetSize(16, 16)
+ MasterLooterIndicator:SetPoint('TOPRIGHT', self)
+
+ -- Register it with oUF
+ self.MasterLooterIndicator = MasterLooterIndicator
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local GetLootMethod = GetLootMethod
+local UnitInParty = UnitInParty
+local UnitInRaid = UnitInRaid
+local UnitIsUnit = UnitIsUnit
+
+local function Update(self, event)
+ local unit = self.unit
+ local element = self.MasterLooterIndicator
+
+ --[[ Callback: MasterLooterIndicator:PreUpdate()
+ Called before the element has been updated.
+
+ * self - the MasterLooterIndicator element
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate()
+ end
+
+ local isShown = false
+ if(UnitInParty(unit) or UnitInRaid(unit)) then
+ local method, partyIndex, raidIndex = GetLootMethod()
+ if(method == 'master') then
+ local mlUnit
+ if(partyIndex) then
+ if(partyIndex == 0) then
+ mlUnit = 'player'
+ else
+ mlUnit = 'party' .. partyIndex
+ end
+ elseif(raidIndex) then
+ mlUnit = 'raid' .. raidIndex
+ end
+
+ if(mlUnit and UnitIsUnit(unit, mlUnit)) then
+ isShown = true
+ end
+ end
+ end
+
+ if isShown then
+ element:Show()
+ else
+ element:Hide()
+ end
+
+ --[[ Callback: MasterLooterIndicator:PostUpdate(isShown)
+ Called after the element has been updated.
+
+ * self - the MasterLooterIndicator element
+ * isShown - indicates whether the element is shown (boolean)
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(isShown)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: MasterLooterIndicator.Override(self, event, ...)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ * ... - the arguments accompanying the event
+ --]]
+ return (self.MasterLooterIndicator.Override or Update) (self, ...)
+end
+
+local function ForceUpdate(element)
+ return Path(element.__owner, 'ForceUpdate')
+end
+
+local function Enable(self, unit)
+ local element = self.MasterLooterIndicator
+ if(element) then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+
+ self:RegisterEvent('PARTY_LOOT_METHOD_CHANGED', Path, true)
+ self:RegisterEvent('PARTY_MEMBERS_CHANGED', Path, true)
+
+ if(element:IsObjectType('Texture') and not element:GetTexture()) then
+ element:SetTexture([[Interface\GroupFrame\UI-Group-MasterLooter]])
+ end
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.MasterLooterIndicator
+ if(element) then
+ element:Hide()
+
+ self:UnregisterEvent('PARTY_LOOT_METHOD_CHANGED', Path)
+ self:UnregisterEvent('PARTY_MEMBERS_CHANGED', Path)
+ end
+end
+
+oUF:AddElement('MasterLooterIndicator', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/portrait.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/portrait.lua
new file mode 100644
index 0000000..5416c29
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/portrait.lua
@@ -0,0 +1,148 @@
+--[[
+# Element: Portraits
+
+Handles the updating of the unit's portrait.
+
+## Widget
+
+Portrait - A `PlayerModel` or a `Texture` used to represent the unit's portrait.
+
+## Notes
+
+A question mark model will be used if the widget is a PlayerModel and the client doesn't have the model information for
+the unit.
+
+## Examples
+
+ -- 3D Portrait
+ -- Position and size
+ local Portrait = CreateFrame('PlayerModel', nil, self)
+ Portrait:SetSize(32, 32)
+ Portrait:SetPoint('RIGHT', self, 'LEFT')
+
+ -- Register it with oUF
+ self.Portrait = Portrait
+
+ -- 2D Portrait
+ local Portrait = self:CreateTexture(nil, 'OVERLAY')
+ Portrait:SetSize(32, 32)
+ Portrait:SetPoint('RIGHT', self, 'LEFT')
+
+ -- Register it with oUF
+ self.Portrait = Portrait
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local SetPortraitTexture = SetPortraitTexture
+local UnitExists = UnitExists
+local UnitName = UnitName
+local UnitIsConnected = UnitIsConnected
+local UnitIsUnit = UnitIsUnit
+local UnitIsVisible = UnitIsVisible
+
+local function Update(self, event, unit)
+ if(not unit or not UnitIsUnit(self.unit, unit)) then return end
+
+ local element = self.Portrait
+
+ --[[ Callback: Portrait:PreUpdate(unit)
+ Called before the element has been updated.
+
+ * self - the Portrait element
+ * unit - the unit for which the update has been triggered (string)
+ --]]
+ if(element.PreUpdate) then element:PreUpdate(unit) end
+
+ local name = UnitName(unit)
+ local isAvailable = UnitIsConnected(unit) and UnitIsVisible(unit)
+ if(event ~= 'OnUpdate' or element.name ~= name or element.state ~= isAvailable) then
+ if(element:IsObjectType('PlayerModel')) then
+ if(not isAvailable) then
+ element:SetModelScale(4.25)
+ element:SetCamera(0)
+ element:SetPosition(0, 0, -1.5)
+ element:SetModel([[Interface\Buttons\TalkToMeQuestionMark.m2]])
+ elseif(element.name ~= name or event == 'UNIT_MODEL_CHANGED') then
+ element:ClearModel()
+ element:SetUnit(unit)
+ element:SetModelScale(1)
+ element:SetCamera(0)
+ element:SetPosition(0, 0, 0)
+ else
+ element:SetCamera(0)
+ end
+ else
+ SetPortraitTexture(element, unit)
+ end
+
+ element.name = name
+ element.state = isAvailable
+ end
+
+ --[[ Callback: Portrait:PostUpdate(unit)
+ Called after the element has been updated.
+
+ * self - the Portrait element
+ * unit - the unit for which the update has been triggered (string)
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(unit)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: Portrait.Override(self, event, unit)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ * unit - the unit accompanying the event (string)
+ --]]
+ return (self.Portrait.Override or Update) (self, unpack(arg))
+end
+
+local function ForceUpdate(element)
+ return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
+end
+
+local function Enable(self, unit)
+ local element = self.Portrait
+ if(element) then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+
+ self:RegisterEvent('UNIT_PORTRAIT_UPDATE', Path)
+ self:RegisterEvent('UNIT_MODEL_CHANGED', Path)
+ self:RegisterEvent('UNIT_CONNECTION', Path)
+
+ -- The quest log uses PARTY_MEMBER_{ENABLE,DISABLE} to handle updating of
+ -- party members overlapping quests. This will probably be enough to handle
+ -- model updating.
+ --
+ -- DISABLE isn't used as it fires when we most likely don't have the
+ -- information we want.
+ if(unit == 'party') then
+ self:RegisterEvent('PARTY_MEMBER_ENABLE', Path)
+ end
+
+ element:Show()
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.Portrait
+ if(element) then
+ element:Hide()
+
+ self:UnregisterEvent('UNIT_PORTRAIT_UPDATE', Path)
+ self:UnregisterEvent('UNIT_MODEL_CHANGED', Path)
+ self:UnregisterEvent('PARTY_MEMBER_ENABLE', Path)
+ self:UnregisterEvent('UNIT_CONNECTION', Path)
+ end
+end
+
+oUF:AddElement('Portrait', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/power.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/power.lua
new file mode 100644
index 0000000..d9489c0
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/power.lua
@@ -0,0 +1,326 @@
+--[[
+# Element: Power Bar
+
+Handles the updating of a status bar that displays the unit's power.
+
+## Widget
+
+Power - A `StatusBar` used to represent the unit's power.
+
+## Sub-Widgets
+
+.bg - A `Texture` used as a background. It will inherit the color of the main StatusBar.
+
+## Notes
+
+A default texture will be applied if the widget is a StatusBar and doesn't have a texture or a color set.
+
+## Options
+
+.frequentUpdates - Indicates whether to use OnUpdate script instead of UNIT_POWER to update the bar. Only valid for the
+ player and pet units (boolean)
+.smoothGradient - 9 color values to be used with the .colorSmooth option (table)
+
+The following options are listed by priority. The first check that returns true decides the color of the bar.
+
+.colorTapping - Use `self.colors.tapping` to color the bar if the unit isn't tapped by the player (boolean)
+.colorDisconnected - Use `self.colors.disconnected` to color the bar if the unit is offline (boolean)
+.colorHappiness - Use `self.colors.happiness` to color the bar if the unit is pet based on pet happiness (boolean)
+.colorPower - Use `self.colors.power[token]` to color the bar based on the unit's power type. This method will
+ fall-back to `:GetAlternativeColor()` if it can't find a color matching the token. If this function
+ isn't defined, then it will attempt to color based upon the alternative power colors returned by
+ [UnitPowerType](http://wowprogramming.com/docs/api/UnitPowerType). Finally, if these aren't
+ defined, then it will attempt to color the bar based upon `self.colors.power[type]` (boolean)
+.colorClass - Use `self.colors.class[class]` to color the bar based on unit class. `class` is defined by the
+ second return of [UnitClass](http://wowprogramming.com/docs/api/UnitClass) (boolean)
+.colorClassNPC - Use `self.colors.class[class]` to color the bar if the unit is a NPC (boolean)
+.colorClassPet - Use `self.colors.class[class]` to color the bar if the unit is player controlled, but not a player
+ (boolean)
+.colorReaction - Use `self.colors.reaction[reaction]` to color the bar based on the player's reaction towards the
+ unit. `reaction` is defined by the return value of
+ [UnitReaction](http://wowprogramming.com/docs/api/UnitReaction) (boolean)
+.colorSmooth - Use `smoothGradient` if present or `self.colors.smooth` to color the bar with a smooth gradient
+ based on the player's current power percentage (boolean)
+
+## Sub-Widget Options
+
+.multiplier - A multiplier used to tint the background based on the main widgets R, G and B values. Defaults to 1
+ (number)[0-1]
+
+## Attributes
+
+.disconnected - Indicates whether the unit is disconnected (boolean)
+.tapped - Indicates whether the unit is tapped by the player (boolean)
+
+## Examples
+
+ -- Position and size
+ local Power = CreateFrame('StatusBar', nil, self)
+ Power:SetHeight(20)
+ Power:SetPoint('BOTTOM')
+ Power:SetPoint('LEFT')
+ Power:SetPoint('RIGHT')
+
+ -- Add a background
+ local Background = Power:CreateTexture(nil, 'BACKGROUND')
+ Background:SetAllPoints(Power)
+ Background:SetTexture(1, 1, 1, .5)
+
+ -- Options
+ Power.frequentUpdates = true
+ Power.colorTapping = true
+ Power.colorDisconnected = true
+ Power.colorPower = true
+ Power.colorClass = true
+ Power.colorReaction = true
+
+ -- Make the background darker.
+ Background.multiplier = .5
+
+ -- Register it with oUF
+ Power.bg = Background
+ self.Power = Power
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local unpack = unpack
+
+local GetPetHappiness = GetPetHappiness
+local UnitClass = UnitClass
+local UnitIsConnected = UnitIsConnected
+local UnitIsPlayer = UnitIsPlayer
+local UnitIsTapped = UnitIsTapped
+local UnitIsTappedByPlayer = UnitIsTappedByPlayer
+local UnitIsUnit = UnitIsUnit
+local UnitMana = UnitMana
+local UnitManaMax = UnitManaMax
+local UnitPlayerControlled = UnitPlayerControlled
+local UnitPowerType = UnitPowerType
+local UnitReaction = UnitReaction
+
+local updateFrequentUpdates
+
+local function UpdateColor(element, unit, cur, min, max)
+ local parent = element.__owner
+
+ if element.frequentUpdates ~= element.__frequentUpdates then
+ element.__frequentUpdates = element.frequentUpdates
+ updateFrequentUpdates(element, unit)
+ end
+
+ local ptype = UnitPowerType(unit)
+ local r, g, b, t
+ if(element.colorTapping and element.tapped) then
+ t = parent.colors.tapped
+ elseif(element.colorDisconnected and element.disconnected) then
+ t = parent.colors.disconnected
+ elseif(element.colorHappiness and UnitIsUnit(unit, 'pet') and GetPetHappiness()) then
+ t = parent.colors.happiness[GetPetHappiness()]
+ elseif(element.colorPower) then
+ t = parent.colors.power[ptype]
+ elseif(element.colorClass and UnitIsPlayer(unit)) or
+ (element.colorClassNPC and not UnitIsPlayer(unit)) or
+ (element.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then
+ local _, class = UnitClass(unit)
+ t = parent.colors.class[class]
+ elseif(element.colorReaction and UnitReaction(unit, 'player')) then
+ t = parent.colors.reaction[UnitReaction(unit, 'player')]
+ elseif(element.colorSmooth) then
+ local adjust = 0 - (min or 0)
+ r, g, b = parent.ColorGradient(cur + adjust, max + adjust, unpack(element.smoothGradient or parent.colors.smooth))
+ end
+
+ if(t) then
+ r, g, b = t[1], t[2], t[3]
+ end
+
+ t = parent.colors.power[ptype]
+
+ element:SetStatusBarTexture(element.texture)
+
+ if(r or g or b) then
+ element:SetStatusBarColor(r, g, b)
+ end
+
+ local bg = element.bg
+ if(bg and b) then
+ local mu = bg.multiplier or 1
+ bg:SetVertexColor(r * mu, g * mu, b * mu)
+ end
+end
+
+local function Update(self, event, unit)
+ if(self.unit ~= unit) then return end
+ local element = self.Power
+
+ --[[ Callback: Power:PreUpdate(unit)
+ Called before the element has been updated.
+
+ * self - the Power element
+ * unit - the unit for which the update has been triggered (string)
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate(unit)
+ end
+
+ local cur, max = UnitMana(unit), UnitManaMax(unit)
+ local disconnected = not UnitIsConnected(unit)
+ local tapped = not UnitPlayerControlled(unit) and (UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit))
+ element:SetMinMaxValues(0, max)
+
+ if(disconnected) then
+ element:SetValue(max)
+ else
+ element:SetValue(cur)
+ end
+
+ element.disconnected = disconnected
+ element.tapped = tapped
+
+ --[[ Override: Power:UpdateColor(unit, cur, max)
+ Used to completely override the internal function for updating the widget's colors.
+
+ * self - the Power element
+ * unit - the unit for which the update has been triggered (string)
+ * cur - the unit's current power value (number)
+ * max - the unit's maximum possible power value (number)
+ --]]
+ element:UpdateColor(unit, cur, max)
+
+ --[[ Callback: Power:PostUpdate(unit, cur, max)
+ Called after the element has been updated.
+
+ * self - the Power element
+ * unit - the unit for which the update has been triggered (string)
+ * cur - the unit's current power value (number)
+ * max - the unit's maximum possible power value (number)
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(unit, cur, max)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: Power.Override(self, event, unit, ...)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ * unit - the unit accompanying the event (string)
+ * ... - the arguments accompanying the event
+ --]]
+ return (self.Power.Override or Update) (self, unpack(arg))
+end
+
+local function ForceUpdate(element)
+ return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
+end
+
+local function onPowerUpdate()
+ if(this.disconnected) then return end
+
+ local unit = this.__owner.unit
+ local power = UnitMana(unit)
+
+ if(power ~= this.min) then
+ this.min = power
+
+ return Path(this.__owner, 'OnPowerUpdate', unit)
+ end
+end
+
+function updateFrequentUpdates(self, unit)
+ if(not unit or (unit ~= 'player' and unit ~= 'pet')) then return end
+
+ local element = self.Power
+ if(element.frequentUpdates and not element:GetScript('OnUpdate')) then
+ element:SetScript('OnUpdate', onPowerUpdate)
+
+ self:UnregisterEvent('UNIT_MANA', Path)
+ self:UnregisterEvent('UNIT_RAGE', Path)
+ self:UnregisterEvent('UNIT_FOCUS', Path)
+ self:UnregisterEvent('UNIT_ENERGY', Path)
+ elseif(not element.frequentUpdates and element:GetScript('OnUpdate')) then
+ element:SetScript('OnUpdate', nil)
+
+ self:RegisterEvent('UNIT_MANA', Path)
+ self:RegisterEvent('UNIT_RAGE', Path)
+ self:RegisterEvent('UNIT_FOCUS', Path)
+ self:RegisterEvent('UNIT_ENERGY', Path)
+ end
+end
+
+local function Enable(self, unit)
+ local element = self.Power
+ if(element) then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+ element.__frequentUpdates = element.frequentUpdates
+ updateFrequentUpdates(self, unit)
+
+ if(element.frequentUpdates and (unit == 'player' or unit == 'pet')) then
+ element:SetScript('OnUpdate', onPowerUpdate)
+ else
+ self:RegisterEvent('UNIT_MANA', Path)
+ self:RegisterEvent('UNIT_RAGE', Path)
+ self:RegisterEvent('UNIT_FOCUS', Path)
+ self:RegisterEvent('UNIT_ENERGY', Path)
+ end
+
+ self:RegisterEvent('UNIT_MAXMANA', Path)
+ self:RegisterEvent('UNIT_MAXRAGE', Path)
+ self:RegisterEvent('UNIT_MAXFOCUS', Path)
+ self:RegisterEvent('UNIT_MAXENERGY', Path)
+ self:RegisterEvent('UNIT_MAXRUNIC_POWER', Path)
+ self:RegisterEvent('UNIT_DISPLAYPOWER', Path)
+
+ self:RegisterEvent('UNIT_CONNECTION', Path)
+ self:RegisterEvent('UNIT_HAPPINESS', Path)
+ self:RegisterEvent('UNIT_FACTION', Path) -- For tapping
+
+ if(element:IsObjectType('StatusBar')) then
+ element.texture = element:GetStatusBarTexture() and element:GetStatusBarTexture():GetTexture() or [[Interface\TargetingFrame\UI-StatusBar]]
+ element:SetStatusBarTexture(element.texture)
+ end
+
+ if(not element.UpdateColor) then
+ element.UpdateColor = UpdateColor
+ end
+
+ element:Show()
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.Power
+ if(element) then
+ element:Hide()
+
+ if(element:GetScript('OnUpdate')) then
+ element:SetScript('OnUpdate', nil)
+ else
+ self:UnregisterEvent('UNIT_MANA', Path)
+ self:UnregisterEvent('UNIT_RAGE', Path)
+ self:UnregisterEvent('UNIT_FOCUS', Path)
+ self:UnregisterEvent('UNIT_ENERGY', Path)
+ self:UnregisterEvent('UNIT_RUNIC_POWER', Path)
+ end
+
+ self:UnregisterEvent('UNIT_MAXMANA', Path)
+ self:UnregisterEvent('UNIT_MAXRAGE', Path)
+ self:UnregisterEvent('UNIT_MAXFOCUS', Path)
+ self:UnregisterEvent('UNIT_MAXENERGY', Path)
+ self:UnregisterEvent('UNIT_MAXRUNIC_POWER', Path)
+ self:UnregisterEvent('UNIT_DISPLAYPOWER', Path)
+
+ self:UnregisterEvent('UNIT_CONNECTION', Path)
+ self:UnregisterEvent('UNIT_HAPPINESS', Path)
+ self:UnregisterEvent('UNIT_FACTION', Path)
+ end
+end
+
+oUF:AddElement('Power', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/pvpindicator.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/pvpindicator.lua
new file mode 100644
index 0000000..3d8c436
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/pvpindicator.lua
@@ -0,0 +1,118 @@
+--[[
+# Element: PvP Icon
+
+Handles the visibility and updating of an indicator based on the unit's PvP status.
+
+## Widget
+
+PvPIndicator - A `Texture` used to display faction, FFA PvP status icon.
+
+## Notes
+
+This element updates by changing the texture.
+
+## Examples
+
+ -- Position and size
+ local PvPIndicator = self:CreateTexture(nil, 'ARTWORK', nil, 1)
+ PvPIndicator:SetSize(30, 30)
+ PvPIndicator:SetPoint('RIGHT', self, 'LEFT')
+
+ -- Register it with oUF
+ self.PvPIndicator = PvPIndicator
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local UnitFactionGroup = UnitFactionGroup
+local UnitIsPVP = UnitIsPVP
+local UnitIsPVPFreeForAll = UnitIsPVPFreeForAll
+
+local FFA_ICON = [[Interface\TargetingFrame\UI-PVP-FFA]]
+local FACTION_ICON = [[Interface\TargetingFrame\UI-PVP-]]
+
+local function Update(self, event, unit)
+ if(unit ~= self.unit) then return end
+
+ local element = self.PvPIndicator
+
+ --[[ Callback: PvPIndicator:PreUpdate(unit)
+ Called before the element has been updated.
+
+ * self - the PvPIndicator element
+ * unit - the unit for which the update has been triggered (string)
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate(unit)
+ end
+
+ local status
+ local factionGroup = UnitFactionGroup(unit)
+
+ if(UnitIsPVPFreeForAll(unit)) then
+ element:SetTexture(FFA_ICON)
+ element:SetTexCoord(0, 0.65625, 0, 0.65625)
+ status = 'ffa'
+ elseif(factionGroup and factionGroup ~= 'Neutral' and UnitIsPVP(unit)) then
+ element:SetTexture(FACTION_ICON .. factionGroup)
+ element:SetTexCoord(0, 0.65625, 0, 0.65625)
+ status = factionGroup
+ end
+
+ if(status) then
+ element:Show()
+ else
+ element:Hide()
+ end
+
+ --[[ Callback: PvPIndicator:PostUpdate(unit, status)
+ Called after the element has been updated.
+
+ * self - the PvPIndicator element
+ * unit - the unit for which the update has been triggered (string)
+ * status - the unit's current PvP status or faction accounting for mercenary mode (string)['ffa', 'Alliance',
+ 'Horde']
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(unit, status)
+ end
+end
+
+local function Path(self, ...)
+ --[[Override: PvPIndicator.Override(self, event, ...)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ * ... - the arguments accompanying the event
+ --]]
+ return (self.PvPIndicator.Override or Update) (self, ...)
+end
+
+local function ForceUpdate(element)
+ return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
+end
+
+local function Enable(self)
+ local element = self.PvPIndicator
+ if(element) then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+
+ self:RegisterEvent('UNIT_FACTION', Path)
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.PvPIndicator
+ if(element) then
+ element:Hide()
+
+ self:UnregisterEvent('UNIT_FACTION', Path)
+ end
+end
+
+oUF:AddElement('PvPIndicator', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/raidroleindicator.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/raidroleindicator.lua
new file mode 100644
index 0000000..678b9de
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/raidroleindicator.lua
@@ -0,0 +1,114 @@
+--[[
+# Element: Raid Role Indicator
+
+Handles the visibility and updating of an indicator based on the unit's raid assignment (main tank or main assist).
+
+## Widget
+
+RaidRoleIndicator - A `Texture` representing the unit's raid assignment.
+
+## Notes
+
+This element updates by changing the texture.
+
+## Examples
+
+ -- Position and size
+ local RaidRoleIndicator = self:CreateTexture(nil, 'OVERLAY')
+ RaidRoleIndicator:SetSize(16, 16)
+ RaidRoleIndicator:SetPoint('TOPLEFT')
+
+ -- Register it with oUF
+ self.RaidRoleIndicator = RaidRoleIndicator
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local GetPartyAssignment = GetPartyAssignment
+local UnitInRaid = UnitInRaid
+
+local MAINTANK_ICON = [[Interface\GROUPFRAME\UI-GROUP-MAINTANKICON]]
+local MAINASSIST_ICON = [[Interface\GROUPFRAME\UI-GROUP-MAINASSISTICON]]
+
+local function Update(self, event)
+ local unit = self.unit
+
+ local element = self.RaidRoleIndicator
+
+ --[[ Callback: RaidRoleIndicator:PreUpdate()
+ Called before the element has been updated.
+
+ * self - the RaidRoleIndicator element
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate()
+ end
+
+ local role, isShown
+ if(UnitInRaid(unit)) then
+ if(GetPartyAssignment('MAINTANK', unit)) then
+ isShown = true
+ element:SetTexture(MAINTANK_ICON)
+ role = 'MAINTANK'
+ elseif(GetPartyAssignment('MAINASSIST', unit)) then
+ isShown = true
+ element:SetTexture(MAINASSIST_ICON)
+ role = 'MAINASSIST'
+ end
+ end
+
+ if isShown then
+ element:Show()
+ else
+ element:Hide()
+ end
+
+ --[[ Callback: RaidRoleIndicator:PostUpdate(role)
+ Called after the element has been updated.
+
+ * self - the RaidRoleIndicator element
+ * role - the unit's raid assignment (string?)['MAINTANK', 'MAINASSIST']
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(role)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: RaidRoleIndicator.Override(self, event, ...)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ * ... - the arguments accompanying the event
+ --]]
+ return (self.RaidRoleIndicator.Override or Update)(self, ...)
+end
+
+local function ForceUpdate(element)
+ return Path(element.__owner, 'ForceUpdate')
+end
+
+local function Enable(self)
+ local element = self.RaidRoleIndicator
+ if(element) then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+
+ self:RegisterEvent('PARTY_MEMBERS_CHANGED', Path, true)
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.RaidRoleIndicator
+ if(element) then
+ element:Hide()
+
+ self:UnregisterEvent('PARTY_MEMBERS_CHANGED', Path)
+ end
+end
+
+oUF:AddElement('RaidRoleIndicator', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/raidtargetindicator.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/raidtargetindicator.lua
new file mode 100644
index 0000000..cba1975
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/raidtargetindicator.lua
@@ -0,0 +1,102 @@
+--[[
+# Element: Raid Target Indicator
+
+Handles the visibility and updating of an indicator based on the unit's raid target assignment.
+
+## Widget
+
+RaidTargetIndicator - A `Texture` used to display the raid target icon.
+
+## Notes
+
+A default texture will be applied if the widget is a Texture and doesn't have a texture set.
+
+## Examples
+
+ -- Position and size
+ local RaidTargetIndicator = self:CreateTexture(nil, 'OVERLAY')
+ RaidTargetIndicator:SetSize(16, 16)
+ RaidTargetIndicator:SetPoint('TOPRIGHT', self)
+
+ -- Register it with oUF
+ self.RaidTargetIndicator = RaidTargetIndicator
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local GetRaidTargetIndex = GetRaidTargetIndex
+local SetRaidTargetIconTexture = SetRaidTargetIconTexture
+
+local function Update(self, event)
+ local element = self.RaidTargetIndicator
+
+ --[[ Callback: RaidTargetIndicator:PreUpdate()
+ Called before the element has been updated.
+
+ * self - the RaidTargetIndicator element
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate()
+ end
+
+ local index = GetRaidTargetIndex(self.unit)
+ if(index) then
+ SetRaidTargetIconTexture(element, index)
+ element:Show()
+ else
+ element:Hide()
+ end
+
+ --[[ Callback: RaidTargetIndicator:PostUpdate(index)
+ Called after the element has been updated.
+
+ * self - the RaidTargetIndicator element
+ * index - the index of the raid target marker (number?)[1-8]
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(index)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: RaidTargetIndicator.Override(self, event)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ --]]
+ return (self.RaidTargetIndicator.Override or Update) (self, ...)
+end
+
+local function ForceUpdate(element)
+ if(not element.__owner.unit) then return end
+ return Path(element.__owner, 'ForceUpdate')
+end
+
+local function Enable(self)
+ local element = self.RaidTargetIndicator
+ if(element) then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+
+ self:RegisterEvent('RAID_TARGET_UPDATE', Path, true)
+
+ if(element:IsObjectType('Texture') and not element:GetTexture()) then
+ element:SetTexture([[Interface\TargetingFrame\UI-RaidTargetingIcons]])
+ end
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.RaidTargetIndicator
+ if(element) then
+ element:Hide()
+
+ self:UnregisterEvent('RAID_TARGET_UPDATE', Path)
+ end
+end
+
+oUF:AddElement('RaidTargetIndicator', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/range.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/range.lua
new file mode 100644
index 0000000..f78d7a2
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/range.lua
@@ -0,0 +1,137 @@
+--[[
+# Element: Range Fader
+
+Changes the opacity of a unit frame based on whether the frame's unit is in the player's range.
+
+## Widget
+
+Range - A table containing opacity values.
+
+## Notes
+
+Offline units are handled as if they are in range.
+
+## Options
+
+.outsideAlpha - Opacity when the unit is out of range. Defaults to 0.55 (number)[0-1].
+.insideAlpha - Opacity when the unit is within range. Defaults to 1 (number)[0-1].
+
+## Examples
+
+ -- Register with oUF
+ self.Range = {
+ insideAlpha = 1,
+ outsideAlpha = 1/2,
+ }
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local _FRAMES = {}
+local OnRangeFrame
+
+local UnitInRange, UnitIsConnected = UnitInRange, UnitIsConnected
+
+local function Update(self, event)
+ local element = self.Range
+ local unit = self.unit
+
+ --[[ Callback: Range:PreUpdate()
+ Called before the element has been updated.
+
+ * self - the Range element
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate()
+ end
+
+ local inRange
+ local connected = UnitIsConnected(unit)
+ if(connected) then
+ inRange = UnitInRange(unit)
+ if(not inRange) then
+ self:SetAlpha(element.outsideAlpha)
+ else
+ self:SetAlpha(element.insideAlpha)
+ end
+ else
+ self:SetAlpha(element.insideAlpha)
+ end
+
+ --[[ Callback: Range:PostUpdate(object, inRange, isConnected)
+ Called after the element has been updated.
+
+ * self - the Range element
+ * object - the parent object
+ * inRange - indicates if the unit was within 40 yards of the player (boolean)
+ * isConnected - indicates if the unit is online (boolean)
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(self, inRange, connected)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: Range.Override(self, event)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ --]]
+ return (self.Range.Override or Update) (self, ...)
+end
+
+-- Internal updating method
+local timer = 0
+local function OnRangeUpdate(_, elapsed)
+ timer = timer + elapsed
+
+ if(timer >= .20) then
+ for _, object in next, _FRAMES do
+ if(object:IsShown()) then
+ Path(object, 'OnUpdate')
+ end
+ end
+
+ timer = 0
+ end
+end
+
+local function Enable(self)
+ local element = self.Range
+ if(element) then
+ element.__owner = self
+ element.insideAlpha = element.insideAlpha or 1
+ element.outsideAlpha = element.outsideAlpha or 0.55
+
+ if(not OnRangeFrame) then
+ OnRangeFrame = CreateFrame('Frame')
+ OnRangeFrame:SetScript('OnUpdate', OnRangeUpdate)
+ end
+
+ table.insert(_FRAMES, self)
+ OnRangeFrame:Show()
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.Range
+ if(element) then
+ for index, frame in next, _FRAMES do
+ if(frame == self) then
+ table.remove(_FRAMES, index)
+ break
+ end
+ end
+ self:SetAlpha(element.insideAlpha)
+
+ if(#_FRAMES == 0) then
+ OnRangeFrame:Hide()
+ end
+ end
+end
+
+oUF:AddElement('Range', nil, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/readycheckindicator.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/readycheckindicator.lua
new file mode 100644
index 0000000..54b8a75
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/readycheckindicator.lua
@@ -0,0 +1,150 @@
+--[[
+# Element: Ready Check Indicator
+
+Handles the visibility and updating of an indicator based on the unit's ready check status.
+
+## Widget
+
+ReadyCheckIndicator - A `Texture` representing ready check status.
+
+## Notes
+
+This element updates by changing the texture.
+Default textures will be applied if the layout does not provide custom ones. See Options.
+
+## Options
+
+.finishedTime - For how many seconds the icon should stick after a check has completed. Defaults to 10 (number).
+.fadeTime - For how many seconds the icon should fade away after the stick duration has completed. Defaults to
+ 1.5 (number).
+.readyTexture - Path to an alternate texture for the ready check 'ready' status.
+.notReadyTexture - Path to an alternate texture for the ready check 'notready' status.
+.waitingTexture - Path to an alternate texture for the ready check 'waiting' status.
+
+## Attributes
+
+.status - the unit's ready check status (string?)['ready', 'noready', 'waiting']
+
+## Examples
+
+ -- Position and size
+ local ReadyCheckIndicator = self:CreateTexture(nil, 'OVERLAY')
+ ReadyCheckIndicator:SetSize(16, 16)
+ ReadyCheckIndicator:SetPoint('TOP')
+
+ -- Register with oUF
+ self.ReadyCheckIndicator = ReadyCheckIndicator
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local GetReadyCheckStatus = GetReadyCheckStatus
+local UnitExists = UnitExists
+
+local function OnFinished(self)
+ local element = self:GetParent()
+ element:Hide()
+
+ --[[ Callback: ReadyCheckIndicator:PostUpdateFadeOut()
+ Called after the element has been faded out.
+
+ * self - the ReadyCheckIndicator element
+ --]]
+ if(element.PostUpdateFadeOut) then
+ element:PostUpdateFadeOut()
+ end
+end
+
+local function Update(self, event)
+ local element = self.ReadyCheckIndicator
+
+ --[[ Callback: ReadyCheckIndicator:PreUpdate()
+ Called before the element has been updated.
+
+ * self - the ReadyCheckIndicator element
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate()
+ end
+
+ local unit = self.unit
+ local status = GetReadyCheckStatus(unit)
+ if(UnitExists(unit) and status) then
+ if(status == 'ready') then
+ element:SetTexture(element.readyTexture)
+ elseif(status == 'notready') then
+ element:SetTexture(element.notReadyTexture)
+ else
+ element:SetTexture(element.waitingTexture)
+ end
+
+ element.status = status
+ element:Show()
+ elseif(event ~= 'READY_CHECK_FINISHED') then
+ element.status = nil
+ element:Hide()
+ end
+
+ if(event == 'READY_CHECK_FINISHED') then
+ if(element.status == 'waiting') then
+ element:SetTexture(element.notReadyTexture)
+ end
+ end
+
+ --[[ Callback: ReadyCheckIndicator:PostUpdate(status)
+ Called after the element has been updated.
+
+ * self - the ReadyCheckIndicator element
+ * status - the unit's ready check status (string?)['ready', 'notready', 'waiting']
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(status)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: ReadyCheckIndicator.Override(self, event, ...)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ * ... - the arguments accompanying the event
+ --]]
+ return (self.ReadyCheckIndicator.Override or Update) (self, ...)
+end
+
+local function ForceUpdate(element)
+ return Path(element.__owner, 'ForceUpdate')
+end
+
+local function Enable(self, unit)
+ local element = self.ReadyCheckIndicator
+ if(element and (unit and (unit:sub(1, 5) == 'party' or unit:sub(1, 4) == 'raid'))) then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+
+ element.readyTexture = element.readyTexture or READY_CHECK_READY_TEXTURE
+ element.notReadyTexture = element.notReadyTexture or READY_CHECK_NOT_READY_TEXTURE
+ element.waitingTexture = element.waitingTexture or READY_CHECK_WAITING_TEXTURE
+
+ self:RegisterEvent('READY_CHECK', Path, true)
+ self:RegisterEvent('READY_CHECK_CONFIRM', Path, true)
+ self:RegisterEvent('READY_CHECK_FINISHED', Path, true)
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.ReadyCheckIndicator
+ if(element) then
+ element:Hide()
+
+ self:UnregisterEvent('READY_CHECK', Path)
+ self:UnregisterEvent('READY_CHECK_CONFIRM', Path)
+ self:UnregisterEvent('READY_CHECK_FINISHED', Path)
+ end
+end
+
+oUF:AddElement('ReadyCheckIndicator', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/restingindicator.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/restingindicator.lua
new file mode 100644
index 0000000..395cc22
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/restingindicator.lua
@@ -0,0 +1,100 @@
+--[[
+# Element: Resting Indicator
+
+Toggles the visibility of an indicator based on the player's resting status.
+
+## Widget
+
+RestingIndicator - Any UI widget.
+
+## Notes
+
+A default texture will be applied if the widget is a Texture and doesn't have a texture or a color set.
+
+## Examples
+
+ -- Position and size
+ local RestingIndicator = self:CreateTexture(nil, 'OVERLAY')
+ RestingIndicator:SetSize(16, 16)
+ RestingIndicator:SetPoint('TOPLEFT', self)
+
+ -- Register it with oUF
+ self.RestingIndicator = RestingIndicator
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local IsResting = IsResting
+
+local function Update(self, event)
+ local element = self.RestingIndicator
+
+ --[[ Callback: RestingIndicator:PreUpdate()
+ Called before the element has been updated.
+
+ * self - the RestingIndicator element
+ --]]
+ if(element.PreUpdate) then
+ element:PreUpdate()
+ end
+
+ local isResting = IsResting()
+ if(isResting) then
+ element:Show()
+ else
+ element:Hide()
+ end
+
+ --[[ Callback: RestingIndicator:PostUpdate(isResting)
+ Called after the element has been updated.
+
+ * self - the RestingIndicator element
+ * isResting - indicates if the player is resting (boolean)
+ --]]
+ if(element.PostUpdate) then
+ return element:PostUpdate(isResting)
+ end
+end
+
+local function Path(self, ...)
+ --[[ Override: RestingIndicator.Override(self, event)
+ Used to completely override the internal update function.
+
+ * self - the parent object
+ * event - the event triggering the update (string)
+ --]]
+ return (self.RestingIndicator.Override or Update) (self, ...)
+end
+
+local function ForceUpdate(element)
+ return Path(element.__owner, 'ForceUpdate')
+end
+
+local function Enable(self, unit)
+ local element = self.RestingIndicator
+ if(element and unit == 'player') then
+ element.__owner = self
+ element.ForceUpdate = ForceUpdate
+
+ self:RegisterEvent('PLAYER_UPDATE_RESTING', Path, true)
+
+ if(element:IsObjectType('Texture') and not element:GetTexture()) then
+ element:SetTexture([[Interface\CharacterFrame\UI-StateIcon]])
+ element:SetTexCoord(0, 0.5, 0, 0.421875)
+ end
+
+ return true
+ end
+end
+
+local function Disable(self)
+ local element = self.RestingIndicator
+ if(element) then
+ element:Hide()
+
+ self:UnregisterEvent('PLAYER_UPDATE_RESTING', Path)
+ end
+end
+
+oUF:AddElement('RestingIndicator', Path, Enable, Disable)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/tags.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/tags.lua
new file mode 100644
index 0000000..898f02f
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/elements/tags.lua
@@ -0,0 +1,828 @@
+-- Credits: Vika, Cladhaire, Tekkub
+--[[
+# Element: Tags
+
+Provides a system for text-based display of information by binding a tag string to a font string widget which in turn is
+tied to a unit frame.
+
+## Widget
+
+A FontString to hold a tag string. Unlike other elements, this widget must not have a preset name.
+
+## Notes
+
+A `Tag` is a Lua string consisting of a function name surrounded by square brackets. The tag will be replaced by the
+output of the function and displayed as text on the font string widget with that the tag has been registered. Literals
+can be pre- or appended by separating them with a `>` before or `<` after the function name. The literals will be only
+displayed when the function returns a non-nil value. I.e. `"[perhp<%]"` will display the current health as a percentage
+of the maximum health followed by the % sign.
+
+A `Tag String` is a Lua string consisting of one or multiple tags with optional literals between them. Each tag will be
+updated individually and the output will follow the tags order. Literals will be displayed in the output string
+regardless of whether the surrounding tag functions return a value. I.e. `"[curhp]/[maxhp]"` will resolve to something
+like `2453/5000`.
+
+A `Tag Function` is used to replace a single tag in a tag string by its output. A tag function receives only two
+arguments - the unit and the realUnit of the unit frame used to register the tag (see Options for further details). The
+tag function is called when the unit frame is shown or when a specified event has fired. It the tag is registered on an
+eventless frame (i.e. one holding the unit "targettarget"), then the tag function is called in a set time interval.
+
+A number of built-in tag functions exist. The layout can also define its own tag functions by adding them to the
+`oUF.Tags.Methods` table. The events upon which the function will be called are specified in a white-space separated
+list added to the `oUF.Tags.Events` table. Should an event fire without unit information, then it should also be listed
+in the `oUF.Tags.SharedEvents` table as follows: `oUF.Tags.SharedEvents.EVENT_NAME = true`.
+
+## Options
+
+.overrideUnit - if specified on the font string widget, the frame's realUnit will be passed as the second argument to
+ every tag function whose name is contained in the relevant tag string. Otherwise the second argument
+ is always nil (boolean)
+.frequentUpdates - defines how often the correspondig tag function(s) should be called. This will override the events for
+ the tag(s), if any. If the value is a number, it is taken as a time interval in seconds. If the value
+ is a boolean, the time interval is set to 0.5 seconds (number or boolean)
+
+## Attributes
+
+.parent - the unit frame on which the tag has been registered
+
+## Examples
+
+ -- define the tag function
+ oUF.Tags.Methods['mylayout:threatname'] = function(unit, realUnit)
+ local color = _TAGS['threatcolor'](unit)
+ local name = _TAGS['name'](unit, realUnit)
+ return string.format('%s%s|r', color, name)
+ end
+
+ -- add the events
+ oUF.Tags.Events['mylayout:threatname'] = 'UNIT_NAME_UPDATE UNIT_THREAT_SITUATION_UPDATE'
+
+ -- create the text widget
+ local info = self.Health:CreateFontString(nil, 'OVERLAY', 'GameFontNormal')
+ info:SetPoint('LEFT')
+
+ -- register the tag on the text widget with oUF
+ self:Tag(info, '[mylayout:threatname]')
+--]]
+
+local ns = oUF
+local oUF = ns.oUF
+
+local _G = _G
+local unpack = unpack
+local floor = math.floor
+local format = string.format
+local tinsert, tremove = table.insert, table.remove
+
+local GetComboPoints = GetComboPoints
+local GetNumRaidMembers = GetNumRaidMembers
+local GetPetHappiness = GetPetHappiness
+local GetQuestDifficultyColor = GetQuestDifficultyColor
+local GetRaidRosterInfo = GetRaidRosterInfo
+local IsResting = IsResting
+local UnitCanAttack = UnitCanAttack
+local UnitClass = UnitClass
+local UnitClassification = UnitClassification
+local UnitCreatureFamily = UnitCreatureFamily
+local UnitCreatureType = UnitCreatureType
+local UnitFactionGroup = UnitFactionGroup
+local UnitIsConnected = UnitIsConnected
+local UnitIsDead = UnitIsDead
+local UnitIsGhost = UnitIsGhost
+local UnitIsPVP = UnitIsPVP
+local UnitIsPartyLeader = UnitIsPartyLeader
+local UnitIsPlayer = UnitIsPlayer
+local UnitLevel = UnitLevel
+local UnitMana = UnitMana
+local UnitManaMax = UnitManaMax
+local UnitName = UnitName
+local UnitPowerType = UnitPowerType
+local UnitRace = UnitRace
+local UnitSex = UnitSex
+
+local _PATTERN = '%[..-%]+'
+
+local _ENV = {
+ Hex = function(r, g, b)
+ if(type(r) == 'table') then
+ if(r.r) then
+ r, g, b = r.r, r.g, r.b
+ else
+ r, g, b = unpack(r)
+ end
+ end
+ if not r or type(r) == 'string' then
+ return '|cffFFFFFF'
+ end
+ return format('|cff%02x%02x%02x', r * 255, g * 255, b * 255)
+ end,
+ ColorGradient = oUF.ColorGradient,
+}
+local _PROXY = setmetatable(_ENV, {__index = _G})
+
+local tagStrings = {
+ ['creature'] = [[function(u)
+ return UnitCreatureFamily(u) or UnitCreatureType(u)
+ end]],
+
+ ['dead'] = [[function(u)
+ if(UnitIsDead(u)) then
+ return 'Dead'
+ elseif(UnitIsGhost(u)) then
+ return 'Ghost'
+ end
+ end]],
+
+ ['difficulty'] = [[function(u)
+ if UnitCanAttack('player', u) then
+ local l = UnitLevel(u)
+ return Hex(GetQuestDifficultyColor((l > 0) and l or 999))
+ end
+ end]],
+
+ ['leader'] = [[function(u)
+ if(UnitIsPartyLeader(u)) then
+ return 'L'
+ end
+ end]],
+
+ ['leaderlong'] = [[function(u)
+ if(UnitIsPartyLeader(u)) then
+ return 'Leader'
+ end
+ end]],
+
+ ['level'] = [[function(u)
+ local l = UnitLevel(u)
+ if(l > 0) then
+ return l
+ else
+ return '??'
+ end
+ end]],
+
+ ['missinghp'] = [[function(u)
+ local current = UnitHealthMax(u) - UnitHealth(u)
+ if(current > 0) then
+ return current
+ end
+ end]],
+
+ ['missingpp'] = [[function(u)
+ local current = UnitManaMax(u) - UnitMana(u)
+ if(current > 0) then
+ return current
+ end
+ end]],
+
+ ['name'] = [[function(u, r)
+ return UnitName(r or u)
+ end]],
+
+ ['offline'] = [[function(u)
+ if(not UnitIsConnected(u)) then
+ return 'Offline'
+ end
+ end]],
+
+ ['perhp'] = [[function(u)
+ local m = UnitHealthMax(u)
+ if(m == 0) then
+ return 0
+ else
+ return floor(UnitHealth(u) / m * 100 + .5)
+ end
+ end]],
+
+ ['perpp'] = [[function(u)
+ local m = UnitManaMax(u)
+ if(m == 0) then
+ return 0
+ else
+ return floor(UnitMana(u) / m * 100 + .5)
+ end
+ end]],
+
+ ['plus'] = [[function(u)
+ local c = UnitClassification(u)
+ if(c == 'elite' or c == 'rareelite') then
+ return '+'
+ end
+ end]],
+
+ ['pvp'] = [[function(u)
+ if(UnitIsPVP(u)) then
+ return 'PvP'
+ end
+ end]],
+
+ ['raidcolor'] = [[function(u)
+ local _, x = UnitClass(u)
+ if(x) then
+ return Hex(_COLORS.class[x])
+ end
+ end]],
+
+ ['rare'] = [[function(u)
+ local c = UnitClassification(u)
+ if(c == 'rare' or c == 'rareelite') then
+ return 'Rare'
+ end
+ end]],
+
+ ['resting'] = [[function(u)
+ if(u == 'player' and IsResting()) then
+ return 'zzz'
+ end
+ end]],
+
+ ['sex'] = [[function(u)
+ local s = UnitSex(u)
+ if(s == 2) then
+ return 'Male'
+ elseif(s == 3) then
+ return 'Female'
+ end
+ end]],
+
+ ['smartclass'] = [[function(u)
+ if(UnitIsPlayer(u)) then
+ return _TAGS['class'](u)
+ end
+
+ return _TAGS['creature'](u)
+ end]],
+
+ ['status'] = [[function(u)
+ if(UnitIsDead(u)) then
+ return 'Dead'
+ elseif(UnitIsGhost(u)) then
+ return 'Ghost'
+ elseif(not UnitIsConnected(u)) then
+ return 'Offline'
+ else
+ return _TAGS['resting'](u)
+ end
+ end]],
+
+ ['cpoints'] = [[function(u)
+ local cp = GetComboPoints('player', 'target')
+ if(cp > 0) then
+ return cp
+ end
+ end]],
+
+ ['smartlevel'] = [[function(u)
+ local c = UnitClassification(u)
+ if(c == 'worldboss') then
+ return 'Boss'
+ else
+ local plus = _TAGS['plus'](u)
+ local level = _TAGS['level'](u)
+ if(plus) then
+ return level .. plus
+ else
+ return level
+ end
+ end
+ end]],
+
+ ['classification'] = [[function(u)
+ local c = UnitClassification(u)
+ if(c == 'rare') then
+ return 'Rare'
+ elseif(c == 'rareelite') then
+ return 'Rare Elite'
+ elseif(c == 'elite') then
+ return 'Elite'
+ elseif(c == 'worldboss') then
+ return 'Boss'
+ end
+ end]],
+
+ ['shortclassification'] = [[function(u)
+ local c = UnitClassification(u)
+ if(c == 'rare') then
+ return 'R'
+ elseif(c == 'rareelite') then
+ return 'R+'
+ elseif(c == 'elite') then
+ return '+'
+ elseif(c == 'worldboss') then
+ return 'B'
+ end
+ end]],
+
+ ['group'] = [[function(unit)
+ local name, server = UnitName(unit)
+ if(server and server ~= '') then
+ name = format('%s-%s', name, server)
+ end
+
+ for i=1, GetNumRaidMembers() do
+ local raidName, _, group = GetRaidRosterInfo(i)
+ if(raidName == name) then
+ return group
+ end
+ end
+ end]],
+
+ ['deficit:name'] = [[function(u)
+ local missinghp = _TAGS['missinghp'](u)
+ if(missinghp) then
+ return '-' .. missinghp
+ else
+ return _TAGS['name'](u)
+ end
+ end]],
+
+ ['curmana'] = [[function(unit)
+ return UnitMana(unit, SPELL_POWER_MANA)
+ end]],
+
+ ['maxmana'] = [[function(unit)
+ return UnitManaMax(unit, SPELL_POWER_MANA)
+ end]],
+
+ ['happiness'] = [[function(u)
+ if(UnitIsUnit(u, 'pet')) then
+ local happiness = GetPetHappiness()
+ if(happiness == 1) then
+ return ':<'
+ elseif(happiness == 2) then
+ return ':|'
+ elseif(happiness == 3) then
+ return ':D'
+ end
+ end
+ end]],
+
+ ['powercolor'] = [[function(u)
+ local pType, pToken, altR, altG, altB = UnitPowerType(u)
+ local t = _COLORS.power[pToken]
+
+ if(not t) then
+ if(altR) then
+ if(altR > 1 or altG > 1 or altB > 1) then
+ return Hex(altR / 255, altG / 255, altB / 255)
+ else
+ return Hex(altR, altG, altB)
+ end
+ else
+ return Hex(_COLORS.power[pType])
+ end
+ end
+
+ return Hex(t)
+ end]],
+}
+
+local tags = setmetatable(
+ {
+ curhp = UnitHealth,
+ curpp = UnitMana,
+ maxhp = UnitHealthMax,
+ maxpp = UnitManaMax,
+ class = UnitClass,
+ faction = UnitFactionGroup,
+ race = UnitRace,
+ },
+ {
+ __index = function(self, key)
+ local tagFunc = tagStrings[key]
+ if(tagFunc) then
+ local func, err = loadstring('return ' .. tagFunc)
+ if(func) then
+ func = func()
+
+ -- Want to trigger __newindex, so no rawset.
+ self[key] = func
+ tagStrings[key] = nil
+
+ return func
+ else
+ error(err, 3)
+ end
+ end
+ end,
+ __newindex = function(self, key, val)
+ if(type(val) == 'string') then
+ tagStrings[key] = val
+ elseif(type(val) == 'function') then
+ -- So we don't clash with any custom envs.
+ if(getfenv(val) == _G) then
+ setfenv(val, _PROXY)
+ end
+
+ rawset(self, key, val)
+ end
+ end,
+ }
+)
+
+_ENV._TAGS = tags
+
+local tagEvents = {
+ ['curhp'] = 'UNIT_HEALTH',
+ ['maxhp'] = 'UNIT_MAXHEALTH',
+ ['curpp'] = 'UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE',
+ ['maxpp'] = 'UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE',
+ ['dead'] = 'UNIT_HEALTH',
+ ['leader'] = 'PARTY_LEADER_CHANGED',
+ ['leaderlong'] = 'PARTY_LEADER_CHANGED',
+ ['level'] = 'UNIT_LEVEL PLAYER_LEVEL_UP',
+ ['missinghp'] = 'UNIT_HEALTH UNIT_MAXHEALTH',
+ ['missingpp'] = 'UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE',
+ ['name'] = 'UNIT_NAME_UPDATE',
+ ['offline'] = 'UNIT_HEALTH',
+ ['perhp'] = 'UNIT_HEALTH UNIT_MAXHEALTH',
+ ['perpp'] = 'UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE',
+ ['plus'] = 'UNIT_CLASSIFICATION_CHANGED',
+ ['pvp'] = 'UNIT_FACTION',
+ ['rare'] = 'UNIT_CLASSIFICATION_CHANGED',
+ ['resting'] = 'PLAYER_UPDATE_RESTING',
+ ['status'] = 'UNIT_HEALTH PLAYER_UPDATE_RESTING',
+ ['cpoints'] = 'PLAYER_COMBO_POINTS PLAYER_TARGET_CHANGED',
+ ['smartlevel'] = 'UNIT_LEVEL PLAYER_LEVEL_UP UNIT_CLASSIFICATION_CHANGED',
+ ['classification'] = 'UNIT_CLASSIFICATION_CHANGED',
+ ['shortclassification'] = 'UNIT_CLASSIFICATION_CHANGED',
+ ['group'] = 'PARTY_MEMBERS_CHANGED RAID_ROSTER_UPDATE',
+ ['curmana'] = 'UNIT_MANA UNIT_MAXMANA',
+ ['maxmana'] = 'UNIT_MANA UNIT_MAXMANA',
+ ['happiness'] = 'UNIT_HAPPINESS',
+ ['powercolor'] = 'UNIT_DISPLAYPOWER',
+}
+
+local unitlessEvents = {
+ PLAYER_LEVEL_UP = true,
+ PLAYER_UPDATE_RESTING = true,
+ PLAYER_TARGET_CHANGED = true,
+
+ RAID_ROSTER_UPDATE = true,
+ PARTY_MEMBERS_CHANGED = true,
+ PARTY_LEADER_CHANGED = true,
+
+ PLAYER_COMBO_POINTS = true,
+}
+
+local events = {}
+local frame = CreateFrame('Frame')
+frame:SetScript('OnEvent', function(self, event, unit)
+ local strings = events[event]
+ if(strings) then
+ for _, fontstring in next, strings do
+ if(fontstring:IsVisible() and (unitlessEvents[event] or fontstring.parent.unit == unit)) then
+ fontstring:UpdateTag()
+ end
+ end
+ end
+end)
+
+local onUpdates = {}
+local eventlessUnits = {}
+
+local function createOnUpdate(timer)
+ local OnUpdate = onUpdates[timer]
+
+ if(not OnUpdate) then
+ local total = timer
+ local frame = CreateFrame('Frame')
+ local strings = eventlessUnits[timer]
+
+ frame:SetScript('OnUpdate', function()
+ if(total >= timer) then
+ for _, fs in next, strings do
+ if(fs.parent:IsShown() and UnitExists(fs.parent.unit)) then
+ fs:UpdateTag()
+ end
+ end
+
+ total = 0
+ end
+
+ total = total + arg1
+ end)
+
+ onUpdates[timer] = frame
+ end
+end
+
+local function onShow(self)
+ for _, fs in next, self.__tags do
+ fs:UpdateTag()
+ end
+end
+
+local function getTagName(tag)
+ local tagStart = (string.match(tag, '>+()') or 2)
+ local tagEnd = string.match(tag, '.*()<+')
+ tagEnd = (tagEnd and tagEnd - 1) or -2
+
+ return string.sub(tag, tagStart, tagEnd), tagStart, tagEnd
+end
+
+local function registerEvent(fontstr, event)
+ if(not events[event]) then events[event] = {} end
+
+ frame:RegisterEvent(event)
+ tinsert(events[event], fontstr)
+end
+
+local function registerEvents(fontstr, tagstr)
+ for tag in string.gmatch(tagstr, _PATTERN) do
+ tag = getTagName(tag)
+ local tagevents = tagEvents[tag]
+ if(tagevents) then
+ for event in string.gmatch(tagevents, '%S+') do
+ registerEvent(fontstr, event)
+ end
+ end
+ end
+end
+
+local function unregisterEvents(fontstr)
+ for event, data in next, events do
+ for i, tagfsstr in next, data do
+ if(tagfsstr == fontstr) then
+ if(getn(data) == 1) then
+ frame:UnregisterEvent(event)
+ end
+
+ tremove(data, i)
+ end
+ end
+ end
+end
+
+local OnEnter = function(self)
+ for _, fs in pairs(self.__mousetags) do
+ fs:SetAlpha(1)
+ end
+end
+
+local OnLeave = function(self)
+ for _, fs in pairs(self.__mousetags) do
+ fs:SetAlpha(0)
+ end
+end
+
+local onUpdateDelay = {}
+local tagPool = {}
+local funcPool = {}
+local tmp = {}
+local escapeSequences = {
+ ["||c"] = "|c",
+ ["||r"] = "|r",
+ ["||T"] = "|T",
+ ["||t"] = "|t",
+}
+
+--[[ Tags: frame:Tag(fs, tagstr)
+Used to register a tag on a unit frame.
+
+* self - the unit frame on which to register the tag
+* fs - the font string to display the tag (FontString)
+* tagstr - the tag string (string)
+--]]
+local function Tag(self, fs, tagstr)
+ if(not fs or not tagstr) then return end
+
+ if(not self.__tags) then
+ self.__tags = {}
+ self.__mousetags = {}
+ tinsert(self.__elements, onShow)
+ else
+ -- Since people ignore everything that's good practice - unregister the tag
+ -- if it already exists.
+ for _, tag in pairs(self.__tags) do
+ if(fs == tag) then
+ -- We don't need to remove it from the __tags table as Untag handles
+ -- that for us.
+ self:Untag(fs)
+ end
+ end
+ end
+
+ fs.parent = self
+
+ for escapeSequence, replacement in pairs(escapeSequences) do
+ while string.find(tagstr, escapeSequence) do
+ tagstr = string.gsub(tagstr, escapeSequence, replacement)
+ end
+ end
+
+ if string.find(tagstr, '%[mouseover%]') then
+ tinsert(self.__mousetags, fs)
+ fs:SetAlpha(0)
+ if not self.__HookFunc then
+ self:HookScript('OnEnter', OnEnter)
+ self:HookScript('OnLeave', OnLeave)
+ self.__HookFunc = true;
+ end
+ tagstr = string.gsub(tagstr, '%[mouseover%]', '')
+ else
+ for index, fontString in pairs(self.__mousetags) do
+ if fontString == fs then
+ self.__mousetags[index] = nil;
+ fs:SetAlpha(1)
+ end
+ end
+ end
+
+ local containsOnUpdate
+ for tag in string.gmatch(tagstr, _PATTERN) do
+ tag = getTagName(tag)
+ if not tagEvents[tag] then
+ containsOnUpdate = onUpdateDelay[tag] or 0.15;
+ end
+ end
+
+ local func = tagPool[tagstr]
+ if(not func) then
+ local format, numTags = string.gsub(string.gsub(tagstr, '%%', '%%%%'), _PATTERN, '%%s')
+ local args = {}
+
+ for bracket in string.gmatch(tagstr, _PATTERN) do
+ local tagFunc = funcPool[bracket] or tags[string.sub(bracket, 2, -2)]
+ if(not tagFunc) then
+ local tagName, tagStart, tagEnd = getTagName(bracket)
+
+ local tag = tags[tagName]
+ if(tag) then
+ tagStart = tagStart - 2
+ tagEnd = tagEnd + 2
+
+ if(tagStart ~= 0 and tagEnd ~= 0) then
+ local prefix = string.sub(bracket, 2, tagStart)
+ local suffix = string.sub(bracket, tagEnd, -2)
+
+ tagFunc = function(unit, realUnit)
+ local str = tag(unit, realUnit)
+ if(str) then
+ return prefix .. str .. suffix
+ end
+ end
+ elseif(tagStart ~= 0) then
+ local prefix = string.sub(bracket, 2, tagStart)
+
+ tagFunc = function(unit, realUnit)
+ local str = tag(unit, realUnit)
+ if(str) then
+ return prefix .. str
+ end
+ end
+ elseif(tagEnd ~= 0) then
+ local suffix = string.sub(bracket, tagEnd, -2)
+
+ tagFunc = function(unit, realUnit)
+ local str = tag(unit, realUnit)
+ if(str) then
+ return str .. suffix
+ end
+ end
+ end
+
+ funcPool[bracket] = tagFunc
+ end
+ end
+
+ if(tagFunc) then
+ tinsert(args, tagFunc)
+ else
+ numTags = -1
+ func = function(self)
+ return self:SetText(bracket)
+ end
+ end
+ end
+
+ if(numTags == 1) then
+ func = function(self)
+ local parent = self.parent
+ local realUnit
+ if(self.overrideUnit) then
+ realUnit = parent.realUnit
+ end
+
+ _ENV._COLORS = parent.colors
+ return self:SetText(string.format(
+ format,
+ args[1](parent.unit, realUnit) or ''
+ ))
+ end
+ elseif(numTags == 2) then
+ func = function(self)
+ local parent = self.parent
+ local unit = parent.unit
+ local realUnit
+ if(self.overrideUnit) then
+ realUnit = parent.realUnit
+ end
+
+ _ENV._COLORS = parent.colors
+ return self:SetText(string.format(
+ format,
+ args[1](unit, realUnit) or '',
+ args[2](unit, realUnit) or ''
+ ))
+ end
+ elseif(numTags == 3) then
+ func = function(self)
+ local parent = self.parent
+ local unit = parent.unit
+ local realUnit
+ if(self.overrideUnit) then
+ realUnit = parent.realUnit
+ end
+
+ _ENV._COLORS = parent.colors
+ return self:SetText(string.format(
+ format,
+ args[1](unit, realUnit) or '',
+ args[2](unit, realUnit) or '',
+ args[3](unit, realUnit) or ''
+ ))
+ end
+ elseif numTags ~= -1 then
+ func = function(self)
+ local parent = self.parent
+ local unit = parent.unit
+ local realUnit
+ if(self.overrideUnit) then
+ realUnit = parent.realUnit
+ end
+
+ _ENV._COLORS = parent.colors
+ for i, func in next, args do
+ tmp[i] = func(unit, realUnit) or ''
+ end
+
+ -- We do 1, numTags because tmp can hold several unneeded variables.
+ return self:SetText(string.format(format, unpack(tmp, 1, numTags)))
+ end
+ end
+
+ if numTags ~= -1 then
+ tagPool[tagstr] = func
+ end
+ end
+ fs.UpdateTag = func
+
+ local unit = self.unit
+ if(self.__eventless or fs.frequentUpdates) or containsOnUpdate then
+ local timer
+ if(type(fs.frequentUpdates) == 'number') then
+ timer = fs.frequentUpdates
+ elseif containsOnUpdate then
+ timer = containsOnUpdate
+ else
+ timer = .5
+ end
+
+ if(not eventlessUnits[timer]) then eventlessUnits[timer] = {} end
+ tinsert(eventlessUnits[timer], fs)
+
+ createOnUpdate(timer)
+ else
+ registerEvents(fs, tagstr)
+ end
+
+ tinsert(self.__tags, fs)
+end
+
+--[[ Tags: frame:Untag(fs)
+Used to unregister a tag from a unit frame.
+
+* self - the unit frame from which to unregister the tag
+* fs - the font string holding the tag (FontString)
+--]]
+local function Untag(self, fs)
+ if(not fs) then return end
+
+ unregisterEvents(fs)
+ for _, timers in next, eventlessUnits do
+ for i, fontstr in next, timers do
+ if(fs == fontstr) then
+ tremove(timers, i)
+ end
+ end
+ end
+
+ for i, fontstr in next, self.__tags do
+ if(fontstr == fs) then
+ tremove(self.__tags, i)
+ end
+ end
+
+ fs.UpdateTag = nil
+end
+
+oUF.Tags = {
+ Methods = tags,
+ Events = tagEvents,
+ SharedEvents = unitlessEvents,
+ OnUpdateThrottle = onUpdateDelay,
+}
+
+oUF:RegisterMetaFunction('Tag', Tag)
+oUF:RegisterMetaFunction('Untag', Untag)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/events.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/events.lua
new file mode 100644
index 0000000..413891c
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/events.lua
@@ -0,0 +1,145 @@
+local ns = oUF
+local oUF = ns.oUF
+local Private = oUF.Private
+
+local argcheck = Private.argcheck
+local error = Private.error
+local frame_metatable = Private.frame_metatable
+
+-- Original event methods
+local registerEvent = frame_metatable.__index.RegisterEvent
+local unregisterEvent = frame_metatable.__index.UnregisterEvent
+
+function Private.UpdateUnits(frame, unit, realUnit)
+ if(unit == realUnit) then
+ realUnit = nil
+ end
+
+ if(frame.unit ~= unit or frame.realUnit ~= realUnit) then
+ frame.unit = unit
+ frame.realUnit = realUnit
+ frame.id = string.match(unit, '^.-(%d+)')
+ return true
+ end
+end
+
+local function onEvent()
+ if(this:IsVisible() or event == 'UNIT_COMBO_POINTS') then
+ --print(this, event, arg and unpack(arg))
+ --print(this, event, arg1, arg2, arg3, arg4, arg5)
+
+ return this[event](this, event, arg1, arg2, arg3, arg4, arg5)
+ end
+end
+
+local event_metatable = {
+ __call = function(funcs, self, ...)
+ for _, func in next, funcs do
+ func(self, unpack(arg))
+ end
+ end,
+}
+
+--[[ Events: frame:RegisterEvent(event, func, unitless)
+Used to register a frame for a game event and add an event handler. OnUpdate polled frames are prevented from
+registering events.
+
+* self - frame that will be registered for the given event.
+* event - name of the event to register (string)
+* func - function that will be executed when the event fires. If a string is passed, then a function by that name
+ must be defined on the frame. Multiple functions can be added for the same frame and event
+ (string or function)
+* unitless - indicates that the event does not fire for a specific unit, so the event arguments won't be
+ matched to the frame unit(s). Events that do not start with UNIT_ or are not known to be unit events are
+ automatically considered unitless (boolean)
+--]]
+function frame_metatable.__index:RegisterEvent(event, func)
+ -- Block OnUpdate polled frames from registering events.
+ -- UNIT_PORTRAIT_UPDATE and UNIT_MODEL_CHANGED which are used for
+ -- portrait updates.
+ if(self.__eventless and event ~= 'UNIT_PORTRAIT_UPDATE' and event ~= 'UNIT_MODEL_CHANGED') then return end
+
+ argcheck(event, 2, 'string')
+
+ if(type(func) == 'string' and type(self[func]) == 'function') then
+ func = self[func]
+ end
+
+ local curev = self[event]
+ local kind = type(curev)
+ if(curev and func) then
+ if(kind == 'function' and curev ~= func) then
+ self[event] = setmetatable({curev, func}, event_metatable)
+ elseif(kind == 'table') then
+ for _, infunc in next, curev do
+ if(infunc == func) then return end
+ end
+
+ table.insert(curev, func)
+ end
+ elseif(self:IsEventRegistered(event)) then
+ return
+ else
+ if(type(func) == 'function') then
+ self[event] = func
+ elseif(not self[event]) then
+ return error("Style [%s] attempted to register event [%s] on unit [%s] with a handler that doesn't exist.", self.style, event, self.unit or 'unknown')
+ end
+
+ if not self:GetScript('OnEvent') then
+ self:SetScript('OnEvent', onEvent)
+ end
+
+ registerEvent(self, event)
+ self.__registeredEvents[event] = true
+ end
+end
+
+--[[ Events: frame:IsEventRegistered(event, func)
+Used to determine if a game event is registered.
+
+* self - the frame registered for the event
+* event - name of the registered event (string)
+--]]
+function frame_metatable.__index:IsEventRegistered(event)
+ argcheck(event, 2, 'string')
+
+ return self.__registeredEvents[event] and true or false
+end
+
+--[[ Events: frame:UnregisterEvent(event, func)
+Used to remove a function from the event handler list for a game event.
+
+* self - the frame registered for the event
+* event - name of the registered event (string)
+* func - function to be removed from the list of event handlers. If this is the only handler for the given event, then
+ the frame will be unregistered for the event
+--]]
+function frame_metatable.__index:UnregisterEvent(event, func)
+ argcheck(event, 2, 'string')
+
+ local curev = self[event]
+ if(type(curev) == 'table' and func) then
+ for k, infunc in next, curev do
+ if(infunc == func) then
+ table.remove(curev, k)
+
+ local n = getn(curev)
+ if(n == 1) then
+ local _, handler = next(curev)
+ self[event] = handler
+ elseif(n == 0) then
+ -- This should not happen
+ unregisterEvent(self, event)
+ self.__registeredEvents[event] = nil
+ end
+
+ break
+ end
+ end
+ elseif(curev == func) then
+ self[event] = nil
+ unregisterEvent(self, event)
+ self.__registeredEvents[event] = nil
+ end
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/factory.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/factory.lua
new file mode 100644
index 0000000..35ee6f6
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/factory.lua
@@ -0,0 +1,71 @@
+local ns = oUF
+local oUF = ns.oUF
+local Private = oUF.Private
+
+local argcheck = Private.argcheck
+
+local queue = {}
+local factory = CreateFrame('Frame')
+factory:SetScript('OnEvent', function()
+ return this[event](this, event, arg and unpack(arg))
+end)
+
+factory:RegisterEvent('PLAYER_LOGIN')
+factory.active = true
+
+function factory:PLAYER_LOGIN()
+ if(not self.active) then return end
+
+ for _, func in next, queue do
+ func(oUF)
+ end
+
+ -- Avoid creating dupes.
+ wipe(queue)
+end
+
+--[[ Factory: oUF:Factory(func)
+Used to call a function directly if the current character is logged in and the factory is active. Else the function is
+queued up to be executed at a later time (upon PLAYER_LOGIN by default).
+
+* self - the global oUF object
+* func - function to be executed or delayed (function)
+--]]
+function oUF:Factory(func)
+ argcheck(func, 2, 'function')
+
+ -- Call the function directly if we're active and logged in.
+ if(IsLoggedIn() and factory.active) then
+ return func(self)
+ else
+ table.insert(queue, func)
+ end
+end
+
+--[[ Factory: oUF:EnableFactory()
+Used to enable the factory.
+
+* self - the global oUF object
+--]]
+function oUF:EnableFactory()
+ factory.active = true
+end
+
+--[[ Factory: oUF:DisableFactory()
+Used to disable the factory.
+
+* self - the global oUF object
+--]]
+function oUF:DisableFactory()
+ factory.active = nil
+end
+
+--[[ Factory: oUF:RunFactoryQueue()
+Used to try to execute queued up functions. The current player must be logged in and the factory must be active for
+this to succeed.
+
+* self - the global oUF object
+--]]
+function oUF:RunFactoryQueue()
+ factory:PLAYER_LOGIN()
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/finalize.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/finalize.lua
new file mode 100644
index 0000000..e319a5f
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/finalize.lua
@@ -0,0 +1,4 @@
+local ns = oUF
+
+-- It's named Private for a reason!
+ns.oUF.Private = nil
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/init.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/init.lua
new file mode 100644
index 0000000..cad6dda
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/init.lua
@@ -0,0 +1,5 @@
+oUF = {}
+
+local ns = oUF
+ns.oUF = {}
+ns.oUF.Private = {}
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/oUF.xml b/2/3/4/5/6/7/ElvUI/Libraries/oUF/oUF.xml
new file mode 100644
index 0000000..b238637
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/oUF.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/ouf.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/ouf.lua
new file mode 100644
index 0000000..063dcaf
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/ouf.lua
@@ -0,0 +1,754 @@
+local ns = oUF
+
+local oUF = ns.oUF
+local Private = oUF.Private
+
+local argcheck = Private.argcheck
+
+local print = Private.print
+local error = Private.error
+
+local styles, style = {}
+local callback, units, objects, headers = {}, {}, {}, {}
+
+local elements = {}
+local activeElements = {}
+
+local pairs = pairs
+
+local unitExistsWatchers = {}
+local unitExistsCache = setmetatable({},{
+ __index = function(t, k)
+ local v = UnitExists(k) or false
+ t[k] = v
+ return v
+ end
+})
+
+local function updateUnitWatch(frame)
+ local unit = frame.unit
+ local exists = (unit and unitExistsCache[unit])
+ if exists then
+ frame:Show()
+ else
+ frame:Hide()
+ end
+end
+
+local unitWatch = CreateFrame("Frame")
+unitWatch:Hide()
+
+local timer = 0
+unitWatch:SetScript("OnUpdate", function()
+ timer = timer - arg1
+ if timer <= 0 then
+ timer = 0.2
+
+ for k in pairs(unitExistsCache) do
+ unitExistsCache[k] = nil
+ end
+ for frame in pairs(unitExistsWatchers) do
+ updateUnitWatch(frame)
+ end
+ end
+end)
+unitWatch:SetScript("OnEvent", function() timer = 0 end)
+
+unitWatch:RegisterEvent("PLAYER_TARGET_CHANGED")
+unitWatch:RegisterEvent("PLAYER_FOCUS_CHANGED")
+unitWatch:RegisterEvent("PLAYER_REGEN_DISABLED")
+unitWatch:RegisterEvent("PLAYER_REGEN_ENABLED")
+unitWatch:RegisterEvent("UNIT_PET")
+unitWatch:RegisterEvent("RAID_ROSTER_UPDATE")
+unitWatch:RegisterEvent("PARTY_MEMBERS_CHANGED")
+
+local function RegisterUnitWatch(frame)
+ unitExistsWatchers[frame] = true
+ unitWatch:Show()
+ updateUnitWatch(frame)
+end
+
+local function UnregisterUnitWatch(frame)
+ unitExistsWatchers[frame] = nil
+end
+
+-- updating of "invalid" units.
+local function enableTargetUpdate(object)
+ object.onUpdateFrequency = object.onUpdateFrequency or .5
+ object.__eventless = true
+
+ local total = 0
+ object:SetScript('OnUpdate', function()
+ if not this.unit then
+ return
+ elseif total > this.onUpdateFrequency then
+ this:UpdateAllElements('OnUpdate')
+ total = 0
+ end
+
+ total = total + GetTime()
+ end)
+end
+Private.enableTargetUpdate = enableTargetUpdate
+
+local function updateActiveUnit(self, event, unit)
+ return true
+end
+
+local function iterateChildren(...)
+ for i = 1, table.getn(arg) do
+ local obj = arg[i]
+
+ if(type(obj) == 'table' and obj.isChild) then
+ updateActiveUnit(obj, 'iterateChildren')
+ end
+ end
+end
+
+local function onAttributeChanged(self, name, value)
+ if(name == 'unit' and value) then
+ if(self.hasChildren) then
+ iterateChildren(self:GetChildren())
+ end
+
+ if(not self.onlyProcessChildren) then
+ updateActiveUnit(self, 'OnAttributeChanged')
+ end
+--[[
+ if(self.unit and self.unit == value) then
+ return
+ else
+ if(self.hasChildren) then
+ iterateChildren(self:GetChildren())
+ end
+ end
+]]
+ end
+end
+
+local frame_metatable = {
+ __index = CreateFrame('Button')
+}
+Private.frame_metatable = frame_metatable
+
+for k, v in next, {
+ UpdateElement = function(self, name)
+ local unit = self.unit
+ if(not unit or not UnitExists(unit)) then return end
+
+ local element = elements[name]
+ if(not element or not self:IsElementEnabled(name) or not activeElements[self]) then return end
+ if(element.update) then
+ element.update(self, 'OnShow', unit)
+ end
+ end,
+
+ UpdateElement = function(self, name)
+ local unit = self.unit
+ if(not unit or not UnitExists(unit)) then return end
+
+ local element = elements[name]
+ if(not element or not self:IsElementEnabled(name) or not activeElements[self]) then return end
+ if(element.update) then
+ element.update(self, 'OnShow', unit)
+ end
+ end,
+
+ --[[ frame:EnableElement(name, unit)
+ Used to activate an element for the given unit frame.
+
+ * self - unit frame for which the element should be enabled
+ * name - name of the element to be enabled (string)
+ * unit - unit to be passed to the element's Enable function. Defaults to the frame's unit (string?)
+ --]]
+ EnableElement = function(self, name, unit)
+ argcheck(name, 2, 'string')
+ argcheck(unit, 3, 'string', 'nil')
+
+ local element = elements[name]
+ if(not element or self:IsElementEnabled(name) or not activeElements[self]) then return end
+
+ if(element.enable(self, unit or self.unit)) then
+ activeElements[self][name] = true
+
+ if(element.update) then
+ table.insert(self.__elements, element.update)
+ end
+ end
+ end,
+
+ --[[ frame:DisableElement(name)
+ Used to deactivate an element for the given unit frame.
+
+ * self - unit frame for which the element should be disabled
+ * name - name of the element to be disabled (string)
+ --]]
+ DisableElement = function(self, name)
+ argcheck(name, 2, 'string')
+
+ local enabled = self:IsElementEnabled(name)
+ if(not enabled) then return end
+
+ local update = elements[name].update
+ for k, func in next, self.__elements do
+ if(func == update) then
+ table.remove(self.__elements, k)
+ break
+ end
+ end
+
+ activeElements[self][name] = nil
+
+ -- We need to run a new update cycle in-case we knocked ourself out of sync.
+ -- The main reason we do this is to make sure the full update is completed
+ -- if an element for some reason removes itself _during_ the update
+ -- progress.
+ self:UpdateAllElements('DisableElement')
+
+ return elements[name].disable(self)
+ end,
+
+ --[[ frame:IsElementEnabled(name)
+ Used to check if an element is enabled on the given frame.
+
+ * self - unit frame
+ * name - name of the element (string)
+ --]]
+ IsElementEnabled = function(self, name)
+ argcheck(name, 2, 'string')
+
+ local element = elements[name]
+ if(not element) then return end
+
+ local active = activeElements[self]
+ return active and active[name]
+ end,
+
+ --[[ frame:Enable(asState)
+ Used to toggle the visibility of a unit frame based on the existence of its unit. This is a reference to
+ `RegisterUnitWatch`.
+
+ * self - unit frame
+ * asState - if true, the frame's "state-unitexists" attribute will be set to a boolean value denoting whether the
+ unit exists; if false, the frame will be shown if its unit exists, and hidden if it does not (boolean)
+ --]]
+ Enable = RegisterUnitWatch,
+ --[[ frame:Disable()
+ Used to UnregisterUnitWatch for the given frame and hide it.
+
+ * self - unit frame
+ --]]
+ Disable = function(self)
+ UnregisterUnitWatch(self)
+ self:Hide()
+ end,
+
+ --[[ frame:UpdateAllElements(event)
+ Used to update all enabled elements on the given frame.
+
+ * self - unit frame
+ * event - event name to pass to the elements' update functions (string)
+ --]]
+ UpdateAllElements = function(self, event)
+ local unit = self.unit
+ if(not UnitExists(unit)) then return end
+
+ assert(type(event) == 'string', "Invalid argument 'event' in UpdateAllElements.")
+
+ if(self.PreUpdate) then
+ self:PreUpdate(event)
+ end
+
+ for _, func in next, self.__elements do
+ func(self, event, unit)
+ end
+
+ if(self.PostUpdate) then
+ self:PostUpdate(event)
+ end
+ end,
+} do
+ frame_metatable.__index[k] = v
+end
+
+local secureDropdown
+local function InitializeSecureMenu()
+ local unit = SecureTemplatesDropdown.unit
+ if(not unit) then return end
+
+ local unitType = string.match(unit, '^([a-z]+)[0-9]+$') or unit
+
+ local menu
+ if(unitType == 'party') then
+ menu = 'PARTY'
+ elseif(unitType == 'focus') then
+ menu = 'RAID_TARGET_ICON'
+-- elseif(unitType == 'arenapet' or unitType == 'arena') then
+ elseif(unitType == 'arena') then
+ menu = 'RAID_TARGET_ICON'
+ elseif(UnitIsUnit(unit, 'player')) then
+ menu = 'SELF'
+ elseif(UnitIsUnit(unit, 'pet')) then
+ menu = 'PET'
+ elseif(UnitIsPlayer(unit)) then
+ if(UnitInRaid(unit)) then
+ menu = 'RAID_PLAYER'
+ elseif(UnitInParty(unit)) then
+ menu = 'PARTY'
+ else
+ menu = 'PLAYER'
+ end
+ elseif(UnitIsUnit(unit, 'target')) then
+ menu = 'RAID_TARGET_ICON'
+ end
+
+ if(menu) then
+ UnitPopup_ShowMenu(SecureTemplatesDropdown, menu, unit)
+ end
+end
+
+local function togglemenu(self, unit)
+ if(not secureDropdown) then
+ secureDropdown = CreateFrame('Frame', 'SecureTemplatesDropdown', nil, 'UIDropDownMenuTemplate')
+ secureDropdown:SetID(1)
+
+ table.insert(UnitPopupFrames, secureDropdown:GetName())
+ UIDropDownMenu_Initialize(secureDropdown, InitializeSecureMenu, 'MENU')
+ end
+
+ if(secureDropdown.openedFor and secureDropdown.openedFor ~= self) then
+ CloseDropDownMenus()
+ end
+
+ secureDropdown.unit = string.lower(unit)
+ secureDropdown.openedFor = self
+
+ ToggleDropDownMenu(1, nil, secureDropdown, 'cursor')
+end
+
+local function onShow()
+ return this:UpdateAllElements('OnShow')
+end
+
+local function initObject(unit, style, styleFunc, header, ...)
+ local num = table.getn(arg)
+ for i = 1, num do
+ local object = arg[i]
+ local objectUnit = object.guessUnit or unit
+ local suffix = "ery"
+
+ object.__elements = {}
+ object.__registeredEvents = {}
+ object.style = style
+ object = setmetatable(object, frame_metatable)
+
+ -- Expose the frame through oUF.objects.
+ table.insert(objects, object)
+
+ -- We have to force update the frames when PEW fires.
+ object:RegisterEvent('PLAYER_ENTERING_WORLD', object.UpdateAllElements)
+
+ if(not header) then
+ -- No header means it's a frame created through :Spawn().
+ object.menu = togglemenu
+ object:SetScript("OnClick", function()
+ TargetUnit(unit)
+ end)
+
+ -- Other target units are handled by :HandleUnit().
+ if(suffix == 'target') then
+ enableTargetUpdate(object)
+ else
+ oUF:HandleUnit(object)
+ end
+ else
+ -- Used to update frames when they change position in a group.
+ object:RegisterEvent('RAID_ROSTER_UPDATE', object.UpdateAllElements)
+
+ if(num > 1) then
+ if(object:GetParent() == header) then
+ object.hasChildren = true
+ else
+ object.isChild = true
+ end
+ end
+
+ if(suffix == 'target') then
+ enableTargetUpdate(object)
+ end
+ end
+
+ Private.UpdateUnits(object, objectUnit)
+
+ styleFunc(object, objectUnit, not header)
+
+ --object:SetScript('OnAttributeChanged', onAttributeChanged)
+ object:SetScript('OnShow', onShow)
+
+ activeElements[object] = {}
+ for element in next, elements do
+ object:EnableElement(element, objectUnit)
+ end
+
+ for _, func in next, callback do
+ func(object)
+ end
+
+ -- Make Clique kinda happy
+ _G.ClickCastFrames = ClickCastFrames or {}
+ ClickCastFrames[object] = true
+ end
+end
+
+local function walkObject(object, unit)
+ local parent = object:GetParent()
+ local style = parent.style or style
+ local styleFunc = styles[style]
+
+ local header = parent.headerType and parent
+
+ -- Check if we should leave the main frame blank.
+ if(object.onlyProcessChildren) then
+ object.hasChildren = true
+ object:SetScript('OnAttributeChanged', onAttributeChanged)
+ return initObject(unit, style, styleFunc, header, object:GetChildren())
+ end
+
+ return initObject(unit, style, styleFunc, header, object, object:GetChildren())
+end
+
+--[[ oUF:RegisterInitCallback(func)
+Used to add a function to a table to be executed upon unit frame/header initialization.
+
+* self - the global oUF object
+* func - function to be added
+--]]
+function oUF:RegisterInitCallback(func)
+ table.insert(callback, func)
+end
+
+--[[ oUF:RegisterMetaFunction(name, func)
+Used to make a (table of) function(s) available to all unit frames.
+
+* self - the global oUF object
+* name - unique name of the function (string)
+* func - function or a table of functions (function or table)
+--]]
+function oUF:RegisterMetaFunction(name, func)
+ argcheck(name, 2, 'string')
+ argcheck(func, 3, 'function', 'table')
+
+ if(frame_metatable.__index[name]) then
+ return
+ end
+
+ frame_metatable.__index[name] = func
+end
+
+--[[ oUF:RegisterStyle(name, func)
+Used to register a style with oUF. This will also set the active style if it hasn't been set yet.
+
+* self - the global oUF object
+* name - name of the style
+* func - function(s) defining the style (function or table)
+--]]
+function oUF:RegisterStyle(name, func)
+ argcheck(name, 2, 'string')
+ argcheck(func, 3, 'function', 'table')
+
+ if(styles[name]) then return error('Style [%s] already registered.', name) end
+ if(not style) then style = name end
+
+ styles[name] = func
+end
+
+--[[ oUF:SetActiveStyle(name)
+Used to set the active style.
+
+* self - the global oUF object
+* name - name of the style (string)
+--]]
+function oUF:SetActiveStyle(name)
+ argcheck(name, 2, 'string')
+ if(not styles[name]) then return error('Style [%s] does not exist.', name) end
+
+ style = name
+end
+
+do
+ local function iter(_, n)
+ -- don't expose the style functions.
+ return (next(styles, n))
+ end
+
+ --[[ oUF:IterateStyles()
+ Returns an iterator over all registered styles.
+
+ * self - the global oUF object
+ --]]
+ function oUF.IterateStyles()
+ return iter, nil, nil
+ end
+end
+
+local getCondition
+do
+ local conditions = {
+ raid40 = '[target=raid26,exists] show;',
+ raid25 = '[target=raid11,exists] show;',
+ raid10 = '[target=raid6,exists] show;',
+ raid = '[group:raid] show;',
+ party = '[group:party,nogroup:raid] show;',
+ solo = '[target=player,exists,nogroup:party] show;',
+ }
+
+ function getCondition(...)
+ local cond = ''
+
+ for i = 1, select('#', arg) do
+ local short = select(i, unpack(arg))
+
+ local condition = conditions[short]
+ if(condition) then
+ cond = cond .. condition
+ end
+ end
+
+ return cond .. 'hide'
+ end
+end
+
+local function generateName(unit, ...)
+ local name = 'oUF_' .. style:gsub('^oUF_?', ''):gsub('[^%a%d_]+', '')
+
+ local raid, party, groupFilter
+ for i = 1, select('#', arg), 2 do
+ local att, val = select(i, unpack(arg))
+ if(att == 'showRaid') then
+ raid = true
+ elseif(att == 'showParty') then
+ party = true
+ elseif(att == 'groupFilter') then
+ groupFilter = val
+ end
+ end
+
+ local append
+ if(raid) then
+ if(groupFilter) then
+ if(type(groupFilter) == 'number' and groupFilter > 0) then
+ append = groupFilter
+ elseif(groupFilter:match('TANK')) then
+ append = 'MainTank'
+ elseif(groupFilter:match('ASSIST')) then
+ append = 'MainAssist'
+ else
+ local _, count = groupFilter:gsub(',', '')
+ if(count == 0) then
+ append = 'Raid' .. groupFilter
+ else
+ append = 'Raid'
+ end
+ end
+ else
+ append = 'Raid'
+ end
+ elseif(party) then
+ append = 'Party'
+ elseif(unit) then
+ append = unit:gsub('^%l', string.upper)
+ end
+
+ if(append) then
+ name = name .. append
+ end
+
+ local base = name
+ local i = 2
+ while(_G[name]) do
+ name = base .. i
+ i = i + 1
+ end
+
+ return name
+end
+
+do
+ local function styleProxy(self, frame, ...)
+ return walkObject(_G[frame])
+ end
+
+ -- There has to be an easier way to do this.
+ local initialConfigFunction = function(self)
+ local header = self:GetParent()
+ for i = 1, select('#', self), 1 do
+ local frame = select(i, self)
+ local unit
+ -- There's no need to do anything on frames with onlyProcessChildren
+ if(not frame.onlyProcessChildren) then
+ -- Attempt to guess what the header is set to spawn.
+ local groupFilter = header:GetAttribute('groupFilter')
+
+ if(type(groupFilter) == 'string' and groupFilter:match('MAIN[AT]')) then
+ local role = groupFilter:match('MAIN([AT])')
+ if(role == 'T') then
+ unit = 'maintank'
+ else
+ unit = 'mainassist'
+ end
+ elseif(header:GetAttribute('showRaid')) then
+ unit = 'raid'
+ elseif(header:GetAttribute('showParty')) then
+ unit = 'party'
+ end
+
+ local headerType = header.headerType
+ local suffix = frame:GetAttribute('unitsuffix')
+ if(unit and suffix) then
+ if(headerType == 'pet' and suffix == 'target') then
+ unit = unit .. headerType .. suffix
+ else
+ unit = unit .. suffix
+ end
+ elseif(unit and headerType == 'pet') then
+ unit = unit .. headerType
+ end
+
+ frame.menu = togglemenu
+ frame:SetAttribute('type1', 'target')
+ frame:SetAttribute('type2', 'menu')
+ frame.guessUnit = unit
+ end
+ end
+
+ header:styleFunction(self:GetName())
+ end
+
+ --[[ oUF:SpawnHeader(overrideName, template, visibility, ...)
+ Used to create a group header and apply the currently active style to it.
+
+ * self - the global oUF object
+ * overrideName - unique global name to be used for the header. Defaults to an auto-generated name based on the name
+ of the active style and other arguments passed to `:SpawnHeader` (string?)
+ * template - name of a template to be used for creating the header. Defaults to `'SecureGroupHeaderTemplate'`
+ (string?)
+ * visibility - macro conditional(s) which define when to display the header (string).
+ * ... - further argument pairs. Consult [Group Headers](http://wowprogramming.com/docs/secure_template/Group_Headers)
+ for possible values.
+
+ In addition to the standard group headers, oUF implements some of its own attributes. These can be supplied by the
+ layout, but are optional.
+
+ * oUF-initialConfigFunction - can contain code that will be securely run at the end of the initial secure
+ configuration (string?)
+ * oUF-onlyProcessChildren - can be used to force headers to only process children (boolean?)
+ --]]
+ function oUF:SpawnHeader(overrideName, template, visibility, ...)
+ if(not style) then return error('Unable to create frame. No styles have been registered.') end
+
+ template = (template or 'SecureGroupHeaderTemplate')
+
+ local isPetHeader = string.match(template, 'PetHeader')
+ local name = overrideName or generateName(nil, unpack(arg))
+ local header = CreateFrame('Frame', name, UIParent, template)
+
+ header:SetAttribute('template', 'SecureUnitButtonTemplate')
+ for i = 1, select('#', arg), 2 do
+ local att, val = select(i, unpack(arg))
+ if(not att) then break end
+ header:SetAttribute(att, val)
+ end
+
+ header.style = style
+ header.styleFunction = styleProxy
+ header.visibility = visibility
+
+ -- Expose the header through oUF.headers.
+ table.insert(headers, header)
+
+ header.initialConfigFunction = initialConfigFunction
+ header.headerType = isPetHeader and 'pet' or 'group'
+
+ if(header:GetAttribute('showParty')) then
+ self:DisableBlizzard('party')
+ end
+
+ if(visibility) then
+ local type, list = string.split(' ', visibility, 2)
+ if(list and type == 'custom') then
+ RegisterStateDriver(header, 'visibility', list)
+ header.visibility = list
+ else
+ local condition = getCondition(string.split(',', visibility))
+ RegisterStateDriver(header, 'visibility', condition)
+ header.visibility = condition
+ end
+ end
+
+ return header
+ end
+end
+
+--[[ oUF:Spawn(unit, overrideName)
+Used to create a single unit frame and apply the currently active style to it.
+
+* self - the global oUF object
+* unit - the frame's unit (string)
+* overrideName - unique global name to use for the unit frame. Defaults to an auto-generated name based on the unit
+ (string?)
+--]]
+function oUF:Spawn(unit, overrideName)
+ argcheck(unit, 2, 'string')
+ if(not style) then return error('Unable to create frame. No styles have been registered.') end
+
+ unit = string.lower(unit)
+
+ local name = overrideName or generateName(unit)
+ local object = CreateFrame('Button', name, UIParent)
+ object:Hide()
+ Private.UpdateUnits(object, unit)
+
+ self:DisableBlizzard(unit)
+ units[unit] = object
+ walkObject(object, unit)
+
+ object.unit = unit
+
+ return object
+end
+
+--[[ oUF:AddElement(name, update, enable, disable)
+Used to register an element with oUF.
+
+* self - the global oUF object
+* name - unique name of the element (string)
+* update - used to update the element (function?)
+* enable - used to enable the element for a given unit frame and unit (function?)
+* disable - used to disable the element for a given unit frame (function?)
+--]]
+function oUF:AddElement(name, update, enable, disable)
+ argcheck(name, 2, 'string')
+ argcheck(update, 3, 'function', 'nil')
+ argcheck(enable, 4, 'function', 'nil')
+ argcheck(disable, 5, 'function', 'nil')
+
+ if(elements[name]) then return error('Element [%s] is already registered.', name) end
+ elements[name] = {
+ update = update;
+ enable = enable;
+ disable = disable;
+ }
+end
+
+--[[ oUF.units
+Array containing all unit frames with existing units created by oUF:Spawn.
+--]]
+oUF.units = units
+--[[ oUF.objects
+Array containing all unit frames created by `oUF:Spawn`.
+--]]
+oUF.objects = objects
+--[[ oUF.headers
+Array containing all group headers created by `oUF:SpawnHeader`.
+--]]
+oUF.headers = headers
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/private.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/private.lua
new file mode 100644
index 0000000..c481ad4
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/private.lua
@@ -0,0 +1,22 @@
+local ns = oUF
+local Private = ns.oUF.Private
+
+function Private.argcheck(value, num, ...)
+ assert(type(num) == 'number', "Bad argument #2 to 'argcheck' (number expected, got " .. type(num) .. ')')
+
+ for i = 1, select('#', arg) do
+ if(type(value) == select(i, unpack(arg))) then return end
+ end
+
+ local types = strjoin(', ', unpack(arg))
+ local name = string.match(debugstack(2,2,0), ": in function [`<](.-)['>]")
+ error(string.format("Bad argument #%d to '%s' (%s expected, got %s)", num, name, types, type(value)), 3)
+end
+
+function Private.print(...)
+ print('|cff33ff99oUF:|r', unpack(arg))
+end
+
+function Private.error(...)
+ Private.print('|cffff0000Error:|r ' .. string.format(unpack(arg)))
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Libraries/oUF/units.lua b/2/3/4/5/6/7/ElvUI/Libraries/oUF/units.lua
new file mode 100644
index 0000000..3586799
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Libraries/oUF/units.lua
@@ -0,0 +1,20 @@
+local ns = oUF
+local oUF = ns.oUF
+local Private = oUF.Private
+
+local enableTargetUpdate = Private.enableTargetUpdate
+
+-- Handles unit specific actions.
+function oUF:HandleUnit(object, unit)
+ local unit = object.unit or unit
+
+ if(unit == 'target') then
+ object:RegisterEvent('PLAYER_TARGET_CHANGED', object.UpdateAllElements)
+ elseif(unit == 'mouseover') then
+ object:RegisterEvent('UPDATE_MOUSEOVER_UNIT', object.UpdateAllElements)
+ elseif(unit == 'focus') then
+ object:RegisterEvent('PLAYER_FOCUS_CHANGED', object.UpdateAllElements)
+ elseif(string.match(unit, '%w+target')) then
+ enableTargetUpdate(object)
+ end
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/Load_Modules.xml b/2/3/4/5/6/7/ElvUI/Modules/Load_Modules.xml
index 310b330..ec4e5fd 100644
--- a/2/3/4/5/6/7/ElvUI/Modules/Load_Modules.xml
+++ b/2/3/4/5/6/7/ElvUI/Modules/Load_Modules.xml
@@ -3,6 +3,7 @@
+
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Config_Enviroment.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Config_Enviroment.lua
new file mode 100644
index 0000000..4d6070f
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Config_Enviroment.lua
@@ -0,0 +1,297 @@
+local E, L, V, P, G = unpack(ElvUI)
+local UF = E:GetModule("UnitFrames");
+local ns = oUF
+local ElvUF = ns.oUF
+
+local _G = _G;
+local setmetatable, getfenv, setfenv = setmetatable, getfenv, setfenv;
+local type, unpack, select, pairs = type, unpack, select, pairs;
+local min, random = math.min, math.random;
+local format = string.format;
+
+local UnitMana = UnitMana;
+local UnitManaMax = UnitManaMax;
+local UnitHealth = UnitHealth;
+local UnitHealthMax = UnitHealthMax;
+local UnitName = UnitName;
+local UnitClass = UnitClass;
+local InCombatLockdown = InCombatLockdown;
+local UnregisterUnitWatch = UnregisterUnitWatch;
+local RegisterUnitWatch = RegisterUnitWatch;
+local RegisterStateDriver = RegisterStateDriver;
+local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE;
+local CLASS_SORT_ORDER = CLASS_SORT_ORDER;
+local MAX_RAID_MEMBERS = MAX_RAID_MEMBERS;
+
+local attributeBlacklist = {["showRaid"] = true, ["showParty"] = true, ["showSolo"] = true}
+local configEnv
+local originalEnvs = {}
+local overrideFuncs = {}
+
+local function createConfigEnv()
+ if( configEnv ) then return end
+ configEnv = setmetatable({
+ UnitMana = function (unit, displayType)
+ if(unit:find("target") or unit:find("focus")) then
+ return UnitMana(unit, displayType);
+ end
+
+ return random(1, UnitManaMax(unit, displayType) or 1);
+ end,
+ UnitHealth = function(unit)
+ if(unit:find("target") or unit:find("focus")) then
+ return UnitHealth(unit);
+ end
+
+ return random(1, UnitHealthMax(unit));
+ end,
+ UnitName = function(unit)
+ if(unit:find("target") or unit:find("focus")) then
+ return UnitName(unit);
+ end
+ if(E.CreditsList) then
+ local max = #E.CreditsList;
+ return E.CreditsList[random(1, max)];
+ end
+ return "Test Name";
+ end,
+ UnitClass = function(unit)
+ if(unit:find("target") or unit:find("focus")) then
+ return UnitClass(unit);
+ end
+
+ local classToken = CLASS_SORT_ORDER[random(1, #(CLASS_SORT_ORDER))];
+ return LOCALIZED_CLASS_NAMES_MALE[classToken], classToken;
+ end,
+ Hex = function(r, g, b)
+ if(type(r) == "table") then
+ if(r.r) then r, g, b = r.r, r.g, r.b; else r, g, b = unpack(r); end
+ end
+ return format("|cff%02x%02x%02x", r*255, g*255, b*255);
+ end,
+ ColorGradient = ElvUF.ColorGradient,
+ }, {
+ __index = _G,
+ __newindex = function(_, key, value) _G[key] = value end,
+ })
+
+ overrideFuncs["namecolor"] = ElvUF.Tags.Methods["namecolor"]
+ overrideFuncs["name:veryshort"] = ElvUF.Tags.Methods["name:veryshort"]
+ overrideFuncs["name:short"] = ElvUF.Tags.Methods["name:short"]
+ overrideFuncs["name:medium"] = ElvUF.Tags.Methods["name:medium"]
+ overrideFuncs["name:long"] = ElvUF.Tags.Methods["name:long"]
+
+ overrideFuncs["healthcolor"] = ElvUF.Tags.Methods["healthcolor"]
+ overrideFuncs["health:current"] = ElvUF.Tags.Methods["health:current"]
+ overrideFuncs["health:deficit"] = ElvUF.Tags.Methods["health:deficit"]
+ overrideFuncs["health:current-percent"] = ElvUF.Tags.Methods["health:current-percent"]
+ overrideFuncs["health:current-max"] = ElvUF.Tags.Methods["health:current-max"]
+ overrideFuncs["health:current-max-percent"] = ElvUF.Tags.Methods["health:current-max-percent"]
+ overrideFuncs["health:max"] = ElvUF.Tags.Methods["health:max"]
+ overrideFuncs["health:percent"] = ElvUF.Tags.Methods["health:percent"]
+
+ overrideFuncs["powercolor"] = ElvUF.Tags.Methods["powercolor"]
+ overrideFuncs["power:current"] = ElvUF.Tags.Methods["power:current"]
+ overrideFuncs["power:deficit"] = ElvUF.Tags.Methods["power:deficit"]
+ overrideFuncs["power:current-percent"] = ElvUF.Tags.Methods["power:current-percent"]
+ overrideFuncs["power:current-max"] = ElvUF.Tags.Methods["power:current-max"]
+ overrideFuncs["power:current-max-percent"] = ElvUF.Tags.Methods["power:current-max-percent"]
+ overrideFuncs["power:max"] = ElvUF.Tags.Methods["power:max"]
+ overrideFuncs["power:percent"] = ElvUF.Tags.Methods["power:percent"]
+end
+
+function UF:ForceShow(frame)
+ if InCombatLockdown() then return; end
+ if not frame.isForced then
+ frame.oldUnit = frame.unit
+ frame.unit = "player"
+ frame.isForced = true;
+ frame.oldOnUpdate = frame:GetScript("OnUpdate")
+ end
+
+ frame:SetScript("OnUpdate", nil)
+ frame.forceShowAuras = true
+ UnregisterUnitWatch(frame)
+ RegisterUnitWatch(frame, true)
+
+ frame:Show()
+ if frame:IsVisible() and frame.Update then
+ frame:Update()
+ end
+
+ if(_G[frame:GetName().."Target"]) then
+ self:ForceShow(_G[frame:GetName().."Target"]);
+ end
+
+ if(_G[frame:GetName().."Pet"]) then
+ self:ForceShow(_G[frame:GetName().."Pet"]);
+ end
+end
+
+function UF:UnforceShow(frame)
+ if InCombatLockdown() then return; end
+ if not frame.isForced then
+ return
+ end
+ frame.forceShowAuras = nil
+ frame.isForced = nil
+
+ -- Ask the SecureStateDriver to show/hide the frame for us
+ UnregisterUnitWatch(frame)
+ RegisterUnitWatch(frame)
+
+ if frame.oldOnUpdate then
+ frame:SetScript("OnUpdate", frame.oldOnUpdate)
+ frame.oldOnUpdate = nil
+ end
+
+ frame.unit = frame.oldUnit or frame.unit
+ -- If we're visible force an update so everything is properly in a
+ -- non-config mode state
+ if frame:IsVisible() and frame.Update then
+ frame:Update()
+ end
+
+ if(_G[frame:GetName().."Target"]) then
+ self:UnforceShow(_G[frame:GetName().."Target"])
+ end
+
+ if(_G[frame:GetName().."Pet"]) then
+ self:UnforceShow(_G[frame:GetName().."Pet"])
+ end
+end
+
+function UF:ShowChildUnits(header, ...)
+ header.isForced = true
+
+ for i=1, select("#", ...) do
+ local frame = select(i, ...)
+ frame:RegisterForClicks(nil)
+ frame:SetID(i)
+ frame.TargetGlow:SetAlpha(0)
+ self:ForceShow(frame)
+ end
+end
+
+function UF:UnshowChildUnits(header, ...)
+ header.isForced = nil
+
+ for i=1, select("#", ...) do
+ local frame = select(i, ...)
+ frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
+ frame.TargetGlow:SetAlpha(1)
+ self:UnforceShow(frame)
+ end
+end
+
+local function OnAttributeChanged(self)
+ if not self:GetParent().forceShow and not self.forceShow then return; end
+ if not self:IsShown() then return end
+
+ local db = self.db or self:GetParent().db
+ local maxUnits = MAX_RAID_MEMBERS
+
+ local startingIndex = db.raidWideSorting and -(min(db.numGroups * (db.groupsPerRowCol * 5), maxUnits) + 1) or -4
+ if self:GetAttribute("startingIndex") ~= startingIndex then
+ self:SetAttribute("startingIndex", startingIndex)
+ UF:ShowChildUnits(self, self:GetChildren())
+ end
+end
+
+function UF:HeaderConfig(header, configMode)
+ if InCombatLockdown() then return; end
+
+ createConfigEnv()
+ header.forceShow = configMode
+ header.forceShowAuras = configMode
+ header.isForced = configMode
+
+ if configMode then
+ for _, func in pairs(overrideFuncs) do
+ if type(func) == "function" then
+ if not originalEnvs[func] then
+ originalEnvs[func] = getfenv(func)
+ setfenv(func, configEnv)
+ end
+ end
+ end
+
+ RegisterStateDriver(header, "visibility", "show")
+ else
+ for func, env in pairs(originalEnvs) do
+ setfenv(func, env)
+ originalEnvs[func] = nil
+ end
+
+ RegisterStateDriver(header, "visibility", header.db.visibility)
+
+ if(header:GetScript("OnEvent")) then
+ header:GetScript("OnEvent")(header, "PLAYER_ENTERING_WORLD");
+ end
+ end
+
+ for i=1, #header.groups do
+ local group = header.groups[i]
+
+ if group:IsShown() then
+ group.forceShow = header.forceShow
+ group.forceShowAuras = header.forceShowAuras
+ group:HookScript("OnAttributeChanged", OnAttributeChanged)
+ if configMode then
+ for key in pairs(attributeBlacklist) do
+ group:SetAttribute(key, nil)
+ end
+
+ OnAttributeChanged(group)
+
+ group:Update()
+ else
+ for key in pairs(attributeBlacklist) do
+ group:SetAttribute(key, true)
+ end
+
+ UF:UnshowChildUnits(group, group:GetChildren())
+ group:SetAttribute("startingIndex", 1)
+
+ group:Update()
+ end
+ end
+ end
+
+ UF["headerFunctions"][header.groupName]:AdjustVisibility(header);
+end
+
+function UF:PLAYER_REGEN_DISABLED()
+ for _, header in pairs(UF["headers"]) do
+ if header.forceShow then
+ self:HeaderConfig(header)
+ end
+ end
+
+ for _, unit in pairs(UF["units"]) do
+ local frame = self[unit]
+ if frame and frame.forceShow then
+ self:UnforceShow(frame)
+ end
+ end
+
+ for i=1, 5 do
+ if self["arena"..i] and self["arena"..i].isForced then
+ self:UnforceShow(self["arena"..i])
+ end
+ end
+
+ for i=1, 4 do
+ if self["boss"..i] and self["boss"..i].isForced then
+ self:UnforceShow(self["boss"..i])
+ end
+ end
+
+ for i=1, 4 do
+ if self["party"..i] and self["party"..i].isForced then
+ self:UnforceShow(self["party"..i])
+ end
+ end
+end
+
+UF:RegisterEvent("PLAYER_REGEN_DISABLED")
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Health.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Health.lua
new file mode 100644
index 0000000..1ac1966
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Health.lua
@@ -0,0 +1,218 @@
+local E, L, V, P, G = unpack(ElvUI)
+local UF = E:GetModule("UnitFrames")
+
+local random = random
+
+local CreateFrame = CreateFrame
+local UnitIsTapped = UnitIsTapped
+local UnitIsTappedByPlayer = UnitIsTappedByPlayer
+local UnitReaction = UnitReaction
+local UnitIsPlayer = UnitIsPlayer
+local UnitClass = UnitClass
+local UnitIsDeadOrGhost = UnitIsDeadOrGhost
+
+local ns = oUF
+local ElvUF = ns.oUF
+assert(ElvUF, "ElvUI was unable to locate oUF.")
+
+function UF:Construct_HealthBar(frame, bg, text, textPos)
+ local health = CreateFrame("StatusBar", nil, frame)
+ UF["statusbars"][health] = true
+
+ health:SetFrameLevel(10)
+ health.PostUpdate = self.PostUpdateHealth
+
+ CreateStatusBarTexturePointer(health)
+
+ if bg then
+ health.bg = health:CreateTexture(nil, "BORDER")
+ health.bg:SetAllPoints()
+ health.bg:SetTexture(E["media"].blankTex)
+ health.bg.multiplier = 0.25
+ end
+
+ if text then
+ health.value = frame.RaisedElementParent:CreateFontString(nil, "OVERLAY")
+ UF:Configure_FontString(health.value)
+
+ local x = -2
+ if textPos == "LEFT" then
+ x = 2
+ end
+
+ health.value:SetPoint(textPos, health, textPos, x, 0)
+ end
+
+ health.colorTapping = true
+ health.colorDisconnected = true
+ E:CreateBackdrop(health, "Default", nil, nil, self.thinBorders, true)
+
+ return health
+end
+
+function UF:Configure_HealthBar(frame)
+ if not frame.VARIABLES_SET then return end
+
+ local db = frame.db
+ local health = frame.Health
+
+ health.Smooth = self.db.smoothbars
+ health.SmoothSpeed = self.db.smoothSpeed * 10
+
+ if health.value then
+ local attachPoint = self:GetObjectAnchorPoint(frame, db.health.attachTextTo)
+ health.value:ClearAllPoints()
+ health.value:SetPoint(db.health.position, attachPoint, db.health.position, db.health.xOffset, db.health.yOffset)
+ frame:Tag(health.value, db.health.text_format)
+ end
+
+ health.colorSmooth = nil
+ health.colorHealth = nil
+ health.colorClass = nil
+ health.colorReaction = nil
+ if db.colorOverride and db.colorOverride == "FORCE_ON" then
+ health.colorClass = true
+ health.colorReaction = true
+ elseif db.colorOverride and db.colorOverride == "FORCE_OFF" then
+ if self.db["colors"].colorhealthbyvalue == true then
+ health.colorSmooth = true
+ else
+ health.colorHealth = true
+ end
+ else
+ if self.db.colors.healthclass ~= true then
+ if self.db.colors.colorhealthbyvalue == true then
+ health.colorSmooth = true
+ else
+ health.colorHealth = true
+ end
+ else
+ health.colorClass = (not self.db.colors.forcehealthreaction)
+ health.colorReaction = true
+ end
+ end
+
+ health:ClearAllPoints()
+ if frame.ORIENTATION == "LEFT" then
+ health:SetWidth(frame.UNIT_WIDTH - (frame.BORDER + frame.SPACING) - (frame.HAPPINESS_WIDTH or 0))
+ health:SetHeight(frame.UNIT_HEIGHT - frame.POWERBAR_HEIGHT - (frame.BORDER + frame.SPACING) - frame.CLASSBAR_YOFFSET)
+
+ if frame.USE_POWERBAR_OFFSET then
+ health:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -frame.BORDER - frame.SPACING - frame.POWERBAR_OFFSET - (frame.HAPPINESS_WIDTH or 0), -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
+ health:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING, frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET)
+ elseif frame.POWERBAR_DETACHED or not frame.USE_POWERBAR or frame.USE_INSET_POWERBAR then
+ health:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING, frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET)
+ elseif frame.USE_MINI_POWERBAR then
+ health:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING, frame.SPACING + (frame.POWERBAR_HEIGHT/2))
+ else
+ health:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING, frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET)
+ end
+ elseif frame.ORIENTATION == "RIGHT" then
+ health:SetPoint("TOPLEFT", frame, "TOPLEFT", frame.BORDER + frame.SPACING + (frame.HAPPINESS_WIDTH or 0), -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
+
+ if frame.USE_POWERBAR_OFFSET then
+ health:SetPoint("TOPLEFT", frame, "TOPLEFT", frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET + (frame.HAPPINESS_WIDTH or 0), -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
+ health:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -frame.PORTRAIT_WIDTH - frame.BORDER - frame.SPACING, frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET)
+ elseif frame.POWERBAR_DETACHED or not frame.USE_POWERBAR or frame.USE_INSET_POWERBAR then
+ health:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -frame.PORTRAIT_WIDTH - frame.BORDER - frame.SPACING, frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET)
+ elseif frame.USE_MINI_POWERBAR then
+ health:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -frame.PORTRAIT_WIDTH - frame.BORDER - frame.SPACING, frame.SPACING + (frame.POWERBAR_HEIGHT/2))
+ else
+ health:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -frame.PORTRAIT_WIDTH - frame.BORDER - frame.SPACING, frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET)
+ end
+ elseif frame.ORIENTATION == "MIDDLE" then
+ health:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -frame.BORDER - frame.SPACING - (frame.HAPPINESS_WIDTH or 0), -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
+
+ if frame.USE_POWERBAR_OFFSET then
+ health:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -frame.BORDER - frame.SPACING - frame.POWERBAR_OFFSET, -frame.BORDER - frame.SPACING - frame.CLASSBAR_YOFFSET)
+ health:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET, frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET)
+ elseif frame.POWERBAR_DETACHED or not frame.USE_POWERBAR or frame.USE_INSET_POWERBAR then
+ health:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", frame.BORDER + frame.SPACING + frame.POWERBAR_OFFSET, frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET)
+ elseif frame.USE_MINI_POWERBAR then
+ health:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", frame.BORDER + frame.SPACING, frame.SPACING + (frame.POWERBAR_HEIGHT/2))
+ else
+ health:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", frame.PORTRAIT_WIDTH + frame.BORDER + frame.SPACING, frame.BORDER + frame.SPACING + frame.BOTTOM_OFFSET)
+ end
+ end
+
+ health.bg:ClearAllPoints()
+ if not frame.USE_PORTRAIT_OVERLAY then
+ health.bg:SetParent(health)
+ health.bg:SetAllPoints()
+ else
+ health.bg:SetPoint("BOTTOMLEFT", health.texturePointer, "BOTTOMRIGHT")
+ health.bg:SetPoint("TOPRIGHT", health)
+ health.bg:SetParent(frame.Portrait.overlay)
+ end
+
+ if db.health then
+ if db.health.orientation then
+ health:SetOrientation(db.health.orientation)
+ end
+
+ if db.health.frequentUpdates then
+ health.frequentUpdates = db.health.frequentUpdates
+ end
+ end
+
+ UF:ToggleTransparentStatusBar(UF.db.colors.transparentHealth, frame.Health, frame.Health.bg, (frame.USE_PORTRAIT and frame.USE_PORTRAIT_OVERLAY) ~= true)
+
+ frame:UpdateElement("Health")
+end
+
+function UF:GetHealthBottomOffset(frame)
+ local bottomOffset = 0
+ if frame.USE_POWERBAR and not frame.POWERBAR_DETACHED and not frame.USE_INSET_POWERBAR then
+ bottomOffset = bottomOffset + frame.POWERBAR_HEIGHT - (frame.BORDER-frame.SPACING)
+ end
+ if frame.USE_INFO_PANEL then
+ bottomOffset = bottomOffset + frame.INFO_PANEL_HEIGHT - (frame.BORDER-frame.SPACING)
+ end
+
+ return bottomOffset
+end
+
+function UF:PostUpdateHealth(unit, min, max)
+ local parent = self:GetParent()
+ if parent.isForced then
+ min = random(1, max)
+ self:SetValue(min)
+ end
+
+ local r, g, b = self:GetStatusBarColor()
+ local colors = E.db["unitframe"]["colors"]
+ if ((colors.healthclass == true and colors.colorhealthbyvalue == true) or (colors.colorhealthbyvalue and parent.isForced)) and not (UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit)) then
+ local newr, newg, newb = ElvUF.ColorGradient(min, max, 1, 0, 0, 1, 1, 0, r, g, b)
+
+ self:SetStatusBarColor(newr, newg, newb)
+ if self.bg and self.bg.multiplier then
+ local mu = self.bg.multiplier
+ self.bg:SetVertexColor(newr * mu, newg * mu, newb * mu)
+ end
+ end
+
+ if colors.classbackdrop then
+ local reaction = UnitReaction(unit, "player")
+ local t
+ if UnitIsPlayer(unit) then
+ local _, class = UnitClass(unit)
+ t = parent.colors.class[class]
+ elseif(reaction) then
+ t = parent.colors.reaction[reaction]
+ end
+
+ if t then
+ self.bg:SetVertexColor(t[1], t[2], t[3])
+ end
+ end
+
+ if colors.customhealthbackdrop then
+ local backdrop = colors.health_backdrop
+ self.bg:SetVertexColor(backdrop.r, backdrop.g, backdrop.b)
+ end
+
+ if colors.useDeadBackdrop and UnitIsDeadOrGhost(unit) then
+ local backdrop = colors.health_backdrop_dead
+ self.bg:SetVertexColor(backdrop.r, backdrop.g, backdrop.b)
+ end
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/InfoPanel.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/InfoPanel.lua
new file mode 100644
index 0000000..40d34b8
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/InfoPanel.lua
@@ -0,0 +1,46 @@
+local E, L, V, P, G = unpack(ElvUI)
+local UF = E:GetModule("UnitFrames")
+
+function UF:Construct_InfoPanel(frame)
+ local infoPanel = CreateFrame("Frame", nil, frame)
+ infoPanel:SetFrameLevel(7)
+ local thinBorders = self.thinBorders
+ infoPanel:CreateBackdrop("Default", true, nil, thinBorders, true)
+
+ return infoPanel
+end
+
+function UF:Configure_InfoPanel(frame)
+ if(not frame.VARIABLES_SET) then return end
+ local db = frame.db
+
+ if(frame.USE_INFO_PANEL) then
+ frame.InfoPanel:Show()
+ frame.InfoPanel:ClearAllPoints()
+
+ if(frame.ORIENTATION == "RIGHT" and not (frame.unitframeType == "arena")) then
+ frame.InfoPanel:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -frame.BORDER - frame.SPACING, frame.BORDER + frame.SPACING)
+ if(frame.USE_POWERBAR and not frame.USE_INSET_POWERBAR and not frame.POWERBAR_DETACHED) then
+ frame.InfoPanel:Point("TOPLEFT", frame.Power.backdrop, "BOTTOMLEFT", frame.BORDER - frame.HAPPINESS_WIDTH, -(frame.SPACING*3))
+ else
+ frame.InfoPanel:Point("TOPLEFT", frame.Health.backdrop, "BOTTOMLEFT", frame.BORDER - frame.HAPPINESS_WIDTH, -(frame.SPACING*3))
+ end
+ else
+ frame.InfoPanel:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", frame.BORDER + frame.SPACING, frame.BORDER + frame.SPACING)
+ if(frame.USE_POWERBAR and not frame.USE_INSET_POWERBAR and not frame.POWERBAR_DETACHED) then
+ frame.InfoPanel:Point("TOPRIGHT", frame.Power.backdrop, "BOTTOMRIGHT", -frame.BORDER + frame.HAPPINESS_WIDTH, -(frame.SPACING*3))
+ else
+ frame.InfoPanel:Point("TOPRIGHT", frame.Health.backdrop, "BOTTOMRIGHT", -frame.BORDER + frame.HAPPINESS_WIDTH, -(frame.SPACING*3))
+ end
+ end
+
+ local thinBorders = self.thinBorders
+ if(db.infoPanel.transparent) then
+ frame.InfoPanel.backdrop:SetTemplate("Transparent", nil, nil, thinBorders, true)
+ else
+ frame.InfoPanel.backdrop:SetTemplate("Default", true, nil, thinBorders, true)
+ end
+ else
+ frame.InfoPanel:Hide()
+ end
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Load_Elements.xml b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Load_Elements.xml
new file mode 100644
index 0000000..fe5607f
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Load_Elements.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Name.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Name.lua
new file mode 100644
index 0000000..c5b6d33
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Name.lua
@@ -0,0 +1,48 @@
+local E, L, V, P, G = unpack(ElvUI);
+local UF = E:GetModule("UnitFrames");
+
+local UnitIsPlayer = UnitIsPlayer
+
+function UF:Construct_NameText(frame)
+ local name = frame.RaisedElementParent:CreateFontString(nil, "OVERLAY")
+ UF:Configure_FontString(name)
+ name:SetPoint("CENTER", frame.Health)
+
+ return name
+end
+
+function UF:UpdateNameSettings(frame, childType)
+ local db = frame.db
+ if childType == "pet" then
+ db = frame.db.petsGroup
+ elseif childType == "target" then
+ db = frame.db.targetsGroup
+ end
+
+ local name = frame.Name
+ if not db.power or not db.power.enable or not db.power.hideonnpc then
+ local attachPoint = self:GetObjectAnchorPoint(frame, db.name.attachTextTo)
+ name:ClearAllPoints()
+ name:SetPoint(db.name.position, attachPoint, db.name.position, db.name.xOffset, db.name.yOffset)
+ end
+
+ frame:Tag(name, db.name.text_format)
+end
+
+function UF:PostNamePosition(frame, unit)
+ if not frame.Power.value:IsShown() then return end
+ local db = frame.db
+ if UnitIsPlayer(unit) or (db.power and not db.power.enable) then
+ local position = db.name.position
+ local attachPoint = self:GetObjectAnchorPoint(frame, db.name.attachTextTo)
+ frame.Power.value:SetAlpha(1)
+
+ frame.Name:ClearAllPoints()
+ frame.Name:SetPoint(position, attachPoint, position, db.name.xOffset, db.name.yOffset)
+ else
+ frame.Power.value:SetAlpha(db.power.hideonnpc and 0 or 1)
+
+ frame.Name:ClearAllPoints()
+ frame.Name:SetPoint(frame.Power.value:GetPoint())
+ end
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Portrait.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Portrait.lua
new file mode 100644
index 0000000..6c2e7b3
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Portrait.lua
@@ -0,0 +1,115 @@
+local E, L, V, P, G = unpack(ElvUI);
+local UF = E:GetModule("UnitFrames");
+
+local CreateFrame = CreateFrame;
+
+function UF:Construct_Portrait(frame, type)
+ local portrait;
+ if(type == "texture") then
+ local backdrop = CreateFrame("Frame", nil, frame);
+ portrait = frame:CreateTexture(nil, "OVERLAY");
+ portrait:SetTexCoord(0.15, 0.85, 0.15, 0.85);
+ E:SetOutside(backdrop, portrait);
+ backdrop:SetFrameLevel(frame:GetFrameLevel());
+ E:SetTemplate(backdrop, "Default");
+ portrait.backdrop = backdrop;
+ else
+ portrait = CreateFrame("PlayerModel", nil, frame);
+ E:CreateBackdrop(portrait, "Default", nil, nil, self.thinBorders, true)
+ end
+
+ portrait.PostUpdate = self.PortraitUpdate;
+
+ portrait.overlay = CreateFrame("Frame", nil, frame);
+ portrait.overlay:SetFrameLevel(frame.Health:GetFrameLevel() + 5);
+
+ return portrait;
+end
+
+function UF:Configure_Portrait(frame, dontHide)
+ if(not frame.VARIABLES_SET) then return; end
+ local db = frame.db;
+ if(frame.Portrait and not dontHide) then
+ frame.Portrait:Hide();
+ frame.Portrait:ClearAllPoints();
+ frame.Portrait.backdrop:Hide();
+ end
+ frame.Portrait = db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D;
+
+ local portrait = frame.Portrait;
+ if(frame.USE_PORTRAIT) then
+ if(not frame:IsElementEnabled("Portrait")) then
+ frame:EnableElement("Portrait", frame.unit);
+ end
+
+ local color = E.db.unitframe.colors.borderColor
+ portrait.backdrop:SetBackdropBorderColor(color.r, color.g, color.b)
+
+ portrait:ClearAllPoints();
+ portrait.backdrop:ClearAllPoints();
+ if(frame.USE_PORTRAIT_OVERLAY) then
+ if(db.portrait.style == "3D") then
+ portrait:SetFrameLevel(frame.Health:GetFrameLevel());
+ else
+ portrait:SetParent(frame.Health);
+ end
+
+ portrait:SetAllPoints(frame.Health);
+ portrait:SetAlpha(0.35);
+ if(not dontHide) then
+ portrait:Show();
+ end
+ portrait.backdrop:Hide();
+ else
+ portrait:SetAlpha(1);
+ if(not dontHide) then
+ portrait:Show();
+ end
+ portrait.backdrop:Show();
+ if(db.portrait.style == "3D") then
+ portrait:SetFrameLevel(frame.Health:GetFrameLevel() - 4);
+ else
+ portrait:SetParent(frame.Health);
+ end
+
+ if(frame.ORIENTATION == "LEFT") then
+ portrait.backdrop:SetPoint("TOPLEFT", frame, "TOPLEFT", frame.SPACING, frame.USE_MINI_CLASSBAR and -(frame.CLASSBAR_YOFFSET+frame.SPACING) or -frame.SPACING);
+
+ if(frame.USE_MINI_POWERBAR or frame.USE_POWERBAR_OFFSET or not frame.USE_POWERBAR or frame.USE_INSET_POWERBAR or frame.POWERBAR_DETACHED) then
+ portrait.backdrop:SetPoint("BOTTOMRIGHT", frame.Health.backdrop, "BOTTOMLEFT", frame.BORDER - frame.SPACING*3, 0);
+ else
+ portrait.backdrop:SetPoint("BOTTOMRIGHT", frame.Power.backdrop, "BOTTOMLEFT", frame.BORDER - frame.SPACING*3, 0);
+ end
+ elseif(frame.ORIENTATION == "RIGHT") then
+ portrait.backdrop:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -frame.SPACING, frame.USE_MINI_CLASSBAR and -(frame.CLASSBAR_YOFFSET+frame.SPACING) or -frame.SPACING);
+
+ if(frame.USE_MINI_POWERBAR or frame.USE_POWERBAR_OFFSET or not frame.USE_POWERBAR or frame.USE_INSET_POWERBAR or frame.POWERBAR_DETACHED) then
+ portrait.backdrop:SetPoint("BOTTOMLEFT", frame.Health.backdrop, "BOTTOMRIGHT", -frame.BORDER + frame.SPACING*3, 0);
+ else
+ portrait.backdrop:SetPoint("BOTTOMLEFT", frame.Power.backdrop, "BOTTOMRIGHT", -frame.BORDER + frame.SPACING*3, 0);
+ end
+ end
+
+ E:SetInside(portrait, portrait.backdrop, frame.BORDER);
+ end
+ else
+ if(frame:IsElementEnabled("Portrait")) then
+ frame:DisableElement("Portrait");
+ portrait:Hide();
+ portrait.backdrop:Hide();
+ end
+ end
+end
+
+function UF:PortraitUpdate()
+ local db = self:GetParent().db;
+ if(not db) then return; end
+
+ local portrait = db.portrait;
+ if(portrait.enable and self:GetParent().USE_PORTRAIT_OVERLAY) then
+ self:SetAlpha(0);
+ self:SetAlpha(0.35);
+ else
+ self:SetAlpha(1)
+ end
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Power.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Power.lua
new file mode 100644
index 0000000..e5a46bd
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Elements/Power.lua
@@ -0,0 +1,228 @@
+local E, L, V, P, G = unpack(ElvUI)
+local UF = E:GetModule("UnitFrames")
+
+local random = random
+
+local CreateFrame = CreateFrame
+
+local ns = oUF
+local ElvUF = ns.oUF
+assert(ElvUF, "ElvUI was unable to locate oUF.")
+
+function UF:Construct_PowerBar(frame, bg, text, textPos)
+ local power = CreateFrame("StatusBar", nil, frame)
+ UF["statusbars"][power] = true
+
+ power.PostUpdate = self.PostUpdatePower
+
+ CreateStatusBarTexturePointer(power)
+
+ if bg then
+ power.bg = power:CreateTexture(nil, "BORDER")
+ power.bg:SetAllPoints()
+ power.bg:SetTexture(E["media"].blankTex)
+ power.bg.multiplier = 0.2
+ end
+
+ if text then
+ power.value = frame.RaisedElementParent:CreateFontString(nil, "OVERLAY")
+ power.value.frequentUpdates = true
+
+ UF:Configure_FontString(power.value)
+
+ local x = -2
+ if textPos == "LEFT" then
+ x = 2
+ end
+
+ power.value:SetPoint(textPos, frame.Health, textPos, x, 0)
+ end
+
+ power.colorDisconnected = false
+ power.colorTapping = false
+ E:CreateBackdrop(power, "Default", nil, nil, self.thinBorders)
+
+ return power
+end
+
+function UF:Configure_Power(frame)
+ if not frame.VARIABLES_SET then return end
+ local db = frame.db
+ local power = frame.Power
+
+ if frame.USE_POWERBAR then
+ if not frame:IsElementEnabled("Power") then
+ frame:EnableElement("Power", frame.unit)
+
+ power:Show()
+ end
+
+ power.Smooth = self.db.smoothbars
+ power.SmoothSpeed = self.db.smoothSpeed * 10
+
+ local attachPoint = self:GetObjectAnchorPoint(frame, db.power.attachTextTo)
+ power.value:ClearAllPoints()
+ power.value:SetPoint(db.power.position, attachPoint, db.power.position, db.power.xOffset, db.power.yOffset)
+ frame:Tag(power.value, db.power.text_format)
+
+ if db.power.attachTextTo == "Power" then
+ power.value:SetParent(power)
+ else
+ power.value:SetParent(frame.RaisedElementParent)
+ end
+
+ power.colorClass = nil
+ power.colorReaction = nil
+ power.colorPower = nil
+ if self.db["colors"].powerclass then
+ power.colorClass = true
+ power.colorReaction = true
+ else
+ power.colorPower = true
+ end
+
+ local heightChanged = false
+ if (not self.thinBorders and not E.PixelMode) and frame.POWERBAR_HEIGHT < 7 then
+ frame.POWERBAR_HEIGHT = 7
+ if(db.power) then db.power.height = 7 end
+ heightChanged = true
+ elseif (self.thinBorders or E.PixelMode) and frame.POWERBAR_HEIGHT < 3 then
+ frame.POWERBAR_HEIGHT = 3
+ if db.power then db.power.height = 3 end
+ heightChanged = true
+ end
+ if heightChanged then
+ frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)
+ UF:Configure_HealthBar(frame)
+ end
+
+ power:ClearAllPoints()
+ if frame.POWERBAR_DETACHED then
+ power:SetWidth(frame.POWERBAR_WIDTH - ((frame.BORDER + frame.SPACING)*2))
+ power:SetHeight(frame.POWERBAR_HEIGHT - ((frame.BORDER + frame.SPACING)*2))
+ if not power.Holder or (power.Holder and not power.Holder.mover) then
+ power.Holder = CreateFrame("Frame", nil, power)
+ power.Holder:SetWidth(frame.POWERBAR_WIDTH)
+ power.Holder:SetHeight(frame.POWERBAR_HEIGHT)
+ power.Holder:SetPoint("BOTTOM", frame, "BOTTOM", 0, -20)
+ power:ClearAllPoints()
+ power:SetPoint("BOTTOMLEFT", power.Holder, "BOTTOMLEFT", frame.BORDER+frame.SPACING, frame.BORDER+frame.SPACING)
+
+ if(frame.unitframeType and frame.unitframeType == "player") then
+ E:CreateMover(power.Holder, "PlayerPowerBarMover", L["Player Powerbar"], nil, nil, nil, "ALL,SOLO")
+ elseif(frame.unitframeType and frame.unitframeType == "target") then
+ E:CreateMover(power.Holder, "TargetPowerBarMover", L["Target Powerbar"], nil, nil, nil, "ALL,SOLO")
+ end
+ else
+ power.Holder:SetWidth(frame.POWERBAR_WIDTH)
+ power.Holder:SetHeight(frame.POWERBAR_HEIGHT)
+ power:ClearAllPoints()
+ power:SetPoint("BOTTOMLEFT", power.Holder, "BOTTOMLEFT", frame.BORDER+frame.SPACING, frame.BORDER+frame.SPACING)
+ power.Holder.mover:SetScale(1)
+ power.Holder.mover:SetAlpha(1)
+ end
+
+ power:SetFrameLevel(50)
+ elseif frame.USE_POWERBAR_OFFSET then
+ if frame.ORIENTATION == "LEFT" then
+ power:SetPoint("TOPRIGHT", frame.Health, "TOPRIGHT", frame.POWERBAR_OFFSET + frame.HAPPINESS_WIDTH, -frame.POWERBAR_OFFSET)
+ power:SetPoint("BOTTOMLEFT", frame.Health, "BOTTOMLEFT", frame.POWERBAR_OFFSET, -frame.POWERBAR_OFFSET)
+ elseif frame.ORIENTATION == "MIDDLE" then
+ power:SetPoint("TOPLEFT", frame, "TOPLEFT", frame.BORDER + frame.SPACING, -frame.POWERBAR_OFFSET -frame.CLASSBAR_YOFFSET)
+ power:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -frame.BORDER - frame.SPACING, frame.BORDER)
+ else
+ power:SetPoint("TOPLEFT", frame.Health, "TOPLEFT", -frame.POWERBAR_OFFSET - frame.HAPPINESS_WIDTH, -frame.POWERBAR_OFFSET)
+ power:SetPoint("BOTTOMRIGHT", frame.Health, "BOTTOMRIGHT", -frame.POWERBAR_OFFSET, -frame.POWERBAR_OFFSET)
+ end
+ power:SetFrameLevel(frame.Health:GetFrameLevel() -5)
+ elseif frame.USE_INSET_POWERBAR then
+ power:SetHeight(frame.POWERBAR_HEIGHT - ((frame.BORDER + frame.SPACING)*2))
+ power:SetPoint("BOTTOMLEFT", frame.Health, "BOTTOMLEFT", frame.BORDER + (frame.BORDER*2), frame.BORDER + (frame.BORDER*2))
+ power:SetPoint("BOTTOMRIGHT", frame.Health, "BOTTOMRIGHT", -(frame.BORDER + (frame.BORDER*2)), frame.BORDER + (frame.BORDER*2))
+ power:SetFrameLevel(50)
+ elseif frame.USE_MINI_POWERBAR then
+ power:SetWidth(frame.POWERBAR_HEIGHT - ((frame.BORDER + frame.SPACING)*2))
+
+ if frame.ORIENTATION == "LEFT" then
+ power:SetWidth(frame.POWERBAR_WIDTH - frame.BORDER*2)
+ power:SetPoint("RIGHT", frame, "BOTTOMRIGHT", -(frame.BORDER*2 + 4) -frame.HAPPINESS_WIDTH, ((frame.POWERBAR_HEIGHT-frame.BORDER)/2))
+ elseif frame.ORIENTATION == "RIGHT" then
+ power:SetWidth(frame.POWERBAR_WIDTH - frame.BORDER*2)
+ power:SetPoint("LEFT", frame, "BOTTOMLEFT", (frame.BORDER*2 + 4) +frame.HAPPINESS_WIDTH, ((frame.POWERBAR_HEIGHT-frame.BORDER)/2))
+ else
+ power:SetPoint("LEFT", frame, "BOTTOMLEFT", (frame.BORDER*2 + 4), ((frame.POWERBAR_HEIGHT-frame.BORDER)/2))
+ power:SetPoint("RIGHT", frame, "BOTTOMRIGHT", -(frame.BORDER*2 + 4) -frame.HAPPINESS_WIDTH, ((frame.POWERBAR_HEIGHT-frame.BORDER)/2))
+ end
+
+ power:SetFrameLevel(50)
+ else
+ power:SetPoint("TOPRIGHT", frame.Health.backdrop, "BOTTOMRIGHT", -frame.BORDER, -frame.SPACING*3)
+ power:SetPoint("TOPLEFT", frame.Health.backdrop, "BOTTOMLEFT", frame.BORDER, -frame.SPACING*3)
+ power:SetHeight(frame.POWERBAR_HEIGHT - ((frame.BORDER + frame.SPACING)*2))
+
+ power:SetFrameLevel(frame.Health:GetFrameLevel() - 5)
+ end
+
+ if not frame.POWERBAR_DETACHED then
+ if power.Holder and power.Holder.mover then
+ power.Holder.mover:SetScale(0.0001)
+ power.Holder.mover:SetAlpha(0)
+ end
+ end
+
+ if db.power.strataAndLevel and db.power.strataAndLevel.useCustomStrata then
+ power:SetFrameStrata(db.power.strataAndLevel.frameStrata)
+ else
+ power:SetFrameStrata("LOW")
+ end
+
+ if db.power.strataAndLevel and db.power.strataAndLevel.useCustomLevel then
+ power:SetFrameLevel(db.power.strataAndLevel.frameLevel)
+ power.backdrop:SetFrameLevel(power:GetFrameLevel() - 1)
+ end
+
+ if frame.POWERBAR_DETACHED and db.power.parent == "UIPARENT" then
+ power:SetParent(E.UIParent)
+ else
+ power:SetParent(frame)
+ end
+ elseif frame:IsElementEnabled("Power") then
+ frame:DisableElement("Power")
+ power:Hide()
+ end
+
+ if frame.DruidAltMana then
+ if(db.power.druidMana) then
+ frame:EnableElement("DruidAltMana")
+ else
+ frame:DisableElement("DruidAltMana")
+ frame.DruidAltMana:Hide()
+ end
+ end
+
+ if frame.Power then
+ UF:ToggleTransparentStatusBar(UF.db.colors.transparentPower, frame.Power, frame.Power.bg)
+ end
+end
+
+function UF:PostUpdatePower(unit, cur, max)
+ local parent = self:GetParent()
+
+ if parent.isForced then
+ local pType = random(0, 3)
+ local color = ElvUF["colors"].power[pType]
+ cur = random(1, max)
+ self:SetValue(cur)
+
+ if not self.colorClass then
+ self:SetStatusBarColor(color[1], color[2], color[3])
+ local mu = self.bg.multiplier or 1
+ self.bg:SetVertexColor(color[1] * mu, color[2] * mu, color[3] * mu)
+ end
+ end
+
+ local db = parent.db
+ if db and db.power and db.power.hideonnpc then
+ UF:PostNamePosition(parent, unit)
+ end
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Load_UnitFrames.xml b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Load_UnitFrames.xml
new file mode 100644
index 0000000..48db7ca
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Load_UnitFrames.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Tags.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Tags.lua
new file mode 100644
index 0000000..aaf4e0d
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Tags.lua
@@ -0,0 +1,552 @@
+local E, L, V, P, G = unpack(ElvUI)
+
+local _G = _G;
+local floor = math.floor;
+local format = string.format;
+
+local GetPVPTimer = GetPVPTimer;
+local GetTime = GetTime;
+local UnitClass = UnitClass;
+local UnitClassification = UnitClassification;
+local UnitGUID = UnitGUID;
+local UnitIsAFK = UnitIsAFK;
+local UnitIsConnected = UnitIsConnected;
+local UnitIsDND = UnitIsDND;
+local UnitIsDead = UnitIsDead;
+local UnitIsDeadOrGhost = UnitIsDeadOrGhost;
+local UnitIsGhost = UnitIsGhost;
+local UnitIsPVP = UnitIsPVP;
+local UnitIsPVPFreeForAll = UnitIsPVPFreeForAll;
+local UnitIsPlayer = UnitIsPlayer;
+local UnitLevel = UnitLevel;
+local UnitMana = UnitMana;
+local UnitManaMax = UnitManaMax;
+local UnitPowerType = UnitPowerType;
+local UnitReaction = UnitReaction;
+local DEFAULT_AFK_MESSAGE = DEFAULT_AFK_MESSAGE;
+local PVP = PVP;
+
+------------------------------------------------------------------------
+-- Tags
+------------------------------------------------------------------------
+
+ElvUF.Tags.Events["afk"] = "PLAYER_FLAGS_CHANGED"
+ElvUF.Tags.Methods["afk"] = function(unit)
+ local isAFK = UnitIsAFK(unit)
+ if isAFK then
+ return ("|cffFFFFFF[|r|cffFF0000%s|r|cFFFFFFFF]|r"):format(DEFAULT_AFK_MESSAGE)
+ else
+ return ""
+ end
+end
+
+ElvUF.Tags.Events["healthcolor"] = "UNIT_HEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"
+ElvUF.Tags.Methods["healthcolor"] = function(unit)
+ if UnitIsDeadOrGhost(unit) or not UnitIsConnected(unit) then
+ return Hex(0.84, 0.75, 0.65)
+ else
+ local r, g, b = ElvUF.ColorGradient(UnitHealth(unit), UnitHealthMax(unit), 0.69, 0.31, 0.31, 0.65, 0.63, 0.35, 0.33, 0.59, 0.33)
+ return Hex(r, g, b)
+ end
+end
+
+ElvUF.Tags.Events["health:current"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"
+ElvUF.Tags.Methods["health:current"] = function(unit)
+ local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
+ if (status) then
+ return status
+ else
+ return E:GetFormattedText("CURRENT", UnitHealth(unit), UnitHealthMax(unit))
+ end
+end
+
+ElvUF.Tags.Events["health:deficit"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"
+ElvUF.Tags.Methods["health:deficit"] = function(unit)
+ local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
+
+ if (status) then
+ return status
+ else
+ return E:GetFormattedText("DEFICIT", UnitHealth(unit), UnitHealthMax(unit))
+ end
+end
+
+ElvUF.Tags.Events["health:current-percent"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"
+ElvUF.Tags.Methods["health:current-percent"] = function(unit)
+ local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
+
+ if (status) then
+ return status
+ else
+ return E:GetFormattedText("CURRENT_PERCENT", UnitHealth(unit), UnitHealthMax(unit))
+ end
+end
+
+ElvUF.Tags.Events["health:current-max"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"
+ElvUF.Tags.Methods["health:current-max"] = function(unit)
+ local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
+
+ if (status) then
+ return status
+ else
+ return E:GetFormattedText("CURRENT_MAX", UnitHealth(unit), UnitHealthMax(unit))
+ end
+end
+
+ElvUF.Tags.Events["health:current-max-percent"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"
+ElvUF.Tags.Methods["health:current-max-percent"] = function(unit)
+ local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
+
+ if (status) then
+ return status
+ else
+ return E:GetFormattedText("CURRENT_MAX_PERCENT", UnitHealth(unit), UnitHealthMax(unit))
+ end
+end
+
+ElvUF.Tags.Events["health:max"] = "UNIT_MAXHEALTH"
+ElvUF.Tags.Methods["health:max"] = function(unit)
+ local max = UnitHealthMax(unit)
+
+ return E:GetFormattedText("CURRENT", max, max)
+end
+
+ElvUF.Tags.Events["health:percent"] = "UNIT_HEALTH UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"
+ElvUF.Tags.Methods["health:percent"] = function(unit)
+ local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
+
+ if (status) then
+ return status
+ else
+ return E:GetFormattedText("PERCENT", UnitHealth(unit), UnitHealthMax(unit))
+ end
+end
+
+ElvUF.Tags.Events["health:current-nostatus"] = "UNIT_HEALTH UNIT_MAXHEALTH";
+ElvUF.Tags.Methods["health:current-nostatus"] = function(unit)
+ return E:GetFormattedText("CURRENT", UnitHealth(unit), UnitHealthMax(unit));
+end
+
+ElvUF.Tags.Events["health:deficit-nostatus"] = "UNIT_HEALTH UNIT_MAXHEALTH";
+ElvUF.Tags.Methods["health:deficit-nostatus"] = function(unit)
+ return E:GetFormattedText("DEFICIT", UnitHealth(unit), UnitHealthMax(unit));
+end
+
+ElvUF.Tags.Events["health:current-percent-nostatus"] = "UNIT_HEALTH UNIT_MAXHEALTH";
+ElvUF.Tags.Methods["health:current-percent-nostatus"] = function(unit)
+ return E:GetFormattedText("CURRENT_PERCENT", UnitHealth(unit), UnitHealthMax(unit));
+end
+
+ElvUF.Tags.Events["health:current-max-nostatus"] = "UNIT_HEALTH UNIT_MAXHEALTH";
+ElvUF.Tags.Methods["health:current-max-nostatus"] = function(unit)
+ return E:GetFormattedText("CURRENT_MAX", UnitHealth(unit), UnitHealthMax(unit));
+end
+
+ElvUF.Tags.Events["health:current-max-percent-nostatus"] = "UNIT_HEALTH UNIT_MAXHEALTH";
+ElvUF.Tags.Methods["health:current-max-percent-nostatus"] = function(unit)
+ return E:GetFormattedText("CURRENT_MAX_PERCENT", UnitHealth(unit), UnitHealthMax(unit));
+end
+
+ElvUF.Tags.Events["health:percent-nostatus"] = "UNIT_HEALTH UNIT_MAXHEALTH";
+ElvUF.Tags.Methods["health:percent-nostatus"] = function(unit)
+ return E:GetFormattedText("PERCENT", UnitHealth(unit), UnitHealthMax(unit));
+end
+
+ElvUF.Tags.Events["health:deficit-percent:name"] = "UNIT_HEALTH UNIT_MAXHEALTH";
+ElvUF.Tags.Methods["health:deficit-percent:name"] = function(unit)
+ local currentHealth = UnitHealth(unit)
+ local deficit = UnitHealthMax(unit) - currentHealth;
+
+ if (deficit > 0 and currentHealth > 0) then
+ return _TAGS["health:percent-nostatus"](unit);
+ else
+ return _TAGS["name"](unit);
+ end
+end
+
+ElvUF.Tags.Events["health:deficit-percent:name-long"] = "UNIT_HEALTH UNIT_MAXHEALTH"
+ElvUF.Tags.Methods["health:deficit-percent:name-long"] = function(unit)
+ local currentHealth = UnitHealth(unit)
+ local deficit = UnitHealthMax(unit) - currentHealth
+
+ if (deficit > 0 and currentHealth > 0) then
+ return _TAGS["health:percent-nostatus"](unit)
+ else
+ return _TAGS["name:long"](unit)
+ end
+end
+
+ElvUF.Tags.Events["health:deficit-percent:name-medium"] = "UNIT_HEALTH UNIT_MAXHEALTH"
+ElvUF.Tags.Methods["health:deficit-percent:name-medium"] = function(unit)
+ local currentHealth = UnitHealth(unit)
+ local deficit = UnitHealthMax(unit) - currentHealth
+
+ if (deficit > 0 and currentHealth > 0) then
+ return _TAGS["health:percent-nostatus"](unit)
+ else
+ return _TAGS["name:medium"](unit)
+ end
+end
+
+ElvUF.Tags.Events["health:deficit-percent:name-short"] = "UNIT_HEALTH UNIT_MAXHEALTH"
+ElvUF.Tags.Methods["health:deficit-percent:name-short"] = function(unit)
+ local currentHealth = UnitHealth(unit)
+ local deficit = UnitHealthMax(unit) - currentHealth
+
+ if (deficit > 0 and currentHealth > 0) then
+ return _TAGS["health:percent-nostatus"](unit)
+ else
+ return _TAGS["name:short"](unit)
+ end
+end
+
+ElvUF.Tags.Events["health:deficit-percent:name-veryshort"] = "UNIT_HEALTH UNIT_MAXHEALTH"
+ElvUF.Tags.Methods["health:deficit-percent:name-veryshort"] = function(unit)
+ local currentHealth = UnitHealth(unit)
+ local deficit = UnitHealthMax(unit) - currentHealth
+
+ if (deficit > 0 and currentHealth > 0) then
+ return _TAGS["health:percent-nostatus"](unit)
+ else
+ return _TAGS["name:veryshort"](unit)
+ end
+end
+
+ElvUF.Tags.Events["powercolor"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_MAXPOWER"
+ElvUF.Tags.Methods["powercolor"] = function(unit)
+ local color = ElvUF["colors"].power[UnitPowerType(unit)]
+ if color then
+ return Hex(color[1], color[2], color[3])
+ else
+ return Hex(unpack(ElvUF["colors"].power[0]))
+ end
+end
+
+ElvUF.Tags.Events["power:current"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_MAXPOWER"
+ElvUF.Tags.Methods["power:current"] = function(unit)
+ local min = UnitMana(unit)
+
+ return min == 0 and " " or E:GetFormattedText("CURRENT", min, UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["power:current-max"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_MAXPOWER"
+ElvUF.Tags.Methods["power:current-max"] = function(unit)
+ local min = UnitMana(unit)
+
+ return min == 0 and " " or E:GetFormattedText("CURRENT_MAX", min, UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["power:current-percent"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_MAXPOWER"
+ElvUF.Tags.Methods["power:current-percent"] = function(unit)
+ local min = UnitMana(unit)
+
+ return min == 0 and " " or E:GetFormattedText("CURRENT_PERCENT", min, UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["power:current-max-percent"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_MAXPOWER"
+ElvUF.Tags.Methods["power:current-max-percent"] = function(unit)
+ local min = UnitMana(unit)
+
+ return min == 0 and " " or E:GetFormattedText("CURRENT_MAX_PERCENT", min, UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["power:percent"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_MAXPOWER"
+ElvUF.Tags.Methods["power:percent"] = function(unit)
+ local min = UnitMana(unit)
+
+ return min == 0 and " " or E:GetFormattedText("PERCENT", min, UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["power:deficit"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_MAXPOWER"
+ElvUF.Tags.Methods["power:deficit"] = function(unit)
+ return E:GetFormattedText("DEFICIT", UnitMana(unit), UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["power:max"] = "UNIT_MAXENERGY UNIT_MAXFOCUS UNIT_MAXMANA UNIT_MAXRAGE UNIT_MAXRUNIC_POWER"
+ElvUF.Tags.Methods["power:max"] = function(unit)
+ local max = UnitManaMax(unit)
+
+ return E:GetFormattedText("CURRENT", max, max)
+end
+
+ElvUF.Tags.Methods["manacolor"] = function()
+ local altR, altG, altB = PowerBarColor["MANA"].r, PowerBarColor["MANA"].g, PowerBarColor["MANA"].b
+ local color = ElvUF["colors"].power["MANA"]
+ if color then
+ return Hex(color[1], color[2], color[3])
+ else
+ return Hex(altR, altG, altB)
+ end
+end
+
+ElvUF.Tags.Events["mana:current"] = "UNIT_MANA UNIT_MAXMANA"
+ElvUF.Tags.Methods["mana:current"] = function(unit)
+ local min = UnitMana(unit)
+
+ return min == 0 and " " or E:GetFormattedText("CURRENT", min, UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["mana:current-max"] = "UNIT_MANA UNIT_MAXMANA"
+ElvUF.Tags.Methods["mana:current-max"] = function(unit)
+ local min = UnitMana(unit)
+
+ return min == 0 and " " or E:GetFormattedText("CURRENT_MAX", min, UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["mana:current-percent"] = "UNIT_MANA UNIT_MAXMANA"
+ElvUF.Tags.Methods["mana:current-percent"] = function(unit)
+ local min = UnitMana(unit)
+
+ return min == 0 and " " or E:GetFormattedText("CURRENT_PERCENT", min, UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["mana:current-max-percent"] = "UNIT_MANA UNIT_MAXMANA"
+ElvUF.Tags.Methods["mana:current-max-percent"] = function(unit)
+ local min = UnitMana(unit)
+
+ return min == 0 and " " or E:GetFormattedText("CURRENT_MAX_PERCENT", min, UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["mana:percent"] = "UNIT_MANA UNIT_MAXMANA"
+ElvUF.Tags.Methods["mana:percent"] = function(unit)
+ local min = UnitMana(unit)
+
+ return min == 0 and " " or E:GetFormattedText("PERCENT", min, UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["mana:deficit"] = "UNIT_MANA UNIT_MAXMANA"
+ElvUF.Tags.Methods["mana:deficit"] = function(unit)
+ return E:GetFormattedText("DEFICIT", UnitMana(unit), UnitManaMax(unit))
+end
+
+ElvUF.Tags.Events["mana:max"] = "UNIT_MAXMANA"
+ElvUF.Tags.Methods["mana:max"] = function(unit)
+ local max = UnitManaMax(unit)
+
+ return E:GetFormattedText("CURRENT", max, max)
+end
+
+ElvUF.Tags.Events["difficultycolor"] = "UNIT_LEVEL PLAYER_LEVEL_UP"
+ElvUF.Tags.Methods["difficultycolor"] = function(unit)
+ local r, g, b = 0.69, 0.31, 0.31
+ local level = UnitLevel(unit)
+ if (level > 1) then
+ local DiffColor = UnitLevel(unit) - UnitLevel("player")
+ if (DiffColor >= 5) then
+ r, g, b = 0.69, 0.31, 0.31
+ elseif (DiffColor >= 3) then
+ r, g, b = 0.71, 0.43, 0.27
+ elseif (DiffColor >= -2) then
+ r, g, b = 0.84, 0.75, 0.65
+ elseif (-DiffColor <= GetQuestGreenRange()) then
+ r, g, b = 0.33, 0.59, 0.33
+ else
+ r, g, b = 0.55, 0.57, 0.61
+ end
+ end
+
+ return Hex(r, g, b)
+end
+
+ElvUF.Tags.Events["namecolor"] = "UNIT_NAME_UPDATE"
+ElvUF.Tags.Methods["namecolor"] = function(unit)
+ local unitReaction = UnitReaction(unit, "player")
+ local _, unitClass = UnitClass(unit)
+ if (UnitIsPlayer(unit)) then
+ local class = ElvUF.colors.class[unitClass]
+ if not class then return "" end
+ return Hex(class[1], class[2], class[3])
+ elseif (unitReaction) then
+ local reaction = ElvUF["colors"].reaction[unitReaction]
+ return Hex(reaction[1], reaction[2], reaction[3])
+ else
+ return "|cFFC2C2C2"
+ end
+end
+
+ElvUF.Tags.Events["smartlevel"] = "UNIT_LEVEL PLAYER_LEVEL_UP"
+ElvUF.Tags.Methods["smartlevel"] = function(unit)
+ local level = UnitLevel(unit)
+ if level == UnitLevel("player") then
+ return ""
+ elseif(level > 0) then
+ return level
+ else
+ return "??"
+ end
+end
+
+ElvUF.Tags.Events["name:veryshort"] = "UNIT_NAME_UPDATE"
+ElvUF.Tags.Methods["name:veryshort"] = function(unit)
+ local name = UnitName(unit)
+ return name ~= nil and E:ShortenString(name, 5) or ""
+end
+
+ElvUF.Tags.Events["name:short"] = "UNIT_NAME_UPDATE"
+ElvUF.Tags.Methods["name:short"] = function(unit)
+ local name = UnitName(unit)
+ return name ~= nil and E:ShortenString(name, 10) or ""
+end
+
+ElvUF.Tags.Events["name:medium"] = "UNIT_NAME_UPDATE"
+ElvUF.Tags.Methods["name:medium"] = function(unit)
+ local name = UnitName(unit)
+ return name ~= nil and E:ShortenString(name, 15) or ""
+end
+
+ElvUF.Tags.Events["name:long"] = "UNIT_NAME_UPDATE"
+ElvUF.Tags.Methods["name:long"] = function(unit)
+ local name = UnitName(unit)
+ return name ~= nil and E:ShortenString(name, 20) or ""
+end
+
+ElvUF.Tags.Events["name:veryshort:status"] = "UNIT_NAME_UPDATE UNIT_CONNECTION PLAYER_FLAGS_CHANGED UNIT_HEALTH"
+ElvUF.Tags.Methods["name:veryshort:status"] = function(unit)
+ local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
+ local name = UnitName(unit)
+ if (status) then
+ return status
+ else
+ return name ~= nil and E:ShortenString(name, 5) or ""
+ end
+end
+
+ElvUF.Tags.Events["name:short:status"] = "UNIT_NAME_UPDATE UNIT_CONNECTION PLAYER_FLAGS_CHANGED UNIT_HEALTH"
+ElvUF.Tags.Methods["name:short:status"] = function(unit)
+ local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
+ local name = UnitName(unit)
+ if (status) then
+ return status
+ else
+ return name ~= nil and E:ShortenString(name, 10) or ""
+ end
+end
+
+ElvUF.Tags.Events["name:medium:status"] = "UNIT_NAME_UPDATE UNIT_CONNECTION PLAYER_FLAGS_CHANGED UNIT_HEALTH"
+ElvUF.Tags.Methods["name:medium:status"] = function(unit)
+ local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
+ local name = UnitName(unit)
+ if (status) then
+ return status
+ else
+ return name ~= nil and E:ShortenString(name, 15) or ""
+ end
+end
+
+ElvUF.Tags.Events["name:long:status"] = "UNIT_NAME_UPDATE UNIT_CONNECTION PLAYER_FLAGS_CHANGED UNIT_HEALTH"
+ElvUF.Tags.Methods["name:long:status"] = function(unit)
+ local status = UnitIsDead(unit) and L["Dead"] or UnitIsGhost(unit) and L["Ghost"] or not UnitIsConnected(unit) and L["Offline"]
+ local name = UnitName(unit)
+ if (status) then
+ return status
+ else
+ return name ~= nil and E:ShortenString(name, 20) or ""
+ end
+end
+
+local unitStatus = {}
+ElvUF.Tags.OnUpdateThrottle["statustimer"] = 1
+ElvUF.Tags.Methods["statustimer"] = function(unit)
+ if not UnitIsPlayer(unit) then return; end
+ local guid = UnitGUID(unit)
+ if (UnitIsAFK(unit)) then
+ if not unitStatus[guid] or unitStatus[guid] and unitStatus[guid][1] ~= "AFK" then
+ unitStatus[guid] = {"AFK", GetTime()}
+ end
+ elseif(UnitIsDND(unit)) then
+ if not unitStatus[guid] or unitStatus[guid] and unitStatus[guid][1] ~= "DND" then
+ unitStatus[guid] = {"DND", GetTime()}
+ end
+ elseif(UnitIsDead(unit)) or (UnitIsGhost(unit))then
+ if not unitStatus[guid] or unitStatus[guid] and unitStatus[guid][1] ~= "Dead" then
+ unitStatus[guid] = {"Dead", GetTime()}
+ end
+ elseif(not UnitIsConnected(unit)) then
+ if not unitStatus[guid] or unitStatus[guid] and unitStatus[guid][1] ~= "Offline" then
+ unitStatus[guid] = {"Offline", GetTime()}
+ end
+ else
+ unitStatus[guid] = nil
+ end
+
+ if unitStatus[guid] ~= nil then
+ local status = unitStatus[guid][1]
+ local timer = GetTime() - unitStatus[guid][2]
+ local mins = floor(timer / 60)
+ local secs = floor(timer - (mins * 60))
+ return ("%s (%01.f:%02.f)"):format(status, mins, secs)
+ else
+ return ""
+ end
+end
+
+ElvUF.Tags.OnUpdateThrottle["pvptimer"] = 1
+ElvUF.Tags.Methods["pvptimer"] = function(unit)
+ if (UnitIsPVPFreeForAll(unit) or UnitIsPVP(unit)) then
+ local timer = GetPVPTimer()
+
+ if timer ~= 301000 and timer ~= -1 then
+ local mins = floor((timer / 1000) / 60)
+ local secs = floor((timer / 1000) - (mins * 60))
+ return ("%s (%01.f:%02.f)"):format(PVP, mins, secs)
+ else
+ return PVP
+ end
+ else
+ return ""
+ end
+end
+
+ElvUF.Tags.Events["classificationcolor"] = "UNIT_CLASSIFICATION_CHANGED";
+ElvUF.Tags.Methods["classificationcolor"] = function(unit)
+ local c = UnitClassification(unit);
+ if(c == "rare" or c == "elite") then
+ return Hex(1, 0.5, 0.25); -- Orange
+ elseif(c == "rareelite" or c == "worldboss") then
+ return Hex(1, 0, 0); -- Red
+ end
+end
+
+ElvUF.Tags.Events["guild"] = "PLAYER_GUILD_UPDATE"
+ElvUF.Tags.Methods["guild"] = function(unit)
+ local guildName = GetGuildInfo(unit)
+
+ return guildName or ""
+end
+
+ElvUF.Tags.Events["guild:brackets"] = "PLAYER_GUILD_UPDATE"
+ElvUF.Tags.Methods["guild:brackets"] = function(unit)
+ local guildName = GetGuildInfo(unit)
+
+ return guildName and format("<%s>", guildName) or ""
+end
+
+ElvUF.Tags.Events["target:veryshort"] = "UNIT_TARGET"
+ElvUF.Tags.Methods["target:veryshort"] = function(unit)
+ local targetName = UnitName(unit.."target")
+ return targetName ~= nil and E:ShortenString(targetName, 5) or ""
+end
+
+ElvUF.Tags.Events["target:short"] = "UNIT_TARGET"
+ElvUF.Tags.Methods["target:short"] = function(unit)
+ local targetName = UnitName(unit.."target")
+ return targetName ~= nil and E:ShortenString(targetName, 10) or ""
+end
+
+ElvUF.Tags.Events["target:medium"] = "UNIT_TARGET"
+ElvUF.Tags.Methods["target:medium"] = function(unit)
+ local targetName = UnitName(unit.."target")
+ return targetName ~= nil and E:ShortenString(targetName, 15) or ""
+end
+
+ElvUF.Tags.Events["target:long"] = "UNIT_TARGET"
+ElvUF.Tags.Methods["target:long"] = function(unit)
+ local targetName = UnitName(unit.."target")
+ return targetName ~= nil and E:ShortenString(targetName, 20) or ""
+end
+
+ElvUF.Tags.Events["target"] = "UNIT_TARGET"
+ElvUF.Tags.Methods["target"] = function(unit)
+ local targetName = UnitName(unit.."target")
+ return targetName or ""
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/UnitFrames.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/UnitFrames.lua
new file mode 100644
index 0000000..0c9a614
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/UnitFrames.lua
@@ -0,0 +1,1191 @@
+local E, L, V, P, G = unpack(ElvUI)
+local UF = E:NewModule("UnitFrames", "AceTimer-3.0", "AceEvent-3.0", "AceHook-3.0")
+local LSM = LibStub("LibSharedMedia-3.0")
+UF.LSM = LSM
+
+--Cache global variables
+--Lua functions
+local _G = _G
+local select, pairs, type, unpack, assert, tostring = select, pairs, type, unpack, assert, tostring
+local min = math.min
+local tinsert = table.insert
+local find, gsub, format = string.find, string.gsub, string.format
+--WoW API / Variables
+local hooksecurefunc = hooksecurefunc
+local CreateFrame = CreateFrame
+local UnitFrame_OnEnter = UnitFrame_OnEnter
+local UnitFrame_OnLeave = UnitFrame_OnLeave
+local IsInInstance = IsInInstance
+local InCombatLockdown = InCombatLockdown
+local GetInstanceInfo = GetInstanceInfo
+local UnregisterStateDriver = UnregisterStateDriver
+local RegisterStateDriver = RegisterStateDriver
+local MAX_RAID_MEMBERS = MAX_RAID_MEMBERS
+local MAX_BOSS_FRAMES = MAX_BOSS_FRAMES
+
+local ns = oUF
+ElvUF = ns.oUF
+assert(ElvUF, "ElvUI was unable to locate oUF.")
+
+UF["headerstoload"] = {}
+UF["unitgroupstoload"] = {}
+UF["unitstoload"] = {}
+
+UF["groupPrototype"] = {}
+UF["headerPrototype"] = {}
+UF["headers"] = {}
+UF["groupunits"] = {}
+UF["units"] = {}
+
+UF["statusbars"] = {}
+UF["fontstrings"] = {}
+UF["badHeaderPoints"] = {
+ ["TOP"] = "BOTTOM",
+ ["LEFT"] = "RIGHT",
+ ["BOTTOM"] = "TOP",
+ ["RIGHT"] = "LEFT"
+}
+
+UF["headerFunctions"] = {}
+
+UF["classMaxResourceBar"] = {
+ ["DRUID"] = 1
+}
+
+UF["mapIDs"] = {
+ [443] = 10, -- Warsong Gulch
+ [461] = 15, -- Arathi Basin
+ [401] = 40, -- Alterac Valley
+ [566] = 15, -- Eye of the Storm
+}
+
+UF["headerGroupBy"] = {
+ ["CLASS"] = function(header)
+ header:SetAttribute("groupingOrder", "DRUID,HUNTER,MAGE,PALADIN,PRIEST,SHAMAN,WARLOCK,WARRIOR")
+ header:SetAttribute("sortMethod", "NAME")
+ header:SetAttribute("groupBy", "CLASS")
+ end,
+ ["MTMA"] = function(header)
+ header:SetAttribute("groupingOrder", "MAINTANK,MAINASSIST,NONE")
+ header:SetAttribute("sortMethod", "NAME")
+ header:SetAttribute("groupBy", "ROLE")
+ end,
+ ["NAME"] = function(header)
+ header:SetAttribute("groupingOrder", "1,2,3,4,5,6,7,8")
+ header:SetAttribute("sortMethod", "NAME")
+ header:SetAttribute("groupBy", nil)
+ end,
+ ["GROUP"] = function(header)
+ header:SetAttribute("groupingOrder", "1,2,3,4,5,6,7,8")
+ header:SetAttribute("sortMethod", "INDEX")
+ header:SetAttribute("groupBy", "GROUP")
+ end,
+ ["PETNAME"] = function(header)
+ header:SetAttribute("groupingOrder", "1,2,3,4,5,6,7,8")
+ header:SetAttribute("sortMethod", "NAME")
+ header:SetAttribute("groupBy", nil)
+ header:SetAttribute("filterOnPet", true) --This is the line that matters. Without this, it sorts based on the owners name
+ end,
+}
+
+local POINT_COLUMN_ANCHOR_TO_DIRECTION = {
+ ["TOPTOP"] = "UP_RIGHT",
+ ["BOTTOMBOTTOM"] = "TOP_RIGHT",
+ ["LEFTLEFT"] = "RIGHT_UP",
+ ["RIGHTRIGHT"] = "LEFT_UP",
+ ["RIGHTTOP"] = "LEFT_DOWN",
+ ["LEFTTOP"] = "RIGHT_DOWN",
+ ["LEFTBOTTOM"] = "RIGHT_UP",
+ ["RIGHTBOTTOM"] = "LEFT_UP",
+ ["BOTTOMRIGHT"] = "UP_LEFT",
+ ["BOTTOMLEFT"] = "UP_RIGHT",
+ ["TOPRIGHT"] = "DOWN_LEFT",
+ ["TOPLEFT"] = "DOWN_RIGHT"
+}
+
+local DIRECTION_TO_POINT = {
+ DOWN_RIGHT = "TOP",
+ DOWN_LEFT = "TOP",
+ UP_RIGHT = "BOTTOM",
+ UP_LEFT = "BOTTOM",
+ RIGHT_DOWN = "LEFT",
+ RIGHT_UP = "LEFT",
+ LEFT_DOWN = "RIGHT",
+ LEFT_UP = "RIGHT",
+ UP = "BOTTOM",
+ DOWN = "TOP"
+}
+
+local DIRECTION_TO_GROUP_ANCHOR_POINT = {
+ DOWN_RIGHT = "TOPLEFT",
+ DOWN_LEFT = "TOPRIGHT",
+ UP_RIGHT = "BOTTOMLEFT",
+ UP_LEFT = "BOTTOMRIGHT",
+ RIGHT_DOWN = "TOPLEFT",
+ RIGHT_UP = "BOTTOMLEFT",
+ LEFT_DOWN = "TOPRIGHT",
+ LEFT_UP = "BOTTOMRIGHT",
+ OUT_RIGHT_UP = "BOTTOM",
+ OUT_LEFT_UP = "BOTTOM",
+ OUT_RIGHT_DOWN = "TOP",
+ OUT_LEFT_DOWN = "TOP",
+ OUT_UP_RIGHT = "LEFT",
+ OUT_UP_LEFT = "RIGHT",
+ OUT_DOWN_RIGHT = "LEFT",
+ OUT_DOWN_LEFT = "RIGHT"
+}
+
+local INVERTED_DIRECTION_TO_COLUMN_ANCHOR_POINT = {
+ DOWN_RIGHT = "RIGHT",
+ DOWN_LEFT = "LEFT",
+ UP_RIGHT = "RIGHT",
+ UP_LEFT = "LEFT",
+ RIGHT_DOWN = "BOTTOM",
+ RIGHT_UP = "TOP",
+ LEFT_DOWN = "BOTTOM",
+ LEFT_UP = "TOP",
+ UP = "TOP",
+ DOWN = "BOTTOM"
+}
+
+local DIRECTION_TO_COLUMN_ANCHOR_POINT = {
+ DOWN_RIGHT = "LEFT",
+ DOWN_LEFT = "RIGHT",
+ UP_RIGHT = "LEFT",
+ UP_LEFT = "RIGHT",
+ RIGHT_DOWN = "TOP",
+ RIGHT_UP = "BOTTOM",
+ LEFT_DOWN = "TOP",
+ LEFT_UP = "BOTTOM"
+}
+
+local DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER = {
+ DOWN_RIGHT = 1,
+ DOWN_LEFT = -1,
+ UP_RIGHT = 1,
+ UP_LEFT = -1,
+ RIGHT_DOWN = 1,
+ RIGHT_UP = 1,
+ LEFT_DOWN = -1,
+ LEFT_UP = -1
+}
+
+local DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER = {
+ DOWN_RIGHT = -1,
+ DOWN_LEFT = -1,
+ UP_RIGHT = 1,
+ UP_LEFT = 1,
+ RIGHT_DOWN = -1,
+ RIGHT_UP = 1,
+ LEFT_DOWN = -1,
+ LEFT_UP = 1
+}
+
+function UF:ConvertGroupDB(group)
+ local db = self.db.units[group.groupName]
+ if db.point and db.columnAnchorPoint then
+ db.growthDirection = POINT_COLUMN_ANCHOR_TO_DIRECTION[db.point..db.columnAnchorPoint];
+ db.point = nil;
+ db.columnAnchorPoint = nil;
+ end
+
+ if db.growthDirection == "UP" then
+ db.growthDirection = "UP_RIGHT"
+ end
+
+ if db.growthDirection == "DOWN" then
+ db.growthDirection = "DOWN_RIGHT"
+ end
+end
+
+function UF:Construct_UF(frame, unit)
+ frame:SetScript("OnEnter", UnitFrame_OnEnter)
+ frame:SetScript("OnLeave", UnitFrame_OnLeave)
+
+ if(self.thinBorders) then
+ frame.SPACING = 0
+ frame.BORDER = E.mult
+ else
+ frame.BORDER = E.Border
+ frame.SPACING = E.Spacing
+ end
+
+ frame.SHADOW_SPACING = 3
+ frame.CLASSBAR_YOFFSET = 0 --placeholder
+ frame.BOTTOM_OFFSET = 0 --placeholder
+
+ frame.RaisedElementParent = CreateFrame("Frame", nil, frame)
+ frame.RaisedElementParent.TextureParent = CreateFrame("Frame", nil, frame.RaisedElementParent)
+ frame.RaisedElementParent:SetFrameLevel(frame:GetFrameLevel() + 100)
+
+ if not self["groupunits"][unit] then
+ local stringTitle = E:StringTitle(unit)
+ if string.find(stringTitle, "target") then
+ stringTitle = gsub(stringTitle, "target", "Target")
+ end
+ self["Construct_"..stringTitle.."Frame"](self, frame, unit)
+ else
+ UF["Construct_"..E:StringTitle(self["groupunits"][unit]).."Frames"](self, frame, unit)
+ end
+
+ self:Update_StatusBars()
+ self:Update_FontStrings()
+ return frame
+end
+
+function UF:GetObjectAnchorPoint(frame, point)
+ if not frame[point] or point == "Frame" then
+ return frame
+ elseif frame[point] and not frame[point]:IsShown() then
+ return frame.Health
+ else
+ return frame[point]
+ end
+end
+
+function UF:GetPositionOffset(position, offset)
+ if not offset then offset = 2; end
+ local x, y = 0, 0
+ if find(position, "LEFT") then
+ x = offset
+ elseif find(position, "RIGHT") then
+ x = -offset
+ end
+
+ if find(position, "TOP") then
+ y = -offset
+ elseif find(position, "BOTTOM") then
+ y = offset
+ end
+
+ return x, y
+end
+
+function UF:GetAuraOffset(p1, p2)
+ local x, y = 0, 0
+ if p1 == "RIGHT" and p2 == "LEFT" then
+ x = -3
+ elseif p1 == "LEFT" and p2 == "RIGHT" then
+ x = 3
+ end
+
+ if find(p1, "TOP") and find(p2, "BOTTOM") then
+ y = -1
+ elseif find(p1, "BOTTOM") and find(p2, "TOP") then
+ y = 1
+ end
+
+ return E:Scale(x), E:Scale(y)
+end
+
+function UF:GetAuraAnchorFrame(frame, attachTo, isConflict)
+ if isConflict then
+ E:Print(format(L["%s frame(s) has a conflicting anchor point, please change either the buff or debuff anchor point so they are not attached to each other. Forcing the debuffs to be attached to the main unitframe until fixed."], E:StringTitle(frame:GetName())))
+ end
+
+ if isConflict or attachTo == "FRAME" then
+ return frame
+ elseif attachTo == "TRINKET" then
+ if select(2, IsInInstance()) == "arena" then
+ return frame.Trinket
+ end
+ elseif attachTo == "BUFFS" then
+ return frame.Buffs
+ elseif attachTo == "DEBUFFS" then
+ return frame.Debuffs
+ elseif attachTo == "HEALTH" then
+ return frame.Health
+ elseif attachTo == "POWER" and frame.Power then
+ return frame.Power
+ else
+ return frame
+ end
+end
+
+function UF:ClearChildPoints(...)
+ for i = 1, select("#", unpack(arg)) do
+ local child = select(i, unpack(arg))
+ child:ClearAllPoints()
+ end
+end
+
+function UF:UpdateColors()
+ local db = self.db.colors
+
+ local good = E:GetColorTable(db.reaction.GOOD)
+ local bad = E:GetColorTable(db.reaction.BAD)
+ local neutral = E:GetColorTable(db.reaction.NEUTRAL)
+
+ ElvUF.colors.tapped = E:GetColorTable(db.tapped);
+ ElvUF.colors.disconnected = E:GetColorTable(db.disconnected);
+ ElvUF.colors.health = E:GetColorTable(db.health);
+ ElvUF.colors.power[0] = E:GetColorTable(db.power.MANA);
+ ElvUF.colors.power[1] = E:GetColorTable(db.power.RAGE);
+ ElvUF.colors.power[2] = E:GetColorTable(db.power.FOCUS);
+ ElvUF.colors.power[3] = E:GetColorTable(db.power.ENERGY);
+
+ --[[ElvUF.colors.ComboPoints = {}
+ ElvUF.colors.ComboPoints[1] = E:GetColorTable(db.classResources.comboPoints[1])
+ ElvUF.colors.ComboPoints[2] = E:GetColorTable(db.classResources.comboPoints[2])
+ ElvUF.colors.ComboPoints[3] = E:GetColorTable(db.classResources.comboPoints[3])
+ ElvUF.colors.ComboPoints[4] = E:GetColorTable(db.classResources.comboPoints[4])
+ ElvUF.colors.ComboPoints[5] = E:GetColorTable(db.classResources.comboPoints[5])]]
+
+ ElvUF.colors.reaction[1] = bad
+ ElvUF.colors.reaction[2] = bad
+ ElvUF.colors.reaction[3] = bad
+ ElvUF.colors.reaction[4] = neutral
+ ElvUF.colors.reaction[5] = good
+ ElvUF.colors.reaction[6] = good
+ ElvUF.colors.reaction[7] = good
+ ElvUF.colors.reaction[8] = good
+ ElvUF.colors.smooth = {1, 0, 0,
+ 1, 1, 0,
+ unpack(E:GetColorTable(db.health))}
+
+ ElvUF.colors.castColor = E:GetColorTable(db.castColor);
+end
+
+function UF:Update_StatusBars()
+ local statusBarTexture = LSM:Fetch("statusbar", self.db.statusbar)
+ for statusbar in pairs(UF["statusbars"]) do
+ if statusbar and statusbar:GetObjectType() == "StatusBar" and not statusbar.isTransparent then
+ statusbar:SetStatusBarTexture(statusBarTexture)
+ elseif statusbar and statusbar:GetObjectType() == "Texture" then
+ statusbar:SetTexture(statusBarTexture)
+ end
+ end
+end
+
+function UF:Update_StatusBar(bar)
+ bar:SetStatusBarTexture(LSM:Fetch("statusbar", self.db.statusbar))
+end
+
+function UF:Update_FontString(object)
+ E:FontTemplate(object, LSM:Fetch("font", self.db.font), self.db.fontSize, self.db.fontOutline)
+end
+
+function UF:Update_FontStrings()
+ local stringFont = LSM:Fetch("font", self.db.font)
+ for font in pairs(UF["fontstrings"]) do
+ E:FontTemplate(font, stringFont, self.db.fontSize, self.db.fontOutline)
+ end
+end
+
+function UF:Configure_FontString(obj)
+ UF["fontstrings"][obj] = true
+ E:FontTemplate(obj) --This is temporary.
+end
+
+function UF:Update_AllFrames()
+ if E.private["unitframe"].enable ~= true then return; end
+ self:UpdateColors()
+ self:Update_FontStrings()
+ self:Update_StatusBars()
+
+ for unit in pairs(self["units"]) do
+ if self.db["units"][unit].enable then
+ self[unit]:Enable()
+ self[unit]:Update()
+ E:EnableMover(self[unit].mover:GetName())
+ else
+ self[unit]:Disable()
+ E:DisableMover(self[unit].mover:GetName())
+ end
+ end
+
+ for unit, group in pairs(self["groupunits"]) do
+ if self.db["units"][group].enable then
+ self[unit]:Enable()
+ self[unit]:Update()
+ E:EnableMover(self[unit].mover:GetName())
+ else
+ self[unit]:Disable()
+ E:DisableMover(self[unit].mover:GetName())
+ end
+ end
+
+ self:UpdateAllHeaders()
+end
+
+function UF:CreateAndUpdateUFGroup(group, numGroup)
+ for i = 1, numGroup do
+ local unit = group..i
+ local frameName = E:StringTitle(unit)
+ frameName = frameName:gsub("t(arget)", "T%1")
+ if not self[unit] then
+ self["groupunits"][unit] = group
+ self[unit] = ElvUF:Spawn(unit, "ElvUF_"..frameName)
+ self[unit].index = i
+ self[unit]:SetID(i)
+ end
+
+ local frameName = E:StringTitle(group)
+ frameName = frameName:gsub("t(arget)", "T%1")
+ self[unit].Update = function()
+ UF["Update_"..E:StringTitle(frameName).."Frames"](self, self[unit], self.db["units"][group])
+ end
+
+ if self.db["units"][group].enable then
+ self[unit]:Enable()
+ self[unit].Update()
+
+ if self[unit].isForced then
+ self:ForceShow(self[unit])
+ end
+ E:EnableMover(self[unit].mover:GetName())
+ else
+ self[unit]:Disable()
+ E:DisableMover(self[unit].mover:GetName())
+ end
+ end
+end
+
+function UF:HeaderUpdateSpecificElement(group, elementName)
+ assert(self[group], "Invalid group specified.")
+ for i = 1, self[group]:GetNumChildren() do
+ local frame = select(i, self[group]:GetChildren())
+ if frame and frame.Health then
+ frame:UpdateElement(elementName)
+ end
+ end
+end
+
+--Keep an eye on this one, it may need to be changed too
+--Reference: http://www.tukui.org/forums/topic.php?id=35332
+function UF.groupPrototype:GetAttribute(name)
+ return self.groups[1]:GetAttribute(name)
+end
+
+function UF.groupPrototype:Configure_Groups(self)
+ local db = UF.db.units[self.groupName]
+
+ local point
+ local width, height, newCols, newRows = 0, 0, 0, 0
+ local direction = db.growthDirection
+ local xMult, yMult = DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER[direction], DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER[direction]
+ local UNIT_HEIGHT = db.infoPanel and db.infoPanel.enable and (db.height + db.infoPanel.height) or db.height
+
+ local numGroups = self.numGroups
+ for i = 1, numGroups do
+ local group = self.groups[i]
+
+ point = DIRECTION_TO_POINT[direction]
+
+ if group then
+ UF:ConvertGroupDB(group)
+ if point == "LEFT" or point == "RIGHT" then
+ group:SetAttribute("xOffset", db.horizontalSpacing * DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER[direction])
+ group:SetAttribute("yOffset", 0)
+ group:SetAttribute("columnSpacing", db.verticalSpacing)
+ else
+ group:SetAttribute("xOffset", 0)
+ group:SetAttribute("yOffset", db.verticalSpacing * DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER[direction])
+ group:SetAttribute("columnSpacing", db.horizontalSpacing)
+ end
+
+ --[[if not group.isForced then
+ if not group.initialized then
+ group:SetAttribute("startingIndex", db.raidWideSorting and (-min(numGroups * (db.groupsPerRowCol * 5), MAX_RAID_MEMBERS) + 1) or -4)
+ group:Show()
+ group.initialized = true
+ end
+ group:SetAttribute("startingIndex", 1)
+ end]]
+
+ group:ClearAllPoints()
+ if db.raidWideSorting and db.invertGroupingOrder then
+ group:SetAttribute("columnAnchorPoint", INVERTED_DIRECTION_TO_COLUMN_ANCHOR_POINT[direction])
+ else
+ group:SetAttribute("columnAnchorPoint", DIRECTION_TO_COLUMN_ANCHOR_POINT[direction])
+ end
+
+ group:ClearChildPoints()
+ group:SetAttribute("point", point)
+
+ if not group.isForced then
+ group:SetAttribute("maxColumns", db.raidWideSorting and numGroups or 1)
+ group:SetAttribute("unitsPerColumn", db.raidWideSorting and (db.groupsPerRowCol * 5) or 5)
+ UF.headerGroupBy[db.groupBy](group)
+ group:SetAttribute("sortDir", db.sortDir)
+ group:SetAttribute("showPlayer", db.showPlayer)
+ end
+
+ if i == 1 and db.raidWideSorting then
+ group:SetAttribute("groupFilter", "1,2,3,4,5,6,7,8")
+ else
+ group:SetAttribute("groupFilter", tostring(i))
+ end
+ end
+
+ --MATH!! WOOT
+ point = DIRECTION_TO_GROUP_ANCHOR_POINT[direction]
+ if db.raidWideSorting and db.startFromCenter then
+ point = DIRECTION_TO_GROUP_ANCHOR_POINT["OUT_"..direction]
+ end
+ if math.mod(i - 1, db.groupsPerRowCol) == 0 then
+ if DIRECTION_TO_POINT[direction] == "LEFT" or DIRECTION_TO_POINT[direction] == "RIGHT" then
+ if group then
+ group:SetPoint(point, self, point, 0, height * yMult)
+ end
+ height = height + UNIT_HEIGHT + db.verticalSpacing
+ newRows = newRows + 1
+ else
+ if group then
+ group:SetPoint(point, self, point, width * xMult, 0)
+ end
+ width = width + db.width + db.horizontalSpacing
+
+ newCols = newCols + 1
+ end
+ else
+ if DIRECTION_TO_POINT[direction] == "LEFT" or DIRECTION_TO_POINT[direction] == "RIGHT" then
+ if newRows == 1 then
+ if group then
+ group:SetPoint(point, self, point, width * xMult, 0)
+ end
+ width = width + ((db.width + db.horizontalSpacing) * 5)
+ newCols = newCols + 1
+ elseif group then
+ group:SetPoint(point, self, point, (((db.width + db.horizontalSpacing) * 5) * (math.mod(i-1, db.groupsPerRowCol))) * xMult, ((UNIT_HEIGHT + db.verticalSpacing) * (newRows - 1)) * yMult)
+ end
+ else
+ if newCols == 1 then
+ if group then
+ group:SetPoint(point, self, point, 0, height * yMult)
+ end
+ height = height + ((UNIT_HEIGHT + db.verticalSpacing) * 5)
+ newRows = newRows + 1
+ elseif group then
+ group:SetPoint(point, self, point, ((db.width + db.horizontalSpacing) * (newCols - 1)) * xMult, (((UNIT_HEIGHT + db.verticalSpacing) * 5) * (math.mod(i-1, db.groupsPerRowCol))) * yMult)
+ end
+ end
+ end
+
+ if height == 0 then
+ height = height + ((UNIT_HEIGHT + db.verticalSpacing) * 5)
+ elseif width == 0 then
+ width = width + ((db.width + db.horizontalSpacing) * 5)
+ end
+ end
+
+ if not self.isInstanceForced then
+ self.dirtyWidth = width - db.horizontalSpacing
+ self.dirtyHeight = height - db.verticalSpacing
+ end
+
+ if self.mover then
+ self.mover.positionOverride = DIRECTION_TO_GROUP_ANCHOR_POINT[direction]
+ E:UpdatePositionOverride(self.mover:GetName())
+ self:GetScript("OnSizeChanged")(self) --Mover size is not updated if frame is hidden, so call an update manually
+ end
+
+ self:SetSize(width - db.horizontalSpacing, height - db.verticalSpacing)
+end
+
+function UF.groupPrototype:Update(self)
+ local group = self.groupName
+
+ UF[group].db = UF.db["units"][group]
+ for i = 1, getn(self.groups) do
+ self.groups[i].db = UF.db["units"][group]
+ self.groups[i]:Update()
+ end
+end
+
+function UF.groupPrototype:AdjustVisibility(self)
+ if not self.isForced then
+ local numGroups = self.numGroups
+ for i = 1, getn(self.groups) do
+ local group = self.groups[i]
+ if (i <= numGroups) and ((self.db.raidWideSorting and i <= 1) or not self.db.raidWideSorting) then
+ group:Show()
+ else
+ if group.forceShow then
+ group:Hide()
+ UF:UnshowChildUnits(group, group:GetChildren())
+ group:SetAttribute("startingIndex", 1)
+ else
+ group:Reset()
+ end
+ end
+ end
+ end
+end
+
+function UF.groupPrototype:UpdateHeader(self)
+ local group = self.groupName;
+ UF["Update_"..E:StringTitle(group).."Header"](UF, self, UF.db["units"][group]);
+end
+
+function UF.headerPrototype:ClearChildPoints()
+ for i = 1, self:GetNumChildren() do
+ local child = select(i, self:GetChildren())
+ child:ClearAllPoints()
+ end
+end
+
+function UF.headerPrototype:Update(isForced)
+ local group = self.groupName
+ local db = UF.db["units"][group]
+
+ local i = 1
+ local child = self:GetAttribute("child" .. i)
+
+ while child do
+ UF["Update_"..E:StringTitle(group).."Frames"](UF, child, db)
+
+ if _G[child:GetName().."Pet"] then
+ UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Pet"], db)
+ end
+
+ if _G[child:GetName().."Target"] then
+ UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Target"], db)
+ end
+
+ i = i + 1
+ child = self:GetAttribute("child" .. i)
+ end
+end
+
+function UF.headerPrototype:Reset()
+ self:Hide()
+
+ self:SetAttribute("showPlayer", true)
+
+ self:SetAttribute("showSolo", true)
+ self:SetAttribute("showParty", true)
+ self:SetAttribute("showRaid", true)
+
+ self:SetAttribute("columnSpacing", nil)
+ self:SetAttribute("columnAnchorPoint", nil)
+ self:SetAttribute("groupBy", nil)
+ self:SetAttribute("groupFilter", nil)
+ self:SetAttribute("groupingOrder", nil)
+ self:SetAttribute("maxColumns", nil)
+ self:SetAttribute("nameList", nil)
+ self:SetAttribute("point", nil)
+ self:SetAttribute("sortDir", nil)
+ self:SetAttribute("sortMethod", "NAME")
+ self:SetAttribute("startingIndex", nil)
+ self:SetAttribute("strictFiltering", nil)
+ self:SetAttribute("unitsPerColumn", nil)
+ self:SetAttribute("xOffset", nil)
+ self:SetAttribute("yOffset", nil)
+end
+
+function UF:CreateHeader(parent, groupFilter, overrideName, template, groupName, headerTemplate)
+ local group = parent.groupName or groupName
+ local db = UF.db["units"][group]
+ ElvUF:SetActiveStyle("ElvUF_"..E:StringTitle(group))
+ local header = ElvUF:SpawnHeader(overrideName, headerTemplate, nil,
+ "initial-width", db.width,
+ "initial-height", db.height,
+ "groupFilter", groupFilter,
+ "showParty", true,
+ "showRaid", true,
+ "showSolo", true,
+ template and "template", template)
+
+ header.groupName = group
+ header:SetParent(parent)
+ header:Show()
+
+ for k, v in pairs(self.headerPrototype) do
+ header[k] = v
+ end
+
+ return header
+end
+
+function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdate, headerTemplate)
+ local db = self.db["units"][group]
+ local raidFilter = UF.db.smartRaidFilter
+ local numGroups = db.numGroups
+ if(raidFilter and numGroups and (self[group] and not self[group].blockVisibilityChanges)) then
+ local inInstance, instanceType = IsInInstance()
+ if(inInstance and (instanceType == "raid" or instanceType == "pvp")) then
+ local _, _, _, _, maxPlayers = GetInstanceInfo()
+ local mapID = GetCurrentMapAreaID()
+
+ if UF.mapIDs[mapID] then
+ maxPlayers = UF.mapIDs[mapID]
+ end
+
+ if maxPlayers > 0 then
+ numGroups = E:Round(maxPlayers/5)
+ end
+ end
+ end
+
+ if not self[group] then
+ local stringTitle = E:StringTitle(group)
+ ElvUF:RegisterStyle("ElvUF_"..stringTitle, UF["Construct_"..stringTitle.."Frames"])
+ ElvUF:SetActiveStyle("ElvUF_"..stringTitle)
+
+ if db.numGroups then
+ self[group] = CreateFrame("Frame", "ElvUF_"..stringTitle, E.UIParent)
+ self[group].groups = {}
+ self[group].groupName = group
+ self[group].template = self[group].template or template
+ self[group].headerTemplate = self[group].headerTemplate or headerTemplate
+ if not UF["headerFunctions"][group] then UF["headerFunctions"][group] = {} end
+ for k, v in pairs(self.groupPrototype) do
+ UF["headerFunctions"][group][k] = v
+ end
+ else
+ self[group] = self:CreateHeader(E.UIParent, groupFilter, "ElvUF_"..E:StringTitle(group), template, group, headerTemplate)
+ end
+
+ self[group].db = db
+ self["headers"][group] = self[group]
+ self[group]:Show()
+ end
+
+ self[group].numGroups = numGroups
+ if numGroups then
+ if db.raidWideSorting then
+ if not self[group].groups[1] then
+ self[group].groups[1] = self:CreateHeader(self[group], nil, "ElvUF_"..E:StringTitle(self[group].groupName).."Group1", template or self[group].template, nil, headerTemplate or self[group].headerTemplate)
+ end
+ else
+ while numGroups > getn(self[group].groups) do
+ local index = tostring(getn(self[group].groups) + 1)
+ tinsert(self[group].groups, self:CreateHeader(self[group], index, "ElvUF_"..E:StringTitle(self[group].groupName).."Group"..index, template or self[group].template, nil, headerTemplate or self[group].headerTemplate))
+ end
+ end
+
+ UF["headerFunctions"][group]:AdjustVisibility(self[group])
+
+ if headerUpdate or not self[group].mover then
+ UF["headerFunctions"][group]:Configure_Groups(self[group])
+ if not self[group].isForced and not self[group].blockVisibilityChanges then
+ RegisterStateDriver(self[group], "visibility", db.visibility)
+ end
+ else
+ UF["headerFunctions"][group]:Configure_Groups(self[group])
+ UF["headerFunctions"][group]:UpdateHeader(self[group])
+ UF["headerFunctions"][group]:Update(self[group])
+ end
+
+ if(db.enable) then
+ if self[group].mover then
+ E:EnableMover(self[group].mover:GetName())
+ end
+ else
+ UnregisterStateDriver(self[group], "visibility")
+ self[group]:Hide()
+ if self[group].mover then
+ E:DisableMover(self[group].mover:GetName())
+ end
+ return
+ end
+ else
+ self[group].db = db
+
+ if not UF["headerFunctions"][group] then UF["headerFunctions"][group] = {} end
+ UF["headerFunctions"][group]["Update"] = function()
+ local db = UF.db["units"][group]
+ if db.enable ~= true then
+ UnregisterStateDriver(UF[group], "visibility")
+ UF[group]:Hide()
+ if(UF[group].mover) then
+ E:DisableMover(UF[group].mover:GetName())
+ end
+ return
+ end
+ UF["Update_"..E:StringTitle(group).."Header"](UF, UF[group], db)
+
+ for i = 1, UF[group]:GetNumChildren() do
+ local child = select(i, UF[group]:GetChildren())
+ UF["Update_"..E:StringTitle(group).."Frames"](UF, child, UF.db["units"][group])
+
+ if _G[child:GetName().."Target"] then
+ UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Target"], UF.db["units"][group])
+ end
+
+ if _G[child:GetName().."Pet"] then
+ UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Pet"], UF.db["units"][group])
+ end
+ end
+
+ E:EnableMover(UF[group].mover:GetName())
+ end
+
+ if headerUpdate then
+ UF["Update_"..E:StringTitle(group).."Header"](self, self[group], db)
+ else
+ UF["headerFunctions"][group]:Update(self[group])
+ end
+ end
+end
+
+function UF:PLAYER_REGEN_ENABLED()
+ self:Update_AllFrames()
+ self:UnregisterEvent("PLAYER_REGEN_ENABLED")
+end
+
+function UF:CreateAndUpdateUF(unit)
+ assert(unit, "No unit provided to create or update.")
+
+ local frameName = E:StringTitle(unit)
+ frameName = gsub(frameName, "t(arget)", "T%1")
+ if not self[unit] then
+ self[unit] = ElvUF:Spawn(unit, "ElvUF_"..frameName)
+ self["units"][unit] = unit
+ end
+
+ self[unit].Update = function()
+ UF["Update_"..frameName.."Frame"](self, self[unit], self.db["units"][unit])
+ end
+
+ if self.db["units"][unit].enable then
+ self[unit]:Enable()
+ self[unit].Update()
+ E:EnableMover(self[unit].mover:GetName())
+ else
+ self[unit]:Disable()
+ E:DisableMover(self[unit].mover:GetName())
+ end
+end
+
+function UF:LoadUnits()
+ for _, unit in pairs(self["unitstoload"]) do
+ self:CreateAndUpdateUF(unit)
+ end
+ self["unitstoload"] = nil
+
+ for group, groupOptions in pairs(self["unitgroupstoload"]) do
+ local numGroup, template = unpack(groupOptions)
+ self:CreateAndUpdateUFGroup(group, numGroup, template)
+ end
+ self["unitgroupstoload"] = nil
+
+ for group, groupOptions in pairs(self["headerstoload"]) do
+ local groupFilter, template, headerTemplate
+ if type(groupOptions) == "table" then
+ groupFilter, template, headerTemplate = unpack(groupOptions)
+ end
+
+ self:CreateAndUpdateHeaderGroup(group, groupFilter, template, nil, headerTemplate)
+ end
+ self["headerstoload"] = nil
+end
+
+function UF:UpdateAllHeaders(event)
+ local _, instanceType = IsInInstance()
+ local ORD = ns.oUF_RaidDebuffs or oUF_RaidDebuffs
+ if ORD then
+ ORD:ResetDebuffData()
+
+ if instanceType == "party" or instanceType == "raid" then
+ ORD:RegisterDebuffs(E.global.unitframe.aurafilters.RaidDebuffs.spells)
+ else
+ ORD:RegisterDebuffs(E.global.unitframe.aurafilters.CCDebuffs.spells)
+ end
+ end
+
+ if E.private["unitframe"]["disabledBlizzardFrames"].party then
+ ElvUF:DisableBlizzard("party")
+ end
+
+ local smartRaidFilterEnabled = self.db.smartRaidFilter
+ for group, header in pairs(self["headers"]) do
+ if header.numGroups then
+ UF["headerFunctions"][group]:UpdateHeader(header)
+ end
+ UF["headerFunctions"][group]:Update(header)
+
+ local shouldUpdateHeader
+ if header.numGroups == nil or smartRaidFilterEnabled then
+ shouldUpdateHeader = false
+ elseif header.numGroups ~= nil and not smartRaidFilterEnabled then
+ shouldUpdateHeader = true
+ end
+ self:CreateAndUpdateHeaderGroup(group, nil, nil, shouldUpdateHeader)
+
+ if group == "party" or group == "raid" or group == "raid40" then
+ --Update BuffIndicators on profile change as they might be using profile specific data
+ self:UpdateAuraWatchFromHeader(group)
+ end
+ end
+end
+
+local hiddenParent = CreateFrame("Frame")
+hiddenParent:Hide()
+
+local HandleFrame = function(baseName)
+ local frame
+ if(type(baseName) == "string") then
+ frame = _G[baseName]
+ else
+ frame = baseName
+ end
+
+ if(frame) then
+ frame:UnregisterAllEvents()
+ frame:Hide()
+
+ -- Keep frame hidden without causing taint
+ frame:SetParent(hiddenParent)
+
+ local health = frame.healthbar
+ if(health) then
+ health:UnregisterAllEvents()
+ end
+
+ local power = frame.manabar
+ if(power) then
+ power:UnregisterAllEvents()
+ end
+
+ local spell = frame.spellbar
+ if(spell) then
+ spell:UnregisterAllEvents()
+ end
+ end
+end
+
+function ElvUF:DisableBlizzard(unit)
+ if not unit then return end
+
+ if(unit == "player") and E.private["unitframe"]["disabledBlizzardFrames"].player then
+ HandleFrame(PlayerFrame)
+ elseif(unit == "pet") and E.private["unitframe"]["disabledBlizzardFrames"].player then
+ HandleFrame(PetFrame)
+ elseif(unit == "target") and E.private["unitframe"]["disabledBlizzardFrames"].target then
+ HandleFrame(TargetFrame)
+ HandleFrame(ComboFrame)
+-- elseif(unit == "focus") and E.private["unitframe"]["disabledBlizzardFrames"].focus then
+-- HandleFrame(FocusFrame)
+-- HandleFrame(FocusFrameToT)
+ elseif(unit == "targettarget") and E.private["unitframe"]["disabledBlizzardFrames"].target then
+ HandleFrame(TargetofTargetFrame)
+ elseif string.match(unit, "(party)%d?$") == "party" and E.private["unitframe"]["disabledBlizzardFrames"].party then
+ local id = string.match(unit, "party(%d)")
+ if(id) then
+ HandleFrame("PartyMemberFrame"..id)
+ else
+ for i = 1, 4 do
+ HandleFrame(("PartyMemberFrame%d"):format(i))
+ end
+ end
+ HandleFrame(PartyMemberBackground)
+ end
+end
+
+local hasEnteredWorld = false
+function UF:PLAYER_ENTERING_WORLD()
+ if not hasEnteredWorld then
+ --We only want to run Update_AllFrames once when we first log in or /reload
+ self:Update_AllFrames()
+ hasEnteredWorld = true
+ else
+ local _, instanceType = IsInInstance()
+ if instanceType ~= "none" then
+ --We need to update headers when we zone into an instance
+ UF:UpdateAllHeaders()
+ end
+ end
+end
+
+function UF:Initialize()
+ self.db = E.db["unitframe"]
+ self.thinBorders = self.db.thinBorders or E.PixelMode
+ if E.private["unitframe"].enable ~= true then return; end
+ E.UnitFrames = UF
+
+ self:UpdateColors()
+ ElvUF:RegisterStyle("ElvUF", function(frame, unit)
+ self:Construct_UF(frame, unit)
+ end)
+
+ self:LoadUnits()
+ self:RegisterEvent("PLAYER_ENTERING_WORLD")
+
+ local ORD = ns.oUF_RaidDebuffs or oUF_RaidDebuffs
+ if not ORD then return end
+ ORD.ShowDispelableDebuff = true
+ ORD.FilterDispellableDebuff = true
+
+ self:UpdateRangeCheckSpells()
+ self:RegisterEvent("LEARNED_SPELL_IN_TAB", "UpdateRangeCheckSpells")
+end
+
+function UF:ResetUnitSettings(unit)
+ E:CopyTable(self.db["units"][unit], P["unitframe"]["units"][unit])
+
+ if self.db["units"][unit].buffs and self.db["units"][unit].buffs.sizeOverride then
+ self.db["units"][unit].buffs.sizeOverride = P.unitframe.units[unit].buffs.sizeOverride or 0
+ end
+
+ if self.db["units"][unit].debuffs and self.db["units"][unit].debuffs.sizeOverride then
+ self.db["units"][unit].debuffs.sizeOverride = P.unitframe.units[unit].debuffs.sizeOverride or 0
+ end
+
+ self:Update_AllFrames()
+end
+
+function UF:ToggleForceShowGroupFrames(unitGroup, numGroup)
+ for i = 1, numGroup do
+ if self[unitGroup..i] and not self[unitGroup..i].isForced then
+ UF:ForceShow(self[unitGroup..i])
+ elseif self[unitGroup..i] then
+ UF:UnforceShow(self[unitGroup..i])
+ end
+ end
+end
+
+local ignoreSettings = {
+ ["position"] = true,
+ ["playerOnly"] = true,
+ ["noConsolidated"] = true,
+ ["useBlacklist"] = true,
+ ["useWhitelist"] = true,
+ ["noDuration"] = true,
+ ["onlyDispellable"] = true,
+ ["useFilter"] = true
+}
+
+local ignoreSettingsGroup = {
+ ["visibility"] = true
+}
+
+local allowPass = {
+ ["sizeOverride"] = true
+}
+
+function UF:MergeUnitSettings(fromUnit, toUnit, isGroupUnit)
+ local db = self.db["units"]
+ local filter = ignoreSettings
+ if isGroupUnit then
+ filter = ignoreSettingsGroup
+ end
+ if fromUnit ~= toUnit then
+ for option, value in pairs(db[fromUnit]) do
+ if type(value) ~= "table" and not filter[option] then
+ if db[toUnit][option] ~= nil then
+ db[toUnit][option] = value
+ end
+ elseif not filter[option] then
+ if type(value) == "table" then
+ for opt, val in pairs(db[fromUnit][option]) do
+ --local val = db[fromUnit][option][opt]
+ if type(val) ~= "table" and not filter[opt] then
+ if db[toUnit][option] ~= nil and (db[toUnit][option][opt] ~= nil or allowPass[opt]) then
+ db[toUnit][option][opt] = val
+ end
+ elseif not filter[opt] then
+ if type(val) == "table" then
+ for o, v in pairs(db[fromUnit][option][opt]) do
+ if not filter[o] then
+ if db[toUnit][option] ~= nil and db[toUnit][option][opt] ~= nil and db[toUnit][option][opt][o] ~= nil then
+ db[toUnit][option][opt][o] = v
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ else
+ E:Print(L["You cannot copy settings from the same unit."])
+ end
+
+ self:Update_AllFrames()
+end
+
+local function updateColor(self, r, g, b)
+ if not self.isTransparent then return end
+ if self.backdrop then
+ local _, _, _, a = self.backdrop:GetBackdropColor()
+ self.backdrop:SetBackdropColor(r * 0.58, g * 0.58, b * 0.58, a)
+ elseif self:GetParent().template then
+ local _, _, _, a = self:GetParent():GetBackdropColor()
+ self:GetParent():SetBackdropColor(r * 0.58, g * 0.58, b * 0.58, a)
+ end
+
+ if self.bg and self.bg:GetObjectType() == "Texture" and not self.bg.multiplier then
+ self.bg:SetTexture(r * 0.35, g * 0.35, b * 0.35)
+ end
+end
+
+function UF:ToggleTransparentStatusBar(isTransparent, statusBar, backdropTex, adjustBackdropPoints, invertBackdropTex)
+ statusBar.isTransparent = isTransparent
+
+ local statusBarTex = statusBar.texturePointer
+ local statusBarOrientation = statusBar:GetOrientation()
+ if isTransparent then
+ if statusBar.backdrop then
+ E:SetTemplate(statusBar.backdrop, "Transparent", nil, nil, nil, true)
+ statusBar.backdrop.ignoreUpdates = true
+ elseif statusBar:GetParent().template then
+ E:SetTemplate(statusBar:GetParent(), "Transparent", nil, nil, nil, true)
+ statusBar:GetParent().ignoreUpdates = true
+ end
+
+ statusBar:SetStatusBarTexture("")
+
+ backdropTex:ClearAllPoints()
+ if statusBarOrientation == "VERTICAL" then
+ backdropTex:SetPoint("TOPLEFT", statusBar, "TOPLEFT")
+ backdropTex:SetPoint("BOTTOMLEFT", statusBarTex, "TOPLEFT")
+ backdropTex:SetPoint("BOTTOMRIGHT", statusBarTex, "TOPRIGHT")
+ else
+ backdropTex:SetPoint("TOPLEFT", statusBarTex, "TOPRIGHT")
+ backdropTex:SetPoint("BOTTOMLEFT", statusBarTex, "BOTTOMRIGHT")
+ backdropTex:SetPoint("BOTTOMRIGHT", statusBar, "BOTTOMRIGHT")
+ end
+
+ if invertBackdropTex then
+ backdropTex:Show()
+ end
+
+ if not invertBackdropTex and not statusBar.hookedColor then
+ hooksecurefunc(statusBar, "SetStatusBarColor", updateColor)
+ statusBar.hookedColor = true
+ end
+
+ if backdropTex.multiplier then
+ backdropTex.multiplier = 0.25
+ end
+ else
+ if statusBar.backdrop then
+ E:SetTemplate(statusBar.backdrop, "Default", nil, nil, not statusBar.PostCastStart and self.thinBorders, true)
+ statusBar.backdrop.ignoreUpdates = nil
+ elseif statusBar:GetParent().template then
+ E:SetTemplate(statusBar:GetParent(), "Default", nil, nil, self.thinBorders, true)
+ statusBar:GetParent().ignoreUpdates = nil
+ end
+ statusBar:SetStatusBarTexture(LSM:Fetch("statusbar", self.db.statusbar))
+
+ if adjustBackdropPoints then
+ backdropTex:ClearAllPoints()
+ if statusBarOrientation == "VERTICAL" then
+ backdropTex:SetPoint("TOPLEFT", statusBar, "TOPLEFT")
+ backdropTex:SetPoint("BOTTOMLEFT", statusBarTex, "TOPLEFT")
+ backdropTex:SetPoint("BOTTOMRIGHT", statusBarTex, "TOPRIGHT")
+ else
+ backdropTex:SetPoint("TOPLEFT", statusBarTex, "TOPRIGHT")
+ backdropTex:SetPoint("BOTTOMLEFT", statusBarTex, "BOTTOMRIGHT")
+ backdropTex:SetPoint("BOTTOMRIGHT", statusBar, "BOTTOMRIGHT")
+ end
+ end
+
+ if invertBackdropTex then
+ backdropTex:Hide()
+ end
+
+ if backdropTex.multiplier then
+ backdropTex.multiplier = 0.25
+ end
+ end
+end
+
+local function InitializeCallback()
+ UF:Initialize()
+end
+
+E:RegisterInitialModule(UF:GetName(), InitializeCallback)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/Load_Units.xml b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/Load_Units.xml
new file mode 100644
index 0000000..ba62950
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/Load_Units.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/Player.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/Player.lua
new file mode 100644
index 0000000..5245870
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/Player.lua
@@ -0,0 +1,94 @@
+local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
+local UF = E:GetModule("UnitFrames");
+
+--Cache global variables
+--Lua functions
+local _G = _G
+
+local ns = oUF
+local ElvUF = ns.oUF
+assert(ElvUF, "ElvUI was unable to locate oUF.")
+
+local CAN_HAVE_CLASSBAR = E.myclass == "DRUID"
+
+function UF:Construct_PlayerFrame(frame)
+ frame.Health = self:Construct_HealthBar(frame, true, true, "RIGHT")
+ frame.Health.frequentUpdates = true
+
+ frame.Power = self:Construct_PowerBar(frame, true, true, "LEFT")
+ frame.Power.frequentUpdates = true
+
+ frame.Name = self:Construct_NameText(frame)
+
+ frame.Portrait3D = self:Construct_Portrait(frame, "model")
+ frame.Portrait2D = self:Construct_Portrait(frame, "texture")
+
+ frame:SetPoint("BOTTOMLEFT", E.UIParent, "BOTTOM", -413, 68)
+ E:CreateMover(frame, frame:GetName().."Mover", L["Player Frame"], nil, nil, nil, "ALL,SOLO")
+ frame.unitframeType = "player"
+end
+
+function UF:Update_PlayerFrame(frame, db)
+ frame.db = db
+
+ do
+ frame.ORIENTATION = db.orientation
+ frame.UNIT_WIDTH = db.width
+ frame.UNIT_HEIGHT = db.infoPanel.enable and (db.height + db.infoPanel.height) or db.height
+
+ frame.USE_POWERBAR = db.power.enable
+ frame.POWERBAR_DETACHED = db.power.detachFromFrame
+ frame.USE_INSET_POWERBAR = not frame.POWERBAR_DETACHED and db.power.width == "inset" and frame.USE_POWERBAR
+ frame.USE_MINI_POWERBAR = (not frame.POWERBAR_DETACHED and db.power.width == "spaced" and frame.USE_POWERBAR)
+ frame.USE_POWERBAR_OFFSET = db.power.offset ~= 0 and frame.USE_POWERBAR and not frame.POWERBAR_DETACHED
+ frame.POWERBAR_OFFSET = frame.USE_POWERBAR_OFFSET and db.power.offset or 0
+
+ frame.POWERBAR_HEIGHT = not frame.USE_POWERBAR and 0 or db.power.height
+ frame.POWERBAR_WIDTH = frame.USE_MINI_POWERBAR and (frame.UNIT_WIDTH - (frame.BORDER*2))/2 or (frame.POWERBAR_DETACHED and db.power.detachedWidth or (frame.UNIT_WIDTH - ((frame.BORDER+frame.SPACING)*2)))
+
+ frame.USE_PORTRAIT = db.portrait and db.portrait.enable
+ frame.USE_PORTRAIT_OVERLAY = frame.USE_PORTRAIT and (db.portrait.overlay or frame.ORIENTATION == "MIDDLE")
+ frame.PORTRAIT_WIDTH = (frame.USE_PORTRAIT_OVERLAY or not frame.USE_PORTRAIT) and 0 or db.portrait.width
+
+ frame.CAN_HAVE_CLASSBAR = CAN_HAVE_CLASSBAR
+ frame.MAX_CLASS_BAR = frame.MAX_CLASS_BAR or UF.classMaxResourceBar[E.myclass] or 0
+ frame.USE_CLASSBAR = db.classbar.enable and frame.CAN_HAVE_CLASSBAR
+ frame.CLASSBAR_SHOWN = frame.CAN_HAVE_CLASSBAR and frame[frame.ClassBar]:IsShown()
+ frame.CLASSBAR_DETACHED = db.classbar.detachFromFrame
+ frame.USE_MINI_CLASSBAR = db.classbar.fill == "spaced" and frame.USE_CLASSBAR
+ frame.CLASSBAR_HEIGHT = frame.USE_CLASSBAR and db.classbar.height or 0
+ frame.CLASSBAR_WIDTH = frame.UNIT_WIDTH - ((frame.BORDER+frame.SPACING)*2) - frame.PORTRAIT_WIDTH -(frame.ORIENTATION == "MIDDLE" and (frame.POWERBAR_OFFSET*2) or frame.POWERBAR_OFFSET)
+ frame.CLASSBAR_YOFFSET = (not frame.USE_CLASSBAR or not frame.CLASSBAR_SHOWN or frame.CLASSBAR_DETACHED) and 0 or (frame.USE_MINI_CLASSBAR and (frame.SPACING+(frame.CLASSBAR_HEIGHT/2)) or (frame.CLASSBAR_HEIGHT - (frame.BORDER-frame.SPACING)))
+
+ frame.USE_INFO_PANEL = not frame.USE_MINI_POWERBAR and not frame.USE_POWERBAR_OFFSET and db.infoPanel.enable
+ frame.INFO_PANEL_HEIGHT = frame.USE_INFO_PANEL and db.infoPanel.height or 0
+
+ frame.HAPPINESS_WIDTH = 0
+
+ frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)
+
+ frame.VARIABLES_SET = true
+ end
+
+ frame.colors = ElvUF.colors
+ frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
+ --frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
+
+ frame:SetWidth(frame.UNIT_WIDTH)
+ frame:SetHeight(frame.UNIT_HEIGHT)
+ _G[frame:GetName().."Mover"]:SetWidth(frame:GetWidth())
+ _G[frame:GetName().."Mover"]:SetHeight(frame:GetHeight())
+
+ UF:Configure_HealthBar(frame)
+
+ UF:UpdateNameSettings(frame)
+
+ UF:Configure_Power(frame)
+
+ UF:Configure_Portrait(frame)
+
+ E:SetMoverSnapOffset(frame:GetName().."Mover", -(12 + db.castbar.height))
+ frame:UpdateAllElements("ElvUI_UpdateAllElements")
+end
+
+tinsert(UF["unitstoload"], "player")
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/Target.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/Target.lua
new file mode 100644
index 0000000..fe2daec
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/Target.lua
@@ -0,0 +1,90 @@
+local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
+local UF = E:GetModule("UnitFrames");
+
+--Cache global variables
+--Lua functions
+local _G = _G
+
+local ns = oUF
+local ElvUF = ns.oUF
+assert(ElvUF, "ElvUI was unable to locate oUF.")
+
+function UF:Construct_TargetFrame(frame)
+ frame.Health = self:Construct_HealthBar(frame, true, true, "RIGHT")
+ frame.Health.frequentUpdates = true
+
+ frame.Power = self:Construct_PowerBar(frame, true, true, "LEFT")
+ frame.Power.frequentUpdates = true
+
+ frame.Name = self:Construct_NameText(frame)
+
+ frame.Portrait3D = self:Construct_Portrait(frame, "model")
+ frame.Portrait2D = self:Construct_Portrait(frame, "texture")
+
+ frame:SetPoint("BOTTOMRIGHT", E.UIParent, "BOTTOM", 413, 68)
+ E:CreateMover(frame, frame:GetName().."Mover", L["Target Frame"], nil, nil, nil, "ALL,SOLO")
+ frame.unitframeType = "target"
+end
+
+function UF:Update_TargetFrame(frame, db)
+ frame.db = db
+
+ do
+ frame.ORIENTATION = db.orientation
+ frame.UNIT_WIDTH = db.width
+ frame.UNIT_HEIGHT = db.infoPanel.enable and (db.height + db.infoPanel.height) or db.height
+
+ frame.USE_POWERBAR = db.power.enable
+ frame.POWERBAR_DETACHED = db.power.detachFromFrame
+ frame.USE_INSET_POWERBAR = not frame.POWERBAR_DETACHED and db.power.width == "inset" and frame.USE_POWERBAR
+ frame.USE_MINI_POWERBAR = (not frame.POWERBAR_DETACHED and db.power.width == "spaced" and frame.USE_POWERBAR)
+ frame.USE_POWERBAR_OFFSET = db.power.offset ~= 0 and frame.USE_POWERBAR and not frame.POWERBAR_DETACHED
+ frame.POWERBAR_OFFSET = frame.USE_POWERBAR_OFFSET and db.power.offset or 0
+
+ frame.POWERBAR_HEIGHT = not frame.USE_POWERBAR and 0 or db.power.height
+ frame.POWERBAR_WIDTH = frame.USE_MINI_POWERBAR and (frame.UNIT_WIDTH - (frame.BORDER*2))/2 or (frame.POWERBAR_DETACHED and db.power.detachedWidth or (frame.UNIT_WIDTH - ((frame.BORDER+frame.SPACING)*2)))
+
+ frame.USE_PORTRAIT = db.portrait and db.portrait.enable
+ frame.USE_PORTRAIT_OVERLAY = frame.USE_PORTRAIT and (db.portrait.overlay or frame.ORIENTATION == "MIDDLE")
+ frame.PORTRAIT_WIDTH = (frame.USE_PORTRAIT_OVERLAY or not frame.USE_PORTRAIT) and 0 or db.portrait.width
+
+ frame.CAN_HAVE_CLASSBAR = db.combobar.enable
+ frame.MAX_CLASS_BAR = MAX_COMBO_POINTS
+ frame.USE_CLASSBAR = db.combobar.enable
+ frame.CLASSBAR_SHOWN = frame.CAN_HAVE_CLASSBAR and frame.ComboPoints and frame.ComboPoints:IsShown()
+ frame.CLASSBAR_DETACHED = db.combobar.detachFromFrame
+ frame.USE_MINI_CLASSBAR = db.combobar.fill == "spaced" and frame.USE_CLASSBAR
+ frame.CLASSBAR_HEIGHT = frame.USE_CLASSBAR and db.combobar.height or 0
+ frame.CLASSBAR_WIDTH = frame.UNIT_WIDTH - ((frame.BORDER+frame.SPACING)*2) - frame.PORTRAIT_WIDTH - frame.POWERBAR_OFFSET
+ frame.CLASSBAR_YOFFSET = (not frame.USE_CLASSBAR or not frame.CLASSBAR_SHOWN or frame.CLASSBAR_DETACHED) and 0 or (frame.USE_MINI_CLASSBAR and (frame.SPACING+(frame.CLASSBAR_HEIGHT/2)) or (frame.CLASSBAR_HEIGHT + frame.SPACING))
+
+ frame.USE_INFO_PANEL = not frame.USE_MINI_POWERBAR and not frame.USE_POWERBAR_OFFSET and db.infoPanel.enable
+ frame.INFO_PANEL_HEIGHT = frame.USE_INFO_PANEL and db.infoPanel.height or 0
+
+ frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)
+
+ frame.VARIABLES_SET = true
+ end
+
+ frame.colors = ElvUF.colors
+ frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
+ --frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
+
+ frame:SetWidth(frame.UNIT_WIDTH)
+ frame:SetHeight(frame.UNIT_HEIGHT)
+ _G[frame:GetName().."Mover"]:SetWidth(frame:GetWidth())
+ _G[frame:GetName().."Mover"]:SetHeight(frame:GetHeight())
+
+ UF:Configure_HealthBar(frame)
+
+ UF:UpdateNameSettings(frame)
+
+ UF:Configure_Power(frame)
+
+ UF:Configure_Portrait(frame)
+
+ E:SetMoverSnapOffset(frame:GetName().."Mover", -(12 + db.castbar.height))
+ frame:UpdateAllElements("ElvUI_UpdateAllElements")
+end
+
+tinsert(UF["unitstoload"], "target")
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/TargetTarget.lua b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/TargetTarget.lua
new file mode 100644
index 0000000..a830268
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/UnitFrames/Units/TargetTarget.lua
@@ -0,0 +1,74 @@
+local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
+local UF = E:GetModule("UnitFrames");
+
+--Cache global variables
+--Lua functions
+local _G = _G
+
+local ns = oUF
+local ElvUF = ns.oUF
+assert(ElvUF, "ElvUI was unable to locate oUF.")
+
+function UF:Construct_TargetTargetFrame(frame)
+ frame.Health = self:Construct_HealthBar(frame, true, true, "RIGHT")
+ frame.Power = self:Construct_PowerBar(frame, true, true, "LEFT")
+ frame.Name = self:Construct_NameText(frame)
+ frame.Portrait3D = self:Construct_Portrait(frame, "model")
+ frame.Portrait2D = self:Construct_Portrait(frame, "texture")
+
+ frame:SetPoint("BOTTOM", E.UIParent, "BOTTOM", 0, 75)
+ E:CreateMover(frame, frame:GetName().."Mover", L["TargetTarget Frame"], nil, nil, nil, "ALL,SOLO")
+ frame.unitframeType = "targettarget";
+end
+
+function UF:Update_TargetTargetFrame(frame, db)
+ frame.db = db
+
+ do
+ frame.ORIENTATION = db.orientation
+ frame.UNIT_WIDTH = db.width
+ frame.UNIT_HEIGHT = db.infoPanel.enable and (db.height + db.infoPanel.height) or db.height
+
+ frame.USE_POWERBAR = db.power.enable
+ frame.POWERBAR_DETACHED = db.power.detachFromFrame
+ frame.USE_INSET_POWERBAR = not frame.POWERBAR_DETACHED and db.power.width == "inset" and frame.USE_POWERBAR
+ frame.USE_MINI_POWERBAR = (not frame.POWERBAR_DETACHED and db.power.width == "spaced" and frame.USE_POWERBAR)
+ frame.USE_POWERBAR_OFFSET = db.power.offset ~= 0 and frame.USE_POWERBAR and not frame.POWERBAR_DETACHED
+ frame.POWERBAR_OFFSET = frame.USE_POWERBAR_OFFSET and db.power.offset or 0
+
+ frame.POWERBAR_HEIGHT = not frame.USE_POWERBAR and 0 or db.power.height
+ frame.POWERBAR_WIDTH = frame.USE_MINI_POWERBAR and (frame.UNIT_WIDTH - (frame.BORDER*2))/2 or (frame.POWERBAR_DETACHED and db.power.detachedWidth or (frame.UNIT_WIDTH - ((frame.BORDER+frame.SPACING)*2)))
+
+ frame.USE_PORTRAIT = db.portrait and db.portrait.enable
+ frame.USE_PORTRAIT_OVERLAY = frame.USE_PORTRAIT and (db.portrait.overlay or frame.ORIENTATION == "MIDDLE")
+ frame.PORTRAIT_WIDTH = (frame.USE_PORTRAIT_OVERLAY or not frame.USE_PORTRAIT) and 0 or db.portrait.width
+
+ frame.USE_INFO_PANEL = not frame.USE_MINI_POWERBAR and not frame.USE_POWERBAR_OFFSET and db.infoPanel.enable
+ frame.INFO_PANEL_HEIGHT = frame.USE_INFO_PANEL and db.infoPanel.height or 0
+
+ frame.BOTTOM_OFFSET = UF:GetHealthBottomOffset(frame)
+
+ frame.VARIABLES_SET = true
+ end
+
+ frame.colors = ElvUF.colors
+ frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
+ --frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
+ frame:SetWidth(frame.UNIT_WIDTH)
+ frame:SetHeight(frame.UNIT_HEIGHT)
+ _G[frame:GetName().."Mover"]:SetWidth(frame:GetWidth())
+ _G[frame:GetName().."Mover"]:SetHeight(frame:GetHeight())
+
+ UF:Configure_HealthBar(frame)
+
+ UF:UpdateNameSettings(frame)
+
+ UF:Configure_Power(frame)
+
+ UF:Configure_Portrait(frame)
+
+ E:SetMoverSnapOffset(frame:GetName().."Mover", -(12 + self.db["units"].player.castbar.height))
+ frame:UpdateAllElements("ElvUI_UpdateAllElements")
+end
+
+tinsert(UF["unitstoload"], "targettarget")
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Settings/Private.lua b/2/3/4/5/6/7/ElvUI/Settings/Private.lua
index 655e1de..aeb0085 100644
--- a/2/3/4/5/6/7/ElvUI/Settings/Private.lua
+++ b/2/3/4/5/6/7/ElvUI/Settings/Private.lua
@@ -37,6 +37,18 @@ V["tooltip"] = {
["enable"] = true
}
+V["unitframe"] = {
+ ["enable"] = true,
+ ["disabledBlizzardFrames"] = {
+ ["player"] = true,
+ ["target"] = true,
+ ["focus"] = true,
+ ["boss"] = true,
+ ["arena"] = true,
+ ["party"] = true,
+ },
+}
+
V["actionbar"] = {
["enable"] = true
}
diff --git a/2/3/4/5/6/7/ElvUI/Settings/Profile.lua b/2/3/4/5/6/7/ElvUI/Settings/Profile.lua
index e4a4fd1..2c49e58 100644
--- a/2/3/4/5/6/7/ElvUI/Settings/Profile.lua
+++ b/2/3/4/5/6/7/ElvUI/Settings/Profile.lua
@@ -14,8 +14,8 @@ P["general"] = {
["autoAcceptInvite"] = false,
["bottomPanel"] = true,
["hideErrorFrame"] = true,
- ["enhancedPvpMessages"] = true,
["afk"] = true,
+ ["enhancedPvpMessages"] = true,
["numberPrefixStyle"] = "ENGLISH",
["fontSize"] = 12,
["font"] = "PT Sans Narrow",
@@ -276,6 +276,1951 @@ P["tooltip"] = {
}
}
+--UnitFrame
+P["unitframe"] = {
+ ["smoothbars"] = false,
+ ["smoothSpeed"] = 0.3,
+ ["statusbar"] = "ElvUI Norm",
+ ["font"] = "Homespun",
+ ["fontSize"] = 10,
+ ["fontOutline"] = "MONOCHROMEOUTLINE",
+ ["OORAlpha"] = 0.35,
+ ["debuffHighlighting"] = "FILL",
+ ["smartRaidFilter"] = true,
+ ["targetOnMouseDown"] = false,
+ ["auraBlacklistModifier"] = "SHIFT",
+ ["thinBorders"] = false,
+ ["colors"] = {
+ ["borderColor"] = {r = 0, g = 0, b = 0},
+ ["healthclass"] = false,
+ ["forcehealthreaction"] = false,
+ ["powerclass"] = false,
+ ["colorhealthbyvalue"] = true,
+ ["customhealthbackdrop"] = false,
+ ["useDeadBackdrop"] = false,
+ ["classbackdrop"] = false,
+ ["auraBarByType"] = true,
+ ["auraBarTurtle"] = true,
+ ["auraBarTurtleColor"] = {r = 143/255, g = 101/255, b = 158/255},
+ ["transparentHealth"] = false,
+ ["transparentPower"] = false,
+ ["transparentCastbar"] = false,
+ ["transparentAurabars"] = false,
+ ["castColor"] = {r = .31,g = .31,b = .31},
+ ["castNoInterrupt"] = {r = 0.78, g = 0.25, b = 0.25},
+ ["castClassColor"] = false,
+ ["castReactionColor"] = false,
+
+
+ ["health"] = {r = .31,g = .31,b = .31},
+ ["health_backdrop"] = {r = .8,g = .01,b = .01},
+ ["health_backdrop_dead"] = {r = .8,g = .01,b = .01},
+ ["tapped"] = {r = 0.55, g = 0.57, b = 0.61},
+ ["disconnected"] = {r = 0.84, g = 0.75, b = 0.65},
+ ["auraBarBuff"] = {r = .31,g = .31,b = .31},
+ ["auraBarDebuff"] = {r = 0.8, g = 0.1, b = 0.1},
+ ["power"] = {
+ ["MANA"] = {r = 0.31, g = 0.45, b = 0.63},
+ ["RAGE"] = {r = 0.78, g = 0.25, b = 0.25},
+ ["FOCUS"] = {r = 0.71, g = 0.43, b = 0.27},
+ ["ENERGY"] = {r = 0.65, g = 0.63, b = 0.35},
+ ["RUNIC_POWER"] = {r = 0, g = 0.82, b = 1},
+ },
+ ["reaction"] = {
+ ["BAD"] = {r = 0.78, g = 0.25, b = 0.25},
+ ["NEUTRAL"] = {r = 218/255, g = 197/255, b = 92/255},
+ ["GOOD"] = {r = 75/255, g = 175/255, b = 76/255}
+ },
+ ["healPrediction"] = {
+ ["personal"] = {r = 0, g = 1, b = 0.5, a = 0.25},
+ ["others"] = {r = 0, g = 1, b = 0, a = 0.25},
+ ["maxOverflow"] = 0,
+ },
+ ["classResources"] = {
+ ["bgColor"] = {r = 0.1,g = 0.1,b = 0.1, a = 1},
+ ["comboPoints"] = {
+ [1] = {r = 0.69, g = 0.31, b = 0.31},
+ [2] = {r = 0.65, g = 0.63, b = 0.34},
+ [3] = {r = 0.33, g = 0.59, b = 0.33},
+ },
+ ["DEATHKNIGHT"] = {
+ [1] = {r = 1, g = 0, b = 0},
+ [2] = {r = 0, g = 1, b = 0},
+ [3] = {r = 0, g = 1, b = 1},
+ [4] = {r = .9, g = .1, b = 1}
+ },
+ },
+ },
+
+ ["units"] = {
+ ["player"] = {
+ ["enable"] = true,
+ ["orientation"] = "LEFT",
+ ["width"] = 270,
+ ["height"] = 54,
+ ["lowmana"] = 30,
+ ["combatfade"] = false,
+ ["healPrediction"] = true,
+ ["restIcon"] = true,
+ ["combatIcon"] = true,
+ ["threatStyle"] = "GLOW",
+ ["smartAuraPosition"] = "DISABLED",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["health"] = {
+ ["text_format"] = "[healthcolor][health:current-percent]",
+ ["position"] = "LEFT",
+ ["xOffset"] = 2,
+ ["yOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["power"] = {
+ ["enable"] = true,
+ ["text_format"] = "[powercolor][power:current]",
+ ["width"] = "fill",
+ ["height"] = 10,
+ ["offset"] = 0,
+ ["position"] = "RIGHT",
+ ["hideonnpc"] = false,
+ ["xOffset"] = -2,
+ ["yOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ ["detachFromFrame"] = false,
+ ["detachedWidth"] = 250,
+ ["druidMana"] = true,
+ ["strataAndLevel"] = {
+ ["useCustomStrata"] = false,
+ ["frameStrata"] = "LOW",
+ ["useCustomLevel"] = false,
+ ["frameLevel"] = 1,
+ },
+ ["parent"] = "FRAME",
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 20,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["pvp"] = {
+ ["position"] = "BOTTOM",
+ ["text_format"] = "||cFFB04F4F[pvptimer][mouseover]||r",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["pvpIcon"] = {
+ ["enable"] = false,
+ ["anchorPoint"] = "CENTER",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["scale"] = 1,
+ },
+ ["portrait"] = {
+ ["enable"] = true,
+ ["width"] = 45,
+ ["overlay"] = true,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 8,
+ ["numrows"] = 1,
+ ["attachTo"] = "DEBUFFS",
+ ["anchorPoint"] = "TOPLEFT",
+ ["fontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 0,
+ ["priority"] = "Blacklist,Personal,PlayerBuffs,Whitelist,blockNoDuration,nonPersonal", --Player Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 8,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "TOPLEFT",
+ ["fontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 0,
+ ["priority"] = "Blacklist,Personal,nonPersonal", --Player Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["castbar"] = {
+ ["enable"] = true,
+ ["width"] = 270,
+ ["height"] = 18,
+ ["icon"] = true,
+ ["latency"] = true,
+ ["format"] = "REMAINING",
+ ["ticks"] = true,
+ ["spark"] = true,
+ ["displayTarget"] = false,
+ ["iconSize"] = 42,
+ ["iconAttached"] = true,
+ ["insideInfoPanel"] = true,
+ ["iconAttachedTo"] = "Frame",
+ ["iconPosition"] = "LEFT",
+ ["iconXOffset"] = -10,
+ ["iconYOffset"] = 0,
+ ["tickWidth"] = 1,
+ ["tickColor"] = {r = 0, g = 0, b = 0, a = 0.8},
+ },
+ ["classbar"] = {
+ ["enable"] = true,
+ ["fill"] = "fill",
+ ["height"] = 10,
+ ["detachFromFrame"] = false,
+ ["detachedWidth"] = 250,
+ ["autoHide"] = false,
+ ["parent"] = "FRAME",
+ ["verticalOrientation"] = false,
+ ["additionalPowerText"] = true,
+ ["strataAndLevel"] = {
+ ["useCustomStrata"] = false,
+ ["frameStrata"] = "LOW",
+ ["useCustomLevel"] = false,
+ ["frameLevel"] = 1,
+ },
+ },
+ ["aurabar"] = {
+ ["enable"] = true,
+ ["anchorPoint"] = "ABOVE",
+ ["attachTo"] = "DEBUFFS",
+ ["maxBars"] = 6,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 120,
+ ["priority"] = "Blacklist,blockNoDuration,Personal,RaidDebuffs,PlayerBuffs", --Player AuraBars
+ ["friendlyAuraType"] = "HELPFUL",
+ ["enemyAuraType"] = "HARMFUL",
+ ["height"] = 20,
+ ["sort"] = "TIME_REMAINING",
+ ["uniformThreshold"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ },
+ ["target"] = {
+ ["enable"] = true,
+ ["width"] = 270,
+ ["height"] = 54,
+ ["orientation"] = "RIGHT",
+ ["threatStyle"] = "GLOW",
+ ["smartAuraPosition"] = "DISABLED",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["rangeCheck"] = true,
+ ["healPrediction"] = true,
+ ["middleClickFocus"] = true,
+ ["health"] = {
+ ["text_format"] = "[healthcolor][health:current-percent]",
+ ["position"] = "RIGHT",
+ ["xOffset"] = -2,
+ ["yOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["power"] = {
+ ["enable"] = true,
+ ["text_format"] = "[powercolor][power:current]",
+ ["width"] = "fill",
+ ["height"] = 10,
+ ["offset"] = 0,
+ ["position"] = "LEFT",
+ ["hideonnpc"] = false,
+ ["xOffset"] = 2,
+ ["yOffset"] = 0,
+ ["detachFromFrame"] = false,
+ ["detachedWidth"] = 250,
+ ["attachTextTo"] = "Health",
+ ["strataAndLevel"] = {
+ ["useCustomStrata"] = false,
+ ["frameStrata"] = "LOW",
+ ["useCustomLevel"] = false,
+ ["frameLevel"] = 1,
+ },
+ ["parent"] = "FRAME",
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 20,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:medium] [difficultycolor][smartlevel] [shortclassification]",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["pvpIcon"] = {
+ ["enable"] = false,
+ ["anchorPoint"] = "CENTER",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["scale"] = 1,
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 8,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "TOPRIGHT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,nonPersonal", --Target Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 8,
+ ["numrows"] = 1,
+ ["attachTo"] = "BUFFS",
+ ["anchorPoint"] = "TOPRIGHT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,RaidDebuffs,CCDebuffs,Friendly:Dispellable", --Target Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["castbar"] = {
+ ["enable"] = true,
+ ["width"] = 270,
+ ["height"] = 18,
+ ["icon"] = true,
+ ["format"] = "REMAINING",
+ ["spark"] = true,
+ ["iconSize"] = 42,
+ ["iconAttached"] = true,
+ ["insideInfoPanel"] = true,
+ ["iconAttachedTo"] = "Frame",
+ ["iconPosition"] = "LEFT",
+ ["iconXOffset"] = -10,
+ ["iconYOffset"] = 0,
+ },
+ ["combobar"] = {
+ ["enable"] = true,
+ ["fill"] = "fill",
+ ["height"] = 10,
+ ["detachFromFrame"] = false,
+ ["detachedWidth"] = 250,
+ ["autoHide"] = true
+ },
+ ["aurabar"] = {
+ ["enable"] = true,
+ ["anchorPoint"] = "ABOVE",
+ ["attachTo"] = "DEBUFFS",
+ ["maxBars"] = 6,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 120,
+ ["priority"] = "Blacklist,Personal,blockNoDuration,PlayerBuffs,RaidDebuffs", --Target AuraBars
+ ["friendlyAuraType"] = "HELPFUL",
+ ["enemyAuraType"] = "HARMFUL",
+ ["height"] = 20,
+ ["sort"] = "TIME_REMAINING",
+ ["uniformThreshold"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ ["GPSArrow"] = {
+ ["enable"] = false,
+ ["size"] = 45,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["onMouseOver"] = true,
+ ["outOfRange"] = true,
+ },
+ },
+ ["targettarget"] = {
+ ["enable"] = true,
+ ["rangeCheck"] = true,
+ ["threatStyle"] = "NONE",
+ ["orientation"] = "MIDDLE",
+ ["smartAuraPosition"] = "DISABLED",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 130,
+ ["height"] = 36,
+ ["health"] = {
+ ["text_format"] = "",
+ ["position"] = "RIGHT",
+ ["xOffset"] = -2,
+ ["yOffset"] = 0,
+ },
+ ["power"] = {
+ ["enable"] = true,
+ ["text_format"] = "",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["position"] = "LEFT",
+ ["hideonnpc"] = false,
+ ["xOffset"] = 2,
+ ["yOffset"] = 0,
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 14,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:medium]",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 7,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMLEFT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,PlayerBuffs,Dispellable", --TargetTarget Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 5,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMRIGHT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,RaidDebuffs,CCDebuffs,Dispellable,Whitelist", --TargetTarget Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ },
+ ["targettargettarget"] = {
+ ["enable"] = false,
+ ["rangeCheck"] = true,
+ ["orientation"] = "MIDDLE",
+ ["threatStyle"] = "NONE",
+ ["smartAuraPosition"] = "DISABLED",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 130,
+ ["height"] = 36,
+ ["health"] = {
+ ["text_format"] = "",
+ ["position"] = "RIGHT",
+ ["xOffset"] = -2,
+ ["yOffset"] = 0,
+ },
+ ["power"] = {
+ ["enable"] = true,
+ ["text_format"] = "",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["position"] = "LEFT",
+ ["hideonnpc"] = false,
+ ["xOffset"] = 2,
+ ["yOffset"] = 0,
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 12,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:medium]",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 7,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMLEFT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,nonPersonal", --TargetTargetTarget Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 5,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMRIGHT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,nonPersonal", --TargetTargetTarget Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ },
+ ["focus"] = {
+ ["enable"] = true,
+ ["rangeCheck"] = true,
+ ["threatStyle"] = "GLOW",
+ ["orientation"] = "MIDDLE",
+ ["smartAuraPosition"] = "DISABLED",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 190,
+ ["height"] = 36,
+ ["healPrediction"] = true,
+ ["health"] = {
+ ["text_format"] = "",
+ ["position"] = "RIGHT",
+ ["xOffset"] = -2,
+ ["yOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["power"] = {
+ ["enable"] = true,
+ ["text_format"] = "",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["position"] = "LEFT",
+ ["hideonnpc"] = false,
+ ["xOffset"] = 2,
+ ["yOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 14,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:medium]",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 7,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMLEFT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,PlayerBuffs,CastByUnit,Dispellable", --Focus Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 5,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "TOPRIGHT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,RaidDebuffs,Dispellable,Whitelist", --Focus Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["castbar"] = {
+ ["enable"] = true,
+ ["width"] = 190,
+ ["height"] = 18,
+ ["icon"] = true,
+ ["format"] = "REMAINING",
+ ["spark"] = true,
+ ["iconSize"] = 32,
+ ["iconAttached"] = true,
+ ["insideInfoPanel"] = true,
+ ["iconAttachedTo"] = "Frame",
+ ["iconPosition"] = "LEFT",
+ ["iconXOffset"] = -10,
+ ["iconYOffset"] = 0,
+ },
+ ["aurabar"] = {
+ ["enable"] = false,
+ ["anchorPoint"] = "ABOVE",
+ ["attachTo"] = "DEBUFFS",
+ ["maxBars"] = 3,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 120,
+ ["priority"] = "Blacklist,blockNoDuration,Personal,PlayerBuffs,RaidDebuffs", --Focus AuraBars
+ ["friendlyAuraType"] = "HELPFUL",
+ ["enemyAuraType"] = "HARMFUL",
+ ["height"] = 20,
+ ["sort"] = "TIME_REMAINING",
+ ["uniformThreshold"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ ["GPSArrow"] = {
+ ["enable"] = true,
+ ["size"] = 45,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["onMouseOver"] = true,
+ ["outOfRange"] = true,
+ },
+ },
+ ["focustarget"] = {
+ ["enable"] = false,
+ ["rangeCheck"] = true,
+ ["threatStyle"] = "NONE",
+ ["orientation"] = "MIDDLE",
+ ["smartAuraPosition"] = "DISABLED",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 190,
+ ["height"] = 26,
+ ["health"] = {
+ ["text_format"] = "",
+ ["position"] = "RIGHT",
+ ["xOffset"] = -2,
+ ["yOffset"] = 0,
+ },
+ ["power"] = {
+ ["enable"] = false,
+ ["text_format"] = "",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["position"] = "LEFT",
+ ["hideonnpc"] = false,
+ ["xOffset"] = 2,
+ ["yOffset"] = 0,
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 12,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:medium]",
+ ["yOffset"] = 0,
+ ["xOffset"] = 0,
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 7,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMLEFT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,PlayerBuffs,Dispellable,CastByUnit", --FocusTarget Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 5,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMRIGHT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,RaidDebuffs,Dispellable,Whitelist", --FocusTarget Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ },
+ ["pet"] = {
+ ["enable"] = true,
+ ["rangeCheck"] = true,
+ ["orientation"] = "MIDDLE",
+ ["threatStyle"] = "GLOW",
+ ["smartAuraPosition"] = "DISABLED",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 130,
+ ["height"] = 36,
+ ["healPrediction"] = true,
+ ["health"] = {
+ ["text_format"] = "",
+ ["position"] = "RIGHT",
+ ["yOffset"] = 0,
+ ["xOffset"] = -2,
+ },
+ ["power"] = {
+ ["enable"] = true,
+ ["text_format"] = "",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["position"] = "LEFT",
+ ["hideonnpc"] = false,
+ ["yOffset"] = 0,
+ ["xOffset"] = 2,
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 12,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:medium]",
+ ["yOffset"] = 0,
+ ["xOffset"] = 0,
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 7,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMLEFT",
+ ["fontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,PlayerBuffs", --Pet Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 5,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMRIGHT",
+ ["fontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,RaidDebuffs,Dispellable,Whitelist", --Pet Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["buffIndicator"] = {
+ ["enable"] = true,
+ ["size"] = 8,
+ ["fontSize"] = 10,
+ },
+ ["castbar"] = {
+ ["enable"] = true,
+ ["width"] = 130,
+ ["height"] = 18,
+ ["icon"] = true,
+ ["format"] = "REMAINING",
+ ["spark"] = true,
+ ["iconSize"] = 26,
+ ["iconAttached"] = true,
+ ["insideInfoPanel"] = true,
+ ["iconAttachedTo"] = "Frame",
+ ["iconPosition"] = "LEFT",
+ ["iconXOffset"] = -10,
+ ["iconYOffset"] = 0,
+ },
+ },
+ ["pettarget"] = {
+ ["enable"] = false,
+ ["rangeCheck"] = true,
+ ["threatStyle"] = "NONE",
+ ["orientation"] = "MIDDLE",
+ ["smartAuraPosition"] = "DISABLED",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 130,
+ ["height"] = 26,
+ ["health"] = {
+ ["text_format"] = "",
+ ["position"] = "RIGHT",
+ ["yOffset"] = 0,
+ ["xOffset"] = -2,
+ },
+ ["power"] = {
+ ["enable"] = false,
+ ["text_format"] = "",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["position"] = "LEFT",
+ ["hideonnpc"] = false,
+ ["yOffset"] = 0,
+ ["xOffset"] = 2,
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 12,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:medium]",
+ ["yOffset"] = 0,
+ ["xOffset"] = 0,
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 7,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMLEFT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,PlayerBuffs,CastByUnit,Whitelist", --PetTarget Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 5,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "BOTTOMRIGHT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,Personal,RaidDebuffs", --PetTarget Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ },
+ ["boss"] = {
+ ["enable"] = true,
+ ["rangeCheck"] = true,
+ ["growthDirection"] = "DOWN",
+ ["orientation"] = "RIGHT",
+ ["smartAuraPosition"] = "DISABLED",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 216,
+ ["height"] = 46,
+ ["spacing"] = 25,
+ ["targetGlow"] = true,
+ ["health"] = {
+ ["text_format"] = "[healthcolor][health:current]",
+ ["position"] = "LEFT",
+ ["yOffset"] = 0,
+ ["xOffset"] = 2,
+ ["attachTextTo"] = "Health",
+ },
+ ["power"] = {
+ ["enable"] = true,
+ ["text_format"] = "[powercolor][power:current]",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["position"] = "RIGHT",
+ ["hideonnpc"] = false,
+ ["yOffset"] = 0,
+ ["xOffset"] = -2,
+ ["attachTextTo"] = "Health",
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 35,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 16,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:medium]",
+ ["yOffset"] = 0,
+ ["xOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["buffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 3,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "LEFT",
+ ["fontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 0,
+ ["priority"] = "Blacklist,CastByUnit,Whitelist", --Boss Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 20,
+ ["sizeOverride"] = 22,
+ },
+ ["debuffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 3,
+ ["numrows"] = 2,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "LEFT",
+ ["fontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 0,
+ ["priority"] = "Blacklist,Personal,RaidDebuffs,CastByUnit,Whitelist", --Boss Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = -3,
+ ["sizeOverride"] = 22,
+ },
+ ["castbar"] = {
+ ["enable"] = true,
+ ["width"] = 215,
+ ["height"] = 18,
+ ["icon"] = true,
+ ["format"] = "REMAINING",
+ ["spark"] = true,
+ ["iconSize"] = 32,
+ ["iconAttached"] = true,
+ ["insideInfoPanel"] = true,
+ ["iconAttachedTo"] = "Frame",
+ ["iconPosition"] = "LEFT",
+ ["iconXOffset"] = -10,
+ ["iconYOffset"] = 0,
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ },
+ ["arena"] = {
+ ["enable"] = true,
+ ["rangeCheck"] = true,
+ ["growthDirection"] = "DOWN",
+ ["orientation"] = "RIGHT",
+ ["smartAuraPosition"] = "DISABLED",
+ ["spacing"] = 25,
+ ["width"] = 246,
+ ["height"] = 47,
+ ["healPrediction"] = true,
+ ["colorOverride"] = "USE_DEFAULT",
+ ["targetGlow"] = true,
+ ["health"] = {
+ ["text_format"] = "[healthcolor][health:current]",
+ ["position"] = "LEFT",
+ ["yOffset"] = 0,
+ ["xOffset"] = 2,
+ ["attachTextTo"] = "Health",
+ },
+ ["power"] = {
+ ["enable"] = true,
+ ["text_format"] = "[powercolor][power:current]",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["attachTextTo"] = "Health",
+ ["position"] = "RIGHT",
+ ["hideonnpc"] = false,
+ ["yOffset"] = 0,
+ ["xOffset"] = -2,
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 17,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:medium]",
+ ["yOffset"] = 0,
+ ["xOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 3,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "LEFT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,TurtleBuffs,PlayerBuffs,Dispellable", --Arena Buffs
+ ["sizeOverride"] = 27,
+ ["xOffset"] = 0,
+ ["yOffset"] = 16,
+ },
+ ["debuffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 3,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "LEFT",
+ ["fontSize"] = 10,
+ ["clickThrough"] = false,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,blockNoDuration,Personal,CCDebuffs,Whitelist", --Arena Debuffs
+ ["sizeOverride"] = 27,
+ ["xOffset"] = 0,
+ ["yOffset"] = -16,
+ },
+ ["castbar"] = {
+ ["enable"] = true,
+ ["width"] = 256,
+ ["height"] = 18,
+ ["icon"] = true,
+ ["format"] = "REMAINING",
+ ["spark"] = true,
+ ["iconSize"] = 32,
+ ["iconAttached"] = true,
+ ["insideInfoPanel"] = true,
+ ["iconAttachedTo"] = "Frame",
+ ["iconPosition"] = "LEFT",
+ ["iconXOffset"] = -10,
+ ["iconYOffset"] = 0,
+ },
+ ["pvpTrinket"] = {
+ ["enable"] = true,
+ ["position"] = "RIGHT",
+ ["size"] = 46,
+ ["xOffset"] = 1,
+ ["yOffset"] = 0,
+ },
+ },
+ ["party"] = {
+ ["enable"] = true,
+ ["rangeCheck"] = true,
+ ["threatStyle"] = "GLOW",
+ ["orientation"] = "LEFT",
+ ["visibility"] = "[@raid6,exists][nogroup] hide;show",
+ ["growthDirection"] = "UP_RIGHT",
+ ["horizontalSpacing"] = 0,
+ ["verticalSpacing"] = 3,
+ ["numGroups"] = 1,
+ ["groupsPerRowCol"] = 1,
+ ["groupBy"] = "GROUP",
+ ["sortDir"] = "ASC",
+ ["raidWideSorting"] = false,
+ ["invertGroupingOrder"] = false,
+ ["startFromCenter"] = false,
+ ["showPlayer"] = true,
+ ["healPrediction"] = false,
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 184,
+ ["height"] = 54,
+ ["targetGlow"] = true,
+ ["health"] = {
+ ["text_format"] = "[healthcolor][health:current-percent]",
+ ["position"] = "LEFT",
+ ["orientation"] = "HORIZONTAL",
+ ["attachTextTo"] = "Health",
+ ["frequentUpdates"] = false,
+ ["yOffset"] = 0,
+ ["xOffset"] = 2,
+ },
+ ["power"] = {
+ ["enable"] = true,
+ ["text_format"] = "[powercolor][power:current]",
+ ["attachTextTo"] = "Health",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["position"] = "RIGHT",
+ ["hideonnpc"] = false,
+ ["yOffset"] = 0,
+ ["xOffset"] = -2,
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 15,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["attachTextTo"] = "Health",
+ ["text_format"] = "[namecolor][name:medium] [difficultycolor][smartlevel]",
+ ["yOffset"] = 0,
+ ["xOffset"] = 0,
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 4,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "LEFT",
+ ["fontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["countFontSize"] = 10,
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,TurtleBuffs", --Party Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = true,
+ ["perrow"] = 4,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "RIGHT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,RaidDebuffs,CCDebuffs,Dispellable,Whitelist", --Party Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["sizeOverride"] = 52,
+ },
+ ["buffIndicator"] = {
+ ["enable"] = true,
+ ["size"] = 8,
+ ["fontSize"] = 10,
+ ["profileSpecific"] = false,
+ },
+ ["rdebuffs"] = {
+ ["enable"] = false,
+ ["showDispellableDebuff"] = true,
+ ["onlyMatchSpellID"] = true,
+ ["fontSize"] = 10,
+ ["font"] = "Homespun",
+ ["fontOutline"] = "MONOCHROMEOUTLINE",
+ ["size"] = 26,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["duration"] = {
+ ["position"] = "CENTER",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ ["stack"] = {
+ ["position"] = "BOTTOMRIGHT",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ },
+ ["roleIcon"] = {
+ ["enable"] = true,
+ ["position"] = "TOPRIGHT",
+ ["attachTo"] = "Health",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["size"] = 15,
+ },
+ ["raidRoleIcons"] = {
+ ["enable"] = true,
+ ["position"] = "TOPLEFT",
+ },
+ ["petsGroup"] = {
+ ["enable"] = false,
+ ["width"] = 100,
+ ["height"] = 22,
+ ["anchorPoint"] = "TOPLEFT",
+ ["xOffset"] = -1,
+ ["yOffset"] = 0,
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:short]",
+ ["yOffset"] = 0,
+ ["xOffset"] = 0,
+ },
+ },
+ ["targetsGroup"] = {
+ ["enable"] = false,
+ ["width"] = 100,
+ ["height"] = 22,
+ ["anchorPoint"] = "TOPLEFT",
+ ["xOffset"] = -1,
+ ["yOffset"] = 0,
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:short]",
+ ["yOffset"] = 0,
+ ["xOffset"] = 0,
+ },
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ ["GPSArrow"] = {
+ ["enable"] = true,
+ ["size"] = 45,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["onMouseOver"] = true,
+ ["outOfRange"] = true,
+ },
+ ["readycheckIcon"] = {
+ ["enable"] = true,
+ ["size"] = 12,
+ ["attachTo"] = "Health",
+ ["position"] = "BOTTOM",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ },
+ },
+ ["raid"] = {
+ ["enable"] = true,
+ ["rangeCheck"] = true,
+ ["threatStyle"] = "GLOW",
+ ["orientation"] = "MIDDLE",
+ ["visibility"] = "[@raid6,noexists][@raid26,exists] hide;show",
+ ["growthDirection"] = "RIGHT_DOWN",
+ ["horizontalSpacing"] = 3,
+ ["verticalSpacing"] = 3,
+ ["numGroups"] = 5,
+ ["groupsPerRowCol"] = 1,
+ ["groupBy"] = "GROUP",
+ ["sortDir"] = "ASC",
+ ["showPlayer"] = true,
+ ["healPrediction"] = false,
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 80,
+ ["height"] = 44,
+ ["targetGlow"] = true,
+ ["health"] = {
+ ["text_format"] = "[healthcolor][health:deficit]",
+ ["position"] = "BOTTOM",
+ ["orientation"] = "HORIZONTAL",
+ ["attachTextTo"] = "Health",
+ ["frequentUpdates"] = false,
+ ["yOffset"] = 2,
+ ["xOffset"] = 0,
+ },
+ ["power"] = {
+ ["enable"] = true,
+ ["text_format"] = "",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["position"] = "BOTTOMRIGHT",
+ ["hideonnpc"] = false,
+ ["yOffset"] = 2,
+ ["xOffset"] = -2,
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 12,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["attachTextTo"] = "Health",
+ ["text_format"] = "[namecolor][name:short]",
+ ["yOffset"] = 0,
+ ["xOffset"] = 0,
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 3,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "LEFT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,TurtleBuffs", --Raid Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 3,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "RIGHT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,RaidDebuffs,CCDebuffs,Dispellable", --Raid Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["buffIndicator"] = {
+ ["enable"] = true,
+ ["size"] = 8,
+ ["fontSize"] = 10,
+ ["profileSpecific"] = false,
+ },
+ ["rdebuffs"] = {
+ ["enable"] = true,
+ ["showDispellableDebuff"] = true,
+ ["onlyMatchSpellID"] = true,
+ ["fontSize"] = 10,
+ ["font"] = "Homespun",
+ ["fontOutline"] = "MONOCHROMEOUTLINE",
+ ["size"] = 26,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["duration"] = {
+ ["position"] = "CENTER",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ ["stack"] = {
+ ["position"] = "BOTTOMRIGHT",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ },
+ ["roleIcon"] = {
+ ["enable"] = true,
+ ["position"] = "TOPLEFT",
+ ["attachTo"] = "Health",
+ ["xOffset"] = 1,
+ ["yOffset"] = -1,
+ ["size"] = 15,
+ },
+ ["raidRoleIcons"] = {
+ ["enable"] = true,
+ ["position"] = "TOPLEFT",
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ ["GPSArrow"] = {
+ ["enable"] = true,
+ ["size"] = 40,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["onMouseOver"] = true,
+ ["outOfRange"] = true,
+ },
+ ["readycheckIcon"] = {
+ ["enable"] = true,
+ ["size"] = 12,
+ ["attachTo"] = "Health",
+ ["position"] = "BOTTOM",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ },
+ },
+ ["raid40"] = {
+ ["enable"] = true,
+ ["rangeCheck"] = true,
+ ["threatStyle"] = "GLOW",
+ ["orientation"] = "MIDDLE",
+ ["visibility"] = "[@raid26,noexists] hide;show",
+ ["growthDirection"] = "RIGHT_DOWN",
+ ["horizontalSpacing"] = 3,
+ ["verticalSpacing"] = 3,
+ ["numGroups"] = 8,
+ ["groupsPerRowCol"] = 1,
+ ["groupBy"] = "GROUP",
+ ["sortDir"] = "ASC",
+ ["showPlayer"] = true,
+ ["healPrediction"] = false,
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 80,
+ ["height"] = 27,
+ ["targetGlow"] = true,
+ ["health"] = {
+ ["text_format"] = "[healthcolor][health:deficit]",
+ ["position"] = "BOTTOM",
+ ["orientation"] = "HORIZONTAL",
+ ["frequentUpdates"] = false,
+ ["attachTextTo"] = "Health",
+ ["yOffset"] = 2,
+ ["xOffset"] = 0,
+ },
+ ["power"] = {
+ ["enable"] = false,
+ ["text_format"] = "",
+ ["width"] = "fill",
+ ["height"] = 7,
+ ["offset"] = 0,
+ ["position"] = "BOTTOMRIGHT",
+ ["hideonnpc"] = false,
+ ["yOffset"] = 2,
+ ["xOffset"] = -2,
+ },
+ ["infoPanel"] = {
+ ["enable"] = false,
+ ["height"] = 12,
+ ["transparent"] = false,
+ },
+ ["name"] = {
+ ["position"] = "CENTER",
+ ["text_format"] = "[namecolor][name:short]",
+ ["yOffset"] = 0,
+ ["xOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 3,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "LEFT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,TurtleBuffs", --Raid40 Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 3,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "RIGHT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 300,
+ ["priority"] = "Blacklist,RaidDebuffs,CCDebuffs,Dispellable,Whitelist", --Raid40 Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["rdebuffs"] = {
+ ["enable"] = false,
+ ["showDispellableDebuff"] = true,
+ ["onlyMatchSpellID"] = true,
+ ["fontSize"] = 10,
+ ["font"] = "Homespun",
+ ["fontOutline"] = "MONOCHROMEOUTLINE",
+ ["size"] = 22,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["duration"] = {
+ ["position"] = "CENTER",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ ["stack"] = {
+ ["position"] = "BOTTOMRIGHT",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ },
+ ["roleIcon"] = {
+ ["enable"] = false,
+ ["position"] = "BOTTOMRIGHT",
+ ["attachTo"] = "Health",
+ ["xOffset"] = -1,
+ ["yOffset"] = 1,
+ ["size"] = 15,
+ },
+ ["raidRoleIcons"] = {
+ ["enable"] = true,
+ ["position"] = "TOPLEFT",
+ },
+ ["buffIndicator"] = {
+ ["enable"] = true,
+ ["size"] = 8,
+ ["fontSize"] = 10,
+ ["profileSpecific"] = false,
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ ["GPSArrow"] = {
+ ["enable"] = true,
+ ["size"] = 45,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["onMouseOver"] = true,
+ ["outOfRange"] = true,
+ },
+ ["readycheckIcon"] = {
+ ["enable"] = true,
+ ["size"] = 12,
+ ["attachTo"] = "Health",
+ ["position"] = "BOTTOM",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ },
+ },
+ ["raidpet"] = {
+ ["enable"] = false,
+ ["rangeCheck"] = true,
+ ["orientation"] = "MIDDLE",
+ ["threatStyle"] = "GLOW",
+ ["visibility"] = "[group:raid] show; hide",
+ ["growthDirection"] = "DOWN_RIGHT",
+ ["horizontalSpacing"] = 3,
+ ["verticalSpacing"] = 3,
+ ["numGroups"] = 2,
+ ["groupsPerRowCol"] = 1,
+ ["groupBy"] = "PETNAME",
+ ["sortDir"] = "ASC",
+ ["raidWideSorting"] = true,
+ ["invertGroupingOrder"] = false,
+ ["startFromCenter"] = false,
+ ["healPrediction"] = true,
+ ["colorOverride"] = "USE_DEFAULT",
+ ["width"] = 80,
+ ["height"] = 30,
+ ["targetGlow"] = true,
+ ["health"] = {
+ ["text_format"] = "[healthcolor][health:deficit]",
+ ["position"] = "BOTTOM",
+ ["orientation"] = "HORIZONTAL",
+ ["frequentUpdates"] = true,
+ ["yOffset"] = 2,
+ ["xOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["name"] = {
+ ["position"] = "TOP",
+ ["text_format"] = "[namecolor][name:short]",
+ ["yOffset"] = -2,
+ ["xOffset"] = 0,
+ ["attachTextTo"] = "Health",
+ },
+ ["portrait"] = {
+ ["enable"] = false,
+ ["width"] = 45,
+ ["overlay"] = false,
+ ["style"] = "3D",
+ },
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 3,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "LEFT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 0,
+ ["priority"] = "Blacklist,Personal,PlayerBuffs,blockNoDuration,nonPersonal", --RaidPet Buffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["debuffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 3,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "RIGHT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 0,
+ ["priority"] = "Blacklist,Personal,Whitelist,RaidDebuffs,blockNoDuration,nonPersonal", --RaidPet Debuffs
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ },
+ ["buffIndicator"] = {
+ ["enable"] = true,
+ ["size"] = 8,
+ ["fontSize"] = 10,
+ },
+ ["rdebuffs"] = {
+ ["enable"] = true,
+ ["showDispellableDebuff"] = true,
+ ["onlyMatchSpellID"] = true,
+ ["fontSize"] = 10,
+ ["font"] = "Homespun",
+ ["fontOutline"] = "MONOCHROMEOUTLINE",
+ ["size"] = 26,
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ ["duration"] = {
+ ["position"] = "CENTER",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ ["stack"] = {
+ ["position"] = "BOTTOMRIGHT",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ },
+ ["raidicon"] = {
+ ["enable"] = true,
+ ["size"] = 18,
+ ["attachTo"] = "TOP",
+ ["attachToObject"] = "Frame",
+ ["xOffset"] = 0,
+ ["yOffset"] = 8,
+ },
+ },
+ ["tank"] = {
+ ["enable"] = true,
+ ["orientation"] = "LEFT",
+ ["threatStyle"] = "GLOW",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["rangeCheck"] = true,
+ ["width"] = 120,
+ ["height"] = 28,
+ ["disableDebuffHighlight"] = true,
+ ["verticalSpacing"] = 7,
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 6,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "TOPLEFT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 0,
+ ["priority"] = "",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ },
+ ["debuffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 6,
+ ["numrows"] = 1,
+ ["attachTo"] = "BUFFS",
+ ["anchorPoint"] = "TOPRIGHT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 0,
+ ["priority"] = "",
+ ["xOffset"] = 0,
+ ["yOffset"] = 1,
+ },
+ ["buffIndicator"] = {
+ ["enable"] = true,
+ ["size"] = 8,
+ ["fontSize"] = 10,
+ ["profileSpecific"] = false,
+ },
+ ["rdebuffs"] = {
+ ["enable"] = true,
+ ["showDispellableDebuff"] = true,
+ ["onlyMatchSpellID"] = true,
+ ["fontSize"] = 10,
+ ["font"] = "Homespun",
+ ["fontOutline"] = "MONOCHROMEOUTLINE",
+ ["size"] = 26,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["duration"] = {
+ ["position"] = "CENTER",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ ["stack"] = {
+ ["position"] = "BOTTOMRIGHT",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ },
+ ["targetsGroup"] = {
+ ["enable"] = true,
+ ["anchorPoint"] = "RIGHT",
+ ["xOffset"] = 1,
+ ["yOffset"] = 0,
+ ["width"] = 120,
+ ["height"] = 28,
+ ["colorOverride"] = "USE_DEFAULT",
+ },
+ },
+ ["assist"] = {
+ ["enable"] = true,
+ ["orientation"] = "LEFT",
+ ["threatStyle"] = "GLOW",
+ ["colorOverride"] = "USE_DEFAULT",
+ ["rangeCheck"] = true,
+ ["width"] = 120,
+ ["height"] = 28,
+ ["disableDebuffHighlight"] = true,
+ ["verticalSpacing"] = 7,
+ ["buffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 6,
+ ["numrows"] = 1,
+ ["attachTo"] = "FRAME",
+ ["anchorPoint"] = "TOPLEFT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 0,
+ ["priority"] = "",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ },
+ ["debuffs"] = {
+ ["enable"] = false,
+ ["perrow"] = 6,
+ ["numrows"] = 1,
+ ["attachTo"] = "BUFFS",
+ ["anchorPoint"] = "TOPRIGHT",
+ ["fontSize"] = 10,
+ ["countFontSize"] = 10,
+ ["sortMethod"] = "TIME_REMAINING",
+ ["sortDirection"] = "DESCENDING",
+ ["clickThrough"] = false,
+ ["minDuration"] = 0,
+ ["maxDuration"] = 0,
+ ["priority"] = "",
+ ["xOffset"] = 0,
+ ["yOffset"] = 1,
+ },
+ ["buffIndicator"] = {
+ ["enable"] = true,
+ ["size"] = 8,
+ ["fontSize"] = 10,
+ ["profileSpecific"] = false,
+ },
+ ["rdebuffs"] = {
+ ["enable"] = true,
+ ["showDispellableDebuff"] = true,
+ ["onlyMatchSpellID"] = true,
+ ["fontSize"] = 10,
+ ["font"] = "Homespun",
+ ["fontOutline"] = "MONOCHROMEOUTLINE",
+ ["size"] = 26,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["duration"] = {
+ ["position"] = "CENTER",
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ ["stack"] = {
+ ["position"] = "BOTTOMRIGHT",
+ ["xOffset"] = 0,
+ ["yOffset"] = 2,
+ ["color"] = {r = 1, g = 0.9, b = 0, a = 1}
+ },
+ },
+ ["targetsGroup"] = {
+ ["enable"] = true,
+ ["anchorPoint"] = "RIGHT",
+ ["xOffset"] = 1,
+ ["yOffset"] = 0,
+ ["width"] = 120,
+ ["height"] = 28,
+ ["colorOverride"] = "USE_DEFAULT",
+ },
+ },
+ },
+}
+
P["cooldown"] = {
threshold = 3,
expiringColor = {r = 1, g = 0, b = 0},
diff --git a/2/3/4/5/6/7/ElvUI_Config/ElvUI_Config.toc b/2/3/4/5/6/7/ElvUI_Config/ElvUI_Config.toc
index ddfdee9..4343afb 100644
--- a/2/3/4/5/6/7/ElvUI_Config/ElvUI_Config.toc
+++ b/2/3/4/5/6/7/ElvUI_Config/ElvUI_Config.toc
@@ -8,4 +8,5 @@
Libraries\Load_Libraries.xml
locales\load_locales.xml
-core.lua
\ No newline at end of file
+core.lua
+UnitFrames.lua
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfig-3.0.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfig-3.0.lua
index a310def..e319f6f 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfig-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfig-3.0.lua
@@ -12,14 +12,15 @@ Very light wrapper library that combines all the AceConfig subcomponents into on
]]
-local cfgreg = LibStub("AceConfigRegistry-3.0-ElvUI")
-local cfgcmd = LibStub("AceConfigCmd-3.0-ElvUI")
-
-local MAJOR, MINOR = "AceConfig-3.0-ElvUI", 2
+local MAJOR, MINOR = "AceConfig-3.0", 2
local AceConfig = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfig then return end
+AceConfig.embeds = AceConfig.embeds or {}
+
+local cfgreg = LibStub("AceConfigRegistry-3.0")
+local cfgcmd = LibStub("AceConfigCmd-3.0")
--TODO: local cfgdlg = LibStub("AceConfigDialog-3.0", true)
--TODO: local cfgdrp = LibStub("AceConfigDropdown-3.0", true)
@@ -43,16 +44,27 @@ local pcall, error, type, pairs = pcall, error, type, pairs
-- local AceConfig = LibStub("AceConfig-3.0")
-- AceConfig:RegisterOptionsTable("MyAddon", myOptions, {"/myslash", "/my"})
function AceConfig:RegisterOptionsTable(appName, options, slashcmd)
+ if self == AceConfig then
+ error([[Usage: RegisterOptionsTable(appName, options[, slashcmd]): 'self' - use your own 'self']], 2)
+ end
local ok,msg = pcall(cfgreg.RegisterOptionsTable, self, appName, options)
if not ok then error(msg, 2) end
if slashcmd then
if type(slashcmd) == "table" then
for _,cmd in pairs(slashcmd) do
- cfgcmd:CreateChatCommand(cmd, appName)
+ cfgcmd.CreateChatCommand(self, cmd, appName)
end
else
- cfgcmd:CreateChatCommand(slashcmd, appName)
+ cfgcmd.CreateChatCommand(self, slashcmd, appName)
end
end
end
+
+function AceConfig:Embed(target)
+ target["RegisterOptionsTable"] = self["RegisterOptionsTable"]
+end
+
+for addon in pairs(AceConfig.embeds) do
+ AceConfig:Embed(addon)
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua
index bc7650d..90664d9 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua
@@ -14,29 +14,37 @@ REQUIRES: AceConsole-3.0 for command registration (loaded on demand)
-- TODO: plugin args
-local cfgreg = LibStub("AceConfigRegistry-3.0-ElvUI")
-local MAJOR, MINOR = "AceConfigCmd-3.0-ElvUI", 2
+local MAJOR, MINOR = "AceConfigCmd-3.0", 13
local AceConfigCmd = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigCmd then return end
+local AceCore = LibStub("AceCore-3.0")
+local Dispatchers = AceCore.Dispatchers
+local strtrim = AceCore.strtrim
+local strsplit = AceCore.strsplit
+local new, del = AceCore.new, AceCore.del
+local wipe = AceCore.wipe
+
AceConfigCmd.commands = AceConfigCmd.commands or {}
+AceConfigCmd.embeds = AceConfigCmd.embeds or {}
local commands = AceConfigCmd.commands
+local cfgreg = LibStub("AceConfigRegistry-3.0")
local AceConsole -- LoD
local AceConsoleName = "AceConsole-3.0"
-- Lua APIs
-local strsub, strsplit, strlower, strmatch, strtrim, strupper = string.sub, string.split, string.lower, string.match, string.trim, string.upper
-local format, tonumber, tostring, len, find, byte = string.format, tonumber, tostring, string.len, string.find, string.byte
-local tsort, tinsert, tgetn = table.sort, table.insert, table.getn
-local select, pairs, next, type, unpack = select, pairs, next, type, unpack
-local error, assert = error, assert
-local mod = math.mod
+local strbyte, strsub = string.byte, string.sub
+local strlen, strupper, strlower = string.len, string.upper, string.lower
+local strfind, strgfind, strgsub = string.find, string.gfind, string.gsub
+
+local format = string.format
+local tsort, tinsert, tgetn, tremove = table.sort, table.insert, table.getn, table.remove
-- WoW APIs
-local _G = getfenv()
+local _G = AceCore._G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
@@ -61,18 +69,7 @@ local handlermsg = "expected a table"
local functypes = {["function"]=true, ["string"]=true}
local funcmsg = "expected function or member name"
-
--- pickfirstset() - picks the first non-nil value and returns it
-
-local function pickfirstset(...)
- local args = unpack(arg)
- for i=1,select("#", args) do
- if select(i,args)~=nil then
- return select(i,args)
- end
- end
-end
-
+local pickfirstset = AceCore.pickfirstset
-- err() - produce real error() regarding malformed options tables etc
@@ -92,23 +89,26 @@ end
-- callmethod() - call a given named method (e.g. "get", "set") with given arguments
-local function callmethod(info, inputpos, tab, methodtype, ...)
+
+
+local function callmethod(info, inputpos, tab, methodtype, argc, a1, a2, a3, a4)
local method = info[methodtype]
if not method then
err(info, inputpos, "'"..methodtype.."': not set")
end
+ argc = argc or 0
info.arg = tab.arg
info.option = tab
info.type = tab.type
if type(method)=="function" then
- return method(info, unpack(arg))
+ return Dispatchers[argc+1](method, info, a1, a2, a3, a4)
elseif type(method)=="string" then
if type(info.handler[method])~="function" then
err(info, inputpos, "'"..methodtype.."': '"..method.."' is not a member function of "..tostring(info.handler))
end
- return info.handler[method](info.handler, info, unpack(arg))
+ return Dispatchers[argc+2](info.handler[method], info.handler, info, a1, a2, a3, a4)
else
assert(false) -- type should have already been checked on read
end
@@ -116,33 +116,35 @@ end
-- callfunction() - call a given named function (e.g. "name", "desc") with given arguments
-local function callfunction(info, tab, methodtype, ...)
+-- Ace3v: the variable arguments are currently unused, so we removed it
+local function callfunction(info, tab, methodtype)
local method = tab[methodtype]
info.arg = tab.arg
info.option = tab
info.type = tab.type
-
+
if type(method)=="function" then
- return method(info, unpack(arg))
+ return method(info)
else
assert(false) -- type should have already been checked on read
end
end
-- do_final() - do the final step (set/execute) along with validation and confirmation
-
-local function do_final(info, inputpos, tab, methodtype, ...)
- if info.validate then
- local res = callmethod(info,inputpos,tab,"validate",unpack(arg))
+-- Ace3v: experimental
+-- @param argc number of variable arguments
+local function do_final(info, inputpos, tab, methodtype, argc, a1, a2, a3, a4) -- currently maximum 4 arguments
+ if info.validate then
+ local res = callmethod(info,inputpos,tab,"validate",argc,a1,a2,a3,a4)
if type(res)=="string" then
usererr(info, inputpos, "'"..strsub(info.input, inputpos).."' - "..res)
return
end
end
-- console ignores .confirm
-
- callmethod(info,inputpos,tab,methodtype, unpack(arg))
+
+ callmethod(info,inputpos,tab,methodtype,argc,a1,a2,a3,a4)
end
@@ -154,8 +156,8 @@ local function getparam(info, inputpos, tab, depth, paramname, types, errormsg)
if val~=nil then
if val==false then
val=nil
- elseif not types[type(val)] then
- err(info, inputpos, "'" .. paramname.. "' - "..errormsg)
+ elseif not types[type(val)] then
+ err(info, inputpos, "'" .. paramname.. "' - "..errormsg)
end
info[paramname] = val
info[paramname.."_at"] = depth
@@ -165,16 +167,14 @@ end
-- iterateargs(tab) - custom iterator that iterates both t.args and t.plugins.*
-local dummytable={}
-
local function iterateargs(tab)
- if not tab.plugins then
- return pairs(tab.args)
+ if not tab.plugins then
+ return pairs(tab.args)
end
-
+
local argtabkey,argtab=next(tab.plugins)
local v
-
+
return function(_, k)
while argtab do
k,v = next(argtab, k)
@@ -191,49 +191,53 @@ local function iterateargs(tab)
end
end
+local function getValueFromTab(info, inputpos, tab, key)
+ local v = tab[key]
+ if type(v) == "function" or type(v) == "string" then
+ info[key] = v
+ v = callmethod(info, inputpos, tab, key)
+ info[key] = nil
+ end
+ return v
+end
+
local function checkhidden(info, inputpos, tab)
if tab.cmdHidden~=nil then
return tab.cmdHidden
end
- local hidden = tab.hidden
- if type(hidden) == "function" or type(hidden) == "string" then
- info.hidden = hidden
- hidden = callmethod(info, inputpos, tab, 'hidden')
- info.hidden = nil
- end
- return hidden
+ return getValueFromTab(info, inputpos, tab, "hidden")
end
local function showhelp(info, inputpos, tab, depth, noHead)
if not noHead then
print("|cff33ff99"..info.appName.."|r: Arguments to |cffffff78/"..info[0].."|r "..strsub(info.input,1,inputpos-1)..":")
end
-
- local sortTbl = {} -- [1..n]=name
- local refTbl = {} -- [name]=tableref
-
+
+ local sortTbl = new() -- [1..n]=name
+ local refTbl = new() -- [name]=tableref
+
for k,v in iterateargs(tab) do
if not refTbl[k] then -- a plugin overriding something in .args
tinsert(sortTbl, k)
refTbl[k] = v
end
end
-
- tsort(sortTbl, function(one, two)
+
+ tsort(sortTbl, function(one, two)
local o1 = refTbl[one].order or 100
local o2 = refTbl[two].order or 100
if type(o1) == "function" or type(o1) == "string" then
info.order = o1
- info[tgetn(info)+1] = one
+ tinsert(info, one)
o1 = callmethod(info, inputpos, refTbl[one], "order")
- info[tgetn(info)] = nil
+ tremove(info)
info.order = nil
end
if type(o2) == "function" or type(o1) == "string" then
info.order = o2
- info[tgetn(info)+1] = two
+ tinsert(info, two)
o2 = callmethod(info, inputpos, refTbl[two], "order")
- info[tgetn(info)] = nil
+ tremove(info)
info.order = nil
end
if o1<0 and o2<0 then return o1 4) and not _G["KEY_" .. text] then
+ if not strfind(text,"^F%d+$") and text ~= "CAPSLOCK" and strlen(text) ~= 1 and (strbyte(text) < 128 or strlen(text) > 4) and not _G["KEY_" .. text] then
return false
end
local s = text
@@ -329,7 +334,7 @@ local function keybindingValidateFunc(text)
return s
end
--- handle() - selfrecursing function that processes input->optiontable
+-- handle() - selfrecursing function that processes input->optiontable
-- - depth - starts at 0
-- - retfalse - return false rather than produce error if a match is not found (used by inlined groups)
@@ -348,45 +353,45 @@ local function handle(info, inputpos, tab, depth, retfalse)
local oldfunc,oldfunc_at = getparam(info,inputpos,tab,depth,"func",functypes,funcmsg)
local oldvalidate,oldvalidate_at = getparam(info,inputpos,tab,depth,"validate",functypes,funcmsg)
--local oldconfirm,oldconfirm_at = getparam(info,inputpos,tab,depth,"confirm",functypes,funcmsg)
-
+
-------------------------------------------------------------------
-- Act according to .type of this table
-
+
if tab.type=="group" then
------------ group --------------------------------------------
-
+
if type(tab.args)~="table" then err(info, inputpos) end
if tab.plugins and type(tab.plugins)~="table" then err(info,inputpos) end
-
+
-- grab next arg from input
- local _,nextpos,arg = find(info.input, " *([^ ]+) *", inputpos)
+ local _,nextpos,arg = strfind(info.input, " *([^ ]+) *", inputpos)
if not arg then
showhelp(info, inputpos, tab, depth)
return
end
nextpos=nextpos+1
-
+
-- loop .args and try to find a key with a matching name
for k,v in iterateargs(tab) do
if not(type(k)=="string" and type(v)=="table" and type(v.type)=="string") then err(info,inputpos, "options table child '"..tostring(k).."' is malformed") end
-
+
-- is this child an inline group? if so, traverse into it
- if v.type=="group" and pickfirstset(v.cmdInline, v.inline, false) then
- info[depth+1] = k
+ if v.type=="group" and pickfirstset(3, v.cmdInline, v.inline, false) then
+ tinsert(info,k)
if handle(info, inputpos, v, depth+1, true)==false then
- info[depth+1] = nil
+ tremove(info)
-- wasn't found in there, but that's ok, we just keep looking down here
else
return -- done, name was found in inline group
end
-- matching name and not a inline group
- elseif strlower(arg)==strlower(gsub(k, " ", "_")) then
- info[depth+1] = k
+ elseif strlower(arg)==strlower(strgsub(k, " ", "_")) then
+ tinsert(info,k)
return handle(info,nextpos,v,depth+1)
end
end
-
- -- no match
+
+ -- no match
if retfalse then
-- restore old infotable members and return false to indicate failure
info.handler,info.handler_at = oldhandler,oldhandler_at
@@ -397,36 +402,41 @@ local function handle(info, inputpos, tab, depth, retfalse)
--info.confirm,info.confirm_at = oldconfirm,oldconfirm_at
return false
end
-
+
-- couldn't find the command, display error
usererr(info, inputpos, "'"..arg.."' - " .. L["unknown argument"])
return
end
-
+
local str = strsub(info.input,inputpos);
-
+
if tab.type=="execute" then
------------ execute --------------------------------------------
do_final(info, inputpos, tab, "func")
-
-
+
+
elseif tab.type=="input" then
------------ input --------------------------------------------
-
+
+ if str=="" and tab.nullable == false then
+ usererr(info, inputpos, "'"..str.."' - " .. L["invalid input"])
+ return
+ end
+
local res = true
if tab.pattern then
if not(type(tab.pattern)=="string") then err(info, inputpos, "'pattern' - expected a string") end
- if not strmatch(str, tab.pattern) then
+ if not strfind(str, tab.pattern) then
usererr(info, inputpos, "'"..str.."' - " .. L["invalid input"])
return
end
end
-
- do_final(info, inputpos, tab, "set", str)
-
-
+ do_final(info, inputpos, tab, "set", 1, str)
+
+
+
elseif tab.type=="toggle" then
------------ toggle --------------------------------------------
local b
@@ -446,7 +456,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
else
b = not b
end
-
+
elseif str==L["on"] then
b = true
elseif str==L["off"] then
@@ -461,48 +471,64 @@ local function handle(info, inputpos, tab, depth, retfalse)
end
return
end
-
- do_final(info, inputpos, tab, "set", b)
-
+
+ do_final(info, inputpos, tab, "set", 1, b)
+
elseif tab.type=="range" then
------------ range --------------------------------------------
+ local str = strtrim(strlower(str))
+ if str == "" then
+ -- TODO: Show current value
+ return
+ end
+
local val = tonumber(str)
if not val then
usererr(info, inputpos, "'"..str.."' - "..L["expected number"])
return
end
- if type(info.step)=="number" then
- val = val- mod(val, info.step)
- end
- if type(info.min)=="number" and valinfo.max then
- usererr(info, inputpos, val.." - "..format(L["must be equal to or lower than %s"], tostring(info.max)) )
- return
- end
-
- do_final(info, inputpos, tab, "set", val)
-
+ local step = getValueFromTab(info, inputpos, tab, "step")
+ local min = getValueFromTab(info, inputpos, tab, "min")
+
+ if type(step)=="number" then
+ val = min + math.floor((val-min)/step) * step
+ end
+
+ if type(min)=="number" and valmax then
+ usererr(info, inputpos, val.." - "..format(L["must be equal to or lower than %s"], tostring(max)) )
+ return
+ end
+
+ do_final(info, inputpos, tab, "set", 1, val)
+
+
elseif tab.type=="select" then
------------ select ------------------------------------
local str = strtrim(strlower(str))
-
- local values = tab.values
- if type(values) == "function" or type(values) == "string" then
- info.values = values
- values = callmethod(info, inputpos, tab, "values")
- info.values = nil
- end
-
+
+ local values = getValueFromTab(info, inputpos, tab, "values")
+
if str == "" then
- local b = callmethod(info, inputpos, tab, "get")
+ -- Ace3v: it is possbile to not have a current value
+ -- we do this only for select but not for multiselect
+ local b = tab.get
+ if type(b) == "function" or type(b) == "string" then
+ b = callmethod(info, inputpos, tab, "get")
+ else
+ b = nil
+ end
+
local fmt = "|cffffff78- [%s]|r %s"
local fmt_sel = "|cffffff78- [%s]|r %s |cffff0000*|r"
- print(L["Options for |cffffff78"..info[thetn(info)].."|r:"])
+ print(L["Options for |cffffff78"..info[tgetn(info)].."|r:"])
for k, v in pairs(values) do
if b == k then
print(format(fmt_sel, k, v))
@@ -510,76 +536,75 @@ local function handle(info, inputpos, tab, depth, retfalse)
print(format(fmt, k, v))
end
end
+ if tab.valuesTableDestroyable then del(values) end
return
end
local ok
- for k,v in pairs(values) do
+ for k,v in pairs(values) do
if strlower(k)==str then
str = k -- overwrite with key (in case of case mismatches)
ok = true
break
end
end
+ if tab.valuesTableDestroyable then del(values) end
if not ok then
usererr(info, inputpos, "'"..str.."' - "..L["unknown selection"])
return
end
-
- do_final(info, inputpos, tab, "set", str)
-
+
+ do_final(info, inputpos, tab, "set", 1, str)
+
elseif tab.type=="multiselect" then
------------ multiselect -------------------------------------------
local str = strtrim(strlower(str))
-
- local values = tab.values
- if type(values) == "function" or type(values) == "string" then
- info.values = values
- values = callmethod(info, inputpos, tab, "values")
- info.values = nil
- end
-
+
+ local values = getValueFromTab(info, inputpos, tab, "values")
+
if str == "" then
local fmt = "|cffffff78- [%s]|r %s"
local fmt_sel = "|cffffff78- [%s]|r %s |cffff0000*|r"
print(L["Options for |cffffff78"..info[tgetn(info)].."|r (multiple possible):"])
for k, v in pairs(values) do
- if callmethod(info, inputpos, tab, "get", k) then
+ if callmethod(info, inputpos, tab, "get", 1, k) then
print(format(fmt_sel, k, v))
else
print(format(fmt, k, v))
end
end
+ if tab.valuesTableDestroyable then del(values) end
return
end
-
+
--build a table of the selections, checking that they exist
--parse for =on =off =default in the process
--table will be key = true for options that should toggle, key = [on|off|default] for options to be set
- local sels = {}
- for v in gmatch(str, "[^ ]+") do
+ local sels = new()
+ for v in strgfind(str, "[^ ]+") do
--parse option=on etc
- local opt, val = strmatch(v, '(.+)=(.+)')
+ local _, _, opt, val = strfind(v, '(.+)=(.+)')
--get option if toggling
- if not opt then
- opt = v
+ if not opt then
+ opt = v
end
-
+
--check that the opt is valid
local ok
- for k,v in pairs(values) do
+ for k,v in pairs(values) do
if strlower(k)==opt then
opt = k -- overwrite with key (in case of case mismatches)
ok = true
break
end
end
-
+ if tab.valuesTableDestroyable then del(values) end
+
if not ok then
usererr(info, inputpos, "'"..opt.."' - "..L["unknown selection"])
return
end
-
+
--check that if val was supplied it is valid
if val then
if val == L["on"] or val == L["off"] or (tab.tristate and val == L["default"]) then
@@ -591,6 +616,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
else
usererr(info, inputpos, format(L["'%s' '%s' - expected 'on' or 'off', or no argument to toggle."], v, val))
end
+ del(sels)
return
end
else
@@ -598,14 +624,14 @@ local function handle(info, inputpos, tab, depth, retfalse)
sels[opt] = true
end
end
-
+
for opt, val in pairs(sels) do
local newval
-
+
if (val == true) then
--toggle the option
- local b = callmethod(info, inputpos, tab, "get", opt)
-
+ local b = callmethod(info, inputpos, tab, "get", 1, opt)
+
if tab.tristate then
--cycle in true, nil, false order
if b then
@@ -629,11 +655,12 @@ local function handle(info, inputpos, tab, depth, retfalse)
newval = nil
end
end
-
- do_final(info, inputpos, tab, "set", opt, newval)
+
+ do_final(info, inputpos, tab, "set", 2, opt, newval)
end
-
-
+ del(sels)
+
+
elseif tab.type=="color" then
------------ color --------------------------------------------
local str = strtrim(strlower(str))
@@ -641,30 +668,25 @@ local function handle(info, inputpos, tab, depth, retfalse)
--TODO: Show current value
return
end
-
- local r, g, b, a
-
- local hasAlpha = tab.hasAlpha
- if type(hasAlpha) == "function" or type(hasAlpha) == "string" then
- info.hasAlpha = hasAlpha
- hasAlpha = callmethod(info, inputpos, tab, 'hasAlpha')
- info.hasAlpha = nil
- end
-
+
+ local _, r, g, b, a
+
+ local hasAlpha = getValueFromTab(info, inputpos, tab, 'hasAlpha')
+
if hasAlpha then
- if len(str) == 8 and find(str, "^%x*$") then
+ if strlen(str) == 8 and strfind(str, "^%x*$") then
--parse a hex string
- r,g,b,a = tonumber(sub(str, 1, 2), 16) / 255, tonumber(sub(str, 3, 4), 16) / 255, tonumber(sub(str, 5, 6), 16) / 255
+ r,g,b,a = tonumber(strsub(str, 1, 2), 16) / 255, tonumber(strsub(str, 3, 4), 16) / 255, tonumber(strsub(str, 5, 6), 16) / 255, tonumber(strsub(str, 7, 8), 16) / 255
else
--parse seperate values
- r,g,b,a = strmatch(str, "^([%d%.]+) ([%d%.]+) ([%d%.]+) ([%d%.]+)$")
+ _,_,r,g,b,a = strfind(str, "^([%d%.]+) ([%d%.]+) ([%d%.]+) ([%d%.]+)$")
r,g,b,a = tonumber(r), tonumber(g), tonumber(b), tonumber(a)
end
if not (r and g and b and a) then
usererr(info, inputpos, format(L["'%s' - expected 'RRGGBBAA' or 'r g b a'."], str))
return
end
-
+
if r >= 0.0 and r <= 1.0 and g >= 0.0 and g <= 1.0 and b >= 0.0 and b <= 1.0 and a >= 0.0 and a <= 1.0 then
--values are valid
elseif r >= 0 and r <= 255 and g >= 0 and g <= 255 and b >= 0 and b <= 255 and a >= 0 and a <= 255 then
@@ -679,12 +701,12 @@ local function handle(info, inputpos, tab, depth, retfalse)
end
else
a = 1.0
- if len(str) == 6 and find(str, "^%x*$") then
+ if strlen(str) == 6 and strfind(str, "^%x*$") then
--parse a hex string
- r,g,b = tonumber(sub(str, 1, 2), 16) / 255, tonumber(sub(str, 3, 4), 16) / 255, tonumber(sub(str, 5, 6), 16) / 255
+ r,g,b = tonumber(strsub(str, 1, 2), 16) / 255, tonumber(strsub(str, 3, 4), 16) / 255, tonumber(strsub(str, 5, 6), 16) / 255
else
--parse seperate values
- r,g,b = strmatch(str, "^([%d%.]+) ([%d%.]+) ([%d%.]+)$")
+ _,_,r,g,b = strfind(str, "^([%d%.]+) ([%d%.]+) ([%d%.]+)$")
r,g,b = tonumber(r), tonumber(g), tonumber(b)
end
if not (r and g and b) then
@@ -703,8 +725,8 @@ local function handle(info, inputpos, tab, depth, retfalse)
usererr(info, inputpos, format(L["'%s' - values must all be either in the range 0-1 or 0-255."], str))
end
end
-
- do_final(info, inputpos, tab, "set", r,g,b,a)
+
+ do_final(info, inputpos, tab, "set", 4, r,g,b,a)
elseif tab.type=="keybinding" then
------------ keybinding --------------------------------------------
@@ -719,7 +741,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
return
end
- do_final(info, inputpos, tab, "set", value)
+ do_final(info, inputpos, tab, "set", 1, value)
elseif tab.type=="description" then
------------ description --------------------
@@ -739,7 +761,7 @@ end
-- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceConsole-3.0")
-- -- Use AceConsole-3.0 to register a Chat Command
-- MyAddon:RegisterChatCommand("mychat", "ChatCommand")
---
+--
-- -- Show the GUI if no input is supplied, otherwise handle the chat input.
-- function MyAddon:ChatCommand(input)
-- -- Assuming "MyOptions" is the appName of a valid options table
@@ -749,6 +771,9 @@ end
-- LibStub("AceConfigCmd-3.0").HandleCommand(MyAddon, "mychat", "MyOptions", input)
-- end
-- end
+-- Ace3v: experimental, user should copy info table if he wanna reuse it outside
+-- then handler
+local info_ = {}
function AceConfigCmd:HandleCommand(slashcmd, appName, input)
local optgetter = cfgreg:GetOptionsTable(appName)
@@ -756,33 +781,66 @@ function AceConfigCmd:HandleCommand(slashcmd, appName, input)
error([[Usage: HandleCommand("slashcmd", "appName", "input"): 'appName' - no options table "]]..tostring(appName)..[[" has been registered]], 2)
end
local options = assert( optgetter("cmd", MAJOR) )
-
- local info = { -- Don't try to recycle this, it gets handed off to callbacks and whatnot
- [0] = slashcmd,
- appName = appName,
- options = options,
- input = input,
- self = self,
- handler = self,
- uiType = "cmd",
- uiName = MAJOR,
- }
-
- handle(info, 1, options, 0) -- (info, inputpos, table, depth)
+
+ -- Ace3v: prevent user from using AceConfigCmd as self
+ if self == AceConfigCmd then
+ error([[Usage: HandleCommand("slashcmd", "appName", "input"): 'self' - use your own 'self']], 2)
+ end
+
+ --local info = { -- Don't try to recycle this, it gets handed off to callbacks and whatnot
+ -- [0] = slashcmd,
+ -- appName = appName,
+ -- options = options,
+ -- input = input,
+ -- self = self,
+ -- handler = self,
+ -- uiType = "cmd",
+ -- uiName = MAJOR,
+ --}
+
+ wipe(info_)
+ info_[0] = slashcmd
+ info_.appName = appName
+ info_.options = options
+ info_.input = input
+ info_.self = self
+ info_.handler = self
+ info_.uiType = "cmd"
+ info_.uiName = MAJOR
+
+ handle(info_, 1, options, 0) -- (info, inputpos, table, depth)
end
--- Utility function to create a slash command handler.
-- Also registers tab completion with AceTab
-- @param slashcmd The slash command WITHOUT leading slash (only used for error output)
-- @param appName The application name as given to `:RegisterOptionsTable()`
-function AceConfigCmd:CreateChatCommand(slashcmd, appName)
+function AceConfigCmd:CreateChatCommand(slashcmd, appName, func)
if not AceConsole then
AceConsole = LibStub(AceConsoleName)
end
- if AceConsole.RegisterChatCommand(self, slashcmd, function(input)
- AceConfigCmd.HandleCommand(self, slashcmd, appName, input) -- upgradable
- end,
- true) then -- succesfully registered so lets get the command -> app table in
+
+ -- Ace3v: prevent user from using AceConfigCmd as self
+ if self == AceConfigCmd then
+ error([[Usage: CreateChatCommand("slashcmd", "appName"[, "func"]): 'self' - use your own 'self']], 2)
+ end
+
+ local t = type(func)
+
+ -- Ace3v: make it possible to call another function
+ local handler
+ if t == "string" then
+ handler = function(input) self[func](self, input, slashcmd, appName) end
+ elseif t ~= "function" then
+ handler = function(input)
+ AceConfigCmd.HandleCommand(self, slashcmd, appName, input) -- upgradable
+ end
+ else
+ handler = func
+ end
+
+ if AceConsole.RegisterChatCommand(self, slashcmd, handler, true) then
+ -- succesfully registered so lets get the command -> app table in
commands[slashcmd] = appName
end
end
@@ -794,3 +852,12 @@ end
function AceConfigCmd:GetChatCommandOptions(slashcmd)
return commands[slashcmd]
end
+
+function AceConfigCmd:Embed(target)
+ target["HandleCommand"] = self["HandleCommand"]
+ target["CreateChatCommand"] = self["CreateChatCommand"]
+end
+
+for addon in pairs(AceConfigCmd.embeds) do
+ AceConfigCmd:Embed(addon)
+end
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
index c76f93d..b4fa5f4 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua
@@ -1,17 +1,20 @@
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables.
-- @class file
-- @name AceConfigDialog-3.0
--- @release $Id: AceConfigDialog-3.0.lua 1126 2014-11-10 06:38:01Z nevcairiel $
+-- @release $Id: AceConfigDialog-3.0.lua 1139 2016-07-03 07:43:51Z nevcairiel $
local LibStub = LibStub
-local gui = LibStub("AceGUI-3.0")
-local reg = LibStub("AceConfigRegistry-3.0-ElvUI")
-
-local MAJOR, MINOR = "AceConfigDialog-3.0-ElvUI", 2
+local MAJOR, MINOR = "AceConfigDialog-3.0", 61
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigDialog then return end
+local AceCore = LibStub("AceCore-3.0")
+local wipe, strsplit = AceCore.wipe, AceCore.strsplit
+local safecall = AceCore.safecall
+local Dispatchers = AceCore.Dispatchers
+local countargs = AceCore.countargs
+
AceConfigDialog.OpenFrames = AceConfigDialog.OpenFrames or {}
AceConfigDialog.Status = AceConfigDialog.Status or {}
AceConfigDialog.frame = AceConfigDialog.frame or CreateFrame("Frame")
@@ -20,84 +23,42 @@ AceConfigDialog.frame.apps = AceConfigDialog.frame.apps or {}
AceConfigDialog.frame.closing = AceConfigDialog.frame.closing or {}
AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {}
+local gui = LibStub("AceGUI-3.0")
+local reg = LibStub("AceConfigRegistry-3.0")
+
-- Lua APIs
-local tconcat, tgetn, tinsert, tsort, tremove, tsort = table.concat, table.getn, table.insert, table.sort, table.remove, table.sort
-local strmatch, format, strsplit, strupper = string.match, string.format, string.split, string.upper
+local tconcat, tinsert, tsort, tremove, tgetn, tsetn = table.concat, table.insert, table.sort, table.remove, table.getn, table.setn
+local format, strfind, strupper = string.format, string.find, string.upper
local assert, loadstring, error = assert, loadstring, error
-local pairs, next, select, type, unpack, wipe, ipairs = pairs, next, select, type, unpack, wipe, ipairs
+local pairs, next, type, unpack, ipairs = pairs, next, type, unpack, ipairs
local rawset, tostring, tonumber = rawset, tostring, tonumber
local math_min, math_max, math_floor = math.min, math.max, math.floor
-local OKAY = OKAY
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: NORMAL_FONT_COLOR, GameTooltip, StaticPopupDialogs, ACCEPT, CANCEL, StaticPopup_Show
-- GLOBALS: PlaySound, GameFontHighlight, GameFontHighlightSmall, GameFontHighlightLarge
-- GLOBALS: CloseSpecialWindows, InterfaceOptions_AddCategory, geterrorhandler
--- GLOBALS: STATICPOPUP_NUMDIALOGS
local emptyTbl = {}
---[[
- xpcall safecall implementation
-]]
-local xpcall = xpcall
-
-local function errorhandler(err)
- return geterrorhandler()(err)
-end
-
-local function CreateDispatcher(argCount)
- local code = [[
- local method, ARGS
- local function call() return method(ARGS) end
-
- local function dispatch(func, ...)
- method = func
- if not method then return end
- ARGS = unpack(arg)
- return xpcall(call, function(err) return geterrorhandler()(err) end)
- end
-
- return dispatch
- ]]
-
- local ARGS = {}
- for i = 1, argCount do ARGS[i] = "arg"..i end
- code = gsub(code, "ARGS", tconcat(ARGS, ", "))
- return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
-end
-
-local Dispatchers = setmetatable({}, {__index=function(self, argCount)
- local dispatcher = CreateDispatcher(argCount)
- rawset(self, argCount, dispatcher)
- return dispatcher
-end})
-Dispatchers[0] = function(func)
- return xpcall(func, errorhandler)
-end
-
-local function safecall(func, ...)
- return Dispatchers[tgetn(arg)](func, unpack(arg))
-end
-
local width_multiplier = 170
--[[
Group Types
Tree - All Descendant Groups will all become nodes on the tree, direct child options will appear above the tree
- - Descendant Groups with inline=true and thier children will not become nodes
+ - Descendant Groups with inline=true and thier children will not become nodes
Tab - Direct Child Groups will become tabs, direct child options will appear above the tab control
- - Grandchild groups will default to inline unless specified otherwise
+ - Grandchild groups will default to inline unless specified otherwise
Select- Same as Tab but with entries in a dropdown rather than tabs
Inline Groups
- - Will not become nodes of a select group, they will be effectivly part of thier parent group seperated by a border
- - If declared on a direct child of a root node of a select group, they will appear above the group container control
- - When a group is displayed inline, all descendants will also be inline members of the group
+ - Will not become nodes of a select group, they will be effectivly part of thier parent group seperated by a border
+ - If declared on a direct child of a root node of a select group, they will appear above the group container control
+ - When a group is displayed inline, all descendants will also be inline members of the group
]]
@@ -122,6 +83,7 @@ do
for k, v in pairs(t) do
c[k] = v
end
+ tsetn(c, tgetn(t))
return c
end
function del(t)
@@ -139,14 +101,7 @@ do
end
-- picks the first non-nil value and returns it
-local function pickfirstset(...)
- local args = unpack(arg)
- for i=1,select("#", args) do
- if select(i,args)~=nil then
- return select(i,args)
- end
- end
-end
+local pickfirstset = AceCore.pickfirstset
--gets an option from a given group, checking plugins
local function GetSubOption(group, key)
@@ -196,11 +151,10 @@ local allIsLiteral = {
--gets the value for a member that could be a function
--function refs are called with an info arg
--every other type is returned
-local function GetOptionsMemberValue(membername, option, options, path, appName, ...)
+local function GetOptionsMemberValue(membername, option, options, path, appName, argc, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
--get definition for the member
local inherits = isInherited[membername]
-
--get the member of the option, traversing the tree if it can be inherited
local member
@@ -228,11 +182,13 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
local group = options
handler = group.handler or handler
- for i = 1, tgetn(path) do
+ local l = tgetn(path)
+ for i = 1, l do
group = GetSubOption(group, path[i])
info[i] = path[i]
handler = group.handler or handler
end
+ tsetn(info, l)
info.options = options
info.appName = appName
@@ -244,21 +200,22 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
info.uiType = "dialog"
info.uiName = MAJOR
- local a, b, c ,d, e, f, g, h
+ argc = argc or 0
+ local a, b, c ,d
--using 4 returns for the get of a color type, increase if a type needs more
if type(member) == "function" then
--Call the function
- a,b,c,d, e, f, g, h = member(info, unpack(arg))
+ a,b,c,d = Dispatchers[argc+1](member,info,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
else
--Call the method
if handler and handler[member] then
- a,b,c,d,e, f, g, h = handler[member](handler, info, unpack(arg))
+ a,b,c,d = Dispatchers[argc+2](handler[member],handler,info,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
else
error(format("Method %s doesn't exist in handler for type %s", member, membername))
end
end
del(info)
- return a,b,c,d,e, f, g, h
+ return a,b,c,d
else
--The value isnt a function to call, return it
return member
@@ -296,12 +253,12 @@ local function CallOptionsFunction(funcname ,option, options, path, appName, ...
local a, b, c ,d
if type(func) == "string" then
if handler and handler[func] then
- a,b,c,d = handler[func](handler, info, unpack(arg))
+ a,b,c,d = handler[func](handler, info, ...)
else
error(string.format("Method %s doesn't exist in handler for type func", func))
end
elseif type(func) == "function" then
- a,b,c,d = func(info, unpack(arg))
+ a,b,c,d = func(info, ...)
end
del(info)
return a,b,c,d
@@ -354,10 +311,10 @@ local function BuildSortedOptionsTable(group, keySort, opts, options, path, appN
tinsert(keySort, k)
opts[k] = v
- path[tgetn(path)+1] = k
+ tinsert(path,k)
tempOrders[k] = GetOptionsMemberValue("order", v, options, path, appName)
tempNames[k] = GetOptionsMemberValue("name", v, options, path, appName)
- path[tgetn(path)] = nil
+ tremove(path)
end
end
end
@@ -368,10 +325,10 @@ local function BuildSortedOptionsTable(group, keySort, opts, options, path, appN
tinsert(keySort, k)
opts[k] = v
- path[tgetn(path)+1] = k
+ tinsert(path,k)
tempOrders[k] = GetOptionsMemberValue("order", v, options, path, appName)
tempNames[k] = GetOptionsMemberValue("name", v, options, path, appName)
- path[tgetn(path)] = nil
+ tremove(path)
end
end
@@ -464,10 +421,11 @@ end
-- The path specified has to match the keys of the groups in the table.
-- @param appName The application name as given to `:RegisterOptionsTable()`
-- @param ... The path to the key that should be selected
-function AceConfigDialog:SelectGroup(appName, ...)
+do
+local args = {nil,nil,nil,nil,nil,nil,nil,nil,nil,nil}
+function AceConfigDialog:SelectGroup(appName, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
local path = new()
-
local app = reg:GetOptionsTable(appName)
if not app then
error(format("%s isn't registed with AceConfigRegistry, unable to open config", appName), 2)
@@ -482,8 +440,21 @@ function AceConfigDialog:SelectGroup(appName, ...)
local treevalue
local treestatus
- for n = 1, tgetn(arg) do
- local key = arg[n]
+ args[1] = a1
+ args[2] = a2
+ args[3] = a3
+ args[4] = a4
+ args[5] = a5
+ args[6] = a6
+ args[7] = a7
+ args[8] = a8
+ args[9] = a9
+ args[10] = a10
+ for n = 1, 10 do
+ local key = args[n]
+ arg[n] = nil
+
+ if not key then break end
if group.childGroups == "tab" or group.childGroups == "select" then
--if this is a tab or select group, select the group
@@ -527,6 +498,7 @@ function AceConfigDialog:SelectGroup(appName, ...)
del(path)
reg:NotifyChange(appName)
end
+end -- AceConfigDialog:SelectGroup
local function OptionOnMouseOver(widget, event)
--show a tooltip/set the status bar to the desc text
@@ -547,13 +519,13 @@ local function OptionOnMouseOver(widget, event)
GameTooltip:SetText(name, 1, .82, 0, true)
if opt.type == "multiselect" then
- GameTooltip:AddLine(user.text, 0.5, 0.5, 0.8, 1)
+ GameTooltip:AddLine(user.text, 0.5, 0.5, 0.8, true)
end
if type(desc) == "string" then
- GameTooltip:AddLine(desc, 1, 1, 1, 1)
+ GameTooltip:AddLine(desc, 1, 1, 1, true)
end
if type(usage) == "string" then
- GameTooltip:AddLine("Usage: "..usage, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1)
+ GameTooltip:AddLine("Usage: "..usage, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, true)
end
GameTooltip:Show()
@@ -571,7 +543,7 @@ local function GetFuncName(option)
return "set"
end
end
-local function confirmPopup(appName, rootframe, basepath, info, message, func, ...)
+local function confirmPopup(appName, rootframe, basepath, info, message, func, argc,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
if not StaticPopupDialogs["ACECONFIGDIALOG30_CONFIRM_DIALOG"] then
StaticPopupDialogs["ACECONFIGDIALOG30_CONFIRM_DIALOG"] = {}
end
@@ -585,7 +557,7 @@ local function confirmPopup(appName, rootframe, basepath, info, message, func, .
t.preferredIndex = STATICPOPUP_NUMDIALOGS
local dialog, oldstrata
t.OnAccept = function()
- safecall(func, unpack(t))
+ safecall(func, tgetn(t), unpack(t))
if dialog and oldstrata then
dialog:SetFrameStrata(oldstrata)
end
@@ -599,9 +571,23 @@ local function confirmPopup(appName, rootframe, basepath, info, message, func, .
AceConfigDialog:Open(appName, rootframe, unpack(basepath or emptyTbl))
del(info)
end
- for i = 1, tgetn(arg) do
- t[i] = arg[i] or false
+ t[1] = a1
+ t[2] = a2
+ t[3] = a3
+ t[4] = a4
+ t[5] = a5
+ t[6] = a6
+ t[7] = a7
+ t[8] = a8
+ t[9] = a9
+ t[10] = a10
+ for i=1,argc do
+ t[i] = t[i] or false
end
+ for i=argc+1,10 do
+ t[i] = nil
+ end
+ tsetn(t,argc)
t.timeout = 0
t.whileDead = 1
t.hideOnEscape = 1
@@ -613,32 +599,7 @@ local function confirmPopup(appName, rootframe, basepath, info, message, func, .
end
end
-local function validationErrorPopup(message)
- if not StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"] then
- StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"] = {}
- end
- local t = StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"]
- t.text = message
- t.button1 = OKAY
- t.preferredIndex = STATICPOPUP_NUMDIALOGS
- local dialog, oldstrata
- t.OnAccept = function()
- if dialog and oldstrata then
- dialog:SetFrameStrata(oldstrata)
- end
- end
- t.timeout = 0
- t.whileDead = 1
- t.hideOnEscape = 1
-
- dialog = StaticPopup_Show("ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG")
- if dialog then
- oldstrata = dialog:GetFrameStrata()
- dialog:SetFrameStrata("TOOLTIP")
- end
-end
-
-local function ActivateControl(widget, event, ...)
+local function ActivateControl(widget, event, argc, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
--This function will call the set / execute handler for the widget
--widget:GetUserDataTable() contains the needed info
local user = widget:GetUserDataTable()
@@ -661,7 +622,9 @@ local function ActivateControl(widget, event, ...)
handler = group.handler or handler
confirm = group.confirm
validate = group.validate
- for i = 1, tgetn(path) do
+
+ local l = tgetn(path)
+ for i = 1, l do
local v = path[i]
group = GetSubOption(group, v)
info[i] = v
@@ -676,6 +639,7 @@ local function ActivateControl(widget, event, ...)
validate = group.validate
end
end
+ tsetn(info, l)
info.options = options
info.appName = user.appName
@@ -687,6 +651,7 @@ local function ActivateControl(widget, event, ...)
info.uiName = MAJOR
local name
+
if type(option.name) == "function" then
name = option.name(info)
elseif type(option.name) == "string" then
@@ -701,7 +666,7 @@ local function ActivateControl(widget, event, ...)
if option.type == "input" then
if type(pattern)=="string" then
- if not strmatch(unpack(arg), pattern) then
+ if not strfind(a1, pattern) then
validated = false
end
end
@@ -711,46 +676,53 @@ local function ActivateControl(widget, event, ...)
if validated and option.type ~= "execute" then
if type(validate) == "string" then
if handler and handler[validate] then
- success, validated = safecall(handler[validate], handler, info, unpack(arg))
+ success, validated = safecall(handler[validate], argc+2, handler, info, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
if not success then validated = false end
else
error(format("Method %s doesn't exist in handler for type execute", validate))
end
elseif type(validate) == "function" then
- success, validated = safecall(validate, info, unpack(arg))
+ success, validated = safecall(validate, argc+1, info, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
if not success then validated = false end
end
end
local rootframe = user.rootframe
- if not validated or type(validated) == "string" then
- if not validated then
- if usage then
- validated = name..": "..usage
- else
- if pattern then
- validated = name..": Expected "..pattern
- else
- validated = name..": Invalid Value"
- end
- end
- end
-
- -- show validate message
+ if type(validated) == "string" then
+ --validate function returned a message to display
if rootframe.SetStatusText then
rootframe:SetStatusText(validated)
else
- validationErrorPopup(validated)
+ -- TODO: do something else.
+ end
+ PlaySound("igPlayerInviteDecline")
+ del(info)
+ return true
+ elseif not validated then
+ --validate returned false
+ if rootframe.SetStatusText then
+ if usage then
+ rootframe:SetStatusText(name..": "..usage)
+ else
+ if pattern then
+ rootframe:SetStatusText(name..": Expected "..pattern)
+ else
+ rootframe:SetStatusText(name..": Invalid Value")
+ end
+ end
+ else
+ -- TODO: do something else
end
PlaySound("igPlayerInviteDecline")
del(info)
return true
else
+
local confirmText = option.confirmText
--call confirm func/method
if type(confirm) == "string" then
if handler and handler[confirm] then
- success, confirm = safecall(handler[confirm], handler, info, unpack(arg))
+ success, confirm = safecall(handler[confirm], argc+2, handler, info, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
if success and type(confirm) == "string" then
confirmText = confirm
confirm = true
@@ -761,7 +733,7 @@ local function ActivateControl(widget, event, ...)
error(format("Method %s doesn't exist in handler for type confirm", confirm))
end
elseif type(confirm) == "function" then
- success, confirm = safecall(confirm, info, unpack(arg))
+ success, confirm = safecall(confirm, argc+1, info, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
if success and type(confirm) == "string" then
confirmText = confirm
confirm = true
@@ -796,12 +768,12 @@ local function ActivateControl(widget, event, ...)
local basepath = user.rootframe:GetUserData("basepath")
if type(func) == "string" then
if handler and handler[func] then
- confirmPopup(user.appName, rootframe, basepath, info, confirmText, handler[func], handler, info, unpack(arg))
+ confirmPopup(user.appName, rootframe, basepath, info, confirmText, handler[func], argc+2, handler, info, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
else
error(format("Method %s doesn't exist in handler for type func", func))
end
elseif type(func) == "function" then
- confirmPopup(user.appName, rootframe, basepath, info, confirmText, func, info, unpack(arg))
+ confirmPopup(user.appName, rootframe, basepath, info, confirmText, func, argc+1, info,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
end
--func will be called and info deleted when the confirm dialog is responded to
return
@@ -811,16 +783,14 @@ local function ActivateControl(widget, event, ...)
--call the function
if type(func) == "string" then
if handler and handler[func] then
- safecall(handler[func],handler, info, unpack(arg))
+ safecall(handler[func], argc+2, handler, info, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
else
error(format("Method %s doesn't exist in handler for type func", func))
end
elseif type(func) == "function" then
- safecall(func,info, unpack(arg))
+ safecall(func, argc+1, info, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
end
-
-
local iscustom = user.rootframe:GetUserData("iscustom")
local basepath = user.rootframe:GetUserData("basepath") or emptyTbl
--full refresh of the frame, some controls dont cause this on all events
@@ -856,7 +826,7 @@ local function ActivateControl(widget, event, ...)
del(info)
end
-local function ActivateSlider(widget, event, value)
+local function ActivateSlider(widget, event, _, value)
local option = widget:GetUserData("option")
local min, max, step = option.min or (not option.softMin and 0 or nil), option.max or (not option.softMax and 100 or nil), option.step
if min then
@@ -868,13 +838,13 @@ local function ActivateSlider(widget, event, value)
if max then
value = math_min(value, max)
end
- ActivateControl(widget,event,value)
+ ActivateControl(widget,event,1,value)
end
--called from a checkbox that is part of an internally created multiselect group
--this type is safe to refresh on activation of one control
-local function ActivateMultiControl(widget, event, ...)
- ActivateControl(widget, event, widget:GetUserData("value"), unpack(arg))
+local function ActivateMultiControl(widget, event, argc, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ ActivateControl(widget, event, argc+1, widget:GetUserData("value"), a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
local user = widget:GetUserDataTable()
local iscustom = user.rootframe:GetUserData("iscustom")
local basepath = user.rootframe:GetUserData("basepath") or emptyTbl
@@ -885,7 +855,7 @@ local function ActivateMultiControl(widget, event, ...)
end
end
-local function MultiControlOnClosed(widget, event, ...)
+local function MultiControlOnClosed(widget, event)
local user = widget:GetUserDataTable()
if user.valuechanged then
local iscustom = user.rootframe:GetUserData("iscustom")
@@ -906,7 +876,7 @@ end
local function CheckOptionHidden(option, options, path, appName)
--check for a specific boolean option
- local hidden = pickfirstset(option.dialogHidden,option.guiHidden)
+ local hidden = pickfirstset(2,option.dialogHidden,option.guiHidden)
if hidden ~= nil then
return hidden
end
@@ -916,7 +886,7 @@ end
local function CheckOptionDisabled(option, options, path, appName)
--check for a specific boolean option
- local disabled = pickfirstset(option.dialogDisabled,option.guiDisabled)
+ local disabled = pickfirstset(2,option.dialogDisabled,option.guiDisabled)
if disabled ~= nil then
return disabled
end
@@ -932,18 +902,18 @@ local function BuildTabs(group, options, path, appName)
BuildSortedOptionsTable(group, keySort, opts, options, path, appName)
- for i = 1, tgetn(keySort) do
+ for i = 1, #keySort do
local k = keySort[i]
local v = opts[k]
if v.type == "group" then
- path[tgetn(path)+1] = k
- local inline = pickfirstset(v.dialogInline,v.guiInline,v.inline, false)
+ path[#path+1] = k
+ local inline = pickfirstset(4,v.dialogInline,v.guiInline,v.inline, false)
local hidden = CheckOptionHidden(v, options, path, appName)
if not inline and not hidden then
tinsert(tabs, k)
text[k] = GetOptionsMemberValue("name", v, options, path, appName)
end
- path[tgetn(path)] = nil
+ path[#path] = nil
end
end
@@ -965,14 +935,14 @@ local function BuildSelect(group, options, path, appName)
local k = keySort[i]
local v = opts[k]
if v.type == "group" then
- path[tgetn(path)+1] = k
- local inline = pickfirstset(v.dialogInline,v.guiInline,v.inline, false)
+ tinsert(path,k)
+ local inline = pickfirstset(4,v.dialogInline,v.guiInline,v.inline, false)
local hidden = CheckOptionHidden(v, options, path, appName)
if not inline and not hidden then
groups[k] = GetOptionsMemberValue("name", v, options, path, appName)
tinsert(order, k)
end
- path[tgetn(path)] = nil
+ tremove(path)
end
end
@@ -992,8 +962,8 @@ local function BuildSubGroups(group, tree, options, path, appName)
local k = keySort[i]
local v = opts[k]
if v.type == "group" then
- path[tgetn(path)+1] = k
- local inline = pickfirstset(v.dialogInline,v.guiInline,v.inline, false)
+ tinsert(path,k)
+ local inline = pickfirstset(4,v.dialogInline,v.guiInline,v.inline, false)
local hidden = CheckOptionHidden(v, options, path, appName)
if not inline and not hidden then
local entry = new()
@@ -1008,7 +978,7 @@ local function BuildSubGroups(group, tree, options, path, appName)
BuildSubGroups(v,entry, options, path, appName)
end
end
- path[tgetn(path)] = nil
+ tremove(path)
end
end
@@ -1027,8 +997,8 @@ local function BuildGroups(group, options, path, appName, recurse)
local k = keySort[i]
local v = opts[k]
if v.type == "group" then
- path[tgetn(path)+1] = k
- local inline = pickfirstset(v.dialogInline,v.guiInline,v.inline, false)
+ tinsert(path,k)
+ local inline = pickfirstset(4,v.dialogInline,v.guiInline,v.inline, false)
local hidden = CheckOptionHidden(v, options, path, appName)
if not inline and not hidden then
local entry = new()
@@ -1041,7 +1011,7 @@ local function BuildGroups(group, options, path, appName, recurse)
BuildSubGroups(v,entry, options, path, appName)
end
end
- path[tgetn(path)] = nil
+ tremove(path)
end
end
del(keySort)
@@ -1051,9 +1021,12 @@ end
local function InjectInfo(control, options, option, path, rootframe, appName)
local user = control:GetUserDataTable()
- for i = 1, tgetn(path) do
+ local l = tgetn(path)
+ for i = 1, l do
user[i] = path[i]
end
+ tsetn(user,l)
+
user.rootframe = rootframe
user.option = option
user.options = options
@@ -1086,7 +1059,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
local name = GetOptionsMemberValue("name", v, options, path, appName)
if not hidden then
if v.type == "group" then
- if inline or pickfirstset(v.dialogInline,v.guiInline,v.inline, false) then
+ if inline or pickfirstset(4, v.dialogInline,v.guiInline,v.inline, false) then
--Inline group
local GroupContainer
if name and name ~= "" then
@@ -1134,8 +1107,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
control:SetImageSize(width, height)
control:SetLabel(name)
else
- local buttonElvUI = GetOptionsMemberValue("buttonElvUI",v, options, path, appName)
- control = gui:Create(buttonElvUI and "Button-ElvUI" or "Button")
+ control = gui:Create("Button")
control:SetText(name)
end
control:SetCallback("OnClick",ActivateControl)
@@ -1161,12 +1133,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
elseif v.type == "toggle" then
control = gui:Create("CheckBox")
- control.textWidth = GetOptionsMemberValue("textWidth",v,options,path,appName)
control:SetLabel(name)
- if control.textWidth and control.frame and control.text then
- local textWidth = control.text:GetWidth()+30
- control.customWidth = (textWidth>=width_multiplier and textWidth<=width_multiplier*1.5) and textWidth
- end
control:SetTriState(v.tristate)
local value = GetOptionsMemberValue("get",v, options, path, appName)
control:SetValue(value)
@@ -1214,7 +1181,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
local optionValue = GetOptionsMemberValue("get",v, options, path, appName)
local t = {}
for value, text in pairs(values) do
- t[tgetn(t)+1]=value
+ tinsert(t,value)
end
tsort(t)
for k, value in ipairs(t) do
@@ -1247,6 +1214,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
if not control then
geterrorhandler()(format("Invalid Custom Control Type - %s", tostring(controlType)))
control = gui:Create("Dropdown")
+
end
local itemType = v.itemControl
if itemType and not gui:GetWidgetVersion(itemType) then
@@ -1265,6 +1233,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
elseif v.type == "multiselect" then
local values = GetOptionsMemberValue("values", v, options, path, appName)
+
local disabled = CheckOptionDisabled(v, options, path, appName)
local controlType = v.dialogControl or v.control
@@ -1303,69 +1272,38 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
--check:SetTriState(v.tristate)
for i = 1, tgetn(valuesort) do
local key = valuesort[i]
- local value = GetOptionsMemberValue("get",v, options, path, appName, key)
+ local value = GetOptionsMemberValue("get", v, options, path, appName, 1, key)
control:SetItemValue(key,value)
end
else
- local width = GetOptionsMemberValue("width",v,options,path,appName)
- local dragdrop = GetOptionsMemberValue("dragdrop",v,options,path,appName)
-
control = gui:Create("InlineGroup")
control:SetLayout("Flow")
control:SetTitle(name)
control.width = "fill"
- control:PauseLayout()
+ control:PauseLayout()
+ local width = GetOptionsMemberValue("width",v,options,path,appName)
for i = 1, tgetn(valuesort) do
local value = valuesort[i]
local text = values[value]
- if dragdrop then
- local button = gui:Create("Button-ElvUI")
- button:SetDisabled(disabled)
- button:SetUserData("value", value)
- button:SetUserData("text", text)
- local state = v.stateSwitchGetText and v.stateSwitchGetText(button, text, value)
- button:SetText(format("|cFF888888%d|r %s", i, state or text))
- button.stateSwitchOnClick = v.stateSwitchOnClick
- button.dragOnMouseDown = v.dragOnMouseDown
- button.dragOnMouseUp = v.dragOnMouseUp
- button.dragOnEnter = v.dragOnEnter
- button.dragOnLeave = v.dragOnLeave
- button.dragOnClick = v.dragOnClick
- button.dragdrop = true
- button.ActivateMultiControl = ActivateMultiControl
- button.value = GetOptionsMemberValue("get",v, options, path, appName, value)
- InjectInfo(button, options, v, path, rootframe, appName)
- control:AddChild(button)
- if width == "double" then
- button:SetWidth(width_multiplier * 2)
- elseif width == "half" then
- button:SetWidth(width_multiplier / 2)
- elseif width == "full" then
- button.width = "fill"
- else
- button:SetWidth(width_multiplier)
- end
+ local check = gui:Create("CheckBox")
+ check:SetLabel(text)
+ check:SetUserData("value", value)
+ check:SetUserData("text", text)
+ check:SetDisabled(disabled)
+ check:SetTriState(v.tristate)
+ check:SetValue(GetOptionsMemberValue("get",v, options, path, appName, 1, value))
+ check:SetCallback("OnValueChanged",ActivateMultiControl)
+ InjectInfo(check, options, v, path, rootframe, appName)
+ control:AddChild(check)
+ if width == "double" then
+ check:SetWidth(width_multiplier * 2)
+ elseif width == "half" then
+ check:SetWidth(width_multiplier / 2)
+ elseif width == "full" then
+ check.width = "fill"
else
- local check = gui:Create("CheckBox")
- check:SetLabel(text)
- check:SetUserData("value", value)
- check:SetUserData("text", text)
- check:SetDisabled(disabled)
- check:SetTriState(v.tristate)
- check:SetValue(GetOptionsMemberValue("get",v, options, path, appName, value))
- check:SetCallback("OnValueChanged",ActivateMultiControl)
- InjectInfo(check, options, v, path, rootframe, appName)
- control:AddChild(check)
- if width == "double" then
- check:SetWidth(width_multiplier * 2)
- elseif width == "half" then
- check:SetWidth(width_multiplier / 2)
- elseif width == "full" then
- check.width = "fill"
- else
- check:SetWidth(width_multiplier)
- end
+ check:SetWidth(width_multiplier)
end
end
control:ResumeLayout()
@@ -1377,7 +1315,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
del(valuesort)
elseif v.type == "color" then
- control = gui:Create("ColorPicker-ElvUI")
+ control = gui:Create("ColorPicker")
control:SetLabel(name)
control:SetHasAlpha(GetOptionsMemberValue("hasAlpha",v, options, path, appName))
control:SetColor(GetOptionsMemberValue("get",v, options, path, appName))
@@ -1437,21 +1375,16 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
--Common Init
if control then
- local customWidth = control.customWidth or GetOptionsMemberValue("customWidth",v,options,path,appName)
- if control.width ~= "fill" or customWidth then
- if customWidth then
- control:SetWidth(customWidth)
+ if control.width ~= "fill" then
+ local width = GetOptionsMemberValue("width",v,options,path,appName)
+ if width == "double" then
+ control:SetWidth(width_multiplier * 2)
+ elseif width == "half" then
+ control:SetWidth(width_multiplier / 2)
+ elseif width == "full" then
+ control.width = "fill"
else
- local width = GetOptionsMemberValue("width",v,options,path,appName)
- if width == "double" then
- control:SetWidth(width_multiplier * 2)
- elseif width == "half" then
- control:SetWidth(width_multiplier / 2)
- elseif width == "full" then
- control.width = "fill"
- else
- control:SetWidth(width_multiplier)
- end
+ control:SetWidth(width_multiplier)
end
end
if control.SetDisabled then
@@ -1473,14 +1406,15 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
del(opts)
end
-local function BuildPath(path, ...)
- for i = 1, tgetn(arg) do
- tinsert(path, arg[i])
+-- Ace3v: recursive
+local function BuildPath(path, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ if a1 then
+ tinsert(path,a1)
+ BuildPath(path,a2,a3,a4,a5,a6,a7,a8,a9,a10)
end
end
-
-local function TreeOnButtonEnter(widget, event, uniquevalue, button)
+local function TreeOnButtonEnter(widget, event, _, uniquevalue, button)
local user = widget:GetUserDataTable()
if not user then return end
local options = user.options
@@ -1489,9 +1423,11 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button)
local appName = user.appName
local feedpath = new()
- for i = 1, tgetn(path) do
+ local l = tgetn(path)
+ for i = 1, l do
feedpath[i] = path[i]
end
+ tsetn(feedpath,l)
BuildPath(feedpath, strsplit("\001", uniquevalue))
local group = options
@@ -1503,35 +1439,37 @@ local function TreeOnButtonEnter(widget, event, uniquevalue, button)
local name = GetOptionsMemberValue("name", group, options, feedpath, appName)
local desc = GetOptionsMemberValue("desc", group, options, feedpath, appName)
- GameTooltip:SetOwner(button, "ANCHOR_CURSOR")
+ GameTooltip:SetOwner(button, "ANCHOR_NONE")
if widget.type == "TabGroup" then
GameTooltip:SetPoint("BOTTOM",button,"TOP")
else
GameTooltip:SetPoint("LEFT",button,"RIGHT")
end
- GameTooltip:SetText(name, 1, .82, 0, 1)
+ GameTooltip:SetText(name, 1, .82, 0, true)
if type(desc) == "string" then
- GameTooltip:AddLine(desc, 1, 1, 1, 1)
+ GameTooltip:AddLine(desc, 1, 1, 1, true)
end
GameTooltip:Show()
end
-local function TreeOnButtonLeave(widget, event, value, button)
+local function TreeOnButtonLeave(widget, event, _, value, button)
GameTooltip:Hide()
end
local function GroupExists(appName, options, path, uniquevalue)
- if not uniquevalue then return false end
+ if not uniquevalue then return false end
local feedpath = new()
local temppath = new()
- for i = 1, tgetn(path) do
+ local l = tgetn(path)
+ for i = 1, l do
feedpath[i] = path[i]
end
+ tsetn(feedpath,l)
BuildPath(feedpath, strsplit("\001", uniquevalue))
@@ -1552,7 +1490,8 @@ local function GroupExists(appName, options, path, uniquevalue)
return true
end
-local function GroupSelected(widget, event, uniquevalue)
+local function GroupSelected(widget, event, _, uniquevalue)
+ if not uniquevalue then widget:ReleaseChildren() return end
local user = widget:GetUserDataTable()
@@ -1562,9 +1501,11 @@ local function GroupSelected(widget, event, uniquevalue)
local rootframe = user.rootframe
local feedpath = new()
- for i = 1, tgetn(path) do
+ local l = tgetn(path)
+ for i = 1, l do
feedpath[i] = path[i]
end
+ tsetn(feedpath,l)
BuildPath(feedpath, strsplit("\001", uniquevalue))
local group = options
@@ -1572,6 +1513,7 @@ local function GroupSelected(widget, event, uniquevalue)
group = GetSubOption(group, feedpath[i])
end
widget:ReleaseChildren()
+
AceConfigDialog:FeedGroup(user.appName,options,widget,rootframe,feedpath)
del(feedpath)
@@ -1596,16 +1538,16 @@ Rules:
--]]
function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isRoot)
+
local group = options
--follow the path to get to the curent group
local inline
local grouptype, parenttype = options.childGroups, "none"
-
for i = 1, tgetn(path) do
local v = path[i]
group = GetSubOption(group, v)
- inline = inline or pickfirstset(v.dialogInline,v.guiInline,v.inline, false)
+ inline = inline or pickfirstset(4,group.dialogInline,group.guiInline,group.inline, false)
parenttype = grouptype
grouptype = group.childGroups
end
@@ -1617,14 +1559,14 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
--check if the group has child groups
local hasChildGroups
for k, v in pairs(group.args) do
- if v.type == "group" and not pickfirstset(v.dialogInline,v.guiInline,v.inline, false) and not CheckOptionHidden(v, options, path, appName) then
+ if v.type == "group" and not pickfirstset(4,v.dialogInline,v.guiInline,v.inline, false) and not CheckOptionHidden(v, options, path, appName) then
hasChildGroups = true
end
end
if group.plugins then
for plugin, t in pairs(group.plugins) do
for k, v in pairs(t) do
- if v.type == "group" and not pickfirstset(v.dialogInline,v.guiInline,v.inline, false) and not CheckOptionHidden(v, options, path, appName) then
+ if v.type == "group" and not pickfirstset(4,v.dialogInline,v.guiInline,v.inline, false) and not CheckOptionHidden(v, options, path, appName) then
hasChildGroups = true
end
end
@@ -1708,7 +1650,7 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
local firstgroup = orderlist[1]
if firstgroup then
- select:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup)
+ select:SetGroup((GroupExists(appName, options, path, status.groups.selected) and status.groups.selected) or firstgroup)
end
select.width = "fill"
@@ -1756,7 +1698,7 @@ end
local old_CloseSpecialWindows
-local function RefreshOnUpdate()
+local function RefreshOnUpdate(this)
for appName in pairs(this.closing) do
if AceConfigDialog.OpenFrames[appName] then
AceConfigDialog.OpenFrames[appName]:Hide()
@@ -1850,7 +1792,7 @@ end
-- @param appName The application name as given to `:RegisterOptionsTable()`
-- @param container An optional container frame to feed the options into
-- @param ... The path to open after creating the options window (see `:SelectGroup` for details)
-function AceConfigDialog:Open(appName, container, ...)
+function AceConfigDialog:Open(appName, container, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
if not old_CloseSpecialWindows then
old_CloseSpecialWindows = CloseSpecialWindows
CloseSpecialWindows = function()
@@ -1875,9 +1817,7 @@ function AceConfigDialog:Open(appName, container, ...)
tinsert(path, container)
container = nil
end
- for n = 1, tgetn(arg) do
- tinsert(path, arg[i])
- end
+ BuildPath(path, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
local option = options
if type(container) == "table" and container.type == "BlizOptionsGroup" and tgetn(path) > 0 then
@@ -1886,6 +1826,7 @@ function AceConfigDialog:Open(appName, container, ...)
end
name = format("%s - %s", name, GetOptionsMemberValue("name", option, options, path, appName))
end
+
--if a container is given feed into that
if container then
f = container
@@ -1984,8 +1925,9 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
local BlizOptions = AceConfigDialog.BlizOptions
local key = appName
- for n = 1, tgetn(arg) do
- key = key.."\001"..arg[n]
+ local l = tgetn(arg)
+ for n = 1, l do
+ key = key .. "\001" .. arg[n]
end
if not BlizOptions[appName] then
@@ -1999,10 +1941,10 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
group:SetTitle(name or appName)
group:SetUserData("appName", appName)
- if tgetn(arg) > 0 then
+ if l > 0 then
local path = {}
- for n = 1, tgetn(arg) do
- tinsert(path, arg[n])
+ for n = 1, l do
+ tinsert(path, args[n])
end
group:SetUserData("path", path)
end
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua
index edac987..5e45cd0 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua
@@ -4,29 +4,28 @@
-- * Valid **uiTypes**: "cmd", "dropdown", "dialog". This is verified by the library at call time. \\
-- * The **uiName** field is expected to contain the full name of the calling addon, including version, e.g. "FooBar-1.0". This is verified by the library at call time.\\
-- * The **appName** field is the options table name as given at registration time \\
---
+--
-- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName".
-- @class file
-- @name AceConfigRegistry-3.0
--- @release $Id: AceConfigRegistry-3.0.lua 1105 2013-12-08 22:11:58Z nevcairiel $
-local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0")
-
-local MAJOR, MINOR = "AceConfigRegistry-3.0-ElvUI", 2
+-- @release $Id: AceConfigRegistry-3.0.lua 1139 2016-07-03 07:43:51Z nevcairiel $
+local MAJOR, MINOR = "AceConfigRegistry-3.0", 16
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR)
if not AceConfigRegistry then return end
AceConfigRegistry.tables = AceConfigRegistry.tables or {}
+local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0")
+
if not AceConfigRegistry.callbacks then
AceConfigRegistry.callbacks = CallbackHandler:New(AceConfigRegistry)
end
-- Lua APIs
-local tinsert, tconcat = table.insert, table.concat
-local strfind, strmatch = string.find, string.match
-local tgetn = table.getn
-local type, tostring, select, pairs, unpack = type, tostring, select, pairs, unpack
+local tinsert, tconcat, tgetn = table.insert, table.concat, table.getn
+local strfind = string.find
+local type, tostring, pairs = type, tostring, pairs
local error, assert = error, assert
-----------------------------------------------------------------------
@@ -34,24 +33,24 @@ local error, assert = error, assert
AceConfigRegistry.validated = {
- -- list of options table names ran through :ValidateOptionsTable automatically.
+ -- list of options table names ran through :ValidateOptionsTable automatically.
-- CLEARED ON PURPOSE, since newer versions may have newer validators
cmd = {},
dropdown = {},
dialog = {},
}
-
-
local function err(msg, errlvl, ...)
- local t = {}
- for i=tgetn(arg),1,-1 do
- tinsert(t, (arg[i]))
+ local l = tgetn(arg)
+ local i,j = 1,l
+ while i < j do
+ arg[i], arg[j] = arg[j], arg[i]
+ i = i+1
+ j = j-1
end
- error(MAJOR..":ValidateOptionsTable(): "..tconcat(t,".")..msg, errlvl+2)
+ error(MAJOR..":ValidateOptionsTable(): "..tconcat(arg,".")..msg, errlvl+2)
end
-
local isstring={["string"]=true, _="string"}
local isstringfunc={["string"]=true,["function"]=true, _="string or funcref"}
local istable={["table"]=true, _="table"}
@@ -92,17 +91,6 @@ local basekeys={
func=optmethodfalse,
arg={["*"]=true},
width=optstring,
- customWidth=optnumber,
- textWidth=optmethodbool,
- buttonElvUI=optmethodbool,
- dragdrop=optmethodbool,
- dragOnEnter=optmethodfalse,
- dragOnLeave=optmethodfalse,
- dragOnClick=optmethodfalse,
- dragOnMouseUp=optmethodfalse,
- dragOnMouseDown=optmethodfalse,
- stateSwitchOnClick=optmethodfalse,
- stateSwitchGetText=optmethodfalse,
}
local typedkeys={
@@ -137,6 +125,7 @@ local typedkeys={
dialogControl=optstring,
dropdownControl=optstring,
multiline=optboolnumber,
+ nullable=optbool,
},
toggle={
tristate=optbool,
@@ -156,9 +145,10 @@ local typedkeys={
},
select={
values=ismethodtable,
+ valuesTableDestroyable=optbool, -- Ace3v: if the values table is generated by AceCore.new
style={
- ["nil"]=true,
- ["string"]={dropdown=true,radio=true},
+ ["nil"]=true,
+ ["string"]={dropdown=true,radio=true},
_="string: 'dropdown' or 'radio'"
},
control=optstring,
@@ -168,6 +158,7 @@ local typedkeys={
},
multiselect={
values=ismethodtable,
+ valuesTableDestroyable=optbool, -- Ace3v: if the values table is generated by AceCore.new
style=optstring,
tristate=optbool,
control=optstring,
@@ -176,82 +167,81 @@ local typedkeys={
},
color={
hasAlpha=optmethodbool,
- reset=opttable,
},
keybinding={
-- TODO
},
}
-local function validateKey(k,errlvl,...)
+local function validateKey(k,errlvl,arg)
errlvl=(errlvl or 0)+1
if type(k)~="string" then
- err("["..tostring(k).."] - key is not a string", errlvl,unpack(arg))
+ err("["..tostring(k).."] - key is not a string", errlvl, arg)
end
if strfind(k, "[%c\127]") then
- err("["..tostring(k).."] - key name contained control characters", errlvl,unpack(arg))
+ err("["..tostring(k).."] - key name contained control characters", errlvl, arg)
end
end
-local function validateVal(v, oktypes, errlvl,...)
+local function validateVal(v, oktypes, errlvl, arg)
errlvl=(errlvl or 0)+1
local isok=oktypes[type(v)] or oktypes["*"]
if not isok then
- err(": expected a "..oktypes._..", got '"..tostring(v).."'", errlvl,unpack(arg))
+ err(": expected a "..oktypes._..", got '"..tostring(v).."'", errlvl, arg)
end
if type(isok)=="table" then -- isok was a table containing specific values to be tested for!
if not isok[v] then
- err(": did not expect "..type(v).." value '"..tostring(v).."'", errlvl,unpack(arg))
+ err(": did not expect "..type(v).." value '"..tostring(v).."'", errlvl, arg)
end
end
end
-local function validate(options,errlvl,...)
+local function validate(options,errlvl,arg)
errlvl=(errlvl or 0)+1
-- basic consistency
if type(options)~="table" then
- err(": expected a table, got a "..type(options), errlvl,unpack(arg))
+ err(": expected a table, got a "..type(options), errlvl, arg)
end
if type(options.type)~="string" then
- err(".type: expected a string, got a "..type(options.type), errlvl,unpack(arg))
+ err(".type: expected a string, got a "..type(options.type), errlvl, arg)
end
-
+
-- get type and 'typedkeys' member
local tk = typedkeys[options.type]
if not tk then
- err(".type: unknown type '"..options.type.."'", errlvl,unpack(arg))
+ err(".type: unknown type '"..options.type.."'", errlvl, arg)
end
-
+
-- make sure that all options[] are known parameters
for k,v in pairs(options) do
if not (tk[k] or basekeys[k]) then
- err(": unknown parameter", errlvl,tostring(k),unpack(arg))
+ err(": unknown parameter", errlvl,tostring(k), arg)
end
end
-- verify that required params are there, and that everything is the right type
for k,oktypes in pairs(basekeys) do
- validateVal(options[k], oktypes, errlvl,k,unpack(arg))
+ validateVal(options[k], oktypes, errlvl, k, arg)
end
for k,oktypes in pairs(tk) do
- validateVal(options[k], oktypes, errlvl,k,unpack(arg))
+ validateVal(options[k], oktypes, errlvl, k, arg)
end
-- extra logic for groups
if options.type=="group" then
for k,v in pairs(options.args) do
- validateKey(k,errlvl,"args",unpack(arg))
- validate(v, errlvl,k,"args",unpack(arg))
+ validateKey(k,errlvl,"args", arg)
+ validate(v, errlvl,k,"args", arg)
end
if options.plugins then
for plugname,plugin in pairs(options.plugins) do
if type(plugin)~="table" then
- err(": expected a table, got '"..tostring(plugin).."'", errlvl,tostring(plugname),"plugins",unpack(arg))
+ err(": expected a table, got '"..tostring(plugin).."'", errlvl,tostring(plugname), "plugins", arg)
end
for k,v in pairs(plugin) do
- validateKey(k,errlvl,tostring(plugname),"plugins",unpack(arg))
- validate(v, errlvl,k,tostring(plugname),"plugins",unpack(arg))
+ validateKey(k,errlvl,tostring(plugname),"plugins",arg)
+ validate(v, errlvl,k,tostring(plugname),"plugins",arg)
end
end
end
@@ -279,7 +269,7 @@ end
-- @param appName The application name as given to `:RegisterOptionsTable()`
function AceConfigRegistry:NotifyChange(appName)
if not AceConfigRegistry.tables[appName] then return end
- AceConfigRegistry.callbacks:Fire("ConfigTableChange", appName)
+ AceConfigRegistry.callbacks:Fire("ConfigTableChange", 1, appName)
end
-- -------------------------------------------------------------------
@@ -293,7 +283,7 @@ local function validateGetterArgs(uiType, uiName, errlvl)
if uiType~="cmd" and uiType~="dropdown" and uiType~="dialog" then
error(MAJOR..": Requesting options table: 'uiType' - invalid configuration UI type, expected 'cmd', 'dropdown' or 'dialog'", errlvl)
end
- if not strmatch(uiName, "[A-Za-z]%-[0-9]") then -- Expecting e.g. "MyLib-1.2"
+ if not strfind(uiName, "[A-Za-z]+-[0-9]") then -- Expecting e.g. "MyLib-1.2"
error(MAJOR..": Requesting options table: 'uiName' - badly formatted or missing version number. Expected e.g. 'MyLib-1.2'", errlvl)
end
end
@@ -315,7 +305,7 @@ function AceConfigRegistry:RegisterOptionsTable(appName, options, skipValidation
AceConfigRegistry:ValidateOptionsTable(options, appName, errlvl) -- upgradable
AceConfigRegistry.validated[uiType][appName] = true
end
- return options
+ return options
end
elseif type(options)=="function" then
AceConfigRegistry.tables[appName] = function(uiType, uiName, errlvl)
@@ -353,7 +343,7 @@ function AceConfigRegistry:GetOptionsTable(appName, uiType, uiName)
if not f then
return nil
end
-
+
if uiType then
return f(uiType,uiName,1) -- get the table for us
else
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceDBOptions-3.0/AceDBOptions-3.0.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceDBOptions-3.0/AceDBOptions-3.0.lua
index f4f811e..9857b6a 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceDBOptions-3.0/AceDBOptions-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceDBOptions-3.0/AceDBOptions-3.0.lua
@@ -1,12 +1,15 @@
--- AceDBOptions-3.0 provides a universal AceConfig options screen for managing AceDB-3.0 profiles.
-- @class file
-- @name AceDBOptions-3.0
--- @release $Id: AceDBOptions-3.0.lua 1066 2012-09-18 14:36:49Z nevcairiel $
+-- @release $Id: AceDBOptions-3.0.lua 1140 2016-07-03 07:53:29Z nevcairiel $
local ACEDBO_MAJOR, ACEDBO_MINOR = "AceDBOptions-3.0", 15
local AceDBOptions, oldminor = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR)
if not AceDBOptions then return end -- No upgrade needed
+local AceCore = LibStub("AceCore-3.0")
+local new, del = AceCore.new, AceCore.del
+
-- Lua APIs
local pairs, next = pairs, next
@@ -230,7 +233,6 @@ elseif LOCALE == "ptBR" then
end
local defaultProfiles
-local tmpprofiles = {}
-- Get a list of available profiles for the specified database.
-- You can specify which profiles to include/exclude in the list using the two boolean parameters listed below.
@@ -239,8 +241,8 @@ local tmpprofiles = {}
-- @param nocurrent If true, then getProfileList will not display the current profile in the list
-- @return Hashtable of all profiles with the internal name as keys and the display name as value.
local function getProfileList(db, common, nocurrent)
- local profiles = {}
-
+ local profiles = new()
+ local tmpprofiles = new()
-- copy existing profiles into the table
local currentProfile = db:GetCurrentProfile()
for i,v in pairs(db:GetProfiles(tmpprofiles)) do
@@ -248,6 +250,7 @@ local function getProfileList(db, common, nocurrent)
profiles[v] = v
end
end
+ del(tmpprofiles)
-- add our default profiles to choose from ( or rename existing profiles)
for k,v in pairs(defaultProfiles) do
@@ -290,6 +293,8 @@ end
"common" - returns all avaialble profiles + some commonly used profiles ("char - realm", "realm", "class", "Default")
"both" - common except the active profile
]]
+-- Ace3v: It is recommanded to destroy the returned table by AceCore.del
+-- if it is no longer needed
function OptionsHandlerPrototype:ListProfiles(info)
local arg = info.arg
local profiles
@@ -308,7 +313,9 @@ end
function OptionsHandlerPrototype:HasNoProfiles(info)
local profiles = self:ListProfiles(info)
- return ((not next(profiles)) and true or false)
+ local r = (not next(profiles)) and true or false
+ del(profiles)
+ return r
end
--[[ Copy a profile ]]
@@ -371,8 +378,7 @@ local optionsTable = {
current = {
order = 11,
type = "description",
- --name = function(info) return L["current"] .. " " .. NORMAL_FONT_COLOR_CODE .. info.handler:GetCurrentProfile() .. FONT_COLOR_CODE_CLOSE end,
- name = "t",
+ name = function(info) return L["current"] .. " " .. NORMAL_FONT_COLOR_CODE .. info.handler:GetCurrentProfile() .. FONT_COLOR_CODE_CLOSE end,
width = "default",
},
choosedesc = {
@@ -387,6 +393,7 @@ local optionsTable = {
order = 30,
get = false,
set = "SetProfile",
+ nullable = false, -- Ace3v: we do not want a null or empty value
},
choose = {
name = L["choose"],
@@ -396,6 +403,7 @@ local optionsTable = {
get = "GetCurrentProfile",
set = "SetProfile",
values = "ListProfiles",
+ valuesTableDestroyable = true,
arg = "common",
},
copydesc = {
@@ -411,6 +419,7 @@ local optionsTable = {
get = false,
set = "CopyProfile",
values = "ListProfiles",
+ valuesTableDestroyable = true,
disabled = "HasNoProfiles",
arg = "nocurrent",
},
@@ -427,6 +436,7 @@ local optionsTable = {
get = false,
set = "DeleteProfile",
values = "ListProfiles",
+ valuesTableDestroyable = true,
disabled = "HasNoProfiles",
arg = "nocurrent",
confirm = true,
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/AceGUI-3.0.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/AceGUI-3.0.lua
index 02ca207..a0cddf8 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/AceGUI-3.0.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/AceGUI-3.0.lua
@@ -1,6 +1,6 @@
--- **AceGUI-3.0** provides access to numerous widgets which can be used to create GUIs.
-- AceGUI is used by AceConfigDialog to create the option GUIs, but you can use it by itself
--- to create any custom GUI. There are more extensive examples in the test suite in the Ace3
+-- to create any custom GUI. There are more extensive examples in the test suite in the Ace3
-- stand-alone distribution.
--
-- **Note**: When using AceGUI-3.0 directly, please do not modify the frames of the widgets directly,
@@ -30,13 +30,17 @@ local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)
if not AceGUI then return end -- No upgrade needed
+local AceCore = LibStub("AceCore-3.0")
+local hooksecurefunc = AceCore.hooksecurefunc
+local safecall = AceCore.safecall
+
-- Lua APIs
-local tconcat, tgetn, tremove, tinsert = table.concat, table.getn,table.remove, table.insert
-local gsub, strupper = string.gsub, string.upper
-local select, pairs, next, type = select, pairs, next, type
+local tconcat, tremove, tinsert, tgetn, tsetn = table.concat, table.remove, table.insert, table.getn, table.setn
+local pairs, next, type = pairs, next, type
local error, assert, loadstring = error, assert, loadstring
local setmetatable, rawget, rawset = setmetatable, rawget, rawset
local math_max = math.max
+local strupper, strfmt = string.upper, string.format
-- WoW APIs
local UIParent = UIParent
@@ -52,73 +56,17 @@ AceGUI.LayoutRegistry = AceGUI.LayoutRegistry or {}
AceGUI.WidgetBase = AceGUI.WidgetBase or {}
AceGUI.WidgetContainerBase = AceGUI.WidgetContainerBase or {}
AceGUI.WidgetVersions = AceGUI.WidgetVersions or {}
-
+AceGUI.HookedFunctions = AceGUI.HookedFunctions or {}
+
-- local upvalues
local WidgetRegistry = AceGUI.WidgetRegistry
local LayoutRegistry = AceGUI.LayoutRegistry
local WidgetVersions = AceGUI.WidgetVersions
-
---[[
- xpcall safecall implementation
-]]
-local xpcall = xpcall
-
-local function errorhandler(err)
- return geterrorhandler()(err)
-end
-
-local function CreateDispatcher(argCount)
- local code = [[
- local method, ARGS
- local function call() return method(ARGS) end
-
- local function dispatch(func, ...)
- method = func
- if not method then return end
- ARGS = unpack(arg)
- return xpcall(call, function(err) return geterrorhandler()(err) end)
- end
-
- return dispatch
- ]]
-
- local ARGS = {}
- for i = 1, argCount do ARGS[i] = "arg"..i end
- code = gsub(code, "ARGS", tconcat(ARGS, ", "))
- return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler)
-end
-
-local Dispatchers = setmetatable({}, {__index=function(self, argCount)
- local dispatcher = CreateDispatcher(argCount)
- rawset(self, argCount, dispatcher)
- return dispatcher
-end})
-Dispatchers[0] = function(func)
- return xpcall(func, errorhandler)
-end
-
-local function safecall(func, ...)
- return Dispatchers[tgetn(arg)](func, unpack(arg))
-end
+local HookedFunctions = AceGUI.HookedFunctions
-- Recycling functions
local newWidget, delWidget
do
- -- Version Upgrade in Minor 29
- -- Internal Storage of the objects changed, from an array table
- -- to a hash table, and additionally we introduced versioning on
- -- the widgets which would discard all widgets from a pre-29 version
- -- anyway, so we just clear the storage now, and don't try to
- -- convert the storage tables to the new format.
- -- This should generally not cause *many* widgets to end up in trash,
- -- since once dialogs are opened, all addons should be loaded already
- -- and AceGUI should be on the latest version available on the users
- -- setup.
- -- -- nevcairiel - Nov 2nd, 2009
- if oldminor and oldminor < 29 and AceGUI.objPools then
- AceGUI.objPools = nil
- end
-
AceGUI.objPools = AceGUI.objPools or {}
local objPools = AceGUI.objPools
--Returns a new instance, if none are available either returns a new table or calls the given contructor
@@ -126,11 +74,11 @@ do
if not WidgetRegistry[type] then
error("Attempt to instantiate unknown widget type", 2)
end
-
+
if not objPools[type] then
objPools[type] = {}
end
-
+
local newObj = next(objPools[type])
if not newObj then
newObj = WidgetRegistry[type]()
@@ -157,6 +105,35 @@ do
end
end
+-- Ace3v: when a container contains many children, we can only use the variable arguments
+local function _fixlevels(parent, ...)
+ local lv = parent:GetFrameLevel() + 1
+ for i = 1, tgetn(arg) do
+ local child = arg[i]
+ child:SetFrameLevel(lv)
+ _fixlevels(child, child:GetChildren())
+ end
+end
+
+local function fixlevels(parent)
+ return _fixlevels(parent, parent:GetChildren())
+end
+AceGUI.fixlevels = fixlevels
+
+-- Ace3v: attention! this function is recursive
+local function _fixstrata(strata, parent, ...)
+ parent:SetFrameStrata(strata)
+ for i = 1, tgetn(arg) do
+ local child = arg[i]
+ _fixstrata(strata, child, child:GetChildren())
+ end
+end
+
+local function fixstrata(strata, parent)
+ return _fixstrata(strata, parent, parent:GetChildren())
+end
+AceGUI.fixstrata = fixstrata
+
-------------------
-- API Functions --
@@ -173,27 +150,15 @@ function AceGUI:Create(type)
if WidgetRegistry[type] then
local widget = newWidget(type)
- if rawget(widget, "Acquire") then
- widget.OnAcquire = widget.Acquire
- widget.Acquire = nil
- elseif rawget(widget, "Aquire") then
- widget.OnAcquire = widget.Aquire
- widget.Aquire = nil
- end
-
- if rawget(widget, "Release") then
- widget.OnRelease = rawget(widget, "Release")
- widget.Release = nil
- end
-
if widget.OnAcquire then
widget:OnAcquire()
else
- error(format("Widget type %s doesn't supply an OnAcquire Function", type))
+ error(strfmt("Widget type %s doesn't supply an OnAcquire Function", type))
end
+
-- Set the default Layout ("List")
- safecall(widget.SetLayout, widget, "List")
- safecall(widget.ResumeLayout, widget)
+ safecall(widget.SetLayout, 2, widget, "List")
+ safecall(widget.ResumeLayout, 1, widget)
return widget
end
end
@@ -204,14 +169,14 @@ end
-- If this widget is a Container-Widget, all of its Child-Widgets will be releases as well.
-- @param widget The widget to release
function AceGUI:Release(widget)
- safecall(widget.PauseLayout, widget)
+ safecall(widget.PauseLayout, 1, widget)
widget:Fire("OnRelease")
- safecall(widget.ReleaseChildren, widget)
+ safecall(widget.ReleaseChildren, 1, widget)
if widget.OnRelease then
widget:OnRelease()
-- else
--- error(format("Widget type %s doesn't supply an OnRelease Function", widget.type))
+-- error(strfmt("Widget type %s doesn't supply an OnRelease Function", widget.type))
end
for k in pairs(widget.userdata) do
widget.userdata[k] = nil
@@ -246,7 +211,7 @@ end
-- @param widget The widget that should be focused
function AceGUI:SetFocus(widget)
if self.FocusedWidget and self.FocusedWidget ~= widget then
- safecall(self.FocusedWidget.ClearFocus, self.FocusedWidget)
+ safecall(self.FocusedWidget.ClearFocus, 1, self.FocusedWidget)
end
self.FocusedWidget = widget
end
@@ -256,7 +221,7 @@ end
-- e.g. titlebar of a frame being clicked
function AceGUI:ClearFocus()
if self.FocusedWidget then
- safecall(self.FocusedWidget.ClearFocus, self.FocusedWidget)
+ safecall(self.FocusedWidget.ClearFocus, 1, self.FocusedWidget)
self.FocusedWidget = nil
end
end
@@ -267,18 +232,18 @@ end
--[[
Widgets must provide the following functions
OnAcquire() - Called when the object is acquired, should set everything to a default hidden state
-
+
And the following members
frame - the frame or derivitive object that will be treated as the widget for size and anchoring purposes
type - the type of the object, same as the name given to :RegisterWidget()
-
+
Widgets contain a table called userdata, this is a safe place to store data associated with the wigdet
It will be cleared automatically when a widget is released
Placing values directly into a widget object should be avoided
-
+
If the Widget can act as a container for other Widgets the following
content - frame or derivitive that children will be anchored to
-
+
The Widget can supply the following Optional Members
:OnRelease() - Called when the object is Released, should remove any additional anchors and clear any data
:OnWidthSet(width) - Called when the width of the widget is changed
@@ -294,30 +259,33 @@ end
-- Widget Base Template --
--------------------------
do
- local WidgetBase = AceGUI.WidgetBase
-
+ local WidgetBase = AceGUI.WidgetBase
+
WidgetBase.SetParent = function(self, parent)
local frame = self.frame
frame:SetParent(nil)
frame:SetParent(parent.content)
self.parent = parent
+ fixlevels(frame)
end
-
+
WidgetBase.SetCallback = function(self, name, func)
if type(func) == "function" then
self.events[name] = func
end
end
-
- WidgetBase.Fire = function(self, name, ...)
- if self.events[name] then
- local success, ret = safecall(self.events[name], self, name, unpack(arg))
+
+ WidgetBase.Fire = function(self,name,argc,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ argc = argc or 0
+ local func = self.events[name]
+ if func then
+ local success, ret = safecall(func,argc+3,self,name,argc,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
if success then
return ret
end
end
end
-
+
WidgetBase.SetWidth = function(self, width)
self.frame:SetWidth(width)
self.frame.width = width
@@ -325,7 +293,7 @@ do
self:OnWidthSet(width)
end
end
-
+
WidgetBase.SetRelativeWidth = function(self, width)
if width <= 0 or width > 1 then
error(":SetRelativeWidth(width): Invalid relative width.", 2)
@@ -333,7 +301,7 @@ do
self.relWidth = width
self.width = "relative"
end
-
+
WidgetBase.SetHeight = function(self, height)
self.frame:SetHeight(height)
self.frame.height = height
@@ -341,7 +309,7 @@ do
self:OnHeightSet(height)
end
end
-
+
--[[ WidgetBase.SetRelativeHeight = function(self, height)
if height <= 0 or height > 1 then
error(":SetRelativeHeight(height): Invalid relative height.", 2)
@@ -353,47 +321,47 @@ do
WidgetBase.IsVisible = function(self)
return self.frame:IsVisible()
end
-
+
WidgetBase.IsShown= function(self)
return self.frame:IsShown()
end
-
+
WidgetBase.Release = function(self)
AceGUI:Release(self)
end
-
- WidgetBase.SetPoint = function(self, ...)
- return self.frame:SetPoint(unpack(arg))
+
+ WidgetBase.SetPoint = function(self,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ return self.frame:SetPoint(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
end
-
+
WidgetBase.ClearAllPoints = function(self)
return self.frame:ClearAllPoints()
end
-
+
WidgetBase.GetNumPoints = function(self)
return self.frame:GetNumPoints()
end
-
- WidgetBase.GetPoint = function(self, ...)
- return self.frame:GetPoint(unpack(arg))
- end
-
+
+ WidgetBase.GetPoint = function(self,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ return self.frame:GetPoint(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ end
+
WidgetBase.GetUserDataTable = function(self)
return self.userdata
end
-
+
WidgetBase.SetUserData = function(self, key, value)
self.userdata[key] = value
end
-
+
WidgetBase.GetUserData = function(self, key)
return self.userdata[key]
end
-
+
WidgetBase.IsFullHeight = function(self)
return self.height == "fill"
end
-
+
WidgetBase.SetFullHeight = function(self, isFull)
if isFull then
self.height = "fill"
@@ -401,11 +369,11 @@ do
self.height = nil
end
end
-
+
WidgetBase.IsFullWidth = function(self)
return self.width == "fill"
end
-
+
WidgetBase.SetFullWidth = function(self, isFull)
if isFull then
self.width = "fill"
@@ -413,29 +381,29 @@ do
self.width = nil
end
end
-
+
-- local function LayoutOnUpdate(this)
-- this:SetScript("OnUpdate",nil)
-- this.obj:PerformLayout()
-- end
-
+
local WidgetContainerBase = AceGUI.WidgetContainerBase
-
+
WidgetContainerBase.PauseLayout = function(self)
self.LayoutPaused = true
end
-
+
WidgetContainerBase.ResumeLayout = function(self)
self.LayoutPaused = nil
end
-
+
WidgetContainerBase.PerformLayout = function(self)
if self.LayoutPaused then
return
end
- safecall(self.LayoutFunc, self.content, self.children)
+ safecall(self.LayoutFunc, 2, self.content, self.children)
end
-
+
--call this function to layout, makes sure layed out objects get a frame to get sizes etc
WidgetContainerBase.DoLayout = function(self)
self:PerformLayout()
@@ -443,7 +411,7 @@ do
-- self.frame:SetScript("OnUpdate", LayoutOnUpdate)
-- end
end
-
+
WidgetContainerBase.AddChild = function(self, child, beforeWidget)
if beforeWidget then
local siblingIndex = 1
@@ -451,7 +419,7 @@ do
if widget == beforeWidget then
break
end
- siblingIndex = siblingIndex + 1
+ siblingIndex = siblingIndex + 1
end
tinsert(self.children, siblingIndex, child)
else
@@ -461,25 +429,52 @@ do
child.frame:Show()
self:DoLayout()
end
-
- WidgetContainerBase.AddChildren = function(self, ...)
- for i = 1, tgetn(arg) do
- local child = arg[i]
+
+ do
+ local args = {nil,nil,nil,nil,nil,nil,nil,nil,nil,nil}
+ WidgetContainerBase.AddChildren = function(self,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ args[1] = a1
+ args[2] = a2
+ args[3] = a3
+ args[4] = a4
+ args[5] = a5
+ args[6] = a6
+ args[7] = a7
+ args[8] = a8
+ args[9] = a9
+ args[10] = a10
+ for i = 1,10 do
+ local child = args[i]
+ arg[i] = nil
+
+ if not child then break end
tinsert(self.children, child)
child:SetParent(self)
child.frame:Show()
end
self:DoLayout()
end
-
+ end -- WidgetContainerBase.AddChildren
+
WidgetContainerBase.ReleaseChildren = function(self)
local children = self.children
for i = 1,tgetn(children) do
- AceGUI:Release(children[i])
- children[i] = nil
+ AceGUI:Release(tremove(children))
end
end
-
+
+ WidgetContainerBase.SetParent = function(self, parent)
+ WidgetBase.SetParent(self, parent)
+
+ local lv = self.frame:GetFrameLevel()
+ self.content:SetFrameLevel(lv+1)
+ local children = self.children
+ for i = 1,tgetn(children) do
+ local child = children[i]
+ child:SetParent(self)
+ end
+ end
+
WidgetContainerBase.SetLayout = function(self, Layout)
self.LayoutFunc = AceGUI:GetLayout(Layout)
end
@@ -503,7 +498,7 @@ do
end
end
end
-
+
local function ContentResize()
if this:GetWidth() and this:GetHeight() then
this.width = this:GetWidth()
@@ -515,7 +510,7 @@ do
setmetatable(WidgetContainerBase, {__index=WidgetBase})
--One of these function should be called on each Widget Instance as part of its creation process
-
+
--- Register a widget-class as a container for newly created widgets.
-- @param widget The widget class
function AceGUI:RegisterAsContainer(widget)
@@ -531,7 +526,7 @@ do
widget:SetLayout("List")
return widget
end
-
+
--- Register a widget-class as a widget.
-- @param widget The widget class
function AceGUI:RegisterAsWidget(widget)
@@ -558,11 +553,11 @@ end
-- @param Version The version of the widget
function AceGUI:RegisterWidgetType(Name, Constructor, Version)
assert(type(Constructor) == "function")
- assert(type(Version) == "number")
-
+ assert(type(Version) == "number")
+
local oldVersion = WidgetVersions[Name]
if oldVersion and oldVersion >= Version then return end
-
+
WidgetVersions[Name] = Version
WidgetRegistry[Name] = Constructor
end
@@ -573,7 +568,7 @@ end
function AceGUI:RegisterLayout(Name, LayoutFunc)
assert(type(LayoutFunc) == "function")
if type(Name) == "string" then
- Name = strupper(Name)
+ Name = string.upper(Name)
end
LayoutRegistry[Name] = LayoutFunc
end
@@ -631,7 +626,7 @@ AceGUI:RegisterLayout("List",
local width = content.width or content:GetWidth() or 0
for i = 1, tgetn(children) do
local child = children[i]
-
+
local frame = child.frame
frame:ClearAllPoints()
frame:Show()
@@ -640,25 +635,25 @@ AceGUI:RegisterLayout("List",
else
frame:SetPoint("TOPLEFT", children[i-1].frame, "BOTTOMLEFT")
end
-
+
if child.width == "fill" then
child:SetWidth(width)
frame:SetPoint("RIGHT", content)
-
+
if child.DoLayout then
child:DoLayout()
end
elseif child.width == "relative" then
child:SetWidth(width * child.relWidth)
-
+
if child.DoLayout then
child:DoLayout()
end
end
-
+
height = height + (frame.height or frame:GetHeight() or 0)
end
- safecall(content.obj.LayoutFinished, content.obj, nil, height)
+ safecall(content.obj.LayoutFinished, 3, content.obj, nil, height)
end)
-- A single control fills the whole content area
@@ -669,14 +664,15 @@ AceGUI:RegisterLayout("Fill",
children[1]:SetHeight(content:GetHeight() or 0)
children[1].frame:SetAllPoints(content)
children[1].frame:Show()
- safecall(content.obj.LayoutFinished, content.obj, nil, children[1].frame:GetHeight())
+ safecall(content.obj.LayoutFinished, 3, content.obj, nil, children[1].frame:GetHeight())
end
end)
+-- Ace3v: currently only a1 used
local layoutrecursionblock = nil
-local function safelayoutcall(object, func, ...)
+local function safelayoutcall(object, func, a1)
layoutrecursionblock = true
- object[func](object, unpack(arg))
+ object[func](object, a1)
layoutrecursionblock = nil
end
@@ -691,18 +687,18 @@ AceGUI:RegisterLayout("Flow",
local rowheight = 0
local rowoffset = 0
local lastrowoffset
-
+
local width = content.width or content:GetWidth() or 0
-
+
--control at the start of the row
local rowstart
local rowstartoffset
local lastrowstart
local isfullheight
-
+
local frameoffset
local lastframeoffset
- local oversize
+ local oversize
for i = 1, tgetn(children) do
local child = children[i]
oversize = nil
@@ -710,17 +706,17 @@ AceGUI:RegisterLayout("Flow",
local frameheight = frame.height or frame:GetHeight() or 0
local framewidth = frame.width or frame:GetWidth() or 0
lastframeoffset = frameoffset
- -- HACK: Why did we set a frameoffset of (frameheight / 2) ?
+ -- HACK: Why did we set a frameoffset of (frameheight / 2) ?
-- That was moving all widgets half the widgets size down, is that intended?
-- Actually, it seems to be neccessary for many cases, we'll leave it in for now.
-- If widgets seem to anchor weirdly with this, provide a valid alignoffset for them.
-- TODO: Investigate moar!
frameoffset = child.alignoffset or (frameheight / 2)
-
+
if child.width == "relative" then
framewidth = width * child.relWidth
end
-
+
frame:Show()
frame:ClearAllPoints()
if i == 1 then
@@ -759,11 +755,11 @@ AceGUI:RegisterLayout("Flow",
else
--handles cases where the new height is higher than either control because of the offsets
--math.max(rowheight-rowoffset+frameoffset, frameheight-frameoffset+rowoffset)
-
+
--offset is always the larger of the two offsets
rowoffset = math_max(rowoffset, frameoffset)
rowheight = math_max(rowheight, rowoffset + (frameheight / 2))
-
+
frame:SetPoint("TOPLEFT", children[i-1].frame, "TOPRIGHT", 0, frameoffset - lastframeoffset)
usedwidth = framewidth + usedwidth
end
@@ -772,11 +768,11 @@ AceGUI:RegisterLayout("Flow",
if child.width == "fill" then
safelayoutcall(child, "SetWidth", width)
frame:SetPoint("RIGHT", content)
-
+
usedwidth = 0
rowstart = frame
rowstartoffset = frameoffset
-
+
if child.DoLayout then
child:DoLayout()
end
@@ -785,7 +781,7 @@ AceGUI:RegisterLayout("Flow",
rowstartoffset = rowoffset
elseif child.width == "relative" then
safelayoutcall(child, "SetWidth", width * child.relWidth)
-
+
if child.DoLayout then
child:DoLayout()
end
@@ -794,20 +790,20 @@ AceGUI:RegisterLayout("Flow",
frame:SetPoint("RIGHT", content)
end
end
-
+
if child.height == "fill" then
frame:SetPoint("BOTTOM", content)
isfullheight = true
end
end
-
+
--anchor the last row, if its full height needs a special case since its height has just been changed by the anchor
if isfullheight then
rowstart:SetPoint("TOPLEFT", content, "TOPLEFT", 0, -height)
elseif rowstart then
rowstart:SetPoint("TOPLEFT", content, "TOPLEFT", 0, -(height + (rowoffset - rowstartoffset) + 3))
end
-
+
height = height + rowheight + 3
- safecall(content.obj.LayoutFinished, content.obj, nil, height)
+ safecall(content.obj.LayoutFinished, 3, content.obj, nil, height)
end)
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/AceGUI-3.0.xml b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/AceGUI-3.0.xml
index 26728f9..0419ee2 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/AceGUI-3.0.xml
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/AceGUI-3.0.xml
@@ -1,5 +1,4 @@
-
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua
index b0f81b7..777dbef 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua
@@ -15,11 +15,11 @@ local CreateFrame = CreateFrame
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
-local function SelectedGroup(self, event, value)
+local function SelectedGroup(self, event, _, value)
local group = self.parentgroup
local status = group.status or group.localstatus
status.selected = value
- self.parentgroup:Fire("OnGroupSelected", value)
+ self.parentgroup:Fire("OnGroupSelected", 1, value)
end
--[[-----------------------------------------------------------------------------
@@ -63,7 +63,7 @@ local methods = {
self.dropdown:SetValue(group)
local status = self.status or self.localstatus
status.selected = group
- self:Fire("OnGroupSelected", group)
+ self:Fire("OnGroupSelected", 1, group)
end,
["OnWidthSet"] = function(self, width)
@@ -150,7 +150,7 @@ local function Constructor()
widget[method] = func
end
dropdown.parentgroup = widget
-
+
return AceGUI:RegisterAsContainer(widget)
end
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua
index e63b4c1..19e0a0c 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua
@@ -1,13 +1,15 @@
--[[-----------------------------------------------------------------------------
Frame Container
-------------------------------------------------------------------------------]]
-local Type, Version = "Frame", 26
+local Type, Version = "Frame", 24
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
+local AceCore = LibStub("AceCore-3.0")
+local wipe = AceCore.wipe
+
-- Lua APIs
local pairs, assert, type = pairs, assert, type
-local wipe = table.wipe
-- WoW APIs
local PlaySound = PlaySound
@@ -25,10 +27,6 @@ local function Button_OnClick()
this.obj:Hide()
end
-local function Frame_OnShow()
- this.obj:Fire("OnShow")
-end
-
local function Frame_OnClose()
this.obj:Fire("OnClose")
end
@@ -190,7 +188,6 @@ local function Constructor()
frame:SetBackdropColor(0, 0, 0, 1)
frame:SetMinResize(400, 200)
frame:SetToplevel(true)
- frame:SetScript("OnShow", Frame_OnShow)
frame:SetScript("OnHide", Frame_OnClose)
frame:SetScript("OnMouseDown", Frame_OnMouseDown)
@@ -248,6 +245,7 @@ local function Constructor()
titlebg_r:SetWidth(30)
titlebg_r:SetHeight(40)
+ -- bottom right sizer
local sizer_se = CreateFrame("Frame", nil, frame)
sizer_se:SetPoint("BOTTOMRIGHT", 0, 0)
sizer_se:SetWidth(25)
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
index 59266eb..ac1d343 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua
@@ -6,9 +6,12 @@ local Type, Version = "ScrollFrame", 24
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
+local fixlevels = AceGUI.fixlevels
+
-- Lua APIs
local pairs, assert, type = pairs, assert, type
local min, max, floor, abs = math.min, math.max, math.floor, math.abs
+local format = string.format
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
@@ -24,23 +27,23 @@ end
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
-local function ScrollFrame_OnMouseWheel(frame, value)
- frame.obj:MoveScroll(value)
+local function ScrollFrame_OnMouseWheel()
+ this.obj:MoveScroll(arg1)
end
local function ScrollFrame_OnSizeChanged()
this:SetScript("OnUpdate", FixScrollOnUpdate)
end
-local function ScrollBar_OnScrollValueChanged(frame, value)
- frame.obj:SetScroll(value)
+local function ScrollBar_OnScrollValueChanged()
+ this.obj:SetScroll(arg1)
end
--[[-----------------------------------------------------------------------------
Methods
-------------------------------------------------------------------------------]]
local methods = {
- ["OnAcquire"] = function(self)
+ ["OnAcquire"] = function(self)
self:SetScroll(0)
self.scrollframe:SetScript("OnUpdate", FixScrollOnUpdate)
end,
@@ -50,7 +53,7 @@ local methods = {
for k in pairs(self.localstatus) do
self.localstatus[k] = nil
end
- self.scrollframe:SetPoint("BOTTOMRIGHT", 0, 0)
+ self.scrollframe:SetPoint("BOTTOMRIGHT",0,0)
self.scrollbar:Hide()
self.scrollBarShown = nil
self.content.height, self.content.width = nil, nil
@@ -77,7 +80,7 @@ local methods = {
["MoveScroll"] = function(self, value)
local status = self.status or self.localstatus
local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight()
-
+
if self.scrollBarShown then
local diff = height - viewheight
local delta = 1
@@ -89,40 +92,46 @@ local methods = {
end,
["FixScroll"] = function(self)
+
if self.updateLock then return end
self.updateLock = true
local status = self.status or self.localstatus
- local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight()
+ local scrollframe, content, scrollbar = self.scrollframe, self.content, self.scrollbar
+ local viewheight, height = self.scrollframe:GetHeight(), self.content:GetHeight()
local offset = status.offset or 0
- local curvalue = self.scrollbar:GetValue()
+ local curvalue = scrollbar:GetValue()
-- Give us a margin of error of 2 pixels to stop some conditions that i would blame on floating point inaccuracys
-- No-one is going to miss 2 pixels at the bottom of the frame, anyhow!
- if viewheight < height + 2 then
+
+ if height < viewheight + 2 then
if self.scrollBarShown then
self.scrollBarShown = nil
- self.scrollbar:Hide()
- self.scrollbar:SetValue(0)
- self.scrollframe:SetPoint("BOTTOMRIGHT", 0, 0)
+ scrollbar:Hide()
+ scrollbar:SetValue(0)
+ scrollframe:SetPoint("BOTTOMRIGHT",0,0)
self:DoLayout()
end
+ offset = 0
else
if not self.scrollBarShown then
self.scrollBarShown = true
- self.scrollbar:Show()
- self.scrollframe:SetPoint("BOTTOMRIGHT", -20, 0)
+ scrollbar:Show()
+ scrollframe:SetPoint("BOTTOMRIGHT", -20, 0)
self:DoLayout()
end
- local value = (offset / (viewheight - height) * 1000)
- if value > 1000 then value = 1000 end
- self.scrollbar:SetValue(value)
- self:SetScroll(value)
- if value < 1000 then
- self.content:ClearAllPoints()
- self.content:SetPoint("TOPLEFT", 0, offset)
- self.content:SetPoint("TOPRIGHT", 0, offset)
- status.offset = offset
+ local value = (offset / (height - viewheight) * 1000)
+ if value > 1000 then
+ value = 1000
+ offset = height - viewheight
end
+ scrollbar:SetValue(value)
+ self:SetScroll(value)
end
+ status.offset = offset
+ scrollframe:SetScrollChild(content)
+ content:ClearAllPoints()
+ content:SetPoint("TOPLEFT", 0, offset)
+ content:SetPoint("TOPRIGHT", 0, offset)
self.updateLock = nil
end,
@@ -157,8 +166,8 @@ local function Constructor()
local num = AceGUI:GetNextWidgetNum(Type)
local scrollframe = CreateFrame("ScrollFrame", nil, frame)
- scrollframe:SetPoint("TOPLEFT", 0, 0)
- scrollframe:SetPoint("BOTTOMRIGHT", 0, 0)
+ scrollframe:SetPoint("TOPLEFT",0,0)
+ scrollframe:SetPoint("BOTTOMRIGHT",0,0)
scrollframe:EnableMouseWheel(true)
scrollframe:SetScript("OnMouseWheel", ScrollFrame_OnMouseWheel)
scrollframe:SetScript("OnSizeChanged", ScrollFrame_OnSizeChanged)
@@ -180,8 +189,8 @@ local function Constructor()
--Container Support
local content = CreateFrame("Frame", nil, scrollframe)
- content:SetPoint("TOPLEFT", 0, 0)
- content:SetPoint("TOPRIGHT", 0, 0)
+ content:SetPoint("TOPLEFT",0,0)
+ content:SetPoint("TOPRIGHT",0,0)
content:SetHeight(400)
scrollframe:SetScrollChild(content)
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua
index c17f6c4..c195b59 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua
@@ -2,18 +2,22 @@
TabGroup Container
Container that uses tabs on top to switch between groups.
-------------------------------------------------------------------------------]]
-local Type, Version = "TabGroup", 36
+local Type, Version = "TabGroup", 35
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
+local AceCore = LibStub("AceCore-3.0")
+local wipe = AceCore.wipe
+
-- Lua APIs
local pairs, ipairs, assert, type, wipe = pairs, ipairs, assert, type, wipe
local tgetn = table.getn
+local strfmt = string.format
-- WoW APIs
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
-local _G = _G
+local _G = AceCore._G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
@@ -30,57 +34,60 @@ Support functions
local function UpdateTabLook(frame)
if frame.disabled then
PanelTemplates_SetDisabledTabState(frame)
+ frame:SetAlpha(0.5)
elseif frame.selected then
PanelTemplates_SelectTab(frame)
+ frame:SetAlpha(1)
else
PanelTemplates_DeselectTab(frame)
+ frame:SetAlpha(0.5)
end
end
-local function Tab_SetText(frame, text)
- frame:_SetText(text)
- local width = frame.obj.frame.width or frame.obj.frame:GetWidth() or 0
- PanelTemplates_TabResize(frame, 0, nil, width, frame:GetFontString():GetStringWidth())
+local function Tab_SetText(tab, text)
+ tab:_SetText(text)
+ local width = tab.obj.frame.width or tab.obj.frame:GetWidth() or 0
+ PanelTemplates_TabResize(0, tab, nil, width)
end
-local function Tab_SetSelected(frame, selected)
- frame.selected = selected
- UpdateTabLook(frame)
+local function Tab_SetSelected(tab, selected)
+ tab.selected = selected
+ UpdateTabLook(tab)
end
-local function Tab_SetDisabled(frame, disabled)
- frame.disabled = disabled
- UpdateTabLook(frame)
+local function Tab_SetDisabled(tab, disabled)
+ tab.disabled = disabled
+ UpdateTabLook(tab)
end
-local function BuildTabsOnUpdate(frame)
- local self = frame.obj
+local function BuildTabsOnUpdate()
+ local self = this.obj
self:BuildTabs()
- frame:SetScript("OnUpdate", nil)
+ this:SetScript("OnUpdate", nil)
end
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
-local function Tab_OnClick(frame)
- if not (frame.selected or frame.disabled) then
+local function Tab_OnClick()
+ if not (this.selected or this.disabled) then
PlaySound("igCharacterInfoTab")
- frame.obj:SelectTab(frame.value)
+ this.obj:SelectTab(this.value)
end
end
-local function Tab_OnEnter(frame)
- local self = frame.obj
- self:Fire("OnTabEnter", self.tabs[frame.id].value, frame)
+local function Tab_OnEnter()
+ local self = this.obj
+ self:Fire("OnTabEnter", 2, self.tabs[this.id].value, this)
end
-local function Tab_OnLeave(frame)
- local self = frame.obj
- self:Fire("OnTabLeave", self.tabs[frame.id].value, frame)
+local function Tab_OnLeave()
+ local self = this.obj
+ self:Fire("OnTabLeave", 2, self.tabs[this.id].value, this)
end
-local function Tab_OnShow(frame)
- _G[frame:GetName().."HighlightTexture"]:SetWidth(frame:GetTextWidth() + 30)
+local function Tab_OnShow()
+ _G[this:GetName().."HighlightTexture"]:SetWidth(this:GetTextWidth() + 30)
end
--[[-----------------------------------------------------------------------------
@@ -103,16 +110,31 @@ local methods = {
end,
["CreateTab"] = function(self, id)
- local tabname = format("AceGUITabGroup%dTab%d", self.num, id)
- local tab = CreateFrame("Button", tabname, self.border, "OptionsFrameTabButtonTemplate")
+ local tabname = strfmt("AceGUITabGroup%dTab%d", self.num, id)
+ local tab = CreateFrame("Button", tabname, self.border, "TabButtonTemplate")
+ -- Normal texture
+ local texture = getglobal(tabname.."Left")
+ texture:SetTexture("Interface\\ChatFrame\\ChatFrameTab")
+ texture:ClearAllPoints()
+ texture:SetPoint("BOTTOMLEFT", tab,"BOTTOMLEFT")
+ texture:SetPoint("TOPLEFT", tab,"TOPLEFT")
+ texture = getglobal(tabname.."Middle")
+ texture:SetTexture("Interface\\ChatFrame\\ChatFrameTab")
+ texture = getglobal(tabname.."Right")
+ texture:SetTexture("Interface\\ChatFrame\\ChatFrameTab")
+ -- Disabled texture
+ texture = getglobal(tabname.."LeftDisabled")
+ texture:SetTexture("Interface\\ChatFrame\\ChatFrameTab")
+ texture:SetPoint("BOTTOMLEFT", tab,"BOTTOMLEFT")
+ texture:SetPoint("TOPLEFT", tab,"TOPLEFT")
+ texture = getglobal(tabname.."MiddleDisabled")
+ texture:SetTexture("Interface\\ChatFrame\\ChatFrameTab")
+ texture = getglobal(tabname.."RightDisabled")
+ texture:SetTexture("Interface\\ChatFrame\\ChatFrameTab")
+
tab.obj = self
tab.id = id
- tab.text = _G[tabname .. "Text"]
- tab.text:ClearAllPoints()
- tab.text:SetPoint("LEFT", 14, -3)
- tab.text:SetPoint("RIGHT", -12, -3)
-
tab:SetScript("OnClick", Tab_OnClick)
tab:SetScript("OnEnter", Tab_OnEnter)
tab:SetScript("OnLeave", Tab_OnLeave)
@@ -154,7 +176,7 @@ local methods = {
end
status.selected = value
if found then
- self:Fire("OnGroupSelected",value)
+ self:Fire("OnGroupSelected",1,value)
end
end,
@@ -162,22 +184,22 @@ local methods = {
self.tablist = tabs
self:BuildTabs()
end,
-
+
["BuildTabs"] = function(self)
local hastitle = (self.titletext:GetText() and self.titletext:GetText() ~= "")
local status = self.status or self.localstatus
local tablist = self.tablist
local tabs = self.tabs
-
+
if not tablist then return end
-
+
local width = self.frame.width or self.frame:GetWidth() or 0
-
+
wipe(widths)
wipe(rowwidths)
wipe(rowends)
-
+
--Place Text into tabs and get thier initial width
for i, v in ipairs(tablist) do
local tab = tabs[i]
@@ -185,19 +207,24 @@ local methods = {
tab = self:CreateTab(i)
tabs[i] = tab
end
-
+
tab:Show()
- tab:SetText(v.text)
- tab:SetDisabled(v.disabled)
- tab.value = v.value
-
+ if type(v) == "table" then
+ tab:SetText(v.text)
+ tab:SetDisabled(v.disabled)
+ tab.value = v.value
+ elseif type(v) == "string" then
+ tab:SetText(v)
+ tab.value = v
+ end
+
widths[i] = tab:GetWidth() - 6 --tabs are anchored 10 pixels from the right side of the previous one to reduce spacing, but add a fixed 4px padding for the text
end
-
+
for i = tgetn(tablist)+1, tgetn(tabs), 1 do
tabs[i]:Hide()
end
-
+
--First pass, find the minimum number of rows needed to hold all tabs and the initial tab layout
local numtabs = tgetn(tablist)
local numrows = 1
@@ -215,7 +242,7 @@ local methods = {
end
rowwidths[numrows] = usedwidth + 10 --first tab in each row takes up an extra 10px
rowends[numrows] = tgetn(tablist)
-
+
--Fix for single tabs being left on the last row, move a tab from the row above if applicable
if numrows > 1 then
--if the last row has only one tab
@@ -246,23 +273,23 @@ local methods = {
tab:SetPoint("LEFT", tabs[tabno-1], "RIGHT", -10, 0)
end
end
-
+
-- equal padding for each tab to fill the available width,
-- if the used space is above 75% already
- -- the 18 pixel is the typical width of a scrollbar, so we can have a tab group inside a scrolling frame,
+ -- the 18 pixel is the typical width of a scrollbar, so we can have a tab group inside a scrolling frame,
-- and not have the tabs jump around funny when switching between tabs that need scrolling and those that don't
local padding = 0
if not (numrows == 1 and rowwidths[1] < width*0.75 - 18) then
padding = (width - rowwidths[row]) / (endtab - starttab+1)
end
-
+
for i = starttab, endtab do
- PanelTemplates_TabResize(tabs[i], padding + 4, nil, width, tabs[i]:GetFontString():GetStringWidth())
+ PanelTemplates_TabResize(padding + 4, tabs[i], nil, width)
end
starttab = endtab + 1
end
-
- self.borderoffset = (hastitle and 17 or 10)+((numrows)*20)
+
+ self.borderoffset = (hastitle and 17 or 10)+((numrows)*20)+7
self.border:SetPoint("TOPLEFT", 1, -self.borderoffset)
end,
@@ -287,7 +314,7 @@ local methods = {
content:SetHeight(contentheight)
content.height = contentheight
end,
-
+
["LayoutFinished"] = function(self, width, height)
if self.noAutoHeight then return end
self:SetHeight((height or 0) + (self.borderoffset + 23))
@@ -344,7 +371,7 @@ local function Constructor()
for method, func in pairs(methods) do
widget[method] = func
end
-
+
return AceGUI:RegisterAsContainer(widget)
end
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua
index 7ca5b62..4cf7f57 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua
@@ -6,12 +6,15 @@ local Type, Version = "TreeGroup", 40
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
+local AceCore = LibStub("AceCore-3.0")
+local strsplit = AceCore.strsplit
+local _G = AceCore._G
+
-- Lua APIs
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type
local math_min, math_max, floor = math.min, math.max, floor
-local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat
-local strsplit = string.split
-local tgetn = table.getn
+local tgetn, tremove, unpack, tconcat = table.getn, table.remove, unpack, table.concat
+local strfmt = string.format
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
@@ -36,7 +39,7 @@ do
function del(t)
for k in pairs(t) do
t[k] = nil
- end
+ end
pool[t] = true
end
end
@@ -67,7 +70,7 @@ local function UpdateButton(button, treeline, selected, canExpand, isExpanded)
local value = treeline.value
local uniquevalue = treeline.uniquevalue
local disabled = treeline.disabled
-
+
button.treeline = treeline
button.value = value
button.uniquevalue = uniquevalue
@@ -81,16 +84,17 @@ local function UpdateButton(button, treeline, selected, canExpand, isExpanded)
local normalTexture = button:GetNormalTexture()
local line = button.line
button.level = level
+
if ( level == 1 ) then
- button:SetNormalFontObject("GameFontNormal")
+ button.text:SetFontObject("GameFontNormal")
button:SetHighlightFontObject("GameFontHighlight")
button.text:SetPoint("LEFT", (icon and 16 or 0) + 8, 2)
else
- button:SetNormalFontObject("GameFontHighlightSmall")
+ button.text:SetFontObject("GameFontHighlightSmall")
button:SetHighlightFontObject("GameFontHighlightSmall")
button.text:SetPoint("LEFT", (icon and 16 or 0) + 8 * level, 2)
end
-
+
if disabled then
button:EnableMouse(false)
button.text:SetText("|cff808080"..text..FONT_COLOR_CODE_CLOSE)
@@ -98,20 +102,20 @@ local function UpdateButton(button, treeline, selected, canExpand, isExpanded)
button.text:SetText(text)
button:EnableMouse(true)
end
-
+
if icon then
button.icon:SetTexture(icon)
button.icon:SetPoint("LEFT", 8 * level, (level == 1) and 0 or 1)
else
button.icon:SetTexture(nil)
end
-
+
if iconCoords then
button.icon:SetTexCoord(unpack(iconCoords))
else
button.icon:SetTexCoord(0, 1, 0, 1)
end
-
+
if canExpand then
if not isExpanded then
toggle:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-UP")
@@ -156,134 +160,143 @@ local function addLine(self, v, tree, level, parent)
else
line.hasChildren = nil
end
- self.lines[tgetn(self.lines)+1] = line
+ tinsert(self.lines, line)
return line
end
--fire an update after one frame to catch the treeframes height
-local function FirstFrameUpdate(frame)
- local self = frame.obj
- frame:SetScript("OnUpdate", nil)
+local function FirstFrameUpdate()
+ local self = this.obj
+ this:SetScript("OnUpdate", nil)
self:RefreshTree()
end
-local function BuildUniqueValue(...)
- local n = select('#', arg)
- if n == 1 then
- return arg1
- else
- return (unpack(arg)).."\001"..BuildUniqueValue(select(2,arg))
- end
+local BuildUniqueValue
+do
+local args = {nil,nil,nil,nil,nil,nil,nil,nil,nil,nil}
+function BuildUniqueValue(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ args[1] = a1
+ args[2] = a2
+ args[3] = a3
+ args[4] = a4
+ args[5] = a5
+ args[6] = a6
+ args[7] = a7
+ args[8] = a8
+ args[9] = a9
+ args[10] = a10
+ return tconcat(tmp, "\001", 1, tgetn(args))
+end
end
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
-local function Expand_OnClick(frame)
- local button = frame.button
+local function Expand_OnClick()
+ local button = this.button
local self = button.obj
local status = (self.status or self.localstatus).groups
status[button.uniquevalue] = not status[button.uniquevalue]
self:RefreshTree()
end
-local function Button_OnClick(frame)
- local self = frame.obj
- self:Fire("OnClick", frame.uniquevalue, frame.selected)
- if not frame.selected then
- self:SetSelected(frame.uniquevalue)
- frame.selected = true
- frame:LockHighlight()
+local function Button_OnClick()
+ local self = this.obj
+ self:Fire("OnClick", 2, this.uniquevalue, this.selected)
+ if not this.selected then
+ self:SetSelected(this.uniquevalue)
+ this.selected = true
+ this:LockHighlight()
self:RefreshTree()
end
AceGUI:ClearFocus()
end
-local function Button_OnDoubleClick(button)
- local self = button.obj
+local function Button_OnDoubleClick()
+ local self = this.obj
local status = self.status or self.localstatus
local status = (self.status or self.localstatus).groups
- status[button.uniquevalue] = not status[button.uniquevalue]
+ status[this.uniquevalue] = not status[this.uniquevalue]
self:RefreshTree()
end
-local function Button_OnEnter(frame)
- local self = frame.obj
- self:Fire("OnButtonEnter", frame.uniquevalue, frame)
+local function Button_OnEnter()
+ local self = this.obj
+ self:Fire("OnButtonEnter", 2, this.uniquevalue, this)
if self.enabletooltips then
- GameTooltip:SetOwner(frame, "ANCHOR_NONE")
- GameTooltip:SetPoint("LEFT",frame,"RIGHT")
- GameTooltip:SetText(frame.text:GetText() or "", 1, .82, 0, 1)
+ GameTooltip:SetOwner(this, "ANCHOR_NONE")
+ GameTooltip:SetPoint("LEFT",this,"RIGHT")
+ GameTooltip:SetText(this.text:GetText() or "", 1, .82, 0, true)
GameTooltip:Show()
end
end
-local function Button_OnLeave(frame)
- local self = frame.obj
- self:Fire("OnButtonLeave", frame.uniquevalue, frame)
+local function Button_OnLeave()
+ local self = this.obj
+ self:Fire("OnButtonLeave", 2, this.uniquevalue, this)
if self.enabletooltips then
GameTooltip:Hide()
end
end
-local function OnScrollValueChanged(frame, value)
- if frame.obj.noupdate then return end
- local self = frame.obj
+local function OnScrollValueChanged()
+ if this.obj.noupdate then return end
+ local self = this.obj
local status = self.status or self.localstatus
- status.scrollvalue = floor(value + 0.5)
+ status.scrollvalue = floor(arg1 + 0.5)
self:RefreshTree()
AceGUI:ClearFocus()
end
-local function Tree_OnSizeChanged(frame)
- frame.obj:RefreshTree()
+local function Tree_OnSizeChanged()
+ this.obj:RefreshTree()
end
-local function Tree_OnMouseWheel(frame, delta)
- local self = frame.obj
+local function Tree_OnMouseWheel()
+ local self = this.obj
if self.showscroll then
local scrollbar = self.scrollbar
local min, max = scrollbar:GetMinMaxValues()
local value = scrollbar:GetValue()
- local newvalue = math_min(max,math_max(min,value - delta))
+ local newvalue = math_min(max,math_max(min,value - arg1))
if value ~= newvalue then
scrollbar:SetValue(newvalue)
end
end
end
-local function Dragger_OnLeave(frame)
- frame:SetBackdropColor(1, 1, 1, 0)
+local function Dragger_OnLeave()
+ this:SetBackdropColor(1, 1, 1, 0)
end
-local function Dragger_OnEnter(frame)
- frame:SetBackdropColor(1, 1, 1, 0.8)
+local function Dragger_OnEnter()
+ this:SetBackdropColor(1, 1, 1, 0.8)
end
-local function Dragger_OnMouseDown(frame)
- local treeframe = frame:GetParent()
+local function Dragger_OnMouseDown()
+ local treeframe = this:GetParent()
treeframe:StartSizing("RIGHT")
end
-local function Dragger_OnMouseUp(frame)
- local treeframe = frame:GetParent()
+local function Dragger_OnMouseUp()
+ local treeframe = this:GetParent()
local self = treeframe.obj
- local frame = treeframe:GetParent()
+ local this = treeframe:GetParent()
treeframe:StopMovingOrSizing()
--treeframe:SetScript("OnUpdate", nil)
treeframe:SetUserPlaced(false)
--Without this :GetHeight will get stuck on the current height, causing the tree contents to not resize
treeframe:SetHeight(0)
- treeframe:SetPoint("TOPLEFT", frame, "TOPLEFT",0,0)
- treeframe:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT",0,0)
-
+ treeframe:SetPoint("TOPLEFT", this, "TOPLEFT",0,0)
+ treeframe:SetPoint("BOTTOMLEFT", this, "BOTTOMLEFT",0,0)
+
local status = self.status or self.localstatus
status.treewidth = treeframe:GetWidth()
-
- treeframe.obj:Fire("OnTreeResize",treeframe:GetWidth())
+
+ treeframe.obj:Fire("OnTreeResize", 1, treeframe:GetWidth())
-- recalculate the content width
treeframe.obj:OnWidthSet(status.fullwidth)
-- update the layout of the content
@@ -293,7 +306,10 @@ end
--[[-----------------------------------------------------------------------------
Methods
-------------------------------------------------------------------------------]]
-local methods = {
+local methods
+do
+local select_args = {nil,nil,nil,nil,nil,nil,nil,nil,nil,nil}
+methods = {
["OnAcquire"] = function(self)
self:SetTreeWidth(DEFAULT_TREE_WIDTH, DEFAULT_TREE_SIZABLE)
self:EnableButtonTooltips(true)
@@ -322,8 +338,39 @@ local methods = {
["CreateButton"] = function(self)
local num = AceGUI:GetNextWidgetNum("TreeGroupButton")
- local button = CreateFrame("Button", format("AceGUI30TreeButton%d", num), self.treeframe, "OptionsListButtonTemplate")
+
+ local button = CreateFrame("Button", strfmt("AceGUI30TreeButton%d", num), self.treeframe)
button.obj = self
+ button:SetWidth(175)
+ button:SetHeight(18)
+
+ local toggle = CreateFrame("Button", nil, button)
+ toggle.obj = button
+ button.toggle = toggle
+ toggle:SetWidth(14)
+ toggle:SetHeight(14)
+ toggle:ClearAllPoints()
+ toggle:SetPoint("TOPRIGHT", button, "TOPRIGHT", -6, -1)
+ toggle:SetScript("OnClick", Button_OnClick)
+ toggle:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-UP")
+ toggle:SetPushedTexture("Interface\\Buttons\\UI-MinusButton-DOWN")
+ toggle:SetHighlightTexture("Interface\Buttons\UI-PlusButton-Hilight", "ADD")
+
+ local text = button:CreateFontString()
+ button.text = text
+ text:SetFontObject(GameFontNormal)
+ button:SetHighlightFontObject(GameFontHighlight)
+ text:SetPoint("RIGHT", toggle, "LEFT", -2, 0);
+ text:SetJustifyH("LEFT")
+
+ local highlight = button:CreateTexture(nil, "HIGHLIGHT");
+ button.highlight = highlight
+ highlight:SetTexture("Interface\\QuestFrame\\UI-QuestLogTitleHighlight")
+ highlight:SetBlendMode("ADD")
+ highlight:SetVertexColor(.196, .388, .8);
+ highlight:ClearAllPoints()
+ highlight:SetPoint("TOPLEFT",0,1)
+ highlight:SetPoint("BOTTOMRIGHT",0,1)
local icon = button:CreateTexture(nil, "OVERLAY")
icon:SetWidth(14)
@@ -365,8 +412,8 @@ local methods = {
--sets the tree to be displayed
["SetTree"] = function(self, tree, filter)
self.filter = filter
- if tree then
- assert(type(tree) == "table")
+ if tree then
+ assert(type(tree) == "table")
end
self.tree = tree
self:RefreshTree()
@@ -375,7 +422,7 @@ local methods = {
["BuildLevel"] = function(self, tree, level, parent)
local groups = (self.status or self.localstatus).groups
local hasChildren = self.hasChildren
-
+
for i, v in ipairs(tree) do
if v.children then
if not self.filter or ShouldDisplayLevel(v.children) then
@@ -391,7 +438,7 @@ local methods = {
end,
["RefreshTree"] = function(self,scrollToSelection)
- local buttons = self.buttons
+ local buttons = self.buttons
local lines = self.lines
for i, v in ipairs(buttons) do
@@ -412,7 +459,7 @@ local methods = {
local tree = self.tree
local treeframe = self.treeframe
-
+
status.scrollToSelection = status.scrollToSelection or scrollToSelection -- needs to be cached in case the control hasn't been drawn yet (code bails out below)
self:BuildLevel(tree, 1)
@@ -423,7 +470,7 @@ local methods = {
if maxlines <= 0 then return end
local first, last
-
+
scrollToSelection = status.scrollToSelection
status.scrollToSelection = nil
@@ -499,32 +546,41 @@ local methods = {
button:Show()
buttonnum = buttonnum + 1
end
-
+
end,
-
+
["SetSelected"] = function(self, value)
local status = self.status or self.localstatus
if status.selected ~= value then
status.selected = value
- self:Fire("OnGroupSelected", value)
+ self:Fire("OnGroupSelected", 1, value)
end
end,
- ["Select"] = function(self, uniquevalue, ...)
+ ["Select"] = function(self, uniquevalue, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
self.filter = false
local status = self.status or self.localstatus
local groups = status.groups
- local path = {unpack(arg)}
- for i = 1, tgetn(path) do
- groups[tconcat(path, "\001", 1, i)] = true
+ select_args[1] = a1
+ select_args[2] = a2
+ select_args[3] = a3
+ select_args[4] = a4
+ select_args[5] = a5
+ select_args[6] = a6
+ select_args[7] = a7
+ select_args[8] = a8
+ select_args[9] = a9
+ select_args[10] = a10
+ for i = 1, tgetn(select_args) do
+ groups[tconcat(select_args, "\001", 1, i)] = true
end
status.selected = uniquevalue
self:RefreshTree(true)
- self:Fire("OnGroupSelected", uniquevalue)
+ self:Fire("OnGroupSelected", 1, uniquevalue)
end,
- ["SelectByPath"] = function(self, ...)
- self:Select(BuildUniqueValue(unpack(arg)), unpack(arg))
+ ["SelectByPath"] = function(self, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ self:Select(BuildUniqueValue(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10), a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
end,
["SelectByValue"] = function(self, uniquevalue)
@@ -551,16 +607,16 @@ local methods = {
local treeframe = self.treeframe
local status = self.status or self.localstatus
status.fullwidth = width
-
+
local contentwidth = width - status.treewidth - 20
if contentwidth < 0 then
contentwidth = 0
end
content:SetWidth(contentwidth)
content.width = contentwidth
-
+
local maxtreewidth = math_min(400, width - 50)
-
+
if maxtreewidth > 100 and status.treewidth > maxtreewidth then
self:SetTreeWidth(maxtreewidth, status.treesizable)
end
@@ -586,16 +642,16 @@ local methods = {
treewidth = DEFAULT_TREE_WIDTH
else
resizable = false
- treewidth = DEFAULT_TREE_WIDTH
+ treewidth = DEFAULT_TREE_WIDTH
end
end
self.treeframe:SetWidth(treewidth)
self.dragger:EnableMouse(resizable)
-
+
local status = self.status or self.localstatus
status.treewidth = treewidth
status.treesizable = resizable
-
+
-- recalculate the content width
if status.fullwidth then
self:OnWidthSet(status.fullwidth)
@@ -612,6 +668,7 @@ local methods = {
self:SetHeight((height or 0) + 20)
end
}
+end -- method
--[[-----------------------------------------------------------------------------
Constructor
@@ -635,8 +692,8 @@ local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
local treeframe = CreateFrame("Frame", nil, frame)
- treeframe:SetPoint("TOPLEFT")
- treeframe:SetPoint("BOTTOMLEFT")
+ treeframe:SetPoint("TOPLEFT", 0, 0)
+ treeframe:SetPoint("BOTTOMLEFT", 0, 0)
treeframe:SetWidth(DEFAULT_TREE_WIDTH)
treeframe:EnableMouseWheel(true)
treeframe:SetBackdrop(PaneBackdrop)
@@ -660,7 +717,7 @@ local function Constructor()
dragger:SetScript("OnMouseDown", Dragger_OnMouseDown)
dragger:SetScript("OnMouseUp", Dragger_OnMouseUp)
- local scrollbar = CreateFrame("Slider", format("AceConfigDialogTreeGroup%dScrollBar", num), treeframe, "UIPanelScrollBarTemplate")
+ local scrollbar = CreateFrame("Slider", strfmt("AceConfigDialogTreeGroup%dScrollBar", num), treeframe, "UIPanelScrollBarTemplate")
scrollbar:SetScript("OnValueChanged", nil)
scrollbar:SetPoint("TOPRIGHT", -10, -26)
scrollbar:SetPoint("BOTTOMRIGHT", -10, 26)
@@ -676,7 +733,7 @@ local function Constructor()
local border = CreateFrame("Frame",nil,frame)
border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT")
- border:SetPoint("BOTTOMRIGHT")
+ border:SetPoint("BOTTOMRIGHT", 0, 0)
border:SetBackdrop(PaneBackdrop)
border:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
border:SetBackdropBorderColor(0.4, 0.4, 0.4)
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-Window.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-Window.lua
index 7fe5515..6074e18 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-Window.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIContainer-Window.lua
@@ -21,31 +21,27 @@ local CreateFrame, UIParent = CreateFrame, UIParent
]]
do
local Type = "Window"
- local Version = 6
+ local Version = 4
- local function frameOnShow(this)
- this.obj:Fire("OnShow")
- end
-
- local function frameOnClose(this)
+ local function frameOnClose()
this.obj:Fire("OnClose")
end
- local function closeOnClick(this)
+ local function closeOnClick()
PlaySound("gsTitleOptionExit")
this.obj:Hide()
end
- local function frameOnMouseDown(this)
+ local function frameOnMouseDown()
AceGUI:ClearFocus()
end
- local function titleOnMouseDown(this)
+ local function titleOnMouseDown()
this:GetParent():StartMoving()
AceGUI:ClearFocus()
end
- local function frameOnMouseUp(this)
+ local function frameOnMouseUp()
local frame = this:GetParent()
frame:StopMovingOrSizing()
local self = frame.obj
@@ -56,22 +52,22 @@ do
status.left = frame:GetLeft()
end
- local function sizerseOnMouseDown(this)
+ local function sizerseOnMouseDown()
this:GetParent():StartSizing("BOTTOMRIGHT")
AceGUI:ClearFocus()
end
- local function sizersOnMouseDown(this)
+ local function sizersOnMouseDown()
this:GetParent():StartSizing("BOTTOM")
AceGUI:ClearFocus()
end
- local function sizereOnMouseDown(this)
+ local function sizereOnMouseDown()
this:GetParent():StartSizing("RIGHT")
AceGUI:ClearFocus()
end
- local function sizerOnMouseUp(this)
+ local function sizerOnMouseUp()
this:GetParent():StopMovingOrSizing()
end
@@ -184,7 +180,6 @@ do
frame:SetFrameStrata("FULLSCREEN_DIALOG")
frame:SetScript("OnMouseDown", frameOnMouseDown)
- frame:SetScript("OnShow",frameOnShow)
frame:SetScript("OnHide",frameOnClose)
frame:SetMinResize(240,240)
frame:SetToplevel(true)
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Button.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Button.lua
index 4377d3e..59be0e3 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Button.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Button.lua
@@ -2,24 +2,27 @@
Button Widget
Graphical Button.
-------------------------------------------------------------------------------]]
-local Type, Version = "Button", 24
+local Type, Version = "Button", 23
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
+local AceCore = LibStub("AceCore-3.0")
+
-- Lua APIs
-local pairs, unpack = pairs, unpack
+local pairs = pairs
-- WoW APIs
-local _G = _G
+local _G = AceCore._G
local PlaySound, CreateFrame, UIParent = PlaySound, CreateFrame, UIParent
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
+-- arg1 is the button for OnClick event
local function Button_OnClick()
AceGUI:ClearFocus()
PlaySound("igMainMenuOption")
- this.obj:Fire("OnClick", unpack(arg))
+ this.obj:Fire("OnClick", 1, arg1)
end
local function Control_OnEnter()
@@ -74,7 +77,7 @@ Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
local name = "AceGUI30Button" .. AceGUI:GetNextWidgetNum(Type)
- local frame = CreateFrame("Button", name, UIParent, "UIPanelButtonTemplate")
+ local frame = CreateFrame("Button", name, UIParent, "UIPanelButtonTemplate2")
frame:Hide()
frame:EnableMouse(true)
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua
index 5c9a3e7..f71a6e2 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua
@@ -1,12 +1,12 @@
--[[-----------------------------------------------------------------------------
Checkbox Widget
-------------------------------------------------------------------------------]]
-local Type, Version = "CheckBox", 23
+local Type, Version = "CheckBox", 22
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs
-local select, pairs, unpack = select, pairs, unpack
+local pairs = pairs
-- WoW APIs
local PlaySound = PlaySound
@@ -24,10 +24,10 @@ local function AlignImage(self)
self.text:ClearAllPoints()
if not img then
self.text:SetPoint("LEFT", self.checkbg, "RIGHT")
- self.text:SetPoint("RIGHT", 0, 0)
+ self.text:SetPoint("RIGHT",0,0)
else
self.text:SetPoint("LEFT", self.image,"RIGHT", 1, 0)
- self.text:SetPoint("RIGHT", 0, 0)
+ self.text:SetPoint("RIGHT",0,0)
end
end
@@ -55,6 +55,7 @@ local function CheckBox_OnMouseDown()
end
local function CheckBox_OnMouseUp()
+
local self = this.obj
if not self.disabled then
self:ToggleChecked()
@@ -65,7 +66,7 @@ local function CheckBox_OnMouseUp()
PlaySound("igMainMenuOptionCheckBoxOff")
end
- self:Fire("OnValueChanged", self.checked)
+ self:Fire("OnValueChanged", 1, self.checked)
AlignImage(self)
end
end
@@ -172,6 +173,7 @@ local methods = {
highlight:SetTexture("Interface\\Buttons\\UI-CheckBox-Highlight")
highlight:SetTexCoord(0, 1, 0, 1)
end
+
checkbg:SetHeight(size)
checkbg:SetWidth(size)
end,
@@ -220,15 +222,14 @@ local methods = {
self:SetHeight(24)
end
end,
-
- ["SetImage"] = function(self, path, ...)
+
+ ["SetImage"] = function(self, path, a1,a2,a3,a4,a5,a6,a7,a8)
local image = self.image
image:SetTexture(path)
-
+
if image:GetTexture() then
- local n = select("#", arg)
- if n == 4 or n == 8 then
- image:SetTexCoord(unpack(arg))
+ if a4 or a8 then
+ image:SetTexCoord(a1,a2,a3,a4,a5,a6,a7,a8)
else
image:SetTexCoord(0, 1, 0, 1)
end
@@ -253,7 +254,7 @@ local function Constructor()
local checkbg = frame:CreateTexture(nil, "ARTWORK")
checkbg:SetWidth(24)
checkbg:SetHeight(24)
- checkbg:SetPoint("TOPLEFT", 0, 0)
+ checkbg:SetPoint("TOPLEFT",0,0)
checkbg:SetTexture("Interface\\Buttons\\UI-CheckBox-Up")
local check = frame:CreateTexture(nil, "OVERLAY")
@@ -261,10 +262,10 @@ local function Constructor()
check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check")
local text = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
- text:SetJustifyH("LEFT", 0, 0)
+ text:SetJustifyH("LEFT")
text:SetHeight(18)
text:SetPoint("LEFT", checkbg, "RIGHT")
- text:SetPoint("RIGHT", 0, 0)
+ text:SetPoint("RIGHT",0,0)
local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
highlight:SetTexture("Interface\\Buttons\\UI-CheckBox-Highlight")
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua
index d172e6f..8feaca4 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua
@@ -1,7 +1,7 @@
--[[-----------------------------------------------------------------------------
ColorPicker Widget
-------------------------------------------------------------------------------]]
-local Type, Version = "ColorPicker-ElvUI", 1
+local Type, Version = "ColorPicker", 23
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
@@ -25,12 +25,12 @@ local function ColorCallback(self, r, g, b, a, isAlpha)
self:SetColor(r, g, b, a)
if ColorPickerFrame:IsVisible() then
--colorpicker is still open
- self:Fire("OnValueChanged", r, g, b, a)
+ self:Fire("OnValueChanged", 4, r, g, b, a)
else
--colorpicker is closed, color callback is first, ignore it,
--alpha callback is the final call after it closes so confirm now
if isAlpha then
- self:Fire("OnValueConfirmed", r, g, b, a)
+ self:Fire("OnValueConfirmed", 4, r, g, b, a)
end
end
end
@@ -38,20 +38,19 @@ end
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
-local function Control_OnEnter(frame)
- frame.obj:Fire("OnEnter")
+local function Control_OnEnter()
+ this.obj:Fire("OnEnter")
end
-local function Control_OnLeave(frame)
- frame.obj:Fire("OnLeave")
+local function Control_OnLeave()
+ this.obj:Fire("OnLeave")
end
-local function ColorSwatch_OnClick(frame)
+local function ColorSwatch_OnClick()
HideUIPanel(ColorPickerFrame)
- local self = frame.obj
+ local self = this.obj
if not self.disabled then
ColorPickerFrame:SetFrameStrata("FULLSCREEN_DIALOG")
- ColorPickerFrame:SetFrameLevel(frame:GetFrameLevel() + 10)
ColorPickerFrame:SetClampedToScreen(true)
ColorPickerFrame.func = function()
@@ -67,20 +66,12 @@ local function ColorSwatch_OnClick(frame)
ColorCallback(self, r, g, b, a, true)
end
- local r, g, b, a, dR, dG, dB, dA = self.r, self.g, self.b, self.a, self.dR, self.dG, self.dB, self.dA
+ local r, g, b, a = self.r, self.g, self.b, self.a
if self.HasAlpha then
ColorPickerFrame.opacity = 1 - (a or 0)
end
ColorPickerFrame:SetColorRGB(r, g, b)
- if(ColorPPDefault and self.dR and self.dG and self.dB) then
- local alpha = 1
- if(self.dA) then
- alpha = 1 - self.dA
- end
- ColorPPDefault.colors = {r = self.dR, g = self.dG, b = self.dB, a = alpha}
- end
-
ColorPickerFrame.cancelFunc = function()
ColorCallback(self, r, g, b, a, true)
end
@@ -109,15 +100,11 @@ local methods = {
self.text:SetText(text)
end,
- ["SetColor"] = function(self, r, g, b, a, defaultR, defaultG, defaultB, defaultA)
+ ["SetColor"] = function(self, r, g, b, a)
self.r = r
self.g = g
self.b = b
self.a = a or 1
- self.dR = defaultR
- self.dG = defaultG
- self.dB = defaultB
- self.dA = defaultA
self.colorSwatch:SetVertexColor(r, g, b, a)
end,
@@ -153,7 +140,7 @@ local function Constructor()
colorSwatch:SetWidth(19)
colorSwatch:SetHeight(19)
colorSwatch:SetTexture("Interface\\ChatFrame\\ChatFrameColorSwatch")
- colorSwatch:SetPoint("LEFT")
+ colorSwatch:SetPoint("LEFT",0,0)
local texture = frame:CreateTexture(nil, "BACKGROUND")
texture:SetWidth(16)
@@ -177,7 +164,7 @@ local function Constructor()
text:SetJustifyH("LEFT")
text:SetTextColor(1, 1, 1)
text:SetPoint("LEFT", colorSwatch, "RIGHT", 2, 0)
- text:SetPoint("RIGHT")
+ text:SetPoint("RIGHT",0,0)
--local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
--highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua
index 6bf6ec4..f970ade 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua
@@ -1,39 +1,23 @@
---[[ $Id: AceGUIWidget-DropDown-Items.lua 1153 2016-11-20 09:57:15Z nevcairiel $ ]]--
+--[[ $Id: AceGUIWidget-DropDown-Items.lua 1137 2016-05-15 10:57:36Z nevcairiel $ ]]--
local AceGUI = LibStub("AceGUI-3.0")
+local IsLegion = false
+
-- Lua APIs
-local select, assert = select, assert
+local assert = assert
+local tgetn = table.getn
-- WoW APIs
local PlaySound = PlaySound
local CreateFrame = CreateFrame
-local function fixlevels(parent,...)
- local i = 1
- local child = select(i, arg)
- while child do
- child:SetFrameLevel(parent:GetFrameLevel()+1)
- fixlevels(child, child:GetChildren())
- i = i + 1
- child = select(i, arg)
- end
-end
-
-local function fixstrata(strata, parent, ...)
- local i = 1
- local child = select(i, arg)
- parent:SetFrameStrata(strata)
- while child do
- fixstrata(strata, child, child:GetChildren())
- i = i + 1
- child = select(i, arg)
- end
-end
+local fixlevels = AceGUI.fixlevels
+local fixstrata = AceGUI.fixstrata
-- ItemBase is the base "class" for all dropdown items.
-- Each item has to use ItemBase.Create(widgetType) to
--- create an initial 'self' value.
+-- create an initial 'self' value.
-- ItemBase will add common functions and ui event handlers.
-- Be sure to keep basic usage when you override functions.
@@ -45,25 +29,25 @@ local ItemBase = {
counter = 0,
}
-function ItemBase.Frame_OnEnter(this)
+function ItemBase.Frame_OnEnter()
local self = this.obj
if self.useHighlight then
self.highlight:Show()
end
self:Fire("OnEnter")
-
+
if self.specialOnEnter then
self.specialOnEnter(self)
end
end
-function ItemBase.Frame_OnLeave(this)
+function ItemBase.Frame_OnLeave()
local self = this.obj
-
+
self.highlight:Hide()
self:Fire("OnLeave")
-
+
if self.specialOnLeave then
self.specialOnLeave(self)
end
@@ -89,11 +73,12 @@ end
-- Do not call this method directly
function ItemBase.SetPullout(self, pullout)
self.pullout = pullout
-
+
self.frame:SetParent(nil)
- self.frame:SetParent(pullout.itemFrame)
- self.parent = pullout.itemFrame
- fixlevels(pullout.itemFrame, pullout.itemFrame:GetChildren())
+ local itemFrame = pullout.itemFrame
+ self.frame:SetParent(itemFrame)
+ self.parent = itemFrame
+ fixlevels(itemFrame)
end
-- exported
@@ -107,8 +92,8 @@ function ItemBase.GetText(self)
end
-- exported
-function ItemBase.SetPoint(self, ...)
- self.frame:SetPoint(unpack(arg))
+function ItemBase.SetPoint(self, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ self.frame:SetPoint(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
end
-- exported
@@ -155,12 +140,12 @@ function ItemBase.Create(type)
self.frame = frame
frame.obj = self
self.type = type
-
+
self.useHighlight = true
-
+
frame:SetHeight(17)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
-
+
local text = frame:CreateFontString(nil,"OVERLAY","GameFontNormalSmall")
text:SetTextColor(1,1,1)
text:SetJustifyH("LEFT")
@@ -178,7 +163,7 @@ function ItemBase.Create(type)
highlight:Hide()
self.highlight = highlight
- local check = frame:CreateTexture("OVERLAY")
+ local check = frame:CreateTexture("OVERLAY")
check:SetWidth(16)
check:SetHeight(16)
check:SetPoint("LEFT",frame,"LEFT",3,-1)
@@ -192,26 +177,26 @@ function ItemBase.Create(type)
sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1)
sub:SetTexture("Interface\\ChatFrame\\ChatFrameExpandArrow")
sub:Hide()
- self.sub = sub
-
+ self.sub = sub
+
frame:SetScript("OnEnter", ItemBase.Frame_OnEnter)
frame:SetScript("OnLeave", ItemBase.Frame_OnLeave)
-
+
self.OnAcquire = ItemBase.OnAcquire
self.OnRelease = ItemBase.OnRelease
-
+
self.SetPullout = ItemBase.SetPullout
self.GetText = ItemBase.GetText
self.SetText = ItemBase.SetText
self.SetDisabled = ItemBase.SetDisabled
-
+
self.SetPoint = ItemBase.SetPoint
self.Show = ItemBase.Show
self.Hide = ItemBase.Hide
-
+
self.SetOnLeave = ItemBase.SetOnLeave
self.SetOnEnter = ItemBase.SetOnEnter
-
+
return self
end
@@ -223,20 +208,20 @@ end
--[[
Template for items:
-
+
-- Item:
--
do
local widgetType = "Dropdown-Item-"
local widgetVersion = 1
-
+
local function Constructor()
local self = ItemBase.Create(widgetType)
-
+
AceGUI:RegisterAsWidget(self)
return self
end
-
+
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
--]]
@@ -247,25 +232,25 @@ end
do
local widgetType = "Dropdown-Item-Header"
local widgetVersion = 1
-
+
local function OnEnter(this)
local self = this.obj
self:Fire("OnEnter")
-
+
if self.specialOnEnter then
self.specialOnEnter(self)
end
end
-
- local function OnLeave(this)
+
+ local function OnLeave()
local self = this.obj
self:Fire("OnLeave")
-
+
if self.specialOnLeave then
self.specialOnLeave(self)
end
end
-
+
-- exported, override
local function SetDisabled(self, disabled)
ItemBase.SetDisabled(self, disabled)
@@ -273,21 +258,21 @@ do
self.text:SetTextColor(1, 1, 0)
end
end
-
+
local function Constructor()
local self = ItemBase.Create(widgetType)
-
+
self.SetDisabled = SetDisabled
-
+
self.frame:SetScript("OnEnter", OnEnter)
self.frame:SetScript("OnLeave", OnLeave)
-
+
self.text:SetTextColor(1, 1, 0)
-
+
AceGUI:RegisterAsWidget(self)
return self
end
-
+
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
@@ -296,7 +281,7 @@ end
do
local widgetType = "Dropdown-Item-Execute"
local widgetVersion = 1
-
+
local function Frame_OnClick(this, button)
local self = this.obj
if self.disabled then return end
@@ -305,16 +290,16 @@ do
self.pullout:Close()
end
end
-
+
local function Constructor()
local self = ItemBase.Create(widgetType)
-
+
self.frame:SetScript("OnClick", Frame_OnClick)
-
+
AceGUI:RegisterAsWidget(self)
return self
end
-
+
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
@@ -323,8 +308,8 @@ end
-- Does not close the pullout on click.
do
local widgetType = "Dropdown-Item-Toggle"
- local widgetVersion = 4
-
+ local widgetVersion = 3
+
local function UpdateToggle(self)
if self.value then
self.check:Show()
@@ -332,13 +317,13 @@ do
self.check:Hide()
end
end
-
+
local function OnRelease(self)
ItemBase.OnRelease(self)
self:SetValue(nil)
end
-
- local function Frame_OnClick(this, button)
+
+ local function Frame_OnClick()
local self = this.obj
if self.disabled then return end
self.value = not self.value
@@ -348,33 +333,33 @@ do
PlaySound("igMainMenuOptionCheckBoxOff")
end
UpdateToggle(self)
- self:Fire("OnValueChanged", self.value)
+ self:Fire("OnValueChanged", 1, self.value)
end
-
+
-- exported
local function SetValue(self, value)
self.value = value
UpdateToggle(self)
end
-
+
-- exported
local function GetValue(self)
return self.value
end
-
+
local function Constructor()
local self = ItemBase.Create(widgetType)
-
+
self.frame:SetScript("OnClick", Frame_OnClick)
-
+
self.SetValue = SetValue
self.GetValue = GetValue
self.OnRelease = OnRelease
-
+
AceGUI:RegisterAsWidget(self)
return self
end
-
+
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
@@ -384,55 +369,55 @@ end
do
local widgetType = "Dropdown-Item-Menu"
local widgetVersion = 2
-
- local function OnEnter(this)
+
+ local function OnEnter()
local self = this.obj
self:Fire("OnEnter")
-
+
if self.specialOnEnter then
self.specialOnEnter(self)
end
-
+
self.highlight:Show()
-
+
if not self.disabled and self.submenu then
self.submenu:Open("TOPLEFT", self.frame, "TOPRIGHT", self.pullout:GetRightBorderWidth(), 0, self.frame:GetFrameLevel() + 100)
end
end
-
- local function OnHide(this)
+
+ local function OnHide()
local self = this.obj
if self.submenu then
self.submenu:Close()
end
end
-
+
-- exported
local function SetMenu(self, menu)
assert(menu.type == "Dropdown-Pullout")
self.submenu = menu
end
-
+
-- exported
local function CloseMenu(self)
self.submenu:Close()
end
-
+
local function Constructor()
local self = ItemBase.Create(widgetType)
-
+
self.sub:Show()
-
+
self.frame:SetScript("OnEnter", OnEnter)
self.frame:SetScript("OnHide", OnHide)
-
+
self.SetMenu = SetMenu
self.CloseMenu = CloseMenu
-
+
AceGUI:RegisterAsWidget(self)
return self
end
-
+
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
@@ -441,31 +426,32 @@ end
do
local widgetType = "Dropdown-Item-Separator"
local widgetVersion = 2
-
+
-- exported, override
local function SetDisabled(self, disabled)
ItemBase.SetDisabled(self, disabled)
self.useHighlight = false
end
-
+
local function Constructor()
local self = ItemBase.Create(widgetType)
-
+
self.SetDisabled = SetDisabled
-
+
local line = self.frame:CreateTexture(nil, "OVERLAY")
line:SetHeight(1)
line:SetTexture(.5, .5, .5)
+
line:SetPoint("LEFT", self.frame, "LEFT", 10, 0)
line:SetPoint("RIGHT", self.frame, "RIGHT", -10, 0)
-
+
self.text:Hide()
-
+
self.useHighlight = false
-
+
AceGUI:RegisterAsWidget(self)
return self
end
-
+
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion + ItemBase.version)
end
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua
index 1c729ab..157cfdf 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-DropDown.lua
@@ -1,48 +1,31 @@
--[[ $Id: AceGUIWidget-DropDown.lua 1116 2014-10-12 08:15:46Z nevcairiel $ ]]--
local AceGUI = LibStub("AceGUI-3.0")
+local AceCore = LibStub("AceCore-3.0")
+
-- Lua APIs
local min, max, floor = math.min, math.max, math.floor
-local select, pairs, ipairs, type = select, pairs, ipairs, type
-local tgetn, tsort = table.getn, table.sort
+local pairs, ipairs, type = pairs, ipairs, type
+local tsort, tinsert, tgetn, tsetn = table.sort, table.insert, table.getn, table.setn
-- WoW APIs
local PlaySound = PlaySound
local UIParent, CreateFrame = UIParent, CreateFrame
-local _G = _G
+local _G = AceCore._G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: CLOSE
-local function fixlevels(parent,...)
- local i = 1
- local child = select(i, arg)
- while child do
- child:SetFrameLevel(parent:GetFrameLevel()+1)
- fixlevels(child, child:GetChildren())
- i = i + 1
- child = select(i, arg)
- end
-end
-
-local function fixstrata(strata, parent, ...)
- local i = 1
- local child = select(i, arg)
- parent:SetFrameStrata(strata)
- while child do
- fixstrata(strata, child, child:GetChildren())
- i = i + 1
- child = select(i, arg)
- end
-end
+local fixlevels = AceGUI.fixlevels
+local fixstrata = AceGUI.fixstrata
do
local widgetType = "Dropdown-Pullout"
local widgetVersion = 3
-
+
--[[ Static data ]]--
-
+
local backdrop = {
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
@@ -60,9 +43,9 @@ do
local defaultWidth = 200
local defaultMaxHeight = 600
-
+
--[[ UI Event Handlers ]]--
-
+
-- HACK: This should be no part of the pullout, but there
-- is no other 'clean' way to response to any item-OnEnter
-- Used to close Submenus when an other item is entered
@@ -74,22 +57,22 @@ do
end
end
end
-
+
-- See the note in Constructor() for each scroll related function
- local function OnMouseWheel(this, value)
- this.obj:MoveScroll(value)
+ local function OnMouseWheel()
+ this.obj:MoveScroll(arg1)
end
-
- local function OnScrollValueChanged(this, value)
- this.obj:SetScroll(value)
+
+ local function OnScrollValueChanged()
+ this.obj:SetScroll(arg1)
end
-
- local function OnSizeChanged(this)
+
+ local function OnSizeChanged()
this.obj:FixScroll()
end
-
+
--[[ Exported methods ]]--
-
+
-- exported
local function SetScroll(self, value)
local status = self.scrollStatus
@@ -106,9 +89,9 @@ do
child:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, offset)
child:SetPoint("TOPRIGHT", frame, "TOPRIGHT", self.slider:IsShown() and -12 or 0, offset)
status.offset = offset
- status.scrollvalue = value
+ status.scrollvalue = value
end
-
+
-- exported
local function MoveScroll(self, value)
local status = self.scrollStatus
@@ -127,7 +110,7 @@ do
self.slider:SetValue(min(max(status.scrollvalue + delta*(1000/(diff/45)),0), 1000))
end
end
-
+
-- exported
local function FixScroll(self)
local status = self.scrollStatus
@@ -140,7 +123,7 @@ do
child:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, offset)
self.slider:SetValue(0)
else
- self.slider:Show()
+ self.slider:Show()
local value = (offset / (viewheight - height) * 1000)
if value > 1000 then value = 1000 end
self.slider:SetValue(value)
@@ -153,44 +136,44 @@ do
end
end
end
-
+
-- exported, AceGUI callback
local function OnAcquire(self)
self.frame:SetParent(UIParent)
--self.itemFrame:SetToplevel(true)
end
-
+
-- exported, AceGUI callback
local function OnRelease(self)
self:Clear()
self.frame:ClearAllPoints()
self.frame:Hide()
end
-
+
-- exported
local function AddItem(self, item)
- self.items[tgetn(self.items) + 1] = item
-
+ tinsert(self.items, item)
+
local h = tgetn(self.items) * 16
self.itemFrame:SetHeight(h)
self.frame:SetHeight(min(h + 34, self.maxHeight)) -- +34: 20 for scrollFrame placement (10 offset) and +14 for item placement
-
+
item.frame:SetPoint("LEFT", self.itemFrame, "LEFT")
item.frame:SetPoint("RIGHT", self.itemFrame, "RIGHT")
-
+
item:SetPullout(self)
item:SetOnEnter(OnEnter)
end
-
+
-- exported
- local function Open(self, point, relFrame, relPoint, x, y)
+ local function Open(self, point, relFrame, relPoint, x, y)
local items = self.items
local frame = self.frame
local itemFrame = self.itemFrame
-
+
frame:SetPoint(point, relFrame, relPoint, x, y)
-
+
local height = 8
for i, item in pairs(items) do
if i == 1 then
@@ -198,23 +181,23 @@ do
else
item:SetPoint("TOP", items[i-1].frame, "BOTTOM", 0, 1)
end
-
+
item:Show()
-
+
height = height + 16
end
itemFrame:SetHeight(height)
- fixstrata("TOOLTIP", frame, frame:GetChildren())
+ fixstrata("TOOLTIP", frame)
frame:Show()
self:Fire("OnOpen")
- end
-
+ end
+
-- exported
local function Close(self)
self.frame:Hide()
self:Fire("OnClose")
- end
-
+ end
+
-- exported
local function Clear(self)
local items = self.items
@@ -222,18 +205,19 @@ do
AceGUI:Release(item)
items[i] = nil
end
- end
-
+ tsetn(items,0)
+ end
+
-- exported
local function IterateItems(self)
return ipairs(self.items)
end
-
+
-- exported
local function SetHideOnLeave(self, val)
self.hideOnLeave = val
end
-
+
-- exported
local function SetMaxHeight(self, height)
self.maxHeight = height or defaultMaxHeight
@@ -243,19 +227,19 @@ do
self.frame:SetHeight(self.itemFrame:GetHeight() + 34) -- see :AddItem
end
end
-
+
-- exported
local function GetRightBorderWidth(self)
return 6 + (self.slider:IsShown() and 12 or 0)
end
-
+
-- exported
local function GetLeftBorderWidth(self)
return 6
end
-
+
--[[ Constructor ]]--
-
+
local function Constructor()
local count = AceGUI:GetNextWidgetNum(widgetType)
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent)
@@ -264,7 +248,7 @@ do
self.type = widgetType
self.frame = frame
frame.obj = self
-
+
self.OnAcquire = OnAcquire
self.OnRelease = OnRelease
@@ -278,37 +262,37 @@ do
self.SetScroll = SetScroll
self.MoveScroll = MoveScroll
self.FixScroll = FixScroll
-
+
self.SetMaxHeight = SetMaxHeight
self.GetRightBorderWidth = GetRightBorderWidth
self.GetLeftBorderWidth = GetLeftBorderWidth
-
+
self.items = {}
-
+
self.scrollStatus = {
scrollvalue = 0,
}
-
+
self.maxHeight = defaultMaxHeight
-
+
frame:SetBackdrop(backdrop)
frame:SetBackdropColor(0, 0, 0)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
frame:SetClampedToScreen(true)
frame:SetWidth(defaultWidth)
- frame:SetHeight(self.maxHeight)
+ frame:SetHeight(self.maxHeight)
--frame:SetToplevel(true)
-
+
-- NOTE: The whole scroll frame code is copied from the AceGUI-3.0 widget ScrollFrame
local scrollFrame = CreateFrame("ScrollFrame", nil, frame)
local itemFrame = CreateFrame("Frame", nil, scrollFrame)
-
+
self.scrollFrame = scrollFrame
self.itemFrame = itemFrame
-
+
scrollFrame.obj = self
itemFrame.obj = self
-
+
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame)
slider:SetOrientation("VERTICAL")
slider:SetHitRectInsets(0, 0, -10, 0)
@@ -318,7 +302,7 @@ do
slider:SetFrameStrata("FULLSCREEN_DIALOG")
self.slider = slider
slider.obj = self
-
+
scrollFrame:SetScrollChild(itemFrame)
scrollFrame:SetPoint("TOPLEFT", frame, "TOPLEFT", 6, -12)
scrollFrame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -6, 12)
@@ -327,59 +311,59 @@ do
scrollFrame:SetScript("OnSizeChanged", OnSizeChanged)
scrollFrame:SetToplevel(true)
scrollFrame:SetFrameStrata("FULLSCREEN_DIALOG")
-
+
itemFrame:SetPoint("TOPLEFT", scrollFrame, "TOPLEFT", 0, 0)
itemFrame:SetPoint("TOPRIGHT", scrollFrame, "TOPRIGHT", -12, 0)
itemFrame:SetHeight(400)
itemFrame:SetToplevel(true)
itemFrame:SetFrameStrata("FULLSCREEN_DIALOG")
-
+
slider:SetPoint("TOPLEFT", scrollFrame, "TOPRIGHT", -16, 0)
slider:SetPoint("BOTTOMLEFT", scrollFrame, "BOTTOMRIGHT", -16, 0)
slider:SetScript("OnValueChanged", OnScrollValueChanged)
slider:SetMinMaxValues(0, 1000)
slider:SetValueStep(1)
slider:SetValue(0)
-
+
scrollFrame:Show()
itemFrame:Show()
slider:Hide()
-
+
self:FixScroll()
-
+
AceGUI:RegisterAsWidget(self)
return self
end
-
+
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
end
do
local widgetType = "Dropdown"
- local widgetVersion = 31
-
+ local widgetVersion = 30
+
--[[ Static data ]]--
-
+
--[[ UI event handler ]]--
-
- local function Control_OnEnter(this)
+
+ local function Control_OnEnter()
this.obj.button:LockHighlight()
this.obj:Fire("OnEnter")
end
-
- local function Control_OnLeave(this)
+
+ local function Control_OnLeave()
this.obj.button:UnlockHighlight()
this.obj:Fire("OnLeave")
end
- local function Dropdown_OnHide(this)
+ local function Dropdown_OnHide()
local self = this.obj
if self.open then
self.pullout:Close()
end
end
-
- local function Dropdown_TogglePullout(this)
+
+ local function Dropdown_TogglePullout()
local self = this.obj
PlaySound("igMainMenuOptionCheckBoxOn") -- missleading name, but the Blizzard code uses this sound
if self.open then
@@ -393,17 +377,17 @@ do
AceGUI:SetFocus(self)
end
end
-
+
local function OnPulloutOpen(this)
local self = this.userdata.obj
local value = self.value
-
+
if not self.multiselect then
for i, item in this:IterateItems() do
item:SetValue(item.userdata.value == value)
end
end
-
+
self.open = true
self:Fire("OnOpened")
end
@@ -413,7 +397,7 @@ do
self.open = nil
self:Fire("OnClosed")
end
-
+
local function ShowMultiText(self)
local text
for i, widget in self.pullout:IterateItems() do
@@ -429,28 +413,31 @@ do
end
self:SetText(text)
end
-
- local function OnItemValueChanged(this, event, checked)
+
+ local function OnItemValueChanged(this, event, _, checked)
local self = this.userdata.obj
-
+
if self.multiselect then
- self:Fire("OnValueChanged", this.userdata.value, checked)
+ self:Fire("OnValueChanged", 2, this.userdata.value, checked)
ShowMultiText(self)
else
if checked then
self:SetValue(this.userdata.value)
- self:Fire("OnValueChanged", this.userdata.value)
+ self:Fire("OnValueChanged", 1, this.userdata.value)
+ this:SetValue(false)
else
+ self:SetValue(nil)
+ self:Fire("OnValueChanged", 1, nil)
this:SetValue(true)
end
- if self.open then
+ if self.open then
self.pullout:Close()
end
end
end
-
+
--[[ Exported methods ]]--
-
+
-- exported, AceGUI callback
local function OnAcquire(self)
local pullout = AceGUI:Create("Dropdown-Pullout")
@@ -459,14 +446,15 @@ do
pullout:SetCallback("OnClose", OnPulloutClose)
pullout:SetCallback("OnOpen", OnPulloutOpen)
self.pullout.frame:SetFrameLevel(self.frame:GetFrameLevel() + 1)
- fixlevels(self.pullout.frame, self.pullout.frame:GetChildren())
-
+ local frame = self.pullout.frame
+ fixlevels(frame)
+
self:SetHeight(44)
self:SetWidth(200)
self:SetLabel()
self:SetPulloutWidth(nil)
end
-
+
-- exported, AceGUI callback
local function OnRelease(self)
if self.open then
@@ -474,20 +462,20 @@ do
end
AceGUI:Release(self.pullout)
self.pullout = nil
-
+
self:SetText("")
self:SetDisabled(false)
self:SetMultiselect(false)
-
+
self.value = nil
self.list = nil
self.open = nil
self.hasClose = nil
-
+
self.frame:ClearAllPoints()
self.frame:Hide()
end
-
+
-- exported
local function SetDisabled(self, disabled)
self.disabled = disabled
@@ -503,19 +491,19 @@ do
self.text:SetTextColor(1,1,1)
end
end
-
+
-- exported
local function ClearFocus(self)
if self.open then
self.pullout:Close()
end
end
-
+
-- exported
local function SetText(self, text)
self.text:SetText(text or "")
end
-
+
-- exported
local function SetLabel(self, text)
if text and text ~= "" then
@@ -532,7 +520,7 @@ do
self.alignoffset = 12
end
end
-
+
-- exported
local function SetValue(self, value)
if self.list then
@@ -540,12 +528,12 @@ do
end
self.value = value
end
-
+
-- exported
local function GetValue(self)
return self.value
end
-
+
-- exported
local function SetItemValue(self, item, value)
if not self.multiselect then return end
@@ -558,7 +546,7 @@ do
end
ShowMultiText(self)
end
-
+
-- exported
local function SetItemDisabled(self, item, disabled)
for i, widget in self.pullout:IterateItems() do
@@ -567,11 +555,11 @@ do
end
end
end
-
+
local function AddListItem(self, value, text, itemType)
if not itemType then itemType = "Dropdown-Item-Toggle" end
local exists = AceGUI:GetWidgetVersion(itemType)
- if not exists then error(format("The given item type, %q, does not exist within AceGUI-3.0", tostring(itemType)), 2) end
+ if not exists then error(("The given item type, %q, does not exist within AceGUI-3.0"):format(tostring(itemType)), 2) end
local item = AceGUI:Create(itemType)
item:SetText(text)
@@ -580,7 +568,7 @@ do
item:SetCallback("OnValueChanged", OnItemValueChanged)
self.pullout:AddItem(item)
end
-
+
local function AddCloseButton(self)
if not self.hasClose then
local close = AceGUI:Create("Dropdown-Item-Execute")
@@ -589,7 +577,7 @@ do
self.hasClose = true
end
end
-
+
-- exported
local sortlist = {}
local function SetList(self, list, order, itemType)
@@ -597,17 +585,18 @@ do
self.pullout:Clear()
self.hasClose = nil
if not list then return end
-
+
if type(order) ~= "table" then
for v in pairs(list) do
- sortlist[tgetn(sortlist) + 1] = v
+ tinsert(sortlist, v)
end
tsort(sortlist)
-
+
for i, key in ipairs(sortlist) do
AddListItem(self, key, list[key], itemType)
sortlist[i] = nil
end
+ tsetn(sortlist,0)
else
for i, key in ipairs(order) do
AddListItem(self, key, list[key], itemType)
@@ -618,7 +607,7 @@ do
AddCloseButton(self)
end
end
-
+
-- exported
local function AddItem(self, value, text, itemType)
if self.list then
@@ -626,7 +615,7 @@ do
AddListItem(self, value, text, itemType)
end
end
-
+
-- exported
local function SetMultiselect(self, multi)
self.multiselect = multi
@@ -635,23 +624,23 @@ do
AddCloseButton(self)
end
end
-
+
-- exported
local function GetMultiselect(self)
return self.multiselect
end
-
+
local function SetPulloutWidth(self, width)
self.pulloutWidth = width
end
-
+
--[[ Constructor ]]--
-
+
local function Constructor()
local count = AceGUI:GetNextWidgetNum(widgetType)
local frame = CreateFrame("Frame", nil, UIParent)
local dropdown = CreateFrame("Frame", "AceGUI30DropDown"..count, frame, "UIDropDownMenuTemplate")
-
+
local self = {}
self.type = widgetType
self.frame = frame
@@ -659,10 +648,10 @@ do
self.count = count
frame.obj = self
dropdown.obj = self
-
+
self.OnRelease = OnRelease
self.OnAcquire = OnAcquire
-
+
self.ClearFocus = ClearFocus
self.SetText = SetText
@@ -677,9 +666,9 @@ do
self.SetItemValue = SetItemValue
self.SetItemDisabled = SetItemDisabled
self.SetPulloutWidth = SetPulloutWidth
-
+
self.alignoffset = 26
-
+
frame:SetScript("OnHide",Dropdown_OnHide)
dropdown:ClearAllPoints()
@@ -690,10 +679,10 @@ do
local left = _G[dropdown:GetName() .. "Left"]
local middle = _G[dropdown:GetName() .. "Middle"]
local right = _G[dropdown:GetName() .. "Right"]
-
+
middle:ClearAllPoints()
right:ClearAllPoints()
-
+
middle:SetPoint("LEFT", left, "RIGHT", 0, 0)
middle:SetPoint("RIGHT", right, "LEFT", 0, 0)
right:SetPoint("TOPRIGHT", dropdown, "TOPRIGHT", 0, 17)
@@ -704,7 +693,7 @@ do
button:SetScript("OnEnter",Control_OnEnter)
button:SetScript("OnLeave",Control_OnLeave)
button:SetScript("OnClick",Dropdown_TogglePullout)
-
+
local button_cover = CreateFrame("BUTTON",nil,self.frame)
self.button_cover = button_cover
button_cover.obj = self
@@ -713,14 +702,14 @@ do
button_cover:SetScript("OnEnter",Control_OnEnter)
button_cover:SetScript("OnLeave",Control_OnLeave)
button_cover:SetScript("OnClick",Dropdown_TogglePullout)
-
+
local text = _G[dropdown:GetName() .. "Text"]
self.text = text
text.obj = self
text:ClearAllPoints()
text:SetPoint("RIGHT", right, "RIGHT" ,-43, 2)
text:SetPoint("LEFT", left, "LEFT", 25, 2)
-
+
local label = frame:CreateFontString(nil,"OVERLAY","GameFontNormalSmall")
label:SetPoint("TOPLEFT",frame,"TOPLEFT",0,0)
label:SetPoint("TOPRIGHT",frame,"TOPRIGHT",0,0)
@@ -732,6 +721,6 @@ do
AceGUI:RegisterAsWidget(self)
return self
end
-
+
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
-end
+end
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua
index 6e5cc3a..a08d937 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua
@@ -1,18 +1,23 @@
--[[-----------------------------------------------------------------------------
EditBox Widget
-------------------------------------------------------------------------------]]
-local Type, Version = "EditBox", 27
+local Type, Version = "EditBox", 26
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
+local AceCore = LibStub("AceCore-3.0")
+local hooksecurefunc = AceCore.hooksecurefunc
+local _G = AceCore._G
+local GetCursorInfo = _G.GetCursorInfo
+
-- Lua APIs
-local tostring, pairs, unpack = tostring, pairs, unpack
+local tostring, pairs = tostring, pairs
-- WoW APIs
local PlaySound = PlaySound
local GetCursorInfo, ClearCursor, GetSpellInfo = GetCursorInfo, ClearCursor, GetSpellInfo
local CreateFrame, UIParent = CreateFrame, UIParent
-local _G = _G
+local strlen = string.len
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
@@ -116,7 +121,7 @@ end
function _G.AceGUIEditBoxInsertLink(text)
for i = 1, AceGUI:GetWidgetCount(Type) do
local editbox = _G["AceGUI-3.0EditBox"..i]
- if editbox and editbox:IsVisible() and editbox:HasFocus() then
+ if editbox and editbox:IsVisible() and editbox.hasfocus then
editbox:Insert(text)
return true
end
@@ -138,73 +143,82 @@ end
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
-local function Control_OnEnter(frame)
- frame.obj:Fire("OnEnter")
+local function Control_OnEnter()
+ this.obj:Fire("OnEnter")
end
-local function Control_OnLeave(frame)
- frame.obj:Fire("OnLeave")
+local function Control_OnLeave()
+ this.obj:Fire("OnLeave")
end
-local function Frame_OnShowFocus(frame)
- frame.obj.editbox:SetFocus()
- frame:SetScript("OnShow", nil)
+local function Frame_OnShowFocus()
+ this.obj.editbox:SetFocus()
+ this:SetScript("OnShow", nil)
end
-local function EditBox_OnEscapePressed(frame)
+local function EditBox_OnEscapePressed()
AceGUI:ClearFocus()
end
-local function EditBox_OnEnterPressed(frame)
- local self = frame.obj
- local value = frame:GetText()
- local cancel = self:Fire("OnEnterPressed", value)
+local function EditBox_OnEnterPressed()
+ local self = this.obj
+ local value = this:GetText()
+ local cancel = self:Fire("OnEnterPressed", 1, value)
if not cancel then
PlaySound("igMainMenuOptionCheckBoxOn")
HideButton(self)
end
end
-local function EditBox_OnReceiveDrag(frame)
- local self = frame.obj
+local function EditBox_OnReceiveDrag()
+ if not GetCursorInfo then return end
+ local self = this.obj
local type, id, info = GetCursorInfo()
if type == "item" then
self:SetText(info)
- self:Fire("OnEnterPressed", info)
+ self:Fire("OnEnterPressed", 1, info)
ClearCursor()
elseif type == "spell" then
- local name = GetSpellInfo(id, info)
- self:SetText(name)
- self:Fire("OnEnterPressed", name)
+ local spell, rank = GetSpellName(id, info)
+ if rank ~= "" then spell = spell.."("..rank..")" end
+ self:SetText(spell)
+ self:Fire("OnEnterPressed", 1, spell)
ClearCursor()
elseif type == "macro" then
local name = GetMacroInfo(id)
self:SetText(name)
- self:Fire("OnEnterPressed", name)
+ self:Fire("OnEnterPressed", 1, name)
ClearCursor()
end
HideButton(self)
AceGUI:ClearFocus()
end
-local function EditBox_OnTextChanged(frame)
- local self = frame.obj
- local value = frame:GetText()
+
+local function EditBox_OnTextChanged()
+ local self = this.obj
+ local value = this:GetText()
if tostring(value) ~= tostring(self.lasttext) then
- self:Fire("OnTextChanged", value)
+ self:Fire("OnTextChanged", 1, value)
self.lasttext = value
ShowButton(self)
end
end
-local function EditBox_OnFocusGained(frame)
- AceGUI:SetFocus(frame.obj)
+local function EditBox_OnFocusGained()
+ this.hasfocus = true
+ AceGUI:SetFocus(this.obj)
end
-local function Button_OnClick(frame)
- local editbox = frame.obj.editbox
+local function EditBox_OnFocusLost()
+ this.hasfocus = nil
+end
+
+local function Button_OnClick()
+ local editbox = this.obj.editbox
editbox:ClearFocus()
- EditBox_OnEnterPressed(editbox)
+ this = editbox -- Ace3v: this is kinda hack here
+ EditBox_OnEnterPressed()
end
--[[-----------------------------------------------------------------------------
@@ -242,7 +256,7 @@ local methods = {
["SetText"] = function(self, text)
self.lasttext = text or ""
self.editbox:SetText(text or "")
- self.editbox:SetCursorPosition(0)
+ self.editbox:HighlightText(0)
HideButton(self)
end,
@@ -313,10 +327,11 @@ local function Constructor()
editbox:SetScript("OnReceiveDrag", EditBox_OnReceiveDrag)
editbox:SetScript("OnMouseDown", EditBox_OnReceiveDrag)
editbox:SetScript("OnEditFocusGained", EditBox_OnFocusGained)
+ editbox:SetScript("OnEditFocusLost", EditBox_OnFocusLost)
editbox:SetTextInsets(0, 0, 3, 3)
editbox:SetMaxLetters(256)
editbox:SetPoint("BOTTOMLEFT", 6, 0)
- editbox:SetPoint("BOTTOMRIGHT")
+ editbox:SetPoint("BOTTOMRIGHT", 0, 0)
editbox:SetHeight(19)
local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua
index e8cecc4..e4793a6 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua
@@ -43,9 +43,9 @@ local function Constructor()
frame:Hide()
local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
- label:SetPoint("TOP", 0, 0)
- label:SetPoint("BOTTOM", 0, 0)
- label:SetJustifyH("CENTER", 0, 0)
+ label:SetPoint("TOP",0,0)
+ label:SetPoint("BOTTOM",0,0)
+ label:SetJustifyH("CENTER")
local left = frame:CreateTexture(nil, "BACKGROUND")
left:SetHeight(8)
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua
index 09b448f..c4d96fd 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua
@@ -6,7 +6,7 @@ local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs
-local select, pairs, print, unpack = select, pairs, print, unpack
+local pairs, print = pairs, print
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
@@ -14,16 +14,16 @@ local CreateFrame, UIParent = CreateFrame, UIParent
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
-local function Control_OnEnter(frame)
- frame.obj:Fire("OnEnter")
+local function Control_OnEnter()
+ this.obj:Fire("OnEnter")
end
-local function Control_OnLeave(frame)
- frame.obj:Fire("OnLeave")
+local function Control_OnLeave()
+ this.obj:Fire("OnLeave")
end
-local function Button_OnClick(frame, button)
- frame.obj:Fire("OnClick", button)
+local function Button_OnClick()
+ this.obj:Fire("OnClick", 1, arg1)
AceGUI:ClearFocus()
end
@@ -53,14 +53,13 @@ local methods = {
end
end,
- ["SetImage"] = function(self, path, ...)
+ ["SetImage"] = function(self, path, a1,a2,a3,a4,a5,a6,a7,a8)
local image = self.image
image:SetTexture(path)
-
+
if image:GetTexture() then
- local n = select("#", arg)
- if n == 4 or n == 8 then
- image:SetTexCoord(unpack(arg))
+ if a4 or a8 then
+ image:SetTexCoord(a1,a2,a3,a4,a5,a6,a7,a8)
else
image:SetTexCoord(0, 1, 0, 1)
end
@@ -132,7 +131,7 @@ local function Constructor()
widget[method] = func
end
- widget.SetText = function(self, ...) print("AceGUI-3.0-Icon: SetText is deprecated! Use SetLabel instead!"); self:SetLabel(unpack(arg)) end
+ widget.SetText = function(self,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) print("AceGUI-3.0-Icon: SetText is deprecated! Use SetLabel instead!"); self:SetLabel(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) end
return AceGUI:RegisterAsWidget(widget)
end
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua
index 77c4a0f..542d20d 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua
@@ -1,12 +1,12 @@
--[[-----------------------------------------------------------------------------
InteractiveLabel Widget
-------------------------------------------------------------------------------]]
-local Type, Version = "InteractiveLabel", 21
+local Type, Version = "InteractiveLabel", 20
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs
-local select, pairs, unpack = select, pairs, unpack
+local pairs = pairs
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
@@ -18,16 +18,16 @@ local CreateFrame, UIParent = CreateFrame, UIParent
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
-local function Control_OnEnter(frame)
- frame.obj:Fire("OnEnter")
+local function Control_OnEnter()
+ this.obj:Fire("OnEnter")
end
-local function Control_OnLeave(frame)
- frame.obj:Fire("OnLeave")
+local function Control_OnLeave()
+ this.obj:Fire("OnLeave")
end
-local function Label_OnClick(frame, button)
- frame.obj:Fire("OnClick", button)
+local function Label_OnClick()
+ this.obj:Fire("OnClick", 1, arg1)
AceGUI:ClearFocus()
end
@@ -44,14 +44,13 @@ local methods = {
-- ["OnRelease"] = nil,
- ["SetHighlight"] = function(self, ...)
- self.highlight:SetTexture(unpack(arg))
+ ["SetHighlight"] = function(self, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+ self.highlight:SetTexture(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
end,
- ["SetHighlightTexCoord"] = function(self, ...)
- local c = select("#", arg)
- if c == 4 or c == 8 then
- self.highlight:SetTexCoord(unpack(arg))
+ ["SetHighlightTexCoord"] = function(self, a1,a2,a3,a4,a5,a6,a7,a8)
+ if a4 or a8 then
+ self.highlight:SetTexCoord(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
else
self.highlight:SetTexCoord(0, 1, 0, 1)
end
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua
index ec4cead..3640432 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua
@@ -21,44 +21,32 @@ local CreateFrame, UIParent = CreateFrame, UIParent
Scripts
-------------------------------------------------------------------------------]]
-local function Control_OnEnter(frame)
- frame.obj:Fire("OnEnter")
+local function Control_OnEnter()
+ this.obj:Fire("OnEnter")
end
-local function Control_OnLeave(frame)
- frame.obj:Fire("OnLeave")
+local function Control_OnLeave()
+ this.obj:Fire("OnLeave")
end
-local function Keybinding_OnClick(frame, button)
- if button == "LeftButton" or button == "RightButton" then
- local self = frame.obj
- if self.waitingForKey then
- frame:EnableKeyboard(false)
- frame:EnableMouseWheel(false)
- self.msgframe:Hide()
- frame:UnlockHighlight()
- self.waitingForKey = nil
- else
- frame:EnableKeyboard(true)
- frame:EnableMouseWheel(true)
- self.msgframe:Show()
- frame:LockHighlight()
- self.waitingForKey = true
- end
- end
- AceGUI:ClearFocus()
+local function Keybinding_OnHide()
+ local self = this.obj
+ this:EnableKeyboard(false)
+ this:EnableMouseWheel(false)
+ self.msgframe:Hide()
+ this:UnlockHighlight()
+ self.waitingForKey = nil
end
local ignoreKeys = {
["BUTTON1"] = true, ["BUTTON2"] = true,
["UNKNOWN"] = true,
- ["LSHIFT"] = true, ["LCTRL"] = true, ["LALT"] = true,
- ["RSHIFT"] = true, ["RCTRL"] = true, ["RALT"] = true,
+ ["SHIFT"] = true, ["CTRL"] = true, ["ALT"] = true,
}
-local function Keybinding_OnKeyDown(frame, key)
- local self = frame.obj
+local function Keybinding_OnKeyDown()
+ local self = this.obj
if self.waitingForKey then
- local keyPressed = key
+ local keyPressed = arg1
if keyPressed == "ESCAPE" then
keyPressed = ""
else
@@ -74,40 +62,58 @@ local function Keybinding_OnKeyDown(frame, key)
end
end
- frame:EnableKeyboard(false)
- frame:EnableMouseWheel(false)
+ this:EnableKeyboard(false)
+ this:EnableMouseWheel(false)
self.msgframe:Hide()
- frame:UnlockHighlight()
+ this:UnlockHighlight()
self.waitingForKey = nil
if not self.disabled then
self:SetKey(keyPressed)
- self:Fire("OnKeyChanged", keyPressed)
+ self:Fire("OnKeyChanged", 1, keyPressed)
end
end
end
-local function Keybinding_OnMouseDown(frame, button)
- if button == "LeftButton" or button == "RightButton" then
- return
- elseif button == "MiddleButton" then
- button = "BUTTON3"
- elseif button == "Button4" then
- button = "BUTTON4"
- elseif button == "Button5" then
- button = "BUTTON5"
- end
- Keybinding_OnKeyDown(frame, button)
+local function Keybinding_OnMouseDown()
+ getglobal(this:GetName().."Left"):SetTexture("Interface\\Buttons\\UI-Panel-Button-Down");
+ getglobal(this:GetName().."Middle"):SetTexture("Interface\\Buttons\\UI-Panel-Button-Down");
+ getglobal(this:GetName().."Right"):SetTexture("Interface\\Buttons\\UI-Panel-Button-Down");
end
-local function Keybinding_OnMouseWheel(frame, direction)
- local button
- if direction >= 0 then
- button = "MOUSEWHEELUP"
- else
- button = "MOUSEWHEELDOWN"
+local function Keybinding_OnMouseUp()
+ getglobal(this:GetName().."Left"):SetTexture("Interface\\Buttons\\UI-Panel-Button-Up");
+ getglobal(this:GetName().."Middle"):SetTexture("Interface\\Buttons\\UI-Panel-Button-Up");
+ getglobal(this:GetName().."Right"):SetTexture("Interface\\Buttons\\UI-Panel-Button-Up");
+ local self = this.obj
+ if MouseIsOver(this) and not self.disabled then
+ if self.waitingForKey then
+ if arg1 ~= "LeftButton" and arg1 ~= "RightButton" then
+ Keybinding_OnKeyDown()
+ end
+ this:EnableKeyboard(false)
+ this:EnableMouseWheel(false)
+ self.msgframe:Hide()
+ this:UnlockHighlight()
+ self.waitingForKey = nil
+ else
+ this:EnableKeyboard(true)
+ this:EnableMouseWheel(true)
+ self.msgframe:Show()
+ this:LockHighlight()
+ self.waitingForKey = true
+ end
end
- Keybinding_OnKeyDown(frame, button)
+ AceGUI:ClearFocus()
+end
+
+local function Keybinding_OnMouseWheel()
+ if arg1 >= 0 then
+ arg1 = "MOUSEWHEELUP"
+ else
+ arg1 = "MOUSEWHEELDOWN"
+ end
+ Keybinding_OnKeyDown()
end
--[[-----------------------------------------------------------------------------
@@ -141,10 +147,10 @@ local methods = {
["SetKey"] = function(self, key)
if (key or "") == "" then
self.button:SetText(NOT_BOUND)
- self.button:SetNormalFontObject("GameFontNormal")
+ self.text:SetFontObject("GameFontNormal")
else
self.button:SetText(key)
- self.button:SetNormalFontObject("GameFontHighlight")
+ self.text:SetFontObject("GameFontHighlight")
end
end,
@@ -179,28 +185,31 @@ local ControlBackdrop = {
insets = { left = 3, right = 3, top = 3, bottom = 3 }
}
-local function keybindingMsgFixWidth(frame)
- frame:SetWidth(frame.msg:GetWidth() + 10)
- frame:SetScript("OnUpdate", nil)
+local function keybindingMsgFixWidth()
+ this:SetWidth(this.msg:GetWidth() + 10)
+ this:SetScript("OnUpdate", nil)
end
local function Constructor()
local name = "AceGUI30KeybindingButton" .. AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame", nil, UIParent)
- local button = CreateFrame("Button", name, frame, "UIPanelButtonTemplate")
+ local button = CreateFrame("Button", name, frame, "UIPanelButtonTemplate2")
button:EnableMouse(true)
button:EnableMouseWheel(false)
- button:RegisterForClicks("AnyDown")
button:SetScript("OnEnter", Control_OnEnter)
button:SetScript("OnLeave", Control_OnLeave)
- button:SetScript("OnClick", Keybinding_OnClick)
+
button:SetScript("OnKeyDown", Keybinding_OnKeyDown)
+ button:RegisterForClicks("AnyDown","AnyUp")
+ -- Ace3v: RegisterForClicks means OnClick will not be triggered, so use OnKeyDown and OnKeyUp
button:SetScript("OnMouseDown", Keybinding_OnMouseDown)
+ button:SetScript("OnMouseUp", Keybinding_OnMouseUp)
button:SetScript("OnMouseWheel", Keybinding_OnMouseWheel)
- button:SetPoint("BOTTOMLEFT")
- button:SetPoint("BOTTOMRIGHT")
+ button:SetScript("OnHide", Keybinding_OnHide)
+ button:SetPoint("BOTTOMLEFT",0,0)
+ button:SetPoint("BOTTOMRIGHT",0,0)
button:SetHeight(24)
button:EnableKeyboard(false)
@@ -209,8 +218,8 @@ local function Constructor()
text:SetPoint("RIGHT", -7, 0)
local label = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
- label:SetPoint("TOPLEFT")
- label:SetPoint("TOPRIGHT")
+ label:SetPoint("TOPLEFT",0,0)
+ label:SetPoint("TOPRIGHT",0,0)
label:SetJustifyH("CENTER")
label:SetHeight(18)
@@ -236,7 +245,8 @@ local function Constructor()
msgframe = msgframe,
frame = frame,
alignoffset = 30,
- type = Type
+ type = Type,
+ text = text
}
for method, func in pairs(methods) do
widget[method] = func
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Label.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Label.lua
index 47e0337..53dd0e0 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Label.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Label.lua
@@ -2,12 +2,12 @@
Label Widget
Displays text and optionally an icon.
-------------------------------------------------------------------------------]]
-local Type, Version = "Label", 24
+local Type, Version = "Label", 23
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs
-local max, select, pairs, unpack = math.max, select, pairs, unpack
+local max, pairs = math.max, pairs
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent
@@ -35,14 +35,14 @@ local function UpdateImageAnchor(self)
local imagewidth = image:GetWidth()
if (width - imagewidth) < 200 or (label:GetText() or "") == "" then
-- image goes on top centered when less than 200 width for the text, or if there is no text
- image:SetPoint("TOP")
+ image:SetPoint("TOP",0,0)
label:SetPoint("TOP", image, "BOTTOM")
- label:SetPoint("LEFT")
+ label:SetPoint("LEFT",0,0)
label:SetWidth(width)
height = image:GetHeight() + label:GetHeight()
else
-- image on the left
- image:SetPoint("TOPLEFT")
+ image:SetPoint("TOPLEFT",0,0)
if image:GetHeight() > label:GetHeight() then
label:SetPoint("LEFT", image, "RIGHT", 4, 0)
else
@@ -53,7 +53,7 @@ local function UpdateImageAnchor(self)
end
else
-- no image shown
- label:SetPoint("TOPLEFT")
+ label:SetPoint("TOPLEFT",0,0)
label:SetWidth(width)
height = label:GetHeight()
end
@@ -78,8 +78,6 @@ local methods = {
self:SetImageSize(16, 16)
self:SetColor()
self:SetFontObject()
- self:SetJustifyH("LEFT")
- self:SetJustifyV("TOP")
-- reset the flag
self.resizing = nil
@@ -105,15 +103,14 @@ local methods = {
self.label:SetVertexColor(r, g, b)
end,
- ["SetImage"] = function(self, path, ...)
+ ["SetImage"] = function(self, path, a1,a2,a3,a4,a5,a6,a7,a8)
local image = self.image
image:SetTexture(path)
if image:GetTexture() then
self.imageshown = true
- local n = select("#", arg)
- if n == 4 or n == 8 then
- image:SetTexCoord(unpack(arg))
+ if a4 or a8 then
+ image:SetTexCoord(a1,a2,a3,a4,a5,a6,a7,a8)
else
image:SetTexCoord(0, 1, 0, 1)
end
@@ -136,14 +133,6 @@ local methods = {
self.image:SetHeight(height)
UpdateImageAnchor(self)
end,
-
- ["SetJustifyH"] = function(self, justifyH)
- self.label:SetJustifyH(justifyH)
- end,
-
- ["SetJustifyV"] = function(self, justifyV)
- self.label:SetJustifyV(justifyV)
- end,
}
--[[-----------------------------------------------------------------------------
@@ -154,6 +143,9 @@ local function Constructor()
frame:Hide()
local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlightSmall")
+ label:SetJustifyH("LEFT")
+ label:SetJustifyV("TOP")
+
local image = frame:CreateTexture(nil, "BACKGROUND")
-- create widget
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua
index b47870d..9adee87 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-MultiLineEditBox.lua
@@ -2,13 +2,17 @@ local Type, Version = "MultiLineEditBox", 28
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
+local AceCore = LibStub("AceCore-3.0")
+local hooksecurefunc = AceCore.hooksecurefunc
+
-- Lua APIs
-local pairs, unpack = pairs, unpack
+local strfmt = string.format
+local pairs = pairs
-- WoW APIs
local GetCursorInfo, GetSpellInfo, ClearCursor = GetCursorInfo, GetSpellInfo, ClearCursor
local CreateFrame, UIParent = CreateFrame, UIParent
-local _G = _G
+local _G = AceCore._G
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
@@ -17,7 +21,6 @@ local _G = _G
--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]
-
if not AceGUIMultiLineEditBoxInsertLink then
-- upgradeable hook
hooksecurefunc("BankFrameItemButtonGeneric_OnClick",
@@ -112,15 +115,14 @@ end
function _G.AceGUIMultiLineEditBoxInsertLink(text)
for i = 1, AceGUI:GetWidgetCount(Type) do
- local editbox = _G[format("MultiLineEditBox%uEdit", i)]
- if editbox and editbox:IsVisible() and editbox:HasFocus() then
+ local editbox = _G[strfmt("MultiLineEditBox%uEdit",i)]
+ if editbox and editbox:IsVisible() and editbox.hasfocus then
editbox:Insert(text)
return true
end
end
end
-
local function Layout(self)
self:SetHeight(self.numlines * 14 + (self.disablebutton and 19 or 41) + self.labelHeight)
@@ -142,104 +144,122 @@ end
--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]
-local function OnClick(self) -- Button
- self = self.obj
+local function OnClick() -- Button
+ local self = this.obj
self.editBox:ClearFocus()
- if not self:Fire("OnEnterPressed", self.editBox:GetText()) then
+ if not self:Fire("OnEnterPressed", 1, self.editBox:GetText()) then
self.button:Disable()
end
end
-local function OnCursorChanged(self, _, y, _, cursorHeight) -- EditBox
- self, y = self.obj.scrollFrame, -y
+local function OnCursorChanged() -- EditBox
+
+ local self, y = this.obj.scrollFrame, -arg2
local offset = self:GetVerticalScroll()
if y < offset then
self:SetVerticalScroll(y)
else
- y = y + cursorHeight - self:GetHeight()
+ y = y + arg4 - self:GetHeight()
if y > offset then
self:SetVerticalScroll(y)
end
end
end
-local function OnEditFocusLost(self) -- EditBox
- self:HighlightText(0, 0)
- self.obj:Fire("OnEditFocusLost")
+local function OnEditFocusLost() -- EditBox
+ this.hasfocus = nil
+ this:HighlightText(0, 0)
+ this.obj:Fire("OnEditFocusLost")
end
-local function OnEnter(self) -- EditBox / ScrollFrame
- self = self.obj
+local function OnEnter() -- EditBox / ScrollFrame
+ local self = this.obj
if not self.entered then
self.entered = true
self:Fire("OnEnter")
end
end
-local function OnLeave(self) -- EditBox / ScrollFrame
- self = self.obj
+local function OnLeave() -- EditBox / ScrollFrame
+ local self = this.obj
if self.entered then
self.entered = nil
self:Fire("OnLeave")
end
end
-local function OnMouseUp(self) -- ScrollFrame
- self = self.obj.editBox
+local function OnMouseUp() -- ScrollFrame
+ local self = this.obj.editBox
self:SetFocus()
- self:SetCursorPosition(self:GetNumLetters())
+ local n = self:GetNumLetters()
+ self:HighlightText(n,n)
end
-local function OnReceiveDrag(self) -- EditBox / ScrollFrame
+local function OnReceiveDrag() -- EditBox / ScrollFrame
+ if not GetCursorInfo then return end
local type, id, info = GetCursorInfo()
if type == "spell" then
- info = GetSpellInfo(id, info)
+ local spell, rank = GetSpellName(id, info)
+ if rank ~= "" then spell = spell.."("..rank..")" end
+ info = spell
elseif type ~= "item" then
return
end
ClearCursor()
- self = self.obj
+ local self = this.obj
local editBox = self.editBox
- if not editBox:HasFocus() then
+ if not this.hasfocus then
+ this.hasfocus = true
editBox:SetFocus()
- editBox:SetCursorPosition(editBox:GetNumLetters())
+ local n = editBox:GetNumLetters()
+ editBox:HighlightText(n,n)
end
editBox:Insert(info)
self.button:Enable()
end
-local function OnSizeChanged(self, width, height) -- ScrollFrame
- self.obj.editBox:SetWidth(width)
+local function OnSizeChanged() -- ScrollFrame
+ this.obj.editBox:SetWidth(arg1)
end
-local function OnTextChanged(self, userInput) -- EditBox
- if userInput then
- self = self.obj
- self:Fire("OnTextChanged", self.editBox:GetText())
+local function OnTextChanged() -- EditBox
+ local self = this.obj
+ local value = this:GetText()
+ if tostring(value) ~= tostring(self.lasttext) then
+ self:Fire("OnTextChanged", 1, value)
+ self.lasttext = value
self.button:Enable()
end
end
-local function OnTextSet(self) -- EditBox
- self:HighlightText(0, 0)
- self:SetCursorPosition(self:GetNumLetters())
- self:SetCursorPosition(0)
- self.obj.button:Disable()
+local function OnTextSet() -- EditBox
+ this:HighlightText(0, 0)
+ this.obj.button:Disable()
end
-local function OnVerticalScroll(self, offset) -- ScrollFrame
- local editBox = self.obj.editBox
- editBox:SetHitRectInsets(0, 0, offset, editBox:GetHeight() - offset - self:GetHeight())
+local function OnVerticalScroll() -- ScrollFrame
+ local self = this.obj
+ local editBox = self.editBox
+ editBox:SetHitRectInsets(0, 0, arg1, editBox:GetHeight() - arg1 - this:GetHeight())
+
+ self.scrollFrame:SetScrollChild(self.editBox)
+ self.editBox:SetPoint("TOPLEFT",0,arg1)
+ self.editBox:SetPoint("TOPRIGHT",0,arg1)
end
-local function OnShowFocus(frame)
- frame.obj.editBox:SetFocus()
- frame:SetScript("OnShow", nil)
+local function OnShowFocus()
+ this.obj.editBox:SetFocus()
+ this:SetScript("OnShow", nil)
end
-local function OnEditFocusGained(frame)
- AceGUI:SetFocus(frame.obj)
- frame.obj:Fire("OnEditFocusGained")
+local function OnEditFocusGained()
+ this.hasfocus = true
+ AceGUI:SetFocus(this.obj)
+ this.obj:Fire("OnEditFocusGained")
+end
+
+local function OnEscapePressed() -- EditBox
+ AceGUI:ClearFocus()
end
--[[-----------------------------------------------------------------------------
@@ -300,7 +320,10 @@ local methods = {
end,
["SetText"] = function(self, text)
- self.editBox:SetText(text)
+ self.lasttext = text or ""
+ self.editBox:SetText(text or "")
+ self.editBox:HighlightText(0)
+ self.button:Disable()
end,
["GetText"] = function(self)
@@ -320,7 +343,7 @@ local methods = {
end
Layout(self)
end,
-
+
["ClearFocus"] = function(self)
self.editBox:ClearFocus()
self.frame:SetScript("OnShow", nil)
@@ -336,16 +359,6 @@ local methods = {
["HighlightText"] = function(self, from, to)
self.editBox:HighlightText(from, to)
end,
-
- ["GetCursorPosition"] = function(self)
- return self.editBox:GetCursorPosition()
- end,
-
- ["SetCursorPosition"] = function(self, ...)
- return self.editBox:SetCursorPosition(unpack(arg))
- end,
-
-
}
--[[-----------------------------------------------------------------------------
@@ -360,7 +373,7 @@ local backdrop = {
local function Constructor()
local frame = CreateFrame("Frame", nil, UIParent)
frame:Hide()
-
+
local widgetNum = AceGUI:GetNextWidgetNum(Type)
local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
@@ -370,14 +383,14 @@ local function Constructor()
label:SetText(ACCEPT)
label:SetHeight(10)
- local button = CreateFrame("Button", format("%s%dButton", Type, widgetNum), frame, "UIPanelButtonTemplate")
+ local button = CreateFrame("Button", strfmt("%s%dButton", Type, widgetNum), frame, "UIPanelButtonTemplate")
button:SetPoint("BOTTOMLEFT", 0, 4)
button:SetHeight(22)
button:SetWidth(label:GetStringWidth() + 24)
button:SetText(ACCEPT)
button:SetScript("OnClick", OnClick)
button:Disable()
-
+
local text = button:GetFontString()
text:ClearAllPoints()
text:SetPoint("TOPLEFT", button, "TOPLEFT", 5, -5)
@@ -389,7 +402,7 @@ local function Constructor()
scrollBG:SetBackdropColor(0, 0, 0)
scrollBG:SetBackdropBorderColor(0.4, 0.4, 0.4)
- local scrollFrame = CreateFrame("ScrollFrame", format("%s%dScrollFrame", Type, widgetNum), frame, "UIPanelScrollFrameTemplate")
+ local scrollFrame = CreateFrame("ScrollFrame", strfmt("%s%dScrollFrame", Type, widgetNum), frame, "UIPanelScrollFrameTemplate")
local scrollBar = _G[scrollFrame:GetName() .. "ScrollBar"]
scrollBar:ClearAllPoints()
@@ -407,28 +420,37 @@ local function Constructor()
scrollFrame:SetScript("OnMouseUp", OnMouseUp)
scrollFrame:SetScript("OnReceiveDrag", OnReceiveDrag)
scrollFrame:SetScript("OnSizeChanged", OnSizeChanged)
- scrollFrame:HookScript("OnVerticalScroll", OnVerticalScroll)
+ local old = scrollFrame:GetScript("OnVerticalScroll");
+ if old then
+ scrollFrame:SetScript("OnVerticalScroll", function()
+ old()
+ OnVerticalScroll()
+ end)
+ else
+ scrollFrame:SetScript("OnVerticalScroll", OnVerticalScroll)
+ end
- local editBox = CreateFrame("EditBox", format("%s%dEdit", Type, widgetNum), scrollFrame)
- editBox:SetAllPoints()
+ local editBox = CreateFrame("EditBox", strfmt("%s%dEdit", Type, widgetNum), scrollFrame)
editBox:SetFontObject(ChatFontNormal)
editBox:SetMultiLine(true)
editBox:EnableMouse(true)
editBox:SetAutoFocus(false)
- editBox:SetCountInvisibleLetters(false)
+ --editBox:SetCountInvisibleLetters(false)
editBox:SetScript("OnCursorChanged", OnCursorChanged)
editBox:SetScript("OnEditFocusLost", OnEditFocusLost)
editBox:SetScript("OnEnter", OnEnter)
- editBox:SetScript("OnEscapePressed", editBox.ClearFocus)
+ editBox:SetScript("OnEscapePressed", OnEscapePressed)
editBox:SetScript("OnLeave", OnLeave)
editBox:SetScript("OnMouseDown", OnReceiveDrag)
editBox:SetScript("OnReceiveDrag", OnReceiveDrag)
editBox:SetScript("OnTextChanged", OnTextChanged)
editBox:SetScript("OnTextSet", OnTextSet)
editBox:SetScript("OnEditFocusGained", OnEditFocusGained)
-
+ -- Ace3v: the orders are important here
scrollFrame:SetScrollChild(editBox)
+ editBox:SetPoint("TOPLEFT",0,0)
+ editBox:SetPoint("TOPRIGHT",0,0)
local widget = {
button = button,
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua
index 0e65ed5..7764196 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua
@@ -2,13 +2,12 @@
Slider Widget
Graphical Slider, like, for Range values.
-------------------------------------------------------------------------------]]
-local Type, Version = "Slider", 22
+local Type, Version = "Slider", 21
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
-- Lua APIs
local min, max, floor = math.min, math.max, math.floor
-local gsub = string.gsub
local tonumber, pairs = tonumber, pairs
-- WoW APIs
@@ -25,7 +24,7 @@ Support functions
local function UpdateText(self)
local value = self.value or 0
if self.ispercent then
- self.editbox:SetText(format("%s%%", floor(value * 1000 + 0.5) / 10))
+ self.editbox:SetText(("%s%%"):format(floor(value * 1000 + 0.5) / 10))
else
self.editbox:SetText(floor(value * 100 + 0.5) / 100)
end
@@ -34,8 +33,8 @@ end
local function UpdateLabels(self)
local min, max = (self.min or 0), (self.max or 100)
if self.ispercent then
- self.lowtext:SetText(format("%s%%", (min * 100)))
- self.hightext:SetText(format("%s%%", (max * 100)))
+ self.lowtext:SetFormattedText("%s%%", (min * 100))
+ self.hightext:SetFormattedText("%s%%", (max * 100))
else
self.lowtext:SetText(min)
self.hightext:SetText(max)
@@ -68,7 +67,7 @@ local function Slider_OnValueChanged()
end
if newvalue ~= self.value and not self.disabled then
self.value = newvalue
- self:Fire("OnValueChanged", newvalue)
+ self:Fire("OnValueChanged", 1, newvalue)
end
if self.value then
UpdateText(self)
@@ -78,7 +77,7 @@ end
local function Slider_OnMouseUp()
local self = this.obj
- self:Fire("OnMouseUp", self.value)
+ self:Fire("OnMouseUp", 1, self.value)
end
local function Slider_OnMouseWheel()
@@ -102,7 +101,7 @@ local function EditBox_OnEnterPressed()
local self = this.obj
local value = this:GetText()
if self.ispercent then
- value = gsub(value, '%%', '')
+ value = value:gsub('%%', '')
value = tonumber(value) / 100
else
value = tonumber(value)
@@ -111,7 +110,7 @@ local function EditBox_OnEnterPressed()
if value then
PlaySound("igMainMenuOptionCheckBoxOn")
self.slider:SetValue(value)
- self:Fire("OnMouseUp", value)
+ self:Fire("OnMouseUp", 1, value)
end
end
@@ -222,9 +221,9 @@ local function Constructor()
frame:SetScript("OnMouseDown", Frame_OnMouseDown)
local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
- label:SetPoint("TOPLEFT", 0, 0)
- label:SetPoint("TOPRIGHT", 0, 0)
- label:SetJustifyH("CENTER", 0, 0)
+ label:SetPoint("TOPLEFT",0,0)
+ label:SetPoint("TOPRIGHT",0,0)
+ label:SetJustifyH("CENTER",0,0)
label:SetHeight(15)
local slider = CreateFrame("Slider", nil, frame)
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/widgets.xml b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/widgets.xml
index e2b1304..4c67991 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/widgets.xml
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/AceGUI-3.0/widgets/widgets.xml
@@ -12,7 +12,6 @@
-
diff --git a/2/3/4/5/6/7/ElvUI_Config/Libraries/Load_Libraries.xml b/2/3/4/5/6/7/ElvUI_Config/Libraries/Load_Libraries.xml
index 6c758d6..02e8198 100644
--- a/2/3/4/5/6/7/ElvUI_Config/Libraries/Load_Libraries.xml
+++ b/2/3/4/5/6/7/ElvUI_Config/Libraries/Load_Libraries.xml
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI_Config/UnitFrames.lua b/2/3/4/5/6/7/ElvUI_Config/UnitFrames.lua
new file mode 100644
index 0000000..1d05c8e
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI_Config/UnitFrames.lua
@@ -0,0 +1,6865 @@
+local E, L, V, P, G = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
+local UF = E:GetModule("UnitFrames");
+
+local ns = oUF
+local ElvUF = ns.oUF
+
+local _G = _G
+local next = next
+local select = select
+local pairs = pairs
+local ipairs = ipairs
+local format = string.format
+local tremove = table.remove
+local tconcat = table.concat
+local tinsert = table.insert
+local twipe = table.wipe
+local strsplit = strsplit
+local match = string.match
+local gsub = string.gsub
+local IsAddOnLoaded = IsAddOnLoaded
+local GetScreenWidth = GetScreenWidth
+local RAID_CLASS_COLORS = RAID_CLASS_COLORS
+local FRIEND, ENEMY, SHOW, HIDE, DELETE, NONE, FILTERS, FONT_SIZE, COLOR = "FRIEND", "ENEMY", "SHOW", "HIDE", "DELETE", "NONE", "FILTERS", "FONT_SIZE", "COLOR"
+
+local SHIFT_KEY, ALT_KEY, CTRL_KEY = "SHIFT_KEY", "ALT_KEY", "CTRL_KEY"
+local HEALTH, MANA, NAME, PLAYER, CLASS, ROLE, GROUP = "HEALTH", "MANA", "NAME", "PLAYER", "CLASS", "ROLE", "GROUP"
+local RAGE, FOCUS, ENERGY, PAIN, FURY, INSANITY, MAELSTROM, RUNIC_POWER, HOLY_POWER, LUNAR_POWER = "RAGE", "FOCUS", "ENERGY", "PAIN", "FURY", "INSANITY", "MAELSTROM", "RUNIC_POWER", "HOLY_POWER", "LUNAR_POWER"
+local POWER_TYPE_ARCANE_CHARGES, SOUL_SHARDS, RUNES = "POWER_TYPE_ARCANE_CHARGES", "SOUL_SHARDS", "RUNES"
+------------------------------
+
+local ACD = LibStub("AceConfigDialog-3.0")
+local fillValues = {
+ ["fill"] = L["Filled"],
+ ["spaced"] = L["Spaced"],
+ ["inset"] = L["Inset"]
+};
+
+local positionValues = {
+ TOPLEFT = "TOPLEFT",
+ LEFT = "LEFT",
+ BOTTOMLEFT = "BOTTOMLEFT",
+ RIGHT = "RIGHT",
+ TOPRIGHT = "TOPRIGHT",
+ BOTTOMRIGHT = "BOTTOMRIGHT",
+ CENTER = "CENTER",
+ TOP = "TOP",
+ BOTTOM = "BOTTOM",
+};
+
+local threatValues = {
+ ["GLOW"] = L["Glow"],
+ ["BORDERS"] = L["Borders"],
+ ["HEALTHBORDER"] = L["Health Border"],
+ ["INFOPANELBORDER"] = L["InfoPanel Border"],
+ ["ICONTOPLEFT"] = L["Icon: TOPLEFT"],
+ ["ICONTOPRIGHT"] = L["Icon: TOPRIGHT"],
+ ["ICONBOTTOMLEFT"] = L["Icon: BOTTOMLEFT"],
+ ["ICONBOTTOMRIGHT"] = L["Icon: BOTTOMRIGHT"],
+ ["ICONLEFT"] = L["Icon: LEFT"],
+ ["ICONRIGHT"] = L["Icon: RIGHT"],
+ ["ICONTOP"] = L["Icon: TOP"],
+ ["ICONBOTTOM"] = L["Icon: BOTTOM"],
+ ["NONE"] = "NONE"
+}
+
+local petAnchors = {
+ TOPLEFT = "TOPLEFT",
+ LEFT = "LEFT",
+ BOTTOMLEFT = "BOTTOMLEFT",
+ RIGHT = "RIGHT",
+ TOPRIGHT = "TOPRIGHT",
+ BOTTOMRIGHT = "BOTTOMRIGHT",
+ TOP = "TOP",
+ BOTTOM = "BOTTOM",
+};
+
+local auraBarsSortValues = {
+ ["TIME_REMAINING"] = L["Time Remaining"],
+ ["TIME_REMAINING_REVERSE"] = L["Time Remaining Reverse"],
+ ["TIME_DURATION"] = L["Duration"],
+ ["TIME_DURATION_REVERSE"] = L["Duration Reverse"],
+ ["NAME"] = "NAME",
+ ["NONE"] = "NONE",
+}
+
+local auraSortValues = {
+ ["TIME_REMAINING"] = L["Time Remaining"],
+ ["DURATION"] = L["Duration"],
+ ["NAME"] = "NAME",
+ ["INDEX"] = L["Index"],
+ ["PLAYER"] = "PLAYER",
+}
+
+local auraSortMethodValues = {
+ ["ASCENDING"] = L["Ascending"],
+ ["DESCENDING"] = L["Descending"]
+}
+
+local CUSTOMTEXT_CONFIGS = {}
+
+local carryFilterFrom, carryFilterTo
+local function filterValue(value)
+ return gsub(value,"([%(%)%.%%%+%-%*%?%[%^%$])","%%%1")
+end
+
+local function filterMatch(s,v)
+ local m1, m2, m3, m4 = "^"..v.."$", "^"..v..",", ","..v.."$", ","..v..","
+ return (match(s, m1) and m1) or (match(s, m2) and m2) or (match(s, m3) and m3) or (match(s, m4) and v..",")
+end
+
+local function filterPriority(auraType, groupName, value, remove, movehere, friendState)
+ if not auraType or not value then return end
+ local filter = E.db.unitframe.units[groupName] and E.db.unitframe.units[groupName][auraType] and E.db.unitframe.units[groupName][auraType].priority
+ if not filter then return end
+ local found = filterMatch(filter, filterValue(value))
+ if found and movehere then
+ local tbl, sv, sm = {strsplit(",",filter)}
+ for i in ipairs(tbl) do
+ if tbl[i] == value then sv = i elseif tbl[i] == movehere then sm = i end
+ if sv and sm then break end
+ end
+ tremove(tbl, sm);tinsert(tbl, sv, movehere);
+ E.db.unitframe.units[groupName][auraType].priority = tconcat(tbl,",")
+ elseif found and friendState then
+ local realValue = match(value, "^Friendly:([^,]*)") or match(value, "^Enemy:([^,]*)") or value
+ local friend = filterMatch(filter, filterValue("Friendly:"..realValue))
+ local enemy = filterMatch(filter, filterValue("Enemy:"..realValue))
+ local default = filterMatch(filter, filterValue(realValue))
+
+ local state =
+ (friend and (not enemy) and format("%s%s","Enemy:",realValue)) --[x] friend [ ] enemy: > enemy
+ or ((not enemy and not friend) and format("%s%s","Friendly:",realValue)) --[ ] friend [ ] enemy: > friendly
+ or (enemy and (not friend) and default and format("%s%s","Friendly:",realValue)) --[ ] friend [x] enemy: (default exists) > friendly
+ or (enemy and (not friend) and match(value, "^Enemy:") and realValue) --[ ] friend [x] enemy: (no default) > realvalue
+ or (friend and enemy and realValue) --[x] friend [x] enemy: > default
+
+ if state then
+ local stateFound = filterMatch(filter, filterValue(state))
+ if not stateFound then
+ local tbl, sv, sm = {strsplit(",",filter)}
+ for i in ipairs(tbl) do
+ if tbl[i] == value then sv = i;break end
+ end
+ tinsert(tbl, sv, state);tremove(tbl, sv+1)
+ E.db.unitframe.units[groupName][auraType].priority = tconcat(tbl,",")
+ end
+ end
+ elseif found and remove then
+ E.db.unitframe.units[groupName][auraType].priority = gsub(filter, found, "")
+ elseif not found and not remove then
+ E.db.unitframe.units[groupName][auraType].priority = (filter == "" and value) or (filter..","..value)
+ end
+end
+
+-----------------------------------------------------------------------
+-- OPTIONS TABLES
+-----------------------------------------------------------------------
+local function GetOptionsTable_AuraBars(friendlyOnly, updateFunc, groupName)
+ local config = {
+ order = 1100,
+ type = "group",
+ name = L["Aura Bars"],
+ get = function(info) return E.db.unitframe.units[groupName]["aurabar"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["aurabar"][ info[getn(info)] ] = value; updateFunc(UF, groupName) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Aura Bars"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ configureButton1 = {
+ order = 3,
+ name = L["Coloring"],
+ desc = L["This opens the UnitFrames Color settings. These settings affect all unitframes."],
+ type = "execute",
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup", "auraBars") end,
+ },
+ configureButton2 = {
+ order = 4,
+ name = L["Coloring (Specific)"],
+ type = "execute",
+ func = function() E:SetToFilterConfig("AuraBar Colors") end,
+ },
+ anchorPoint = {
+ type = "select",
+ order = 5,
+ name = L["Anchor Point"],
+ desc = L["What point to anchor to the frame you set to attach to."],
+ values = {
+ ["ABOVE"] = L["Above"],
+ ["BELOW"] = L["Below"],
+ },
+ },
+ attachTo = {
+ type = "select",
+ order = 6,
+ name = L["Attach To"],
+ desc = L["The object you want to attach to."],
+ values = {
+ ["FRAME"] = L["Frame"],
+ ["DEBUFFS"] = L["Debuffs"],
+ ["BUFFS"] = L["Buffs"],
+ },
+ },
+ height = {
+ type = "range",
+ order = 7,
+ name = L["Height"],
+ min = 6, max = 40, step = 1,
+ },
+ maxBars = {
+ type = "range",
+ order = 8,
+ name = L["Max Bars"],
+ min = 1, max = 40, step = 1,
+ },
+ sort = {
+ type = "select",
+ order = 9,
+ name = L["Sort Method"],
+ values = auraBarsSortValues,
+ },
+ filters = {
+ name = FILTERS,
+ guiInline = true,
+ type = "group",
+ order = 500,
+ args = {},
+ },
+ friendlyAuraType = {
+ type = "select",
+ order = 16,
+ name = L["Friendly Aura Type"],
+ desc = L["Set the type of auras to show when a unit is friendly."],
+ values = {
+ ["HARMFUL"] = L["Debuffs"],
+ ["HELPFUL"] = L["Buffs"],
+ },
+ },
+ enemyAuraType = {
+ type = "select",
+ order = 17,
+ name = L["Enemy Aura Type"],
+ desc = L["Set the type of auras to show when a unit is a foe."],
+ values = {
+ ["HARMFUL"] = L["Debuffs"],
+ ["HELPFUL"] = L["Buffs"],
+ },
+ },
+ uniformThreshold = {
+ order = 18,
+ type = "range",
+ name = L["Uniform Threshold"],
+ desc = L["Seconds remaining on the aura duration before the bar starts moving. Set to 0 to disable."],
+ min = 0, max = 3600, step = 1,
+ },
+ yOffset = {
+ order = 19,
+ type = "range",
+ name = L["yOffset"],
+ min = -1000, max = 1000, step = 1,
+ },
+ },
+ }
+
+ if groupName == "target" then
+ config.args.attachTo.values["PLAYER_AURABARS"] = L["Player Frame Aura Bars"]
+ end
+
+ config.args.filters.args.minDuration = {
+ order = 16,
+ type = "range",
+ name = L["Minimum Duration"],
+ desc = L["Don't display auras that are shorter than this duration (in seconds). Set to zero to disable."],
+ min = 0, max = 10800, step = 1,
+ }
+ config.args.filters.args.maxDuration = {
+ order = 17,
+ type = "range",
+ name = L["Maximum Duration"],
+ desc = L["Don't display auras that are longer than this duration (in seconds). Set to zero to disable."],
+ min = 0, max = 10800, step = 1,
+ }
+ config.args.filters.args.jumpToFilter = {
+ order = 18,
+ name = L["Filters Page"],
+ desc = L["Shortcut to 'Filters' section of the config."],
+ type = "execute",
+ func = function() ACD:SelectGroup("ElvUI", "filters") end,
+ }
+ config.args.filters.args.specialPriority = {
+ order = 19,
+ name = L["Add Special Filter"],
+ desc = L["These filters don't use a list of spells like the regular filters. Instead they use the WoW API and some code logic to determine if an aura should be allowed or blocked."],
+ type = "select",
+ values = function()
+ local filters = {}
+ local list = E.global.unitframe["specialFilters"]
+ if not list then return end
+ for filter in pairs(list) do
+ filters[filter] = filter
+ end
+ return filters
+ end,
+ set = function(info, value)
+ filterPriority("aurabar", groupName, value)
+ updateFunc(UF, groupName)
+ end
+ }
+ config.args.filters.args.priority = {
+ order = 20,
+ name = L["Add Regular Filter"],
+ desc = L["These filters use a list of spells to determine if an aura should be allowed or blocked. The content of these filters can be modified in the 'Filters' section of the config."],
+ type = "select",
+ values = function()
+ local filters = {}
+ local list = E.global.unitframe["aurafilters"]
+ if not list then return end
+ for filter in pairs(list) do
+ filters[filter] = filter
+ end
+ return filters
+ end,
+ set = function(info, value)
+ filterPriority("aurabar", groupName, value)
+ updateFunc(UF, groupName)
+ end
+ }
+ config.args.filters.args.resetPriority = {
+ order = 21,
+ name = L["Reset Priority"],
+ desc = L["Reset filter priority to the default state."],
+ type = "execute",
+ func = function()
+ E.db.unitframe.units[groupName].aurabar.priority = P.unitframe.units[groupName].aurabar.priority
+ updateFunc(UF, groupName)
+ end,
+ }
+ config.args.filters.args.filterPriority = {
+ order = 22,
+ dragdrop = true,
+ type = "multiselect",
+ name = L["Filter Priority"],
+ dragOnLeave = function() end, --keep this here
+ dragOnEnter = function(info, value)
+ carryFilterTo = info.obj.value
+ end,
+ dragOnMouseDown = function(info, value)
+ carryFilterFrom, carryFilterTo = info.obj.value, nil
+ end,
+ dragOnMouseUp = function(info, value)
+ filterPriority("aurabar", groupName, carryFilterTo, nil, carryFilterFrom) --add it in the new spot
+ carryFilterFrom, carryFilterTo = nil, nil
+ end,
+ dragOnClick = function(info, value)
+ filterPriority("aurabar", groupName, carryFilterFrom, true)
+ end,
+ stateSwitchGetText = function(button, text, value)
+ local friend, enemy = match(text, "^Friendly:([^,]*)"), match(text, "^Enemy:([^,]*)")
+ return (friend and format("|cFF33FF33%s|r %s", FRIEND, friend)) or (enemy and format("|cFFFF3333%s|r %s", ENEMY, enemy))
+ end,
+ stateSwitchOnClick = function(info, value)
+ filterPriority("aurabar", groupName, carryFilterFrom, nil, nil, true)
+ end,
+ values = function()
+ local str = E.db.unitframe.units[groupName].aurabar.priority
+ if str == "" then return nil end
+ return {strsplit(",",str)}
+ end,
+ get = function(info, value)
+ local str = E.db.unitframe.units[groupName].aurabar.priority
+ if str == "" then return nil end
+ local tbl = {strsplit(",",str)}
+ return tbl[value]
+ end,
+ set = function(info, value)
+ E.db.unitframe.units[groupName].aurabar[ info[getn(info)] ] = nil -- this was being set when drag and drop was first added, setting it to nil to clear tester profiles of this variable
+ updateFunc(UF, groupName)
+ end
+ }
+ config.args.filters.args.spacer1 = {
+ order = 23,
+ type = "description",
+ name = L["Use drag and drop to rearrange filter priority or right click to remove a filter."].."\n"..L["Use Shift+LeftClick to toggle between friendly or enemy or normal state. Normal state will allow the filter to be checked on all units. Friendly state is for friendly units only and enemy state is for enemy units."],
+ }
+
+ return config
+end
+
+local function GetOptionsTable_Auras(friendlyUnitOnly, auraType, isGroupFrame, updateFunc, groupName, numUnits)
+ local config = {
+ order = auraType == "buffs" and 600 or 700,
+ type = "group",
+ name = auraType == "buffs" and L["Buffs"] or L["Debuffs"],
+ get = function(info) return E.db.unitframe.units[groupName][auraType][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName][auraType][ info[getn(info)] ] = value; updateFunc(UF, groupName, numUnits) end,
+ args = {
+ header = {
+ type = "header",
+ order = 1,
+ name = auraType == "buffs" and L["Buffs"] or L["Debuffs"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ perrow = {
+ type = "range",
+ order = 3,
+ name = L["Per Row"],
+ min = 1, max = 20, step = 1,
+ },
+ numrows = {
+ type = "range",
+ order = 4,
+ name = L["Num Rows"],
+ min = 1, max = 10, step = 1,
+ },
+ sizeOverride = {
+ type = "range",
+ order = 5,
+ name = L["Size Override"],
+ desc = L["If not set to 0 then override the size of the aura icon to this."],
+ min = 0, max = 60, step = 1,
+ },
+ xOffset = {
+ order = 6,
+ type = "range",
+ name = L["xOffset"],
+ min = -1000, max = 1000, step = 1,
+ },
+ yOffset = {
+ order = 7,
+ type = "range",
+ name = L["yOffset"],
+ min = -1000, max = 1000, step = 1,
+ },
+ anchorPoint = {
+ type = "select",
+ order = 8,
+ name = L["Anchor Point"],
+ desc = L["What point to anchor to the frame you set to attach to."],
+ values = positionValues,
+ },
+ fontSize = {
+ order = 9,
+ name = FONT_SIZE,
+ type = "range",
+ min = 6, max = 212, step = 1,
+ },
+ clickThrough = {
+ order = 15,
+ name = L["Click Through"],
+ desc = L["Ignore mouse events."],
+ type = "toggle",
+ },
+ sortMethod = {
+ order = 16,
+ name = L["Sort By"],
+ desc = L["Method to sort by."],
+ type = "select",
+ values = auraSortValues,
+ },
+ sortDirection = {
+ order = 16,
+ name = L["Sort Direction"],
+ desc = L["Ascending or Descending order."],
+ type = "select",
+ values = auraSortMethodValues,
+ },
+ filters = {
+ name = FILTERS,
+ guiInline = true,
+ type = "group",
+ order = 500,
+ args = {},
+ },
+ },
+ }
+
+ if auraType == "buffs" then
+ config.args.attachTo = {
+ type = "select",
+ order = 7,
+ name = L["Attach To"],
+ desc = L["What to attach the buff anchor frame to."],
+ values = {
+ ["FRAME"] = L["Frame"],
+ ["DEBUFFS"] = L["Debuffs"],
+ ["HEALTH"] = L["Health"],
+ ["POWER"] = L["Power"],
+ },
+ }
+ else
+ config.args.attachTo = {
+ type = "select",
+ order = 7,
+ name = L["Attach To"],
+ desc = L["What to attach the debuff anchor frame to."],
+ values = {
+ ["FRAME"] = L["Frame"],
+ ["BUFFS"] = L["Buffs"],
+ ["HEALTH"] = L["Health"],
+ ["POWER"] = L["Power"],
+ },
+ }
+ end
+
+ if isGroupFrame then
+ config.args.countFontSize = {
+ order = 10,
+ name = L["Count Font Size"],
+ type = "range",
+ min = 6, max = 212, step = 1,
+ }
+ end
+
+ config.args.filters.args.minDuration = {
+ order = 16,
+ type = "range",
+ name = L["Minimum Duration"],
+ desc = L["Don't display auras that are shorter than this duration (in seconds). Set to zero to disable."],
+ min = 0, max = 10800, step = 1,
+ }
+ config.args.filters.args.maxDuration = {
+ order = 17,
+ type = "range",
+ name = L["Maximum Duration"],
+ desc = L["Don't display auras that are longer than this duration (in seconds). Set to zero to disable."],
+ min = 0, max = 10800, step = 1,
+ }
+ config.args.filters.args.jumpToFilter = {
+ order = 18,
+ name = L["Filters Page"],
+ desc = L["Shortcut to 'Filters' section of the config."],
+ type = "execute",
+ func = function() ACD:SelectGroup("ElvUI", "filters") end,
+ }
+ config.args.filters.args.specialPriority = {
+ order = 19,
+ name = L["Add Special Filter"],
+ desc = L["These filters don't use a list of spells like the regular filters. Instead they use the WoW API and some code logic to determine if an aura should be allowed or blocked."],
+ type = "select",
+ values = function()
+ local filters = {}
+ local list = E.global.unitframe["specialFilters"]
+ if not list then return end
+ for filter in pairs(list) do
+ filters[filter] = filter
+ end
+ return filters
+ end,
+ set = function(info, value)
+ filterPriority(auraType, groupName, value)
+ updateFunc(UF, groupName, numUnits)
+ end
+ }
+ config.args.filters.args.priority = {
+ order = 20,
+ name = L["Add Regular Filter"],
+ desc = L["These filters use a list of spells to determine if an aura should be allowed or blocked. The content of these filters can be modified in the 'Filters' section of the config."],
+ type = "select",
+ values = function()
+ local filters = {}
+ local list = E.global.unitframe["aurafilters"]
+ if not list then return end
+ for filter in pairs(list) do
+ filters[filter] = filter
+ end
+ return filters
+ end,
+ set = function(info, value)
+ filterPriority(auraType, groupName, value)
+ updateFunc(UF, groupName, numUnits)
+ end
+ }
+ config.args.filters.args.resetPriority = {
+ order = 21,
+ name = L["Reset Priority"],
+ desc = L["Reset filter priority to the default state."],
+ type = "execute",
+ func = function()
+ E.db.unitframe.units[groupName][auraType].priority = P.unitframe.units[groupName][auraType].priority
+ updateFunc(UF, groupName, numUnits)
+ end,
+ }
+ config.args.filters.args.filterPriority = {
+ order = 22,
+ dragdrop = true,
+ type = "multiselect",
+ name = L["Filter Priority"],
+ dragOnLeave = function() end, --keep this here
+ dragOnEnter = function(info, value)
+ carryFilterTo = info.obj.value
+ end,
+ dragOnMouseDown = function(info, value)
+ carryFilterFrom, carryFilterTo = info.obj.value, nil
+ end,
+ dragOnMouseUp = function(info, value)
+ filterPriority(auraType, groupName, carryFilterTo, nil, carryFilterFrom) --add it in the new spot
+ carryFilterFrom, carryFilterTo = nil, nil
+ end,
+ dragOnClick = function(info, value)
+ filterPriority(auraType, groupName, carryFilterFrom, true)
+ end,
+ stateSwitchGetText = function(button, text, value)
+ local friend, enemy = match(text, "^Friendly:([^,]*)"), match(text, "^Enemy:([^,]*)")
+ return (friend and format("|cFF33FF33%s|r %s", FRIEND, friend)) or (enemy and format("|cFFFF3333%s|r %s", ENEMY, enemy))
+ end,
+ stateSwitchOnClick = function(info, value)
+ filterPriority(auraType, groupName, carryFilterFrom, nil, nil, true)
+ end,
+ values = function()
+ local str = E.db.unitframe.units[groupName][auraType].priority
+ if str == "" then return nil end
+ return {strsplit(",",str)}
+ end,
+ get = function(info, value)
+ local str = E.db.unitframe.units[groupName][auraType].priority
+ if str == "" then return nil end
+ local tbl = {strsplit(",",str)}
+ return tbl[value]
+ end,
+ set = function(info, value)
+ E.db.unitframe.units[groupName][auraType][ info[getn(info)] ] = nil -- this was being set when drag and drop was first added, setting it to nil to clear tester profiles of this variable
+ updateFunc(UF, groupName, numUnits)
+ end
+ }
+ config.args.filters.args.spacer1 = {
+ order = 23,
+ type = "description",
+ name = L["Use drag and drop to rearrange filter priority or right click to remove a filter."].."\n"..L["Use Shift+LeftClick to toggle between friendly or enemy or normal state. Normal state will allow the filter to be checked on all units. Friendly state is for friendly units only and enemy state is for enemy units."],
+ }
+
+ return config
+end
+
+local function GetOptionsTable_Castbar(hasTicks, updateFunc, groupName, numUnits)
+ local config = {
+ order = 800,
+ type = "group",
+ name = L["Castbar"],
+ get = function(info) return E.db.unitframe.units[groupName]["castbar"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["castbar"][ info[getn(info)] ] = value; updateFunc(UF, groupName, numUnits) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Castbar"],
+ },
+ matchsize = {
+ order = 2,
+ type = "execute",
+ name = L["Match Frame Width"],
+ func = function() E.db.unitframe.units[groupName]["castbar"]["width"] = E.db.unitframe.units[groupName]["width"]; updateFunc(UF, groupName, numUnits) end,
+ },
+ forceshow = {
+ order = 3,
+ name = L["Show"].." / "..HIDE,
+ func = function()
+ local frameName = E:StringTitle(groupName)
+ frameName = "ElvUF_"..frameName
+ frameName = frameName:gsub("t(arget)", "T%1")
+
+ if numUnits then
+ for i=1, numUnits do
+ local castbar = _G[frameName..i].Castbar
+ if not castbar.oldHide then
+ castbar.oldHide = castbar.Hide
+ castbar.Hide = castbar.Show
+ castbar:Show()
+ else
+ castbar.Hide = castbar.oldHide
+ castbar.oldHide = nil
+ castbar:Hide()
+ end
+ end
+ else
+ local castbar = _G[frameName].Castbar
+ if not castbar.oldHide then
+ castbar.oldHide = castbar.Hide
+ castbar.Hide = castbar.Show
+ castbar:Show()
+ else
+ castbar.Hide = castbar.oldHide
+ castbar.oldHide = nil
+ castbar:Hide()
+ end
+ end
+ end,
+ type = "execute",
+ },
+ configureButton = {
+ order = 4,
+ name = L["Coloring"],
+ desc = L["This opens the UnitFrames Color settings. These settings affect all unitframes."],
+ type = "execute",
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup", "castBars") end,
+ },
+ enable = {
+ type = "toggle",
+ order = 5,
+ name = L["Enable"],
+ },
+ width = {
+ order = 6,
+ name = L["Width"],
+ type = "range",
+ softMax = 600,
+ min = 50, max = GetScreenWidth(), step = 1,
+ },
+ height = {
+ order = 7,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 85, step = 1,
+ },
+ latency = {
+ order = 8,
+ name = L["Latency"],
+ type = "toggle",
+ },
+ format = {
+ order = 9,
+ type = "select",
+ name = L["Format"],
+ values = {
+ ["CURRENTMAX"] = L["Current / Max"],
+ ["CURRENT"] = L["Current"],
+ ["REMAINING"] = L["Remaining"],
+ },
+ },
+ spark = {
+ order = 10,
+ type = "toggle",
+ name = L["Spark"],
+ desc = L["Display a spark texture at the end of the castbar statusbar to help show the differance between castbar and backdrop."],
+ },
+ insideInfoPanel = {
+ order = 11,
+ name = L["Inside Information Panel"],
+ desc = L["Display the castbar inside the information panel, the icon will be displayed outside the main unitframe."],
+ type = "toggle",
+ disabled = function() return not E.db.unitframe.units[groupName].infoPanel or not E.db.unitframe.units[groupName].infoPanel.enable end,
+ },
+ iconSettings = {
+ order = 13,
+ type = "group",
+ name = L["Icon"],
+ guiInline = true,
+ get = function(info) return E.db.unitframe.units[groupName]["castbar"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["castbar"][ info[getn(info)] ] = value; updateFunc(UF, groupName, numUnits) end,
+ args = {
+ icon = {
+ order = 1,
+ name = L["Enable"],
+ type = "toggle",
+ },
+ iconAttached = {
+ order = 2,
+ name = L["Icon Inside Castbar"],
+ desc = L["Display the castbar icon inside the castbar."],
+ type = "toggle",
+ },
+ iconSize = {
+ order = 3,
+ name = L["Icon Size"],
+ desc = L["This dictates the size of the icon when it is not attached to the castbar."],
+ type = "range",
+ disabled = function() return E.db.unitframe.units[groupName].castbar.iconAttached end,
+ min = 8, max = 150, step = 1,
+ },
+ iconAttachedTo = {
+ order = 4,
+ type = "select",
+ name = L["Attach To"],
+ disabled = function() return E.db.unitframe.units[groupName].castbar.iconAttached end,
+ values = {
+ ["Frame"] = L["Frame"],
+ ["Castbar"] = L["Castbar"],
+ },
+ },
+ iconPosition = {
+ type = "select",
+ order = 5,
+ name = L["Position"],
+ values = positionValues,
+ disabled = function() return E.db.unitframe.units[groupName].castbar.iconAttached end,
+ },
+ iconXOffset = {
+ order = 5,
+ type = "range",
+ name = L["xOffset"],
+ min = -300, max = 300, step = 1,
+ disabled = function() return E.db.unitframe.units[groupName].castbar.iconAttached end,
+ },
+ iconYOffset = {
+ order = 6,
+ type = "range",
+ name = L["yOffset"],
+ min = -300, max = 300, step = 1,
+ disabled = function() return E.db.unitframe.units[groupName].castbar.iconAttached end,
+ },
+ },
+ },
+ },
+ }
+
+
+ if hasTicks then
+ config.args.displayTarget = {
+ order = 11,
+ type = "toggle",
+ name = L["Display Target"],
+ desc = L["Display the target of your current cast. Useful for mouseover casts."],
+ }
+
+ config.args.ticks = {
+ order = 12,
+ type = "group",
+ guiInline = true,
+ name = L["Ticks"],
+ args = {
+ ticks = {
+ order = 1,
+ type = 'toggle',
+ name = L["Ticks"],
+ desc = L["Display tick marks on the castbar for channelled spells. This will adjust automatically for spells like Drain Soul and add additional ticks based on haste."],
+ },
+ tickColor = {
+ order = 2,
+ type = "color",
+ name = "COLOR",
+ hasAlpha = true,
+ get = function(info)
+ local c = E.db.unitframe.units[groupName].castbar.tickColor
+ local d = P.unitframe.units[groupName].castbar.tickColor
+ return c.r, c.g, c.b, c.a, d.r, d.g, d.b, d.a
+ end,
+ set = function(info, r, g, b, a)
+ local c = E.db.unitframe.units[groupName].castbar.tickColor
+ c.r, c.g, c.b, c.a = r, g, b, a
+ updateFunc(UF, groupName, numUnits)
+ end,
+ },
+ tickWidth = {
+ order = 3,
+ type = "range",
+ name = L["Width"],
+ min = 1, max = 20, step = 1,
+ },
+ },
+ }
+ end
+
+ return config
+end
+
+
+local function GetOptionsTable_InformationPanel(updateFunc, groupName, numUnits)
+
+ local config = {
+ order = 4000,
+ type = "group",
+ name = L["Information Panel"],
+ get = function(info) return E.db.unitframe.units[groupName]["infoPanel"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["infoPanel"][ info[getn(info)] ] = value; updateFunc(UF, groupName, numUnits) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Information Panel"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ transparent = {
+ type = "toggle",
+ order = 3,
+ name = L["Transparent"],
+ },
+ height = {
+ type = "range",
+ order = 4,
+ name = L["Height"],
+ min = 4, max = 30, step = 1,
+ },
+ }
+ }
+
+ return config
+end
+
+local function GetOptionsTable_Health(isGroupFrame, updateFunc, groupName, numUnits)
+ local config = {
+ order = 100,
+ type = "group",
+ name = L["Health"],
+ get = function(info) return E.db.unitframe.units[groupName]["health"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["health"][ info[getn(info)] ] = value; updateFunc(UF, groupName, numUnits) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Health"],
+ },
+ position = {
+ type = "select",
+ order = 2,
+ name = L["Text Position"],
+ values = positionValues,
+ },
+ xOffset = {
+ order = 3,
+ type = "range",
+ name = L["Text xOffset"],
+ desc = L["Offset position for text."],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 4,
+ type = "range",
+ name = L["Text yOffset"],
+ desc = L["Offset position for text."],
+ min = -300, max = 300, step = 1,
+ },
+ attachTextTo = {
+ type = "select",
+ order = 5,
+ name = L["Attach Text To"],
+ values = {
+ ["Health"] = L["Health"],
+ ["Power"] = L["Power"],
+ ["InfoPanel"] = L["Information Panel"],
+ ["Frame"] = L["Frame"],
+ },
+ },
+ text_format = {
+ order = 100,
+ name = L["Text Format"],
+ type = "input",
+ width = "full",
+ desc = L["TEXT_FORMAT_DESC"],
+ },
+ configureButton = {
+ order = 6,
+ name = L["Coloring"],
+ desc = L["This opens the UnitFrames Color settings. These settings affect all unitframes."],
+ type = "execute",
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup", "healthGroup") end,
+ },
+ },
+ }
+
+ if isGroupFrame then
+ config.args.frequentUpdates = {
+ type = "toggle",
+ order = 2,
+ name = L["Frequent Updates"],
+ desc = L["Rapidly update the health, uses more memory and cpu. Only recommended for healing."],
+ }
+
+ config.args.orientation = {
+ type = "select",
+ order = 3,
+ name = L["Statusbar Fill Orientation"],
+ desc = L["Direction the health bar moves when gaining/losing health."],
+ values = {
+ ["HORIZONTAL"] = L["Horizontal"],
+ ["VERTICAL"] = L["Vertical"],
+ },
+ }
+ end
+
+ return config
+end
+
+local function CreateCustomTextGroup(unit, objectName)
+ if not E.Options.args.unitframe.args[unit] then
+ return
+ elseif E.Options.args.unitframe.args[unit].args.customText.args[objectName] then
+ E.Options.args.unitframe.args[unit].args.customText.args[objectName].hidden = false -- Re-show existing custom texts which belong to current profile and were previously hidden
+ tinsert(CUSTOMTEXT_CONFIGS, E.Options.args.unitframe.args[unit].args.customText.args[objectName]) --Register this custom text config to be hidden again on profile change
+ return
+ end
+
+ E.Options.args.unitframe.args[unit].args.customText.args[objectName] = {
+ order = -1,
+ type = "group",
+ name = objectName,
+ get = function(info) return E.db.unitframe.units[unit].customTexts[objectName][ info[getn(info)] ] end,
+ set = function(info, value)
+ E.db.unitframe.units[unit].customTexts[objectName][ info[getn(info)] ] = value;
+
+ if unit == "party" or unit:find("raid") then
+ UF:CreateAndUpdateHeaderGroup(unit)
+ elseif unit == "boss" then
+ UF:CreateAndUpdateUFGroup("boss", MAX_BOSS_FRAMES)
+ elseif unit == "arena" then
+ UF:CreateAndUpdateUFGroup("arena", 5)
+ else
+ UF:CreateAndUpdateUF(unit)
+ end
+ end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = objectName,
+ },
+ delete = {
+ type = "execute",
+ order = 2,
+ name = DELETE,
+ func = function()
+ E.Options.args.unitframe.args[unit].args.customText.args[objectName] = nil;
+ E.db.unitframe.units[unit].customTexts[objectName] = nil;
+
+ if unit == "boss" or unit == "arena" then
+ for i=1, 5 do
+ if UF[unit..i] then
+ UF[unit..i]:Tag(UF[unit..i]["customTexts"][objectName], "");
+ UF[unit..i]["customTexts"][objectName]:Hide();
+ end
+ end
+ elseif unit == "party" or unit:find("raid") then
+ for i=1, UF[unit]:GetNumChildren() do
+ local child = select(i, UF[unit]:GetChildren())
+ if child.Tag then
+ child:Tag(child["customTexts"][objectName], "");
+ child["customTexts"][objectName]:Hide();
+ else
+ for x=1, child:GetNumChildren() do
+ local c2 = select(x, child:GetChildren())
+ if(c2.Tag) then
+ c2:Tag(c2["customTexts"][objectName], "");
+ c2["customTexts"][objectName]:Hide();
+ end
+ end
+ end
+ end
+ elseif UF[unit] then
+ UF[unit]:Tag(UF[unit]["customTexts"][objectName], "");
+ UF[unit]["customTexts"][objectName]:Hide();
+ end
+ end,
+ },
+ font = {
+ type = "select", dialogControl = "LSM30_Font",
+ order = 3,
+ name = L["Font"],
+ values = AceGUIWidgetLSMlists.font,
+ },
+ size = {
+ order = 4,
+ name = FONT_SIZE,
+ type = "range",
+ min = 4, max = 212, step = 1,
+ },
+ fontOutline = {
+ order = 5,
+ name = L["Font Outline"],
+ desc = L["Set the font outline."],
+ type = "select",
+ values = {
+ ["NONE"] = NONE,
+ ["OUTLINE"] = "OUTLINE",
+
+ ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE",
+ ["THICKOUTLINE"] = "THICKOUTLINE",
+ },
+ },
+ justifyH = {
+ order = 6,
+ type = "select",
+ name = L["JustifyH"],
+ desc = L["Sets the font instance's horizontal text alignment style."],
+ values = {
+ ["CENTER"] = L["Center"],
+ ["LEFT"] = L["Left"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ xOffset = {
+ order = 7,
+ type = "range",
+ name = L["xOffset"],
+ min = -400, max = 400, step = 1,
+ },
+ yOffset = {
+ order = 8,
+ type = "range",
+ name = L["yOffset"],
+ min = -400, max = 400, step = 1,
+ },
+ attachTextTo = {
+ type = "select",
+ order = 9,
+ name = L["Attach Text To"],
+ values = {
+ ["Health"] = L["Health"],
+ ["Power"] = L["Power"],
+ ["InfoPanel"] = L["Information Panel"],
+ ["Frame"] = L["Frame"],
+ },
+ },
+ text_format = {
+ order = 100,
+ name = L["Text Format"],
+ type = "input",
+ width = "full",
+ desc = L["TEXT_FORMAT_DESC"],
+ },
+ },
+ }
+
+ tinsert(CUSTOMTEXT_CONFIGS, E.Options.args.unitframe.args[unit].args.customText.args[objectName]) --Register this custom text config to be hidden on profile change
+end
+
+local function GetOptionsTable_CustomText(updateFunc, groupName, numUnits, orderOverride)
+ local config = {
+ order = 5100,
+ type = "group",
+ name = L["Custom Texts"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Custom Texts"],
+ },
+ createCustomText = {
+ order = 2,
+ type = "input",
+ name = L["Create Custom Text"],
+ width = "full",
+ get = function() return "" end,
+ set = function(info, textName)
+ for object, _ in pairs(E.db.unitframe.units[groupName]) do
+ if object:lower() == textName:lower() then
+ E:Print(L["The name you have selected is already in use by another element."])
+ return
+ end
+ end
+
+ if not E.db.unitframe.units[groupName].customTexts then
+ E.db.unitframe.units[groupName].customTexts = {};
+ end
+
+ local frameName = "ElvUF_"..E:StringTitle(groupName)
+ if E.db.unitframe.units[groupName].customTexts[textName] or (_G[frameName] and _G[frameName]["customTexts"] and _G[frameName]["customTexts"][textName] or _G[frameName.."Group1UnitButton1"] and _G[frameName.."Group1UnitButton1"]["customTexts"] and _G[frameName.."Group1UnitButton1"][textName]) then
+ E:Print(L["The name you have selected is already in use by another element."])
+ return;
+ end
+
+ E.db.unitframe.units[groupName].customTexts[textName] = {
+ ["text_format"] = "",
+ ["size"] = E.db.unitframe.fontSize,
+ ["font"] = E.db.unitframe.font,
+ ["xOffset"] = 0,
+ ["yOffset"] = 0,
+ ["justifyH"] = "CENTER",
+ ["fontOutline"] = E.db.unitframe.fontOutline,
+ ["attachTextTo"] = "Health"
+ };
+
+ CreateCustomTextGroup(groupName, textName)
+ updateFunc(UF, groupName, numUnits)
+ end,
+ },
+ },
+ }
+
+ return config
+end
+
+local function GetOptionsTable_Name(updateFunc, groupName, numUnits)
+ local config = {
+ order = 400,
+ type = "group",
+ name = L["Name"],
+ get = function(info) return E.db.unitframe.units[groupName]["name"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["name"][ info[getn(info)] ] = value; updateFunc(UF, groupName, numUnits) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Name"],
+ },
+ position = {
+ type = "select",
+ order = 2,
+ name = L["Text Position"],
+ values = positionValues,
+ },
+ xOffset = {
+ order = 3,
+ type = "range",
+ name = L["Text xOffset"],
+ desc = L["Offset position for text."],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 4,
+ type = "range",
+ name = L["Text yOffset"],
+ desc = L["Offset position for text."],
+ min = -300, max = 300, step = 1,
+ },
+ attachTextTo = {
+ type = "select",
+ order = 5,
+ name = L["Attach Text To"],
+ values = {
+ ["Health"] = L["Health"],
+ ["Power"] = L["Power"],
+ ["InfoPanel"] = L["Information Panel"],
+ ["Frame"] = L["Frame"],
+ },
+ },
+ text_format = {
+ order = 100,
+ name = L["Text Format"],
+ type = "input",
+ width = "full",
+ desc = L["TEXT_FORMAT_DESC"],
+ },
+ },
+ }
+
+ return config
+end
+
+local function GetOptionsTable_Portrait(updateFunc, groupName, numUnits)
+ local config = {
+ order = 400,
+ type = "group",
+ name = L["Portrait"],
+ get = function(info) return E.db.unitframe.units[groupName]["portrait"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["portrait"][ info[getn(info)] ] = value; updateFunc(UF, groupName, numUnits) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Portrait"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ desc = L["If you have a lot of 3D Portraits active then it will likely have a big impact on your FPS. Disable some portraits if you experience FPS issues."],
+ },
+ width = {
+ type = "range",
+ order = 3,
+ name = L["Width"],
+ min = 15, max = 150, step = 1,
+ },
+ overlay = {
+ type = "toggle",
+ name = L["Overlay"],
+ desc = L["Overlay the healthbar"],
+ order = 4,
+ },
+ style = {
+ type = "select",
+ name = L["Style"],
+ desc = L["Select the display method of the portrait."],
+ order = 5,
+ values = {
+ ["2D"] = L["2D"],
+ ["3D"] = L["3D"],
+ },
+ },
+ },
+ }
+
+ return config
+end
+
+local function GetOptionsTable_Power(hasDetatchOption, updateFunc, groupName, numUnits, hasStrataLevel)
+ local config = {
+ order = 200,
+ type = "group",
+ name = L["Power"],
+ get = function(info) return E.db.unitframe.units[groupName]["power"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["power"][ info[getn(info)] ] = value; updateFunc(UF, groupName, numUnits) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Power"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ text_format = {
+ order = 100,
+ name = L["Text Format"],
+ type = "input",
+ width = "full",
+ desc = L["TEXT_FORMAT_DESC"],
+ },
+ width = {
+ type = "select",
+ order = 3,
+ name = L["Style"],
+ values = fillValues,
+ set = function(info, value)
+ E.db.unitframe.units[groupName]["power"][ info[getn(info)] ] = value;
+
+ local frameName = E:StringTitle(groupName)
+ frameName = "ElvUF_"..frameName
+ frameName = string.gsub(frameName, "t(arget)", "T%1")
+
+ if numUnits then
+ for i=1, numUnits do
+ if _G[frameName..i] then
+ local v = _G[frameName..i].Power:GetValue()
+ local min, max = _G[frameName..i].Power:GetMinMaxValues()
+ _G[frameName..i].Power:SetMinMaxValues(min, max + 500)
+ _G[frameName..i].Power:SetValue(1)
+ _G[frameName..i].Power:SetValue(0)
+ end
+ end
+ else
+ if _G[frameName] and _G[frameName].Power then
+ local v = _G[frameName].Power:GetValue()
+ local min, max = _G[frameName].Power:GetMinMaxValues()
+ _G[frameName].Power:SetMinMaxValues(min, max + 500)
+ _G[frameName].Power:SetValue(1)
+ _G[frameName].Power:SetValue(0)
+ else
+ for i=1, _G[frameName]:GetNumChildren() do
+ local child = select(i, _G[frameName]:GetChildren())
+ if child and child.Power then
+ local v = child.Power:GetValue()
+ local min, max = child.Power:GetMinMaxValues()
+ child.Power:SetMinMaxValues(min, max + 500)
+ child.Power:SetValue(1)
+ child.Power:SetValue(0)
+ end
+ end
+ end
+ end
+
+ updateFunc(UF, groupName, numUnits)
+ end,
+ },
+ height = {
+ type = "range",
+ name = L["Height"],
+ order = 4,
+ min = ((E.db.unitframe.thinBorders or E.PixelMode) and 3 or 7), max = 50, step = 1,
+ },
+ offset = {
+ type = "range",
+ name = L["Offset"],
+ desc = L["Offset of the powerbar to the healthbar, set to 0 to disable."],
+ order = 5,
+ min = 0, max = 20, step = 1,
+ },
+ configureButton = {
+ order = 6,
+ name = L["Coloring"],
+ desc = L["This opens the UnitFrames Color settings. These settings affect all unitframes."],
+ type = "execute",
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup", "powerGroup") end,
+ },
+ position = {
+ type = "select",
+ order = 7,
+ name = L["Text Position"],
+ values = positionValues,
+ },
+ xOffset = {
+ order = 8,
+ type = "range",
+ name = L["Text xOffset"],
+ desc = L["Offset position for text."],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 9,
+ type = "range",
+ name = L["Text yOffset"],
+ desc = L["Offset position for text."],
+ min = -300, max = 300, step = 1,
+ },
+ attachTextTo = {
+ type = "select",
+ order = 10,
+ name = L["Attach Text To"],
+ values = {
+ ["Health"] = L["Health"],
+ ["Power"] = L["Power"],
+ ["InfoPanel"] = L["Information Panel"],
+ ["Frame"] = L["Frame"],
+ },
+ },
+ },
+ }
+
+ if hasDetatchOption then
+ config.args.detachFromFrame = {
+ type = "toggle",
+ order = 11,
+ name = L["Detach From Frame"],
+ }
+ config.args.detachedWidth = {
+ type = "range",
+ order = 12,
+ name = L["Detached Width"],
+ disabled = function() return not E.db.unitframe.units[groupName].power.detachFromFrame end,
+ min = 15, max = 450, step = 1,
+ }
+ config.args.parent = {
+ type = "select",
+ order = 13,
+ name = L["Parent"],
+ desc = L["Choose UIPARENT to prevent it from hiding with the unitframe."],
+ disabled = function() return not E.db.unitframe.units[groupName].power.detachFromFrame end,
+ values = {
+ ["FRAME"] = "FRAME",
+ ["UIPARENT"] = "UIPARENT",
+ },
+ }
+ end
+
+ if hasStrataLevel then
+ config.args.strataAndLevel = {
+ order = 101,
+ type = "group",
+ name = L["Strata and Level"],
+ get = function(info) return E.db.unitframe.units[groupName]["power"]["strataAndLevel"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["power"]["strataAndLevel"][ info[getn(info)] ] = value; updateFunc(UF, groupName, numUnits) end,
+ guiInline = true,
+ args = {
+ useCustomStrata = {
+ order = 1,
+ type = "toggle",
+ name = L["Use Custom Strata"],
+ },
+ frameStrata = {
+ order = 2,
+ type = "select",
+ name = L["Frame Strata"],
+ values = {
+ ["BACKGROUND"] = "BACKGROUND",
+ ["LOW"] = "LOW",
+ ["MEDIUM"] = "MEDIUM",
+ ["HIGH"] = "HIGH",
+ ["DIALOG"] = "DIALOG",
+ ["TOOLTIP"] = "TOOLTIP",
+ },
+ },
+ spacer = {
+ order = 3,
+ type = "description",
+ name = "",
+ },
+ useCustomLevel = {
+ order = 4,
+ type = "toggle",
+ name = L["Use Custom Level"],
+ },
+ frameLevel = {
+ order = 5,
+ type = "range",
+ name = L["Frame Level"],
+ min = 2, max = 128, step = 1,
+ },
+ },
+ }
+ end
+
+ return config
+end
+
+local function GetOptionsTable_RaidIcon(updateFunc, groupName, numUnits)
+ local config = {
+ order = 5000,
+ type = "group",
+ name = L["Raid Icon"],
+ get = function(info) return E.db.unitframe.units[groupName]["raidicon"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["raidicon"][ info[getn(info)] ] = value; updateFunc(UF, groupName, numUnits) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Raid Icon"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ attachTo = {
+ type = "select",
+ order = 3,
+ name = L["Position"],
+ values = positionValues,
+ },
+ attachToObject = {
+ type = "select",
+ order = 4,
+ name = L["Attach To"],
+ values = {
+ ["Health"] = L["Health"],
+ ["Power"] = L["Power"],
+ ["InfoPanel"] = L["Information Panel"],
+ ["Frame"] = L["Frame"],
+ },
+ },
+ size = {
+ type = "range",
+ name = L["Size"],
+ order = 4,
+ min = 8, max = 60, step = 1,
+ },
+ xOffset = {
+ order = 5,
+ type = "range",
+ name = L["xOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 6,
+ type = "range",
+ name = L["yOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ },
+ }
+
+ return config
+end
+
+local function GetOptionsTable_RaidDebuff(updateFunc, groupName)
+ local config = {
+ order = 800,
+ type = "group",
+ name = L["RaidDebuff Indicator"],
+ get = function(info) return E.db.unitframe.units[groupName]["rdebuffs"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["rdebuffs"][ info[getn(info)] ] = value; updateFunc(UF, groupName) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["RaidDebuff Indicator"],
+ },
+ enable = {
+ order = 2,
+ type = "toggle",
+ name = L["Enable"],
+ },
+ showDispellableDebuff = {
+ order = 3,
+ type = "toggle",
+ name = L["Show Dispellable Debuffs"],
+ },
+ onlyMatchSpellID = {
+ order = 4,
+ type = "toggle",
+ name = L["Only Match SpellID"],
+ desc = L["When enabled it will only show spells that were added to the filter using a spell ID and not a name."],
+ },
+ size = {
+ order = 4,
+ type = "range",
+ name = L["Size"],
+ min = 8, max = 100, step = 1,
+ },
+ font = {
+ order = 5,
+ type = "select", dialogControl = "LSM30_Font",
+ name = L["Font"],
+ values = AceGUIWidgetLSMlists.font,
+ },
+ fontSize = {
+ order = 6,
+ type = "range",
+ name = FONT_SIZE,
+ min = 7, max = 212, step = 1,
+ },
+ fontOutline = {
+ order = 7,
+ type = "select",
+ name = L["Font Outline"],
+ values = {
+ ["NONE"] = NONE,
+ ["OUTLINE"] = "OUTLINE",
+ ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE",
+ ["THICKOUTLINE"] = "THICKOUTLINE",
+ },
+ },
+ xOffset = {
+ order = 8,
+ type = "range",
+ name = L["xOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 9,
+ type = "range",
+ name = L["yOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ configureButton = {
+ order = 10,
+ type = "execute",
+ name = L["Configure Auras"],
+ func = function() E:SetToFilterConfig("RaidDebuffs") end,
+ },
+ duration = {
+ order = 11,
+ type = "group",
+ guiInline = true,
+ name = L["Duration Text"],
+ get = function(info) return E.db.unitframe.units[groupName]["rdebuffs"]["duration"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["rdebuffs"]["duration"][ info[getn(info)] ] = value; updateFunc(UF, groupName) end,
+ args = {
+ position = {
+ order = 1,
+ type = "select",
+ name = L["Position"],
+ values = {
+ ["TOP"] = "TOP",
+ ["LEFT"] = "LEFT",
+ ["RIGHT"] = "RIGHT",
+ ["BOTTOM"] = "BOTTOM",
+ ["CENTER"] = "CENTER",
+ ["TOPLEFT"] = "TOPLEFT",
+ ["TOPRIGHT"] = "TOPRIGHT",
+ ["BOTTOMLEFT"] = "BOTTOMLEFT",
+ ["BOTTOMRIGHT"] = "BOTTOMRIGHT",
+ },
+ },
+ xOffset = {
+ order = 2,
+ type = "range",
+ name = L["xOffset"],
+ min = -10, max = 10, step = 1,
+ },
+ yOffset = {
+ order = 3,
+ type = "range",
+ name = L["yOffset"],
+ min = -10, max = 10, step = 1,
+ },
+ color = {
+ order = 4,
+ type = "color",
+ name = "COLOR",
+ hasAlpha = true,
+ get = function(info)
+ local c = E.db.unitframe.units.raid.rdebuffs.duration.color
+ local d = P.unitframe.units.raid.rdebuffs.duration.color
+ return c.r, c.g, c.b, c.a, d.r, d.g, d.b, d.a
+ end,
+ set = function(info, r, g, b, a)
+ local c = E.db.unitframe.units.raid.rdebuffs.duration.color
+ c.r, c.g, c.b, c.a = r, g, b, a
+ UF:CreateAndUpdateHeaderGroup("raid")
+ end,
+ },
+ },
+ },
+ stack = {
+ order = 12,
+ type = "group",
+ guiInline = true,
+ name = L["Stack Counter"],
+ get = function(info) return E.db.unitframe.units[groupName]["rdebuffs"]["stack"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["rdebuffs"]["stack"][ info[getn(info)] ] = value; updateFunc(UF, groupName) end,
+ args = {
+ position = {
+ order = 1,
+ type = "select",
+ name = L["Position"],
+ values = {
+ ["TOP"] = "TOP",
+ ["LEFT"] = "LEFT",
+ ["RIGHT"] = "RIGHT",
+ ["BOTTOM"] = "BOTTOM",
+ ["CENTER"] = "CENTER",
+ ["TOPLEFT"] = "TOPLEFT",
+ ["TOPRIGHT"] = "TOPRIGHT",
+ ["BOTTOMLEFT"] = "BOTTOMLEFT",
+ ["BOTTOMRIGHT"] = "BOTTOMRIGHT",
+ },
+ },
+ xOffset = {
+ order = 2,
+ type = "range",
+ name = L["xOffset"],
+ min = -10, max = 10, step = 1,
+ },
+ yOffset = {
+ order = 3,
+ type = "range",
+ name = L["yOffset"],
+ min = -10, max = 10, step = 1,
+ },
+ color = {
+ order = 4,
+ type = "color",
+ name = "COLOR",
+ hasAlpha = true,
+ get = function(info)
+ local c = E.db.unitframe.units[groupName].rdebuffs.stack.color
+ local d = P.unitframe.units[groupName].rdebuffs.stack.color
+ return c.r, c.g, c.b, c.a, d.r, d.g, d.b, d.a
+ end,
+ set = function(info, r, g, b, a)
+ local c = E.db.unitframe.units[groupName].rdebuffs.stack.color
+ c.r, c.g, c.b, c.a = r, g, b, a
+ updateFunc(UF, groupName)
+ end,
+ },
+ },
+ },
+ },
+ }
+
+ return config
+end
+
+local function GetOptionsTable_ReadyCheckIcon(updateFunc, groupName)
+ local config = {
+ order = 900,
+ type = "group",
+ name = L["Ready Check Icon"],
+ get = function(info) return E.db.unitframe.units[groupName]["readycheckIcon"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["readycheckIcon"][ info[getn(info)] ] = value; updateFunc(UF, groupName) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Ready Check Icon"],
+ },
+ enable = {
+ order = 2,
+ type = "toggle",
+ name = L["Enable"],
+ },
+ size = {
+ order = 3,
+ type = "range",
+ name = L["Size"],
+ min = 8, max = 60, step = 1,
+ },
+ attachTo = {
+ order = 4,
+ type = "select",
+ name = L["Attach To"],
+ values = {
+ ["Health"] = L["Health"],
+ ["Power"] = L["Power"],
+ ["InfoPanel"] = L["Information Panel"],
+ ["Frame"] = L["Frame"],
+ },
+ },
+ position = {
+ order = 5,
+ type = "select",
+ name = L["Position"],
+ values = positionValues,
+ },
+ xOffset = {
+ order = 6,
+ type = "range",
+ name = L["xOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 7,
+ type = "range",
+ name = L["yOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ },
+ }
+
+ return config
+end
+
+local function GetOptionsTable_GPS(groupName)
+ local config = {
+ order = 1000,
+ type = "group",
+ name = L["GPS Arrow"],
+ get = function(info) return E.db.unitframe.units[groupName]["GPSArrow"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[groupName]["GPSArrow"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup(groupName) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["GPS Arrow"],
+ },
+ enable = {
+ order = 2,
+ type = "toggle",
+ name = L["Enable"],
+ },
+ onMouseOver = {
+ order = 3,
+ type = "toggle",
+ name = L["Mouseover"],
+ desc = L["Only show when you are mousing over a frame."],
+ },
+ outOfRange = {
+ order = 4,
+ type = "toggle",
+ name = L["Out of Range"],
+ desc = L["Only show when the unit is not in range."],
+ },
+ size = {
+ order = 5,
+ type = "range",
+ name = L["Size"],
+ min = 8, max = 60, step = 1,
+ },
+ xOffset = {
+ order = 6,
+ type = "range",
+ name = L["xOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 7,
+ type = "range",
+ name = L["yOffset"],
+ min = -300, max = 300, step = 1,
+ }
+ }
+ }
+
+ return config
+end
+
+local function GetOptionsTableForNonGroup_GPS(unit)
+ local config = {
+ order = 1000,
+ type = "group",
+ name = L["GPS Arrow"],
+ get = function(info) return E.db.unitframe.units[unit]["GPSArrow"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units[unit]["GPSArrow"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF(unit) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["GPS Arrow"],
+ },
+ enable = {
+ order = 2,
+ type = "toggle",
+ name = L["Enable"],
+ },
+ onMouseOver = {
+ order = 3,
+ type = "toggle",
+ name = L["Mouseover"],
+ desc = L["Only show when you are mousing over a frame."],
+ },
+ outOfRange = {
+ order = 4,
+ type = "toggle",
+ name = L["Out of Range"],
+ desc = L["Only show when the unit is not in range."],
+ },
+ size = {
+ order = 5,
+ type = "range",
+ name = L["Size"],
+ min = 8, max = 60, step = 1,
+ },
+ xOffset = {
+ order = 6,
+ type = "range",
+ name = L["xOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 7,
+ type = "range",
+ name = L["yOffset"],
+ min = -300, max = 300, step = 1,
+ }
+ }
+ }
+
+ return config
+end
+
+E.Options.args.unitframe = {
+ type = "group",
+ name = L["UnitFrames"],
+ childGroups = "tree",
+ get = function(info) return E.db.unitframe[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe[ info[getn(info)] ] = value end,
+ args = {
+ enable = {
+ order = 0,
+ type = "toggle",
+ name = L["Enable"],
+ get = function(info) return E.private.unitframe.enable end,
+ set = function(info, value) E.private.unitframe.enable = value; E:StaticPopup_Show("PRIVATE_RL") end
+ },
+ intro = {
+ order = 1,
+ type = "description",
+ name = L["UNITFRAME_DESC"],
+ },
+ header = {
+ order = 2,
+ type = "header",
+ name = L["Shortcuts"],
+ },
+ spacer1 = {
+ order = 3,
+ type = "description",
+ name = " ",
+ },
+ generalShortcut = {
+ order = 4,
+ type = "execute",
+ name = L["General"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "generalGroup") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ colorsShortcut = {
+ order = 5,
+ type = "execute",
+ name = "COLORS",
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ blizzardShortcut = {
+ order = 6,
+ type = "execute",
+ name = L["Disabled Blizzard Frames"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "disabledBlizzardFrames") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ spacer2 = {
+ order = 7,
+ type = "description",
+ name = " ",
+ },
+ playerShortcut = {
+ order = 8,
+ type = "execute",
+ name = L["Player Frame"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "player") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ targetShortcut = {
+ order = 9,
+ type = "execute",
+ name = L["Target Frame"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "target") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ targettargetShortcut = {
+ order = 10,
+ type = "execute",
+ name = L["TargetTarget Frame"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "targettarget") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ spacer3 = {
+ order = 11,
+ type = "description",
+ name = " ",
+ },
+ targettargettargetShortcut = {
+ order = 12,
+ type = "execute",
+ name = L["TargetTargetTarget Frame"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "targettargettarget") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ focusShortcut = {
+ order = 13,
+ type = "execute",
+ name = L["Focus Frame"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "focus") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ focustargetShortcut = {
+ order = 14,
+ type = "execute",
+ name = L["FocusTarget Frame"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "focustarget") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ spacer4 = {
+ order = 15,
+ type = "description",
+ name = " ",
+ },
+ petShortcut = {
+ order = 16,
+ type = "execute",
+ name = L["Pet Frame"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "pet") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ pettargetShortcut = {
+ order = 17,
+ type = "execute",
+ name = L["PetTarget Frame"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "pettarget") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ arenaShortcut = {
+ order = 18,
+ type = "execute",
+ name = L["Arena Frames"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "arena") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ spacer5 = {
+ order = 19,
+ type = "description",
+ name = " ",
+ },
+ bossShortcut = {
+ order = 20,
+ type = "execute",
+ name = L["Boss Frames"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "boss") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ partyShortcut = {
+ order = 21,
+ type = "execute",
+ name = L["Party Frames"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "party") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ raidShortcut = {
+ order = 22,
+ type = "execute",
+ name = L["Raid Frames"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "raid") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ spacer6 = {
+ order = 23,
+ type = "description",
+ name = " ",
+ },
+ raid40Shortcut = {
+ order = 24,
+ type = "execute",
+ name = L["Raid-40 Frames"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "raid40") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ raidpetShortcut = {
+ order = 25,
+ type = "execute",
+ name = L["Raid Pet Frames"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "raidpet") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ assistShortcut = {
+ order = 26,
+ type = "execute",
+ name = L["Assist Frames"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "assist") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ spacer7 = {
+ order = 27,
+ type = "description",
+ name = " ",
+ },
+ tankShortcut = {
+ order = 28,
+ type = "execute",
+ name = L["Tank Frames"],
+ -- buttonElvUI = true,
+ func = function() ACD:SelectGroup("ElvUI", "unitframe", "tank") end,
+ disabled = function() return not E.UnitFrames; end,
+ },
+ generalOptionsGroup = {
+ order = 29,
+ type = "group",
+ name = L["General Options"],
+ childGroups = "tab",
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 0,
+ type = "header",
+ name = L["General"],
+ },
+ thinBorders = {
+ order = 1,
+ name = L["Thin Borders"],
+ desc = L["Use thin borders on certain unitframe elements."],
+ type = "toggle",
+ disabled = function() return E.private.general.pixelPerfect end,
+ set = function(info, value) E.db.unitframe[ info[getn(info)] ] = value; E:StaticPopup_Show("CONFIG_RL") end,
+ },
+ OORAlpha = {
+ order = 2,
+ name = L["OOR Alpha"],
+ desc = L["The alpha to set units that are out of range to."],
+ type = "range",
+ min = 0, max = 1, step = 0.01,
+ },
+ debuffHighlighting = {
+ order = 3,
+ name = L["Debuff Highlighting"],
+ desc = L["Color the unit healthbar if there is a debuff that can be dispelled by you."],
+ type = "select",
+ values = {
+ ["NONE"] = NONE,
+ ["GLOW"] = L["Glow"],
+ ["FILL"] = L["Fill"]
+ },
+ },
+ smartRaidFilter = {
+ order = 4,
+ name = L["Smart Raid Filter"],
+ desc = L["Override any custom visibility setting in certain situations, EX: Only show groups 1 and 2 inside a 10 man instance."],
+ type = "toggle",
+ set = function(info, value) E.db.unitframe[ info[getn(info)] ] = value; UF:UpdateAllHeaders() end
+ },
+ targetOnMouseDown = {
+ order = 5,
+ name = L["Target On Mouse-Down"],
+ desc = L["Target units on mouse down rather than mouse up. \n\n|cffFF0000Warning: If you are using the addon 'Clique' you may have to adjust your clique settings when changing this."],
+ type = "toggle",
+ },
+ auraBlacklistModifier = {
+ order = 6,
+ type = "select",
+ name = L["Blacklist Modifier"],
+ desc = L["You need to hold this modifier down in order to blacklist an aura by right-clicking the icon. Set to None to disable the blacklist functionality."],
+ values = {
+ ["NONE"] = NONE,
+ ["SHIFT"] = SHIFT_KEY,
+ ["ALT"] = ALT_KEY,
+ ["CTRL"] = CTRL_KEY,
+ },
+ },
+ resetFilters = {
+ order = 7,
+ name = L["Reset Aura Filters"],
+ type = "execute",
+ func = function(info, value)
+ E:StaticPopup_Show("RESET_UF_AF") --reset unitframe aurafilters
+ end,
+ },
+ barGroup = {
+ order = 20,
+ type = "group",
+ guiInline = true,
+ name = L["Bars"],
+ args = {
+ smoothbars = {
+ type = "toggle",
+ order = 1,
+ name = L["Smooth Bars"],
+ desc = L["Bars will transition smoothly."],
+ set = function(info, value) E.db.unitframe[ info[getn(info)] ] = value; UF:Update_AllFrames(); end,
+ },
+ smoothSpeed = {
+ type = "range",
+ order = 2,
+ name = L["Animation Speed"],
+ desc = L["Speed in seconds"],
+ min = 0.1, max = 3, step = 0.01,
+ disabled = function() return not E.db.unitframe.smoothbars; end,
+ set = function(info, value) E.db.unitframe[ info[getn(info)] ] = value; UF:Update_AllFrames(); end
+ },
+ statusbar = {
+ type = "select", dialogControl = "LSM30_Statusbar",
+ order = 3,
+ name = L["StatusBar Texture"],
+ desc = L["Main statusbar texture."],
+ values = AceGUIWidgetLSMlists.statusbar,
+ set = function(info, value) E.db.unitframe[ info[getn(info)] ] = value; UF:Update_StatusBars() end,
+ },
+ },
+ },
+ fontGroup = {
+ order = 30,
+ type = "group",
+ guiInline = true,
+ name = L["Fonts"],
+ args = {
+ font = {
+ type = "select", dialogControl = "LSM30_Font",
+ order = 4,
+ name = L["Default Font"],
+ desc = L["The font that the unitframes will use."],
+ values = AceGUIWidgetLSMlists.font,
+ set = function(info, value) E.db.unitframe[ info[getn(info)] ] = value; UF:Update_FontStrings() end,
+ },
+ fontSize = {
+ order = 5,
+ name = FONT_SIZE,
+ desc = L["Set the font size for unitframes."],
+ type = "range",
+ min = 4, max = 212, step = 1,
+ set = function(info, value) E.db.unitframe[ info[getn(info)] ] = value; UF:Update_FontStrings() end,
+ },
+ fontOutline = {
+ order = 6,
+ name = L["Font Outline"],
+ desc = L["Set the font outline."],
+ type = "select",
+ values = {
+ ["NONE"] = NONE,
+ ["OUTLINE"] = "OUTLINE",
+
+ ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE",
+ ["THICKOUTLINE"] = "THICKOUTLINE",
+ },
+ set = function(info, value) E.db.unitframe[ info[getn(info)] ] = value; UF:Update_FontStrings() end,
+ },
+ },
+ },
+ },
+ },
+ allColorsGroup = {
+ order = 2,
+ type = "group",
+ childGroups = "tree",
+ name = "COLORS",
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ args = {
+ header = {
+ order = 0,
+ type = "header",
+ name = "COLORS",
+ },
+ borderColor = {
+ order = 1,
+ type = "color",
+ name = L["Border Color"],
+ get = function(info)
+ local t = E.db.unitframe.colors.borderColor
+ local d = P.unitframe.colors.borderColor
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ local t = E.db.unitframe.colors.borderColor
+ t.r, t.g, t.b = r, g, b
+ E:UpdateMedia()
+ E:UpdateBorderColors()
+ end,
+ },
+ healthGroup = {
+ order = 2,
+ type = "group",
+ name = HEALTH,
+ get = function(info)
+ local t = E.db.unitframe.colors[ info[getn(info)] ]
+ local d = P.unitframe.colors[ info[getn(info)] ]
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ local t = E.db.unitframe.colors[ info[getn(info)] ]
+ t.r, t.g, t.b = r, g, b
+ UF:Update_AllFrames()
+ end,
+ args = {
+ healthclass = {
+ order = 1,
+ type = "toggle",
+ name = L["Class Health"],
+ desc = L["Color health by classcolor or reaction."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ forcehealthreaction = {
+ order = 2,
+ type = "toggle",
+ name = L["Force Reaction Color"],
+ desc = L["Forces reaction color instead of class color on units controlled by players."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ disabled = function() return not E.db.unitframe.colors.healthclass end,
+ },
+ colorhealthbyvalue = {
+ order = 3,
+ type = "toggle",
+ name = L["Health By Value"],
+ desc = L["Color health by amount remaining."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ customhealthbackdrop = {
+ order = 4,
+ type = "toggle",
+ name = L["Custom Health Backdrop"],
+ desc = L["Use the custom health backdrop color instead of a multiple of the main health color."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ classbackdrop = {
+ order = 5,
+ type = "toggle",
+ name = L["Class Backdrop"],
+ desc = L["Color the health backdrop by class or reaction."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ transparentHealth = {
+ order = 6,
+ type = "toggle",
+ name = L["Transparent"],
+ desc = L["Make textures transparent."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ useDeadBackdrop = {
+ order = 7,
+ type = "toggle",
+ name = L["Use Dead Backdrop"],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ health = {
+ order = 10,
+ type = "color",
+ name = L["Health"],
+ },
+ health_backdrop = {
+ order = 11,
+ type = "color",
+ name = L["Health Backdrop"],
+ },
+ tapped = {
+ order = 12,
+ type = "color",
+ name = L["Tapped"],
+ },
+ disconnected = {
+ order = 13,
+ type = "color",
+ name = L["Disconnected"],
+ },
+ health_backdrop_dead = {
+ order = 14,
+ type = "color",
+ name = L["Custom Dead Backdrop"],
+ desc = L["Use this backdrop color for units that are dead or ghosts."],
+ },
+ },
+ },
+ powerGroup = {
+ order = 3,
+ type = "group",
+ name = L["Powers"],
+ get = function(info)
+ local t = E.db.unitframe.colors.power[ info[getn(info)] ]
+ local d = P.unitframe.colors.power[ info[getn(info)] ]
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ local t = E.db.unitframe.colors.power[ info[getn(info)] ]
+ t.r, t.g, t.b = r, g, b
+ UF:Update_AllFrames()
+ end,
+ args = {
+ powerclass = {
+ order = 0,
+ type = "toggle",
+ name = L["Class Power"],
+ desc = L["Color power by classcolor or reaction."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ transparentPower = {
+ order = 1,
+ type = "toggle",
+ name = L["Transparent"],
+ desc = L["Make textures transparent."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ MANA = {
+ order = 2,
+ name = MANA,
+ type = "color",
+ },
+ RAGE = {
+ order = 3,
+ name = RAGE,
+ type = "color",
+ },
+ FOCUS = {
+ order = 4,
+ name = FOCUS,
+ type = "color",
+ },
+ ENERGY = {
+ order = 5,
+ name = ENERGY,
+ type = "color",
+ },
+ RUNIC_POWER = {
+ order = 6,
+ name = RUNIC_POWER,
+ type = "color",
+ },
+ },
+ },
+ reactionGroup = {
+ order = 4,
+ type = "group",
+ name = L["Reactions"],
+ get = function(info)
+ local t = E.db.unitframe.colors.reaction[ info[getn(info)] ]
+ local d = P.unitframe.colors.reaction[ info[getn(info)] ]
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ local t = E.db.unitframe.colors.reaction[ info[getn(info)] ]
+ t.r, t.g, t.b = r, g, b
+ UF:Update_AllFrames()
+ end,
+ args = {
+ BAD = {
+ order = 1,
+ name = L["Bad"],
+ type = "color",
+ },
+ NEUTRAL = {
+ order = 2,
+ name = L["Neutral"],
+ type = "color",
+ },
+ GOOD = {
+ order = 3,
+ name = L["Good"],
+ type = "color",
+ },
+ },
+ },
+ castBars = {
+ order = 5,
+ type = "group",
+ name = L["Castbar"],
+ get = function(info)
+ local t = E.db.unitframe.colors[ info[getn(info)] ]
+ local d = P.unitframe.colors[ info[getn(info)] ]
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ local t = E.db.unitframe.colors[ info[getn(info)] ]
+ t.r, t.g, t.b = r, g, b
+ UF:Update_AllFrames()
+ end,
+ args = {
+ castClassColor = {
+ order = 0,
+ type = "toggle",
+ name = L["Class Castbars"],
+ desc = L["Color castbars by the class of player units."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ castReactionColor = {
+ order = 1,
+ type = "toggle",
+ name = L["Reaction Castbars"],
+ desc = L["Color castbars by the reaction type of non-player units."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ transparentCastbar = {
+ order = 2,
+ type = "toggle",
+ name = L["Transparent"],
+ desc = L["Make textures transparent."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ castColor = {
+ order = 3,
+ name = L["Interruptable"],
+ type = "color",
+ },
+ castNoInterrupt = {
+ order = 4,
+ name = L["Non-Interruptable"],
+ type = "color",
+ },
+ },
+ },
+ auraBars = {
+ order = 6,
+ type = "group",
+ name = L["Aura Bars"],
+ args = {
+ transparentAurabars = {
+ order = 0,
+ type = "toggle",
+ name = L["Transparent"],
+ desc = L["Make textures transparent."],
+ get = function(info) return E.db.unitframe.colors[ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.colors[ info[getn(info)] ] = value; UF:Update_AllFrames() end,
+ },
+ auraBarByType = {
+ order = 1,
+ name = L["By Type"],
+ desc = L["Color aurabar debuffs by type."],
+ type = "toggle",
+ },
+ auraBarTurtle = {
+ order = 2,
+ name = L["Color Turtle Buffs"],
+ desc = L["Color all buffs that reduce the unit's incoming damage."],
+ type = "toggle",
+ },
+ BUFFS = {
+ order = 10,
+ name = L["Buffs"],
+ type = "color",
+ get = function(info)
+ local t = E.db.unitframe.colors.auraBarBuff
+ local d = P.unitframe.colors.auraBarBuff
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ if E:CheckClassColor(r, g, b) then
+ local classColor = E.myclass == "PRIEST" and E.PriestColors or (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[E.myclass] or RAID_CLASS_COLORS[E.myclass])
+ r = classColor.r
+ g = classColor.g
+ b = classColor.b
+ end
+
+ local t = E.db.unitframe.colors.auraBarBuff
+ t.r, t.g, t.b = r, g, b
+
+ UF:Update_AllFrames()
+ end,
+ },
+ DEBUFFS = {
+ order = 11,
+ name = L["Debuffs"],
+ type = "color",
+ get = function(info)
+ local t = E.db.unitframe.colors.auraBarDebuff
+ local d = P.unitframe.colors.auraBarDebuff
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ local t = E.db.unitframe.colors.auraBarDebuff
+ t.r, t.g, t.b = r, g, b
+ UF:Update_AllFrames()
+ end,
+ },
+ auraBarTurtleColor = {
+ order = 12,
+ name = L["Turtle Color"],
+ type = "color",
+ get = function(info)
+ local t = E.db.unitframe.colors.auraBarTurtleColor
+ local d = P.unitframe.colors.auraBarTurtleColor
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ local t = E.db.unitframe.colors.auraBarTurtleColor
+ t.r, t.g, t.b = r, g, b
+ UF:Update_AllFrames()
+ end,
+ },
+ },
+ },
+ healPrediction = {
+ order = 7,
+ name = L["Heal Prediction"],
+ type = "group",
+ get = function(info)
+ local t = E.db.unitframe.colors.healPrediction[ info[getn(info)] ]
+ local d = P.unitframe.colors.healPrediction[ info[getn(info)] ]
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b, d.a
+ end,
+ set = function(info, r, g, b, a)
+ local t = E.db.unitframe.colors.healPrediction[ info[getn(info)] ]
+ t.r, t.g, t.b, t.a = r, g, b, a
+ UF:Update_AllFrames()
+ end,
+ args = {
+ personal = {
+ order = 1,
+ name = L["Personal"],
+ type = "color",
+ hasAlpha = true,
+ },
+ others = {
+ order = 2,
+ name = L["Others"],
+ type = "color",
+ hasAlpha = true,
+ },
+ maxOverflow = {
+ order = 3,
+ type = "range",
+ name = L["Max Overflow"],
+ desc = L["Max amount of overflow allowed to extend past the end of the health bar."],
+ isPercent = true,
+ min = 0, max = 1, step = 0.01,
+ get = function(info) return E.db.unitframe.colors.healPrediction.maxOverflow end,
+ set = function(info, value) E.db.unitframe.colors.healPrediction.maxOverflow = value; UF:Update_AllFrames() end,
+ },
+ },
+ },
+ },
+ },
+ disabledBlizzardFrames = {
+ order = 3,
+ type = "group",
+ name = L["Disabled Blizzard Frames"],
+ get = function(info) return E.private.unitframe.disabledBlizzardFrames[ info[getn(info)] ] end,
+ set = function(info, value) E.private["unitframe"].disabledBlizzardFrames[ info[getn(info)] ] = value; E:StaticPopup_Show("PRIVATE_RL") end,
+ args = {
+ header = {
+ order = 0,
+ type = "header",
+ name = L["Disabled Blizzard Frames"],
+ },
+ player = {
+ order = 1,
+ type = "toggle",
+ name = L["Player Frame"],
+ desc = L["Disables the player and pet unitframes."],
+ },
+ target = {
+ order = 2,
+ type = "toggle",
+ name = L["Target Frame"],
+ desc = L["Disables the target and target of target unitframes."],
+ },
+ focus = {
+ order = 3,
+ type = "toggle",
+ name = L["Focus Frame"],
+ desc = L["Disables the focus and target of focus unitframes."],
+ },
+ boss = {
+ order = 4,
+ type = "toggle",
+ name = L["Boss Frames"],
+ },
+ arena = {
+ order = 5,
+ type = "toggle",
+ name = L["Arena Frames"],
+ },
+ party = {
+ order = 6,
+ type = "toggle",
+ name = L["Party Frames"],
+ },
+ raid = {
+ order = 7,
+ type = "toggle",
+ name = L["Raid Frames"],
+ },
+ },
+ },
+ raidDebuffIndicator = {
+ order = 4,
+ type = "group",
+ name = L["RaidDebuff Indicator"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["RaidDebuff Indicator"],
+ },
+ instanceFilter = {
+ order = 2,
+ type = "select",
+ name = L["Dungeon & Raid Filter"],
+ values = function()
+ local filters = {}
+ local list = E.global.unitframe["aurafilters"]
+ if not list then return end
+ for filter in pairs(list) do
+ filters[filter] = filter
+ end
+
+ return filters
+ end,
+ get = function(info) return E.global.unitframe.raidDebuffIndicator.instanceFilter end,
+ set = function(info, value) E.global.unitframe.raidDebuffIndicator.instanceFilter = value; UF:UpdateAllHeaders() end,
+ },
+ otherFilter = {
+ order = 3,
+ type = "select",
+ name = L["Other Filter"],
+ values = function()
+ local filters = {}
+ local list = E.global.unitframe["aurafilters"]
+ if not list then return end
+ for filter in pairs(list) do
+ filters[filter] = filter
+ end
+
+ return filters
+ end,
+ get = function(info) return E.global.unitframe.raidDebuffIndicator.otherFilter end,
+ set = function(info, value) E.global.unitframe.raidDebuffIndicator.otherFilter = value; UF:UpdateAllHeaders() end,
+ },
+ },
+ },
+ },
+ },
+ },
+}
+
+--Player
+E.Options.args.unitframe.args.player = {
+ name = L["Player Frame"],
+ type = "group",
+ order = 300,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["player"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["player"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("player") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ width = "full",
+ set = function(info, value)
+ E.db.unitframe.units["player"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateUF("player");
+ if value == true and E.db.unitframe.units.player.combatfade then
+ ElvUF_Pet:SetParent(ElvUF_Player)
+ else
+ ElvUF_Pet:SetParent(ElvUF_Parent)
+ end
+ end,
+ },
+ copyFrom = {
+ type = "select",
+ order = 2,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = UF["units"],
+ set = function(info, value) UF:MergeUnitSettings(value, "player"); end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 3,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("player"); E:ResetMovers(L["Player Frame"]) end,
+ },
+ showAuras = {
+ order = 4,
+ type = "execute",
+ name = L["Show Auras"],
+ func = function()
+ local frame = ElvUF_Player
+ if frame.forceShowAuras then
+ frame.forceShowAuras = nil;
+ else
+ frame.forceShowAuras = true;
+ end
+
+ UF:CreateAndUpdateUF("player")
+ end,
+ },
+ width = {
+ order = 5,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ set = function(info, value)
+ if E.db.unitframe.units["player"].castbar.width == E.db.unitframe.units["player"][ info[getn(info)] ] then
+ E.db.unitframe.units["player"].castbar.width = value;
+ end
+
+ E.db.unitframe.units["player"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateUF("player");
+ end,
+ },
+ height = {
+ order = 6,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ combatfade = {
+ order = 7,
+ name = L["Combat Fade"],
+ desc = L["Fade the unitframe when out of combat, not casting, no target exists."],
+ type = "toggle",
+ set = function(info, value)
+ E.db.unitframe.units["player"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateUF("player");
+ if value == true and E.db.unitframe.units.player.enable then
+ ElvUF_Pet:SetParent(ElvUF_Player)
+ else
+ ElvUF_Pet:SetParent(ElvUF_Parent)
+ end
+ end,
+ },
+ healPrediction = {
+ order = 8,
+ name = L["Heal Prediction"],
+ desc = L["Show an incoming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."],
+ type = "toggle",
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 9,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["player"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["player"]["power"].hideonnpc = value; UF:CreateAndUpdateUF("player") end,
+ },
+ restIcon = {
+ order = 10,
+ name = L["Rest Icon"],
+ desc = L["Display the rested icon on the unitframe."],
+ type = "toggle",
+ },
+ combatIcon = {
+ order = 11,
+ name = L["Combat Icon"],
+ desc = L["Display the combat icon on the unitframe."],
+ type = "toggle",
+ },
+ threatStyle = {
+ type = "select",
+ order = 12,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ smartAuraPosition = {
+ order = 13,
+ type = "select",
+ name = L["Smart Aura Position"],
+ desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
+ values = {
+ ["DISABLED"] = DISABLE,
+ ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
+ ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
+ ["FLUID_BUFFS_ON_DEBUFFS"] = L["Fluid Position Buffs on Debuffs"],
+ ["FLUID_DEBUFFS_ON_BUFFS"] = L["Fluid Position Debuffs on Buffs"],
+ },
+ },
+ orientation = {
+ order = 14,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 15,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, "player"),
+ health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, "player"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, "player"),
+ power = GetOptionsTable_Power(true, UF.CreateAndUpdateUF, "player", nil, true),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateUF, "player"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, "player"),
+ --buffs = GetOptionsTable_Auras(true, "buffs", false, UF.CreateAndUpdateUF, "player"),
+ --debuffs = GetOptionsTable_Auras(true, "debuffs", false, UF.CreateAndUpdateUF, "player"),
+ castbar = GetOptionsTable_Castbar(true, UF.CreateAndUpdateUF, "player"),
+ --aurabar = GetOptionsTable_AuraBars(true, UF.CreateAndUpdateUF, "player"),
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, "player"),
+ classbar = {
+ order = 1000,
+ type = "group",
+ name = L["Classbar"],
+ get = function(info) return E.db.unitframe.units["player"]["classbar"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["player"]["classbar"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("player") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Classbar"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ height = {
+ type = "range",
+ order = 3,
+ name = L["Height"],
+ min = ((E.db.unitframe.thinBorders or E.PixelMode) and 3 or 7),
+ max = (E.db.unitframe.units["player"]["classbar"].detachFromFrame and 300 or 30),
+ step = 1,
+ },
+ fill = {
+ type = "select",
+ order = 4,
+ name = L["Fill"],
+ values = {
+ ["fill"] = L["Filled"],
+ ["spaced"] = L["Spaced"],
+ },
+ },
+ autoHide = {
+ order = 5,
+ type = "toggle",
+ name = L["Auto-Hide"],
+ },
+ detachFromFrame = {
+ type = "toggle",
+ order = 6,
+ name = L["Detach From Frame"],
+ set = function(info, value)
+ if value == true then
+ E.Options.args.unitframe.args.player.args.classbar.args.height.max = 300
+ else
+ E.Options.args.unitframe.args.player.args.classbar.args.height.max = 30
+ end
+ E.db.unitframe.units["player"]["classbar"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateUF("player")
+ end,
+ },
+ verticalOrientation = {
+ order = 7,
+ type = "toggle",
+ name = L["Vertical Orientation"],
+ disabled = function() return not E.db.unitframe.units["player"]["classbar"].detachFromFrame end,
+ },
+ detachedWidth = {
+ type = "range",
+ order = 8,
+ name = L["Detached Width"],
+ disabled = function() return not E.db.unitframe.units["player"]["classbar"].detachFromFrame end,
+ min = ((E.db.unitframe.thinBorders or E.PixelMode) and 3 or 7), max = 800, step = 1,
+ },
+ parent = {
+ type = "select",
+ order = 9,
+ name = L["Parent"],
+ desc = L["Choose UIPARENT to prevent it from hiding with the unitframe."],
+ disabled = function() return not E.db.unitframe.units["player"]["classbar"].detachFromFrame end,
+ values = {
+ ["FRAME"] = "FRAME",
+ ["UIPARENT"] = "UIPARENT",
+ },
+ },
+ strataAndLevel = {
+ order = 20,
+ type = "group",
+ name = L["Strata and Level"],
+ get = function(info) return E.db.unitframe.units["player"]["classbar"]["strataAndLevel"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["player"]["classbar"]["strataAndLevel"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("player") end,
+ guiInline = true,
+ disabled = function() return not E.db.unitframe.units["player"]["classbar"].detachFromFrame end,
+ hidden = function() return not E.db.unitframe.units["player"]["classbar"].detachFromFrame end,
+ args = {
+ useCustomStrata = {
+ order = 1,
+ type = "toggle",
+ name = L["Use Custom Strata"],
+ },
+ frameStrata = {
+ order = 2,
+ type = "select",
+ name = L["Frame Strata"],
+ values = {
+ ["BACKGROUND"] = "BACKGROUND",
+ ["LOW"] = "LOW",
+ ["MEDIUM"] = "MEDIUM",
+ ["HIGH"] = "HIGH",
+ ["DIALOG"] = "DIALOG",
+ ["TOOLTIP"] = "TOOLTIP",
+ },
+ },
+ spacer = {
+ order = 3,
+ type = "description",
+ name = "",
+ },
+ useCustomLevel = {
+ order = 4,
+ type = "toggle",
+ name = L["Use Custom Level"],
+ },
+ frameLevel = {
+ order = 5,
+ type = "range",
+ name = L["Frame Level"],
+ min = 2, max = 128, step = 1,
+ },
+ },
+ },
+ },
+ },
+ pvpIcon = {
+ order = 449,
+ type = "group",
+ name = L["PvP Icon"],
+ get = function(info) return E.db.unitframe.units["player"]["pvpIcon"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["player"]["pvpIcon"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("player") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["PvP Icon"],
+ },
+ enable = {
+ order = 2,
+ type = "toggle",
+ name = L["Enable"],
+ },
+ scale = {
+ order = 3,
+ type = "range",
+ name = L["Scale"],
+ isPercent = true,
+ min = 0.1, max = 2, step = 0.01,
+ },
+ spacer = {
+ order = 4,
+ type = "description",
+ name = " ",
+ },
+ anchorPoint = {
+ order = 5,
+ type = "select",
+ name = L["Anchor Point"],
+ values = positionValues,
+ },
+ xOffset = {
+ order = 6,
+ type = "range",
+ name = L["X-Offset"],
+ min = -100, max = 100, step = 1,
+ },
+ yOffset = {
+ order = 7,
+ type = "range",
+ name = L["Y-Offset"],
+ min = -100, max = 100, step = 1,
+ },
+ },
+ },
+ pvpText = {
+ order = 450,
+ type = "group",
+ name = L["PvP Text"],
+ get = function(info) return E.db.unitframe.units["player"]["pvp"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["player"]["pvp"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("player") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name =L["PvP Text"],
+ },
+ position = {
+ type = "select",
+ order = 2,
+ name = L["Position"],
+ values = positionValues,
+ },
+ text_format = {
+ order = 100,
+ name = L["Text Format"],
+ type = "input",
+ width = "full",
+ desc = L["TEXT_FORMAT_DESC"],
+ },
+ },
+ },
+ },
+}
+
+--Target
+E.Options.args.unitframe.args.target = {
+ name = L["Target Frame"],
+ type = "group",
+ order = 400,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["target"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["target"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("target") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ width = "full",
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = UF["units"],
+ set = function(info, value) UF:MergeUnitSettings(value, "target"); end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 4,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("target"); E:ResetMovers(L["Target Frame"]) end,
+ },
+ showAuras = {
+ order = 5,
+ type = "execute",
+ name = L["Show Auras"],
+ func = function()
+ local frame = ElvUF_Target
+ if frame.forceShowAuras then
+ frame.forceShowAuras = nil;
+ else
+ frame.forceShowAuras = true;
+ end
+
+ UF:CreateAndUpdateUF("target")
+ end,
+ },
+ width = {
+ order = 6,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ set = function(info, value)
+ if E.db.unitframe.units["target"].castbar.width == E.db.unitframe.units["target"][ info[getn(info)] ] then
+ E.db.unitframe.units["target"].castbar.width = value;
+ end
+
+ E.db.unitframe.units["target"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateUF("target");
+ end,
+ },
+ height = {
+ order = 7,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ rangeCheck = {
+ order = 8,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ healPrediction = {
+ order = 9,
+ name = L["Heal Prediction"],
+ desc = L["Show an incoming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."],
+ type = "toggle",
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 10,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["target"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["target"]["power"].hideonnpc = value; UF:CreateAndUpdateUF("target") end,
+ },
+ middleClickFocus = {
+ order = 11,
+ name = L["Middle Click - Set Focus"],
+ desc = L["Middle clicking the unit frame will cause your focus to match the unit."],
+ type = "toggle",
+ disabled = function() return IsAddOnLoaded("Clique") end,
+ },
+ threatStyle = {
+ type = "select",
+ order = 12,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ smartAuraPosition = {
+ order = 13,
+ type = "select",
+ name = L["Smart Aura Position"],
+ desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
+ values = {
+ ["DISABLED"] = DISABLE,
+ ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
+ ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
+ ["FLUID_BUFFS_ON_DEBUFFS"] = L["Fluid Position Buffs on Debuffs"],
+ ["FLUID_DEBUFFS_ON_BUFFS"] = L["Fluid Position Debuffs on Buffs"],
+ },
+ },
+ orientation = {
+ order = 14,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 15,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, "target"),
+ health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, "target"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, "target"),
+ power = GetOptionsTable_Power(true, UF.CreateAndUpdateUF, "target", nil, true),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateUF, "target"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, "target"),
+ --buffs = GetOptionsTable_Auras(false, "buffs", false, UF.CreateAndUpdateUF, "target"),
+ --debuffs = GetOptionsTable_Auras(false, "debuffs", false, UF.CreateAndUpdateUF, "target"),
+ castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateUF, "target"),
+ --aurabar = GetOptionsTable_AuraBars(false, UF.CreateAndUpdateUF, "target"),
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, "target"),
+ GPSArrow = GetOptionsTableForNonGroup_GPS("target"),
+ combobar = {
+ order = 850,
+ type = "group",
+ name = L["Combobar"],
+ get = function(info) return E.db.unitframe.units["target"]["combobar"][ info[getn(info)] ]; end,
+ set = function(info, value) E.db.unitframe.units["target"]["combobar"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("target"); end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Combobar"],
+ },
+ enable = {
+ order = 2,
+ type = "toggle",
+ name = L["Enable"],
+ },
+ height = {
+ order = 3,
+ type = "range",
+ name = L["Height"],
+ min = ((E.db.unitframe.thinBorders or E.PixelMode) and 3 or 7), max = 15, step = 1,
+ },
+ fill = {
+ order = 4,
+ type = "select",
+ name = L["Fill"],
+ values = {
+ ["fill"] = L["Filled"],
+ ["spaced"] = L["Spaced"],
+ },
+ },
+ autoHide = {
+ order = 5,
+ type = "toggle",
+ name = L["Auto-Hide"],
+ },
+ detachFromFrame = {
+ order = 6,
+ type = "toggle",
+ name = L["Detach From Frame"],
+ },
+ detachedWidth = {
+ order = 7,
+ type = "range",
+ name = L["Detached Width"],
+ disabled = function() return not E.db.unitframe.units["target"]["combobar"].detachFromFrame; end,
+ min = 15, max = 450, step = 1,
+ },
+ },
+ },
+ pvpIcon = {
+ order = 449,
+ type = "group",
+ name = L["PvP Icon"],
+ get = function(info) return E.db.unitframe.units["target"]["pvpIcon"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["target"]["pvpIcon"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("target") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["PvP Icon"],
+ },
+ enable = {
+ order = 2,
+ type = "toggle",
+ name = L["Enable"],
+ },
+ scale = {
+ order = 3,
+ type = "range",
+ name = L["Scale"],
+ isPercent = true,
+ min = 0.1, max = 2, step = 0.01,
+ },
+ spacer = {
+ order = 4,
+ type = "description",
+ name = " ",
+ },
+ anchorPoint = {
+ order = 5,
+ type = "select",
+ name = L["Anchor Point"],
+ values = positionValues,
+ },
+ xOffset = {
+ order = 6,
+ type = "range",
+ name = L["X-Offset"],
+ min = -100, max = 100, step = 1,
+ },
+ yOffset = {
+ order = 7,
+ type = "range",
+ name = L["Y-Offset"],
+ min = -100, max = 100, step = 1,
+ },
+ },
+ },
+ },
+}
+
+--TargetTarget
+E.Options.args.unitframe.args.targettarget = {
+ name = L["TargetTarget Frame"],
+ type = "group",
+ order = 500,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["targettarget"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["targettarget"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("targettarget") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ width = "full",
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = UF["units"],
+ set = function(info, value) UF:MergeUnitSettings(value, "targettarget"); end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 4,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("targettarget"); E:ResetMovers(L["TargetTarget Frame"]) end,
+ },
+ showAuras = {
+ order = 5,
+ type = "execute",
+ name = L["Show Auras"],
+ func = function()
+ local frame = ElvUF_TargetTarget
+ if frame.forceShowAuras then
+ frame.forceShowAuras = nil;
+ else
+ frame.forceShowAuras = true;
+ end
+
+ UF:CreateAndUpdateUF("targettarget")
+ end,
+ },
+ width = {
+ order = 6,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ },
+ height = {
+ order = 7,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ rangeCheck = {
+ order = 8,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 9,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["targettarget"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["targettarget"]["power"].hideonnpc = value; UF:CreateAndUpdateUF("targettarget") end,
+ },
+ threatStyle = {
+ type = "select",
+ order = 10,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ smartAuraPosition = {
+ order = 11,
+ type = "select",
+ name = L["Smart Aura Position"],
+ desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
+ values = {
+ ["DISABLED"] = DISABLE,
+ ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
+ ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
+ },
+ },
+ orientation = {
+ order = 12,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 13,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, "targettarget"),
+ health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, "targettarget"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, "targettarget"),
+ power = GetOptionsTable_Power(nil, UF.CreateAndUpdateUF, "targettarget"),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateUF, "targettarget"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, "targettarget"),
+ --buffs = GetOptionsTable_Auras(false, "buffs", false, UF.CreateAndUpdateUF, "targettarget"),
+ --debuffs = GetOptionsTable_Auras(false, "debuffs", false, UF.CreateAndUpdateUF, "targettarget"),
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, "targettarget"),
+ },
+}
+
+--TargetTargetTarget
+E.Options.args.unitframe.args.targettargettarget = {
+ name = L["TargetTargetTarget Frame"],
+ type = "group",
+ order = 500,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["targettargettarget"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["targettargettarget"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("targettargettarget") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ width = "full",
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = UF["units"],
+ set = function(info, value) UF:MergeUnitSettings(value, "targettargettarget"); end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 4,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("targettargettarget"); E:ResetMovers(L["TargetTargetTarget Frame"]) end,
+ },
+ showAuras = {
+ order = 5,
+ type = "execute",
+ name = L["Show Auras"],
+ func = function()
+ local frame = ElvUF_TargetTargetTarget
+ if frame.forceShowAuras then
+ frame.forceShowAuras = nil;
+ else
+ frame.forceShowAuras = true;
+ end
+
+ UF:CreateAndUpdateUF("targettargettarget")
+ end,
+ },
+ width = {
+ order = 6,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ },
+ height = {
+ order = 7,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ rangeCheck = {
+ order = 8,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 9,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["targettargettarget"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["targettargettarget"]["power"].hideonnpc = value; UF:CreateAndUpdateUF("targettargettarget") end,
+ },
+ threatStyle = {
+ type = "select",
+ order = 10,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ smartAuraPosition = {
+ order = 11,
+ type = "select",
+ name = L["Smart Aura Position"],
+ desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
+ values = {
+ ["DISABLED"] = DISABLE,
+ ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
+ ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
+ ["FLUID_BUFFS_ON_DEBUFFS"] = L["Fluid Position Buffs on Debuffs"],
+ ["FLUID_DEBUFFS_ON_BUFFS"] = L["Fluid Position Debuffs on Buffs"],
+ },
+ },
+ orientation = {
+ order = 12,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 13,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, "targettargettarget"),
+ health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, "targettargettarget"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, "targettargettarget"),
+ power = GetOptionsTable_Power(nil, UF.CreateAndUpdateUF, "targettargettarget"),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateUF, "targettargettarget"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, "targettargettarget"),
+ --buffs = GetOptionsTable_Auras(false, "buffs", false, UF.CreateAndUpdateUF, "targettargettarget"),
+ --debuffs = GetOptionsTable_Auras(false, "debuffs", false, UF.CreateAndUpdateUF, "targettargettarget"),
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, "targettargettarget"),
+ },
+}
+
+--Focus
+E.Options.args.unitframe.args.focus = {
+ name = L["Focus Frame"],
+ type = "group",
+ order = 600,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["focus"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["focus"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("focus") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ width = "full",
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = UF["units"],
+ set = function(info, value) UF:MergeUnitSettings(value, "focus"); end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 4,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("focus"); E:ResetMovers(L["Focus Frame"]) end,
+ },
+ showAuras = {
+ order = 5,
+ type = "execute",
+ name = L["Show Auras"],
+ func = function()
+ local frame = ElvUF_Focus
+ if frame.forceShowAuras then
+ frame.forceShowAuras = nil;
+ else
+ frame.forceShowAuras = true;
+ end
+
+ UF:CreateAndUpdateUF("focus")
+ end,
+ },
+ width = {
+ order = 6,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ },
+ height = {
+ order = 7,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ rangeCheck = {
+ order = 8,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ healPrediction = {
+ order = 9,
+ name = L["Heal Prediction"],
+ desc = L["Show an incoming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."],
+ type = "toggle",
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 10,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["focus"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["focus"]["power"].hideonnpc = value; UF:CreateAndUpdateUF("focus") end,
+ },
+ threatStyle = {
+ type = "select",
+ order = 11,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ smartAuraPosition = {
+ order = 12,
+ type = "select",
+ name = L["Smart Aura Position"],
+ desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
+ values = {
+ ["DISABLED"] = DISABLE,
+ ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
+ ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
+ ["FLUID_BUFFS_ON_DEBUFFS"] = L["Fluid Position Buffs on Debuffs"],
+ ["FLUID_DEBUFFS_ON_BUFFS"] = L["Fluid Position Debuffs on Buffs"],
+ },
+ },
+ orientation = {
+ order = 13,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 14,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, "focus"),
+ health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, "focus"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, "focus"),
+ power = GetOptionsTable_Power(nil, UF.CreateAndUpdateUF, "focus"),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateUF, "focus"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, "focus"),
+ --buffs = GetOptionsTable_Auras(false, "buffs", false, UF.CreateAndUpdateUF, "focus"),
+ --debuffs = GetOptionsTable_Auras(false, "debuffs", false, UF.CreateAndUpdateUF, "focus"),
+ castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateUF, "focus"),
+ --aurabar = GetOptionsTable_AuraBars(false, UF.CreateAndUpdateUF, "focus"),
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, "focus"),
+ GPSArrow = GetOptionsTableForNonGroup_GPS("focus"),
+ },
+}
+
+--Focus Target
+E.Options.args.unitframe.args.focustarget = {
+ name = L["FocusTarget Frame"],
+ type = "group",
+ order = 700,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["focustarget"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["focustarget"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("focustarget") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ width = "full",
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = UF["units"],
+ set = function(info, value) UF:MergeUnitSettings(value, "focustarget"); end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 4,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("focustarget"); E:ResetMovers(L["FocusTarget Frame"]) end,
+ },
+ showAuras = {
+ order = 5,
+ type = "execute",
+ name = L["Show Auras"],
+ func = function()
+ local frame = ElvUF_FocusTarget
+ if frame.forceShowAuras then
+ frame.forceShowAuras = nil;
+ else
+ frame.forceShowAuras = true;
+ end
+
+ UF:CreateAndUpdateUF("focustarget")
+ end,
+ },
+ width = {
+ order = 6,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ },
+ height = {
+ order = 7,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ rangeCheck = {
+ order = 8,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 9,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["focustarget"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["focustarget"]["power"].hideonnpc = value; UF:CreateAndUpdateUF("focustarget") end,
+ },
+ threatStyle = {
+ type = "select",
+ order = 10,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ smartAuraPosition = {
+ order = 11,
+ type = "select",
+ name = L["Smart Aura Position"],
+ desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
+ values = {
+ ["DISABLED"] = DISABLE,
+ ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
+ ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
+ ["FLUID_BUFFS_ON_DEBUFFS"] = L["Fluid Position Buffs on Debuffs"],
+ ["FLUID_DEBUFFS_ON_BUFFS"] = L["Fluid Position Debuffs on Buffs"],
+ },
+ },
+ orientation = {
+ order = 12,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 13,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, "focustarget"),
+ health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, "focustarget"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, "focustarget"),
+ power = GetOptionsTable_Power(false, UF.CreateAndUpdateUF, "focustarget"),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateUF, "focustarget"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, "focustarget"),
+ --buffs = GetOptionsTable_Auras(false, "buffs", false, UF.CreateAndUpdateUF, "focustarget"),
+ --debuffs = GetOptionsTable_Auras(false, "debuffs", false, UF.CreateAndUpdateUF, "focustarget"),
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, "focustarget"),
+ },
+}
+
+--Pet
+E.Options.args.unitframe.args.pet = {
+ name = L["Pet Frame"],
+ type = "group",
+ order = 800,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["pet"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["pet"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("pet") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ width = "full",
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = UF["units"],
+ set = function(info, value) UF:MergeUnitSettings(value, "pet"); end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 4,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("pet"); E:ResetMovers(L["Pet Frame"]) end,
+ },
+ showAuras = {
+ order = 5,
+ type = "execute",
+ name = L["Show Auras"],
+ func = function()
+ local frame = ElvUF_Pet
+ if frame.forceShowAuras then
+ frame.forceShowAuras = nil;
+ else
+ frame.forceShowAuras = true;
+ end
+
+ UF:CreateAndUpdateUF("pet")
+ end,
+ },
+ width = {
+ order = 6,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ },
+ height = {
+ order = 7,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ rangeCheck = {
+ order = 8,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ healPrediction = {
+ order = 9,
+ name = L["Heal Prediction"],
+ desc = L["Show an incoming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."],
+ type = "toggle",
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 10,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["pet"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["pet"]["power"].hideonnpc = value; UF:CreateAndUpdateUF("pet") end,
+ },
+ threatStyle = {
+ type = "select",
+ order = 11,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ smartAuraPosition = {
+ order = 12,
+ type = "select",
+ name = L["Smart Aura Position"],
+ desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
+ values = {
+ ["DISABLED"] = DISABLE,
+ ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
+ ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
+ ["FLUID_BUFFS_ON_DEBUFFS"] = L["Fluid Position Buffs on Debuffs"],
+ ["FLUID_DEBUFFS_ON_BUFFS"] = L["Fluid Position Debuffs on Buffs"],
+ },
+ },
+ orientation = {
+ order = 13,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 14,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ buffIndicator = {
+ order = 600,
+ type = "group",
+ name = L["Buff Indicator"],
+ get = function(info) return E.db.unitframe.units["pet"]["buffIndicator"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["pet"]["buffIndicator"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("pet") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Buff Indicator"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ size = {
+ type = "range",
+ name = L["Size"],
+ desc = L["Size of the indicator icon."],
+ order = 3,
+ min = 4, max = 50, step = 1,
+ },
+ fontSize = {
+ type = "range",
+ name = FONT_SIZE,
+ order = 4,
+ min = 7, max = 22, step = 1,
+ },
+ },
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, "pet"),
+ health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, "pet"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, "pet"),
+ power = GetOptionsTable_Power(false, UF.CreateAndUpdateUF, "pet"),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateUF, "pet"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, "pet"),
+ --buffs = GetOptionsTable_Auras(true, "buffs", false, UF.CreateAndUpdateUF, "pet"),
+ --debuffs = GetOptionsTable_Auras(true, "debuffs", false, UF.CreateAndUpdateUF, "pet"),
+ castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateUF, "pet"),
+ },
+}
+
+--Pet Target
+E.Options.args.unitframe.args.pettarget = {
+ name = L["PetTarget Frame"],
+ type = "group",
+ order = 900,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["pettarget"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["pettarget"][ info[getn(info)] ] = value; UF:CreateAndUpdateUF("pettarget") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ width = "full",
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = UF["units"],
+ set = function(info, value) UF:MergeUnitSettings(value, "pettarget"); end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 4,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("pettarget"); E:ResetMovers(L["PetTarget Frame"]) end,
+ },
+ showAuras = {
+ order = 5,
+ type = "execute",
+ name = L["Show Auras"],
+ func = function()
+ local frame = ElvUF_PetTarget
+ if frame.forceShowAuras then
+ frame.forceShowAuras = nil;
+ else
+ frame.forceShowAuras = true;
+ end
+
+ UF:CreateAndUpdateUF("pettarget")
+ end,
+ },
+ width = {
+ order = 6,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ },
+ height = {
+ order = 7,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ rangeCheck = {
+ order = 8,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 9,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["pettarget"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["pettarget"]["power"].hideonnpc = value; UF:CreateAndUpdateUF("pettarget") end,
+ },
+ threatStyle = {
+ type = "select",
+ order = 10,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ smartAuraPosition = {
+ order = 11,
+ type = "select",
+ name = L["Smart Aura Position"],
+ desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
+ values = {
+ ["DISABLED"] = DISABLE,
+ ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
+ ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
+ ["FLUID_BUFFS_ON_DEBUFFS"] = L["Fluid Position Buffs on Debuffs"],
+ ["FLUID_DEBUFFS_ON_BUFFS"] = L["Fluid Position Debuffs on Buffs"],
+ },
+ },
+ orientation = {
+ order = 12,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 13,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, "pettarget"),
+ health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, "pettarget"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, "pettarget"),
+ power = GetOptionsTable_Power(false, UF.CreateAndUpdateUF, "pettarget"),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateUF, "pettarget"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, "pettarget"),
+ --buffs = GetOptionsTable_Auras(false, "buffs", false, UF.CreateAndUpdateUF, "pettarget"),
+ --debuffs = GetOptionsTable_Auras(false, "debuffs", false, UF.CreateAndUpdateUF, "pettarget"),
+ },
+}
+
+--Boss Frames
+E.Options.args.unitframe.args.boss = {
+ name = L["Boss Frames"],
+ type = "group",
+ order = 1000,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["boss"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["boss"][ info[getn(info)] ] = value; UF:CreateAndUpdateUFGroup("boss", MAX_BOSS_FRAMES) end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ width = "full",
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = {
+ ["boss"] = "boss",
+ ["arena"] = "arena",
+ },
+ set = function(info, value) UF:MergeUnitSettings(value, "boss"); end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 4,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("boss"); E:ResetMovers(L["Boss Frames"]) end,
+ },
+ displayFrames = {
+ type = "execute",
+ order = 5,
+ name = L["Display Frames"],
+ desc = L["Force the frames to show, they will act as if they are the player frame."],
+ func = function() UF:ToggleForceShowGroupFrames("boss", MAX_BOSS_FRAMES) end,
+ },
+ width = {
+ order = 6,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ set = function(info, value)
+ if E.db.unitframe.units["boss"].castbar.width == E.db.unitframe.units["boss"][ info[getn(info)] ] then
+ E.db.unitframe.units["boss"].castbar.width = value;
+ end
+
+ E.db.unitframe.units["boss"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateUFGroup("boss", MAX_BOSS_FRAMES);
+ end,
+ },
+ height = {
+ order = 7,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ rangeCheck = {
+ order = 8,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 9,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["boss"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["boss"]["power"].hideonnpc = value; UF:CreateAndUpdateUFGroup("boss", MAX_BOSS_FRAMES) end,
+ },
+ growthDirection = {
+ order = 10,
+ type = "select",
+ name = L["Growth Direction"],
+ values = {
+ ["UP"] = L["Bottom to Top"],
+ ["DOWN"] = L["Top to Bottom"],
+ ["LEFT"] = L["Right to Left"],
+ ["RIGHT"] = L["Left to Right"],
+ },
+ },
+ spacing = {
+ order = 11,
+ type = "range",
+ name = L["Spacing"],
+ min = 0, max = 400, step = 1,
+ },
+ threatStyle = {
+ type = "select",
+ order = 12,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ smartAuraPosition = {
+ order = 13,
+ type = "select",
+ name = L["Smart Aura Position"],
+ desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
+ values = {
+ ["DISABLED"] = DISABLE,
+ ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
+ ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
+ ["FLUID_BUFFS_ON_DEBUFFS"] = L["Fluid Position Buffs on Debuffs"],
+ ["FLUID_DEBUFFS_ON_BUFFS"] = L["Fluid Position Debuffs on Buffs"],
+ },
+ },
+ orientation = {
+ order = 14,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 15,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ targetGlow = {
+ order = 16,
+ type = "toggle",
+ name = L["Target Glow"],
+ },
+ },
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUFGroup, "boss", MAX_BOSS_FRAMES),
+ health = GetOptionsTable_Health(false, UF.CreateAndUpdateUFGroup, "boss", MAX_BOSS_FRAMES),
+ power = GetOptionsTable_Power(false, UF.CreateAndUpdateUFGroup, "boss", MAX_BOSS_FRAMES),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUFGroup, "boss", MAX_BOSS_FRAMES),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateUFGroup, "boss", MAX_BOSS_FRAMES),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUFGroup, "boss", MAX_BOSS_FRAMES),
+ --buffs = GetOptionsTable_Auras(false, "buffs", false, UF.CreateAndUpdateUFGroup, "boss", MAX_BOSS_FRAMES),
+ --debuffs = GetOptionsTable_Auras(false, "debuffs", false, UF.CreateAndUpdateUFGroup, "boss", MAX_BOSS_FRAMES),
+ castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateUFGroup, "boss", MAX_BOSS_FRAMES),
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUFGroup, "boss", MAX_BOSS_FRAMES),
+ },
+}
+
+--Arena Frames
+E.Options.args.unitframe.args.arena = {
+ name = L["Arena Frames"],
+ type = "group",
+ order = 1000,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["arena"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["arena"][ info[getn(info)] ] = value; UF:CreateAndUpdateUFGroup("arena", 5) end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ generalGroup = {
+ order = 1,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ width = "full",
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = {
+ ["boss"] = "boss",
+ ["arena"] = "arena",
+ },
+ set = function(info, value) UF:MergeUnitSettings(value, "arena"); end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 4,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("arena"); E:ResetMovers(L["Arena Frames"]) end,
+ },
+ displayFrames = {
+ type = "execute",
+ order = 5,
+ name = L["Display Frames"],
+ desc = L["Force the frames to show, they will act as if they are the player frame."],
+ func = function() UF:ToggleForceShowGroupFrames("arena", 5) end,
+ },
+ width = {
+ order = 6,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ set = function(info, value)
+ if E.db.unitframe.units["arena"].castbar.width == E.db.unitframe.units["arena"][ info[getn(info)] ] then
+ E.db.unitframe.units["arena"].castbar.width = value;
+ end
+
+ E.db.unitframe.units["arena"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateUFGroup("arena", 5);
+ end,
+ },
+ height = {
+ order = 7,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ rangeCheck = {
+ order = 8,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ healPrediction = {
+ order = 9,
+ name = L["Heal Prediction"],
+ desc = L["Show an incoming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."],
+ type = "toggle",
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 10,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["arena"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["arena"]["power"].hideonnpc = value; UF:CreateAndUpdateUFGroup("arena", 5) end,
+ },
+ growthDirection = {
+ order = 11,
+ name = L["Growth Direction"],
+ type = "select",
+ values = {
+ ["UP"] = L["Bottom to Top"],
+ ["DOWN"] = L["Top to Bottom"],
+ ["LEFT"] = L["Right to Left"],
+ ["RIGHT"] = L["Left to Right"],
+ },
+ },
+ spacing = {
+ order = 12,
+ type = "range",
+ name = L["Spacing"],
+ min = 0, max = 400, step = 1,
+ },
+ colorOverride = {
+ order = 13,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ smartAuraPosition = {
+ order = 14,
+ type = "select",
+ name = L["Smart Aura Position"],
+ desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
+ values = {
+ ["DISABLED"] = DISABLE,
+ ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
+ ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
+ ["FLUID_BUFFS_ON_DEBUFFS"] = L["Fluid Position Buffs on Debuffs"],
+ ["FLUID_DEBUFFS_ON_BUFFS"] = L["Fluid Position Debuffs on Buffs"],
+ },
+ },
+ orientation = {
+ order = 15,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ --["MIDDLE"] = L["Middle"], --no way to handle this with trinket
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ targetGlow = {
+ order = 16,
+ type = "toggle",
+ name = L["Target Glow"],
+ },
+ },
+ },
+ pvpTrinket = {
+ order = 4001,
+ type = "group",
+ name = L["PVP Trinket"],
+ get = function(info) return E.db.unitframe.units["arena"]["pvpTrinket"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["arena"]["pvpTrinket"][ info[getn(info)] ] = value; UF:CreateAndUpdateUFGroup("arena", 5) end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["PVP Trinket"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ position = {
+ type = "select",
+ order = 3,
+ name = L["Position"],
+ values = {
+ ["LEFT"] = L["Left"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ size = {
+ order = 4,
+ type = "range",
+ name = L["Size"],
+ min = 10, max = 60, step = 1,
+ },
+ xOffset = {
+ order = 5,
+ type = "range",
+ name = L["xOffset"],
+ min = -60, max = 60, step = 1,
+ },
+ yOffset = {
+ order = 6,
+ type = "range",
+ name = L["yOffset"],
+ min = -60, max = 60, step = 1,
+ },
+ },
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUFGroup, "arena", 5),
+ health = GetOptionsTable_Health(false, UF.CreateAndUpdateUFGroup, "arena", 5),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUFGroup, "arena", 5),
+ power = GetOptionsTable_Power(false, UF.CreateAndUpdateUFGroup, "arena", 5),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateUFGroup, "arena", 5),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUFGroup, "arena", 5),
+ --buffs = GetOptionsTable_Auras(false, "buffs", false, UF.CreateAndUpdateUFGroup, "arena", 5),
+ --debuffs = GetOptionsTable_Auras(false, "debuffs", false, UF.CreateAndUpdateUFGroup, "arena", 5),
+ castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateUFGroup, "arena", 5),
+ },
+}
+
+local groupPoints = {
+ ["TOP"] = "TOP",
+ ["BOTTOM"] = "BOTTOM",
+ ["LEFT"] = "LEFT",
+ ["RIGHT"] = "RIGHT",
+}
+
+--Party Frames
+E.Options.args.unitframe.args.party = {
+ name = L["Party Frames"],
+ type = "group",
+ order = 1100,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["party"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["party"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ configureToggle = {
+ order = 1,
+ type = "execute",
+ name = L["Display Frames"],
+ func = function()
+ UF:HeaderConfig(ElvUF_Party, ElvUF_Party.forceShow ~= true or nil)
+ end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 2,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("party"); E:ResetMovers(L["Party Frames"]) end,
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = {
+ ["raid"] = L["Raid Frames"],
+ ["raid40"] = L["Raid40 Frames"],
+ },
+ set = function(info, value) UF:MergeUnitSettings(value, "party", true); end,
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateHeaderGroup, "party", nil, 4),
+ generalGroup = {
+ order = 5,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 3,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["party"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["party"]["power"].hideonnpc = value; UF:CreateAndUpdateHeaderGroup("party"); end,
+ },
+ rangeCheck = {
+ order = 4,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ healPrediction = {
+ order = 5,
+ name = L["Heal Prediction"],
+ desc = L["Show an incoming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."],
+ type = "toggle",
+ },
+ threatStyle = {
+ type = "select",
+ order = 6,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ colorOverride = {
+ order = 7,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ orientation = {
+ order = 8,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ targetGlow = {
+ order = 9,
+ type = "toggle",
+ name = L["Target Glow"],
+ },
+ positionsGroup = {
+ order = 100,
+ name = L["Size and Positions"],
+ type = "group",
+ guiInline = true,
+ set = function(info, value) E.db.unitframe.units["party"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party", nil, nil, true) end,
+ args = {
+ width = {
+ order = 1,
+ name = L["Width"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ set = function(info, value) E.db.unitframe.units["party"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party") end,
+ },
+ height = {
+ order = 2,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ set = function(info, value) E.db.unitframe.units["party"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party") end,
+ },
+ spacer = {
+ order = 3,
+ name = "",
+ type = "description",
+ width = "full",
+ },
+ growthDirection = {
+ order = 4,
+ name = L["Growth Direction"],
+ desc = L["Growth direction from the first unitframe."],
+ type = "select",
+ values = {
+ DOWN_RIGHT = format(L["%s and then %s"], L["Down"], L["Right"]),
+ DOWN_LEFT = format(L["%s and then %s"], L["Down"], L["Left"]),
+ UP_RIGHT = format(L["%s and then %s"], L["Up"], L["Right"]),
+ UP_LEFT = format(L["%s and then %s"], L["Up"], L["Left"]),
+ RIGHT_DOWN = format(L["%s and then %s"], L["Right"], L["Down"]),
+ RIGHT_UP = format(L["%s and then %s"], L["Right"], L["Up"]),
+ LEFT_DOWN = format(L["%s and then %s"], L["Left"], L["Down"]),
+ LEFT_UP = format(L["%s and then %s"], L["Left"], L["Up"]),
+ },
+ },
+ numGroups = {
+ order = 7,
+ type = "range",
+ name = L["Number of Groups"],
+ min = 1, max = 8, step = 1,
+ set = function(info, value)
+ E.db.unitframe.units["party"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateHeaderGroup("party")
+ if ElvUF_Party.isForced then
+ UF:HeaderConfig(ElvUF_Party)
+ UF:HeaderConfig(ElvUF_Party, true)
+ end
+ end,
+ },
+ groupsPerRowCol = {
+ order = 8,
+ type = "range",
+ name = L["Groups Per Row/Column"],
+ min = 1, max = 8, step = 1,
+ set = function(info, value)
+ E.db.unitframe.units["party"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateHeaderGroup("party")
+ if ElvUF_Party.isForced then
+ UF:HeaderConfig(ElvUF_Party)
+ UF:HeaderConfig(ElvUF_Party, true)
+ end
+ end,
+ },
+ horizontalSpacing = {
+ order = 9,
+ type = "range",
+ name = L["Horizontal Spacing"],
+ min = -1, max = 50, step = 1,
+ },
+ verticalSpacing = {
+ order = 10,
+ type = "range",
+ name = L["Vertical Spacing"],
+ min = -1, max = 50, step = 1,
+ },
+ },
+ },
+ visibilityGroup = {
+ order = 200,
+ name = L["Visibility"],
+ type = "group",
+ guiInline = true,
+ set = function(info, value) E.db.unitframe.units["party"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party", nil, nil, true) end,
+ args = {
+ showPlayer = {
+ order = 1,
+ type = "toggle",
+ name = L["Display Player"],
+ desc = L["When true, the header includes the player when not in a raid."],
+ },
+ visibility = {
+ order = 2,
+ type = "input",
+ name = L["Visibility"],
+ desc = L["The following macro must be true in order for the group to be shown, in addition to any filter that may already be set."],
+ width = "full",
+ },
+ },
+ },
+ sortingGroup = {
+ order = 300,
+ type = "group",
+ guiInline = true,
+ name = L["Grouping & Sorting"],
+ set = function(info, value) E.db.unitframe.units["party"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party", nil, nil, true) end,
+ args = {
+ groupBy = {
+ order = 1,
+ name = L["Group By"],
+ desc = L["Set the order that the group will sort."],
+ type = "select",
+ values = {
+ ["CLASS"] = CLASS,
+ ["NAME"] = NAME,
+ ["MTMA"] = L["Main Tanks / Main Assist"],
+ ["GROUP"] = GROUP,
+ },
+ },
+ sortDir = {
+ order = 2,
+ name = L["Sort Direction"],
+ desc = L["Defines the sort order of the selected sort method."],
+ type = "select",
+ values = {
+ ["ASC"] = L["Ascending"],
+ ["DESC"] = L["Descending"]
+ },
+ },
+ spacer = {
+ order = 3,
+ type = "description",
+ width = "full",
+ name = " "
+ },
+ raidWideSorting = {
+ order = 4,
+ name = L["Raid-Wide Sorting"],
+ desc = L["Enabling this allows raid-wide sorting however you will not be able to distinguish between groups."],
+ type = "toggle",
+ },
+ invertGroupingOrder = {
+ order = 5,
+ name = L["Invert Grouping Order"],
+ desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."],
+ disabled = function() return not E.db.unitframe.units["party"].raidWideSorting end,
+ type = "toggle",
+ },
+ startFromCenter = {
+ order = 6,
+ name = L["Start Near Center"],
+ desc = L["The initial group will start near the center and grow out."],
+ disabled = function() return not E.db.unitframe.units["party"].raidWideSorting end,
+ type = "toggle",
+ },
+ },
+ },
+ },
+ },
+ buffIndicator = {
+ order = 701,
+ type = "group",
+ name = L["Buff Indicator"],
+ get = function(info) return E.db.unitframe.units["party"]["buffIndicator"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["party"]["buffIndicator"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Buff Indicator"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ size = {
+ type = "range",
+ name = L["Size"],
+ desc = L["Size of the indicator icon."],
+ order = 3,
+ min = 4, max = 50, step = 1,
+ },
+ fontSize = {
+ type = "range",
+ name = FONT_SIZE,
+ order = 4,
+ min = 7, max = 22, step = 1,
+ },
+ profileSpecific = {
+ type = "toggle",
+ name = L["Profile Specific"],
+ desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
+ order = 5,
+ },
+ configureButton = {
+ type = "execute",
+ name = L["Configure Auras"],
+ func = function()
+ if E.db.unitframe.units["party"]["buffIndicator"].profileSpecific then
+ E:SetToFilterConfig("Buff Indicator (Profile)")
+ else
+ E:SetToFilterConfig("Buff Indicator")
+ end
+ end,
+ order = 6
+ },
+ },
+ },
+ roleIcon = {
+ order = 702,
+ type = "group",
+ name = L["Role Icon"],
+ get = function(info) return E.db.unitframe.units["party"]["roleIcon"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["party"]["roleIcon"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Role Icon"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ position = {
+ type = "select",
+ order = 3,
+ name = L["Position"],
+ values = positionValues,
+ },
+ attachTo = {
+ type = "select",
+ order = 4,
+ name = L["Attach To"],
+ values = {
+ ["Health"] = L["Health"],
+ ["Power"] = L["Power"],
+ ["InfoPanel"] = L["Information Panel"],
+ ["Frame"] = L["Frame"],
+ },
+ },
+ xOffset = {
+ order = 5,
+ type = "range",
+ name = L["xOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 6,
+ type = "range",
+ name = L["yOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ size = {
+ type = "range",
+ order = 7,
+ name = L["Size"],
+ min = 4, max = 100, step = 1,
+ },
+ },
+ },
+ raidRoleIcons = {
+ order = 703,
+ type = "group",
+ name = L["RL / ML Icons"],
+ get = function(info) return E.db.unitframe.units["party"]["raidRoleIcons"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["party"]["raidRoleIcons"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["RL / ML Icons"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ position = {
+ type = "select",
+ order = 3,
+ name = L["Position"],
+ values = {
+ ["TOPLEFT"] = "TOPLEFT",
+ ["TOPRIGHT"] = "TOPRIGHT",
+ },
+ },
+ },
+ },
+ health = GetOptionsTable_Health(true, UF.CreateAndUpdateHeaderGroup, "party"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateHeaderGroup, "party"),
+ power = GetOptionsTable_Power(false, UF.CreateAndUpdateHeaderGroup, "party"),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, "party"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateHeaderGroup, "party"),
+ --buffs = GetOptionsTable_Auras(true, "buffs", true, UF.CreateAndUpdateHeaderGroup, "party"),
+ --debuffs = GetOptionsTable_Auras(true, "debuffs", true, UF.CreateAndUpdateHeaderGroup, "party"),
+ rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, "party"),
+ petsGroup = {
+ order = 850,
+ type = "group",
+ name = L["Party Pets"],
+ get = function(info) return E.db.unitframe.units["party"]["petsGroup"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["party"]["petsGroup"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Party Pets"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ width = {
+ order = 3,
+ name = L["Width"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ },
+ height = {
+ order = 4,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ anchorPoint = {
+ type = "select",
+ order = 5,
+ name = L["Anchor Point"],
+ desc = L["What point to anchor to the frame you set to attach to."],
+ values = petAnchors,
+ },
+ xOffset = {
+ order = 6,
+ type = "range",
+ name = L["xOffset"],
+ desc = L["An X offset (in pixels) to be used when anchoring new frames."],
+ min = -500, max = 500, step = 1,
+ },
+ yOffset = {
+ order = 7,
+ type = "range",
+ name = L["yOffset"],
+ desc = L["An Y offset (in pixels) to be used when anchoring new frames."],
+ min = -500, max = 500, step = 1,
+ },
+ name = {
+ order = 8,
+ type = "group",
+ guiInline = true,
+ get = function(info) return E.db.unitframe.units["party"]["petsGroup"]["name"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["party"]["petsGroup"]["name"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party") end,
+ name = L["Name"],
+ args = {
+ position = {
+ type = "select",
+ order = 1,
+ name = L["Text Position"],
+ values = positionValues,
+ },
+ xOffset = {
+ order = 2,
+ type = "range",
+ name = L["Text xOffset"],
+ desc = L["Offset position for text."],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 3,
+ type = "range",
+ name = L["Text yOffset"],
+ desc = L["Offset position for text."],
+ min = -300, max = 300, step = 1,
+ },
+ text_format = {
+ order = 100,
+ name = L["Text Format"],
+ type = "input",
+ width = "full",
+ desc = L["TEXT_FORMAT_DESC"],
+ },
+ },
+ },
+ },
+ },
+ targetsGroup = {
+ order = 900,
+ type = "group",
+ name = L["Party Targets"],
+ get = function(info) return E.db.unitframe.units["party"]["targetsGroup"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["party"]["targetsGroup"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Party Targets"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ width = {
+ order = 3,
+ name = L["Width"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ },
+ height = {
+ order = 4,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ anchorPoint = {
+ type = "select",
+ order = 5,
+ name = L["Anchor Point"],
+ desc = L["What point to anchor to the frame you set to attach to."],
+ values = petAnchors,
+ },
+ xOffset = {
+ order = 6,
+ type = "range",
+ name = L["xOffset"],
+ desc = L["An X offset (in pixels) to be used when anchoring new frames."],
+ min = -500, max = 500, step = 1,
+ },
+ yOffset = {
+ order = 7,
+ type = "range",
+ name = L["yOffset"],
+ desc = L["An Y offset (in pixels) to be used when anchoring new frames."],
+ min = -500, max = 500, step = 1,
+ },
+ name = {
+ order = 8,
+ type = "group",
+ guiInline = true,
+ get = function(info) return E.db.unitframe.units["party"]["targetsGroup"]["name"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["party"]["targetsGroup"]["name"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("party") end,
+ name = L["Name"],
+ args = {
+ position = {
+ type = "select",
+ order = 1,
+ name = L["Text Position"],
+ values = positionValues,
+ },
+ xOffset = {
+ order = 2,
+ type = "range",
+ name = L["Text xOffset"],
+ desc = L["Offset position for text."],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 3,
+ type = "range",
+ name = L["Text yOffset"],
+ desc = L["Offset position for text."],
+ min = -300, max = 300, step = 1,
+ },
+ text_format = {
+ order = 100,
+ name = L["Text Format"],
+ type = "input",
+ width = "full",
+ desc = L["TEXT_FORMAT_DESC"],
+ },
+ },
+ },
+ },
+ },
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateHeaderGroup, "party"),
+ readycheckIcon = GetOptionsTable_ReadyCheckIcon(UF.CreateAndUpdateHeaderGroup, "party"),
+ GPSArrow = GetOptionsTable_GPS("party"),
+ },
+}
+
+--Raid Frames
+E.Options.args.unitframe.args.raid = {
+ name = L["Raid Frames"],
+ type = "group",
+ order = 1100,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["raid"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["raid"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ configureToggle = {
+ order = 1,
+ type = "execute",
+ name = L["Display Frames"],
+ func = function()
+ UF:HeaderConfig(_G["ElvUF_Raid"], _G["ElvUF_Raid"].forceShow ~= true or nil)
+ end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 2,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("raid"); E:ResetMovers("Raid Frames") end,
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = {
+ ["party"] = L["Party Frames"],
+ ["raid40"] = L["Raid40 Frames"],
+ },
+ set = function(info, value) UF:MergeUnitSettings(value, "raid", true); end,
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateHeaderGroup, "raid", nil, 4),
+ generalGroup = {
+ order = 5,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 3,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["raid"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["raid"]["power"].hideonnpc = value; UF:CreateAndUpdateHeaderGroup("raid"); end,
+ },
+ rangeCheck = {
+ order = 4,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ healPrediction = {
+ order = 5,
+ name = L["Heal Prediction"],
+ desc = L["Show an incoming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."],
+ type = "toggle",
+ },
+ threatStyle = {
+ type = "select",
+ order = 6,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ colorOverride = {
+ order = 7,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ orientation = {
+ order = 8,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ targetGlow = {
+ order = 9,
+ type = "toggle",
+ name = L["Target Glow"],
+ },
+ positionsGroup = {
+ order = 100,
+ name = L["Size and Positions"],
+ type = "group",
+ guiInline = true,
+ set = function(info, value) E.db.unitframe.units["raid"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid", nil, nil, true) end,
+ args = {
+ width = {
+ order = 1,
+ name = L["Width"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ set = function(info, value) E.db.unitframe.units["raid"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid") end,
+ },
+ height = {
+ order = 2,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ set = function(info, value) E.db.unitframe.units["raid"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid") end,
+ },
+ spacer = {
+ order = 3,
+ name = "",
+ type = "description",
+ width = "full",
+ },
+ growthDirection = {
+ order = 4,
+ name = L["Growth Direction"],
+ desc = L["Growth direction from the first unitframe."],
+ type = "select",
+ values = {
+ DOWN_RIGHT = format(L["%s and then %s"], L["Down"], L["Right"]),
+ DOWN_LEFT = format(L["%s and then %s"], L["Down"], L["Left"]),
+ UP_RIGHT = format(L["%s and then %s"], L["Up"], L["Right"]),
+ UP_LEFT = format(L["%s and then %s"], L["Up"], L["Left"]),
+ RIGHT_DOWN = format(L["%s and then %s"], L["Right"], L["Down"]),
+ RIGHT_UP = format(L["%s and then %s"], L["Right"], L["Up"]),
+ LEFT_DOWN = format(L["%s and then %s"], L["Left"], L["Down"]),
+ LEFT_UP = format(L["%s and then %s"], L["Left"], L["Up"]),
+ },
+ },
+ numGroups = {
+ order = 7,
+ type = "range",
+ name = L["Number of Groups"],
+ min = 1, max = 8, step = 1,
+ set = function(info, value)
+ E.db.unitframe.units["raid"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateHeaderGroup("raid")
+ if _G["ElvUF_Raid"].isForced then
+ UF:HeaderConfig(_G["ElvUF_Raid"])
+ UF:HeaderConfig(_G["ElvUF_Raid"], true)
+ end
+ end,
+ },
+ groupsPerRowCol = {
+ order = 8,
+ type = "range",
+ name = L["Groups Per Row/Column"],
+ min = 1, max = 8, step = 1,
+ set = function(info, value)
+ E.db.unitframe.units["raid"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateHeaderGroup("raid")
+ if _G["ElvUF_Raid"].isForced then
+ UF:HeaderConfig(_G["ElvUF_Raid"])
+ UF:HeaderConfig(_G["ElvUF_Raid"], true)
+ end
+ end,
+ },
+ horizontalSpacing = {
+ order = 9,
+ type = "range",
+ name = L["Horizontal Spacing"],
+ min = -1, max = 50, step = 1,
+ },
+ verticalSpacing = {
+ order = 10,
+ type = "range",
+ name = L["Vertical Spacing"],
+ min = -1, max = 50, step = 1,
+ },
+ },
+ },
+ visibilityGroup = {
+ order = 200,
+ name = L["Visibility"],
+ type = "group",
+ guiInline = true,
+ set = function(info, value) E.db.unitframe.units["raid"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid", nil, nil, true) end,
+ args = {
+ showPlayer = {
+ order = 1,
+ type = "toggle",
+ name = L["Display Player"],
+ desc = L["When true, the header includes the player when not in a raid."],
+ },
+ visibility = {
+ order = 2,
+ type = "input",
+ name = L["Visibility"],
+ desc = L["The following macro must be true in order for the group to be shown, in addition to any filter that may already be set."],
+ width = "full",
+ },
+ },
+ },
+ sortingGroup = {
+ order = 300,
+ type = "group",
+ guiInline = true,
+ name = L["Grouping & Sorting"],
+ set = function(info, value) E.db.unitframe.units["raid"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid", nil, nil, true) end,
+ args = {
+ groupBy = {
+ order = 1,
+ name = L["Group By"],
+ desc = L["Set the order that the group will sort."],
+ type = "select",
+ values = {
+ ["CLASS"] = CLASS,
+ ["NAME"] = NAME,
+ ["MTMA"] = L["Main Tanks / Main Assist"],
+ ["GROUP"] = GROUP,
+ },
+ },
+ sortDir = {
+ order = 2,
+ name = L["Sort Direction"],
+ desc = L["Defines the sort order of the selected sort method."],
+ type = "select",
+ values = {
+ ["ASC"] = L["Ascending"],
+ ["DESC"] = L["Descending"]
+ },
+ },
+ spacer = {
+ order = 3,
+ type = "description",
+ width = "full",
+ name = " "
+ },
+ raidWideSorting = {
+ order = 4,
+ name = L["Raid-Wide Sorting"],
+ desc = L["Enabling this allows raid-wide sorting however you will not be able to distinguish between groups."],
+ type = "toggle",
+ },
+ invertGroupingOrder = {
+ order = 5,
+ name = L["Invert Grouping Order"],
+ desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."],
+ disabled = function() return not E.db.unitframe.units["raid"].raidWideSorting end,
+ type = "toggle",
+ },
+ startFromCenter = {
+ order = 6,
+ name = L["Start Near Center"],
+ desc = L["The initial group will start near the center and grow out."],
+ disabled = function() return not E.db.unitframe.units["raid"].raidWideSorting end,
+ type = "toggle",
+ },
+ },
+ },
+ },
+ },
+ health = GetOptionsTable_Health(true, UF.CreateAndUpdateHeaderGroup, "raid"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateHeaderGroup, "raid"),
+ power = GetOptionsTable_Power(false, UF.CreateAndUpdateHeaderGroup, "raid"),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, "raid"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateHeaderGroup, "raid"),
+ --buffs = GetOptionsTable_Auras(true, "buffs", true, UF.CreateAndUpdateHeaderGroup, "raid"),
+ --debuffs = GetOptionsTable_Auras(true, "debuffs", true, UF.CreateAndUpdateHeaderGroup, "raid"),
+ buffIndicator = {
+ order = 701,
+ type = "group",
+ name = L["Buff Indicator"],
+ get = function(info) return E.db.unitframe.units["raid"]["buffIndicator"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["raid"]["buffIndicator"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Buff Indicator"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ size = {
+ type = "range",
+ name = L["Size"],
+ desc = L["Size of the indicator icon."],
+ order = 3,
+ min = 4, max = 50, step = 1,
+ },
+ fontSize = {
+ type = "range",
+ name = FONT_SIZE,
+ order = 4,
+ min = 7, max = 22, step = 1,
+ },
+ profileSpecific = {
+ type = "toggle",
+ name = L["Profile Specific"],
+ desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
+ order = 5,
+ },
+ configureButton = {
+ type = "execute",
+ name = L["Configure Auras"],
+ func = function()
+ if E.db.unitframe.units["raid"]["buffIndicator"].profileSpecific then
+ E:SetToFilterConfig("Buff Indicator (Profile)")
+ else
+ E:SetToFilterConfig("Buff Indicator")
+ end
+ end,
+ order = 6
+ },
+ },
+ },
+ roleIcon = {
+ order = 702,
+ type = "group",
+ name = L["Role Icon"],
+ get = function(info) return E.db.unitframe.units["raid"]["roleIcon"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["raid"]["roleIcon"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Role Icon"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ position = {
+ type = "select",
+ order = 3,
+ name = L["Position"],
+ values = positionValues,
+ },
+ attachTo = {
+ type = "select",
+ order = 4,
+ name = L["Attach To"],
+ values = {
+ ["Health"] = L["Health"],
+ ["Power"] = L["Power"],
+ ["InfoPanel"] = L["Information Panel"],
+ ["Frame"] = L["Frame"],
+ },
+ },
+ xOffset = {
+ order = 5,
+ type = "range",
+ name = L["xOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 6,
+ type = "range",
+ name = L["yOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ size = {
+ type = "range",
+ order = 7,
+ name = L["Size"],
+ min = 4, max = 100, step = 1,
+ },
+ },
+ },
+ raidRoleIcons = {
+ order = 703,
+ type = "group",
+ name = L["RL / ML Icons"],
+ get = function(info) return E.db.unitframe.units["raid"]["raidRoleIcons"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["raid"]["raidRoleIcons"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["RL / ML Icons"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ position = {
+ type = "select",
+ order = 3,
+ name = L["Position"],
+ values = {
+ ["TOPLEFT"] = "TOPLEFT",
+ ["TOPRIGHT"] = "TOPRIGHT",
+ },
+ },
+ },
+ },
+ rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, "raid"),
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateHeaderGroup, "raid"),
+ readycheckIcon = GetOptionsTable_ReadyCheckIcon(UF.CreateAndUpdateHeaderGroup, "raid"),
+ GPSArrow = GetOptionsTable_GPS("raid"),
+ },
+}
+
+--Raid-40 Frames
+E.Options.args.unitframe.args.raid40 = {
+ name = L["Raid-40 Frames"],
+ type = "group",
+ order = 1100,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["raid40"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["raid40"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid40") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ configureToggle = {
+ order = 1,
+ type = "execute",
+ name = L["Display Frames"],
+ func = function()
+ UF:HeaderConfig(_G["ElvUF_Raid40"], _G["ElvUF_Raid40"].forceShow ~= true or nil)
+ end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 2,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("raid40"); E:ResetMovers("Raid Frames") end,
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = {
+ ["party"] = L["Party Frames"],
+ ["raid"] = L["Raid Frames"],
+ },
+ set = function(info, value) UF:MergeUnitSettings(value, "raid40", true); end,
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateHeaderGroup, "raid40", nil, 4),
+ generalGroup = {
+ order = 5,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ hideonnpc = {
+ type = "toggle",
+ order = 3,
+ name = L["Text Toggle On NPC"],
+ desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
+ get = function(info) return E.db.unitframe.units["raid40"]["power"].hideonnpc end,
+ set = function(info, value) E.db.unitframe.units["raid40"]["power"].hideonnpc = value; UF:CreateAndUpdateHeaderGroup("raid40"); end,
+ },
+ rangeCheck = {
+ order = 4,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ healPrediction = {
+ order = 5,
+ name = L["Heal Prediction"],
+ desc = L["Show an incoming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."],
+ type = "toggle",
+ },
+ threatStyle = {
+ type = "select",
+ order = 6,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ colorOverride = {
+ order = 7,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ orientation = {
+ order = 8,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ targetGlow = {
+ order = 9,
+ type = "toggle",
+ name = L["Target Glow"],
+ },
+ positionsGroup = {
+ order = 100,
+ name = L["Size and Positions"],
+ type = "group",
+ guiInline = true,
+ set = function(info, value) E.db.unitframe.units["raid40"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid40", nil, nil, true) end,
+ args = {
+ width = {
+ order = 1,
+ name = L["Width"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ set = function(info, value) E.db.unitframe.units["raid40"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid40") end,
+ },
+ height = {
+ order = 2,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ set = function(info, value) E.db.unitframe.units["raid40"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid40") end,
+ },
+ spacer = {
+ order = 3,
+ name = "",
+ type = "description",
+ width = "full",
+ },
+ growthDirection = {
+ order = 4,
+ name = L["Growth Direction"],
+ desc = L["Growth direction from the first unitframe."],
+ type = "select",
+ values = {
+ DOWN_RIGHT = format(L["%s and then %s"], L["Down"], L["Right"]),
+ DOWN_LEFT = format(L["%s and then %s"], L["Down"], L["Left"]),
+ UP_RIGHT = format(L["%s and then %s"], L["Up"], L["Right"]),
+ UP_LEFT = format(L["%s and then %s"], L["Up"], L["Left"]),
+ RIGHT_DOWN = format(L["%s and then %s"], L["Right"], L["Down"]),
+ RIGHT_UP = format(L["%s and then %s"], L["Right"], L["Up"]),
+ LEFT_DOWN = format(L["%s and then %s"], L["Left"], L["Down"]),
+ LEFT_UP = format(L["%s and then %s"], L["Left"], L["Up"]),
+ },
+ },
+ numGroups = {
+ order = 7,
+ type = "range",
+ name = L["Number of Groups"],
+ min = 1, max = 8, step = 1,
+ set = function(info, value)
+ E.db.unitframe.units["raid40"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateHeaderGroup("raid40")
+ if _G["ElvUF_Raid"].isForced then
+ UF:HeaderConfig(_G["ElvUF_Raid40"])
+ UF:HeaderConfig(_G["ElvUF_Raid40"], true)
+ end
+ end,
+ },
+ groupsPerRowCol = {
+ order = 8,
+ type = "range",
+ name = L["Groups Per Row/Column"],
+ min = 1, max = 8, step = 1,
+ set = function(info, value)
+ E.db.unitframe.units["raid40"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateHeaderGroup("raid40")
+ if _G["ElvUF_Raid"].isForced then
+ UF:HeaderConfig(_G["ElvUF_Raid40"])
+ UF:HeaderConfig(_G["ElvUF_Raid40"], true)
+ end
+ end,
+ },
+ horizontalSpacing = {
+ order = 9,
+ type = "range",
+ name = L["Horizontal Spacing"],
+ min = -1, max = 50, step = 1,
+ },
+ verticalSpacing = {
+ order = 10,
+ type = "range",
+ name = L["Vertical Spacing"],
+ min = -1, max = 50, step = 1,
+ },
+ },
+ },
+ visibilityGroup = {
+ order = 200,
+ name = L["Visibility"],
+ type = "group",
+ guiInline = true,
+ set = function(info, value) E.db.unitframe.units["raid40"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid40", nil, nil, true) end,
+ args = {
+ showPlayer = {
+ order = 1,
+ type = "toggle",
+ name = L["Display Player"],
+ desc = L["When true, the header includes the player when not in a raid."],
+ },
+ visibility = {
+ order = 2,
+ type = "input",
+ name = L["Visibility"],
+ desc = L["The following macro must be true in order for the group to be shown, in addition to any filter that may already be set."],
+ width = "full",
+ },
+ },
+ },
+ sortingGroup = {
+ order = 300,
+ type = "group",
+ guiInline = true,
+ name = L["Grouping & Sorting"],
+ set = function(info, value) E.db.unitframe.units["raid40"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid40", nil, nil, true) end,
+ args = {
+ groupBy = {
+ order = 1,
+ name = L["Group By"],
+ desc = L["Set the order that the group will sort."],
+ type = "select",
+ values = {
+ ["CLASS"] = CLASS,
+ ["NAME"] = NAME,
+ ["MTMA"] = L["Main Tanks / Main Assist"],
+ ["GROUP"] = GROUP,
+ },
+ },
+ sortDir = {
+ order = 2,
+ name = L["Sort Direction"],
+ desc = L["Defines the sort order of the selected sort method."],
+ type = "select",
+ values = {
+ ["ASC"] = L["Ascending"],
+ ["DESC"] = L["Descending"]
+ },
+ },
+ spacer = {
+ order = 3,
+ type = "description",
+ width = "full",
+ name = " "
+ },
+ raidWideSorting = {
+ order = 4,
+ name = L["Raid-Wide Sorting"],
+ desc = L["Enabling this allows raid-wide sorting however you will not be able to distinguish between groups."],
+ type = "toggle",
+ },
+ invertGroupingOrder = {
+ order = 5,
+ name = L["Invert Grouping Order"],
+ desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."],
+ disabled = function() return not E.db.unitframe.units["raid40"].raidWideSorting end,
+ type = "toggle",
+ },
+ startFromCenter = {
+ order = 6,
+ name = L["Start Near Center"],
+ desc = L["The initial group will start near the center and grow out."],
+ disabled = function() return not E.db.unitframe.units["raid40"].raidWideSorting end,
+ type = "toggle",
+ },
+ },
+ },
+ },
+ },
+ health = GetOptionsTable_Health(true, UF.CreateAndUpdateHeaderGroup, "raid40"),
+ infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateHeaderGroup, "raid40"),
+ power = GetOptionsTable_Power(false, UF.CreateAndUpdateHeaderGroup, "raid40"),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, "raid40"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateHeaderGroup, "raid40"),
+ --buffs = GetOptionsTable_Auras(true, "buffs", true, UF.CreateAndUpdateHeaderGroup, "raid40"),
+ --debuffs = GetOptionsTable_Auras(true, "debuffs", true, UF.CreateAndUpdateHeaderGroup, "raid40"),
+ buffIndicator = {
+ order = 701,
+ type = "group",
+ name = L["Buff Indicator"],
+ get = function(info) return E.db.unitframe.units["raid40"]["buffIndicator"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["raid40"]["buffIndicator"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid40") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Buff Indicator"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ size = {
+ type = "range",
+ name = L["Size"],
+ desc = L["Size of the indicator icon."],
+ order = 3,
+ min = 4, max = 50, step = 1,
+ },
+ fontSize = {
+ type = "range",
+ name = FONT_SIZE,
+ order = 4,
+ min = 7, max = 22, step = 1,
+ },
+ profileSpecific = {
+ type = "toggle",
+ name = L["Profile Specific"],
+ desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
+ order = 5,
+ },
+ configureButton = {
+ type = "execute",
+ name = L["Configure Auras"],
+ func = function()
+ if E.db.unitframe.units["raid40"]["buffIndicator"].profileSpecific then
+ E:SetToFilterConfig("Buff Indicator (Profile)")
+ else
+ E:SetToFilterConfig("Buff Indicator")
+ end
+ end,
+ order = 6
+ },
+ },
+ },
+ roleIcon = {
+ order = 702,
+ type = "group",
+ name = L["Role Icon"],
+ get = function(info) return E.db.unitframe.units["raid40"]["roleIcon"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["raid40"]["roleIcon"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid40") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Role Icon"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ position = {
+ type = "select",
+ order = 3,
+ name = L["Position"],
+ values = positionValues,
+ },
+ attachTo = {
+ type = "select",
+ order = 4,
+ name = L["Attach To"],
+ values = {
+ ["Health"] = L["Health"],
+ ["Power"] = L["Power"],
+ ["InfoPanel"] = L["Information Panel"],
+ ["Frame"] = L["Frame"],
+ },
+ },
+ xOffset = {
+ order = 5,
+ type = "range",
+ name = L["xOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ yOffset = {
+ order = 6,
+ type = "range",
+ name = L["yOffset"],
+ min = -300, max = 300, step = 1,
+ },
+ size = {
+ type = "range",
+ order = 7,
+ name = L["Size"],
+ min = 4, max = 100, step = 1,
+ },
+ },
+ },
+ raidRoleIcons = {
+ order = 703,
+ type = "group",
+ name = L["RL / ML Icons"],
+ get = function(info) return E.db.unitframe.units["raid40"]["raidRoleIcons"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["raid40"]["raidRoleIcons"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raid40") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["RL / ML Icons"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ position = {
+ type = "select",
+ order = 3,
+ name = L["Position"],
+ values = {
+ ["TOPLEFT"] = "TOPLEFT",
+ ["TOPRIGHT"] = "TOPRIGHT",
+ },
+ },
+ },
+ },
+ rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, "raid40"),
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateHeaderGroup, "raid40"),
+ readycheckIcon = GetOptionsTable_ReadyCheckIcon(UF.CreateAndUpdateHeaderGroup, "raid40"),
+ GPSArrow = GetOptionsTable_GPS("raid40"),
+ },
+}
+
+--Raid Pet Frames
+E.Options.args.unitframe.args.raidpet = {
+ order = 1200,
+ type = "group",
+ name = L["Raid Pet Frames"],
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["raidpet"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["raidpet"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raidpet") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ configureToggle = {
+ order = 1,
+ type = "execute",
+ name = L["Display Frames"],
+ func = function()
+ UF:HeaderConfig(ElvUF_Raidpet, ElvUF_Raidpet.forceShow ~= true or nil)
+ end,
+ },
+ resetSettings = {
+ type = "execute",
+ order = 2,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("raidpet"); E:ResetMovers(L["Raid Pet Frames"]); UF:CreateAndUpdateHeaderGroup("raidpet", nil, nil, true); end,
+ },
+ copyFrom = {
+ type = "select",
+ order = 3,
+ name = L["Copy From"],
+ desc = L["Select a unit to copy settings from."],
+ values = {
+ ["party"] = L["Party Frames"],
+ ["raid"] = L["Raid Frames"],
+ },
+ set = function(info, value) UF:MergeUnitSettings(value, "raidpet", true); end,
+ },
+ customText = GetOptionsTable_CustomText(UF.CreateAndUpdateHeaderGroup, "raidpet", nil, 4),
+ generalGroup = {
+ order = 5,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ rangeCheck = {
+ order = 3,
+ name = L["Range Check"],
+ desc = L["Check if you are in range to cast spells on this specific unit."],
+ type = "toggle",
+ },
+ healPrediction = {
+ order = 4,
+ name = L["Heal Prediction"],
+ desc = L["Show an incoming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."],
+ type = "toggle",
+ },
+ threatStyle = {
+ type = "select",
+ order = 5,
+ name = L["Threat Display Mode"],
+ values = threatValues,
+ },
+ colorOverride = {
+ order = 6,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ orientation = {
+ order = 7,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ positionsGroup = {
+ order = 100,
+ name = L["Size and Positions"],
+ type = "group",
+ guiInline = true,
+ set = function(info, value) E.db.unitframe.units["raidpet"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raidpet", nil, nil, true) end,
+ args = {
+ width = {
+ order = 1,
+ name = L["Width"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ set = function(info, value) E.db.unitframe.units["raidpet"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raidpet") end,
+ },
+ height = {
+ order = 2,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ set = function(info, value) E.db.unitframe.units["raidpet"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raidpet") end,
+ },
+ spacer = {
+ order = 3,
+ name = "",
+ type = "description",
+ width = "full",
+ },
+ growthDirection = {
+ order = 4,
+ name = L["Growth Direction"],
+ desc = L["Growth direction from the first unitframe."],
+ type = "select",
+ values = {
+ DOWN_RIGHT = format(L["%s and then %s"], L["Down"], L["Right"]),
+ DOWN_LEFT = format(L["%s and then %s"], L["Down"], L["Left"]),
+ UP_RIGHT = format(L["%s and then %s"], L["Up"], L["Right"]),
+ UP_LEFT = format(L["%s and then %s"], L["Up"], L["Left"]),
+ RIGHT_DOWN = format(L["%s and then %s"], L["Right"], L["Down"]),
+ RIGHT_UP = format(L["%s and then %s"], L["Right"], L["Up"]),
+ LEFT_DOWN = format(L["%s and then %s"], L["Left"], L["Down"]),
+ LEFT_UP = format(L["%s and then %s"], L["Left"], L["Up"]),
+ },
+ },
+ numGroups = {
+ order = 7,
+ type = "range",
+ name = L["Number of Groups"],
+ min = 1, max = 8, step = 1,
+ set = function(info, value)
+ E.db.unitframe.units["raidpet"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateHeaderGroup("raidpet")
+ if ElvUF_Raidpet.isForced then
+ UF:HeaderConfig(ElvUF_Raidpet)
+ UF:HeaderConfig(ElvUF_Raidpet, true)
+ end
+ end,
+ },
+ groupsPerRowCol = {
+ order = 8,
+ type = "range",
+ name = L["Groups Per Row/Column"],
+ min = 1, max = 8, step = 1,
+ set = function(info, value)
+ E.db.unitframe.units["raidpet"][ info[getn(info)] ] = value;
+ UF:CreateAndUpdateHeaderGroup("raidpet")
+ if ElvUF_Raidpet.isForced then
+ UF:HeaderConfig(ElvUF_Raidpet)
+ UF:HeaderConfig(ElvUF_Raidpet, true)
+ end
+ end,
+ },
+ horizontalSpacing = {
+ order = 9,
+ type = "range",
+ name = L["Horizontal Spacing"],
+ min = -1, max = 50, step = 1,
+ },
+ verticalSpacing = {
+ order = 10,
+ type = "range",
+ name = L["Vertical Spacing"],
+ min = -1, max = 50, step = 1,
+ },
+ },
+ },
+ visibilityGroup = {
+ order = 200,
+ name = L["Visibility"],
+ type = "group",
+ guiInline = true,
+ set = function(info, value) E.db.unitframe.units["raidpet"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raidpet", nil, nil, true) end,
+ args = {
+ visibility = {
+ order = 2,
+ type = "input",
+ name = L["Visibility"],
+ desc = L["The following macro must be true in order for the group to be shown, in addition to any filter that may already be set."],
+ width = "full",
+ },
+ },
+ },
+ sortingGroup = {
+ order = 300,
+ type = "group",
+ guiInline = true,
+ name = L["Grouping & Sorting"],
+ set = function(info, value) E.db.unitframe.units["raidpet"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raidpet", nil, nil, true) end,
+ args = {
+ groupBy = {
+ order = 1,
+ name = L["Group By"],
+ desc = L["Set the order that the group will sort."],
+ type = "select",
+ values = {
+ ["NAME"] = L["Owners Name"],
+ ["PETNAME"] = L["Pet Name"],
+ ["GROUP"] = GROUP,
+ },
+ },
+ sortDir = {
+ order = 2,
+ name = L["Sort Direction"],
+ desc = L["Defines the sort order of the selected sort method."],
+ type = "select",
+ values = {
+ ["ASC"] = L["Ascending"],
+ ["DESC"] = L["Descending"]
+ },
+ },
+ spacer = {
+ order = 3,
+ type = "description",
+ width = "full",
+ name = " "
+ },
+ raidWideSorting = {
+ order = 4,
+ name = L["Raid-Wide Sorting"],
+ desc = L["Enabling this allows raid-wide sorting however you will not be able to distinguish between groups."],
+ type = "toggle",
+ },
+ invertGroupingOrder = {
+ order = 5,
+ name = L["Invert Grouping Order"],
+ desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."],
+ disabled = function() return not E.db.unitframe.units["raidpet"].raidWideSorting end,
+ type = "toggle",
+ },
+ startFromCenter = {
+ order = 6,
+ name = L["Start Near Center"],
+ desc = L["The initial group will start near the center and grow out."],
+ disabled = function() return not E.db.unitframe.units["raidpet"].raidWideSorting end,
+ type = "toggle",
+ },
+ },
+ },
+ },
+ },
+ health = GetOptionsTable_Health(true, UF.CreateAndUpdateHeaderGroup, "raidpet"),
+ name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, "raidpet"),
+ portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateHeaderGroup, "raidpet"),
+ --buffs = GetOptionsTable_Auras(true, "buffs", true, UF.CreateAndUpdateHeaderGroup, "raidpet"),
+ --debuffs = GetOptionsTable_Auras(true, "debuffs", true, UF.CreateAndUpdateHeaderGroup, "raidpet"),
+ rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, "raidpet"),
+ raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateHeaderGroup, "raidpet"),
+ buffIndicator = {
+ order = 701,
+ type = "group",
+ name = L["Buff Indicator"],
+ get = function(info) return E.db.unitframe.units["raidpet"]["buffIndicator"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["raidpet"]["buffIndicator"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("raidpet") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Buff Indicator"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ size = {
+ type = "range",
+ name = L["Size"],
+ desc = L["Size of the indicator icon."],
+ order = 3,
+ min = 4, max = 50, step = 1,
+ },
+ fontSize = {
+ type = "range",
+ name = FONT_SIZE,
+ order = 4,
+ min = 7, max = 22, step = 1,
+ },
+ configureButton = {
+ type = "execute",
+ name = L["Configure Auras"],
+ func = function() E:SetToFilterConfig("Buff Indicator") end,
+ order = 5
+ },
+ },
+ },
+ },
+}
+
+--Tank Frames
+E.Options.args.unitframe.args.tank = {
+ name = L["Tank Frames"],
+ type = "group",
+ order = 1300,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["tank"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["tank"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("tank") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ resetSettings = {
+ type = "execute",
+ order = 1,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("tank") end,
+ },
+ generalGroup = {
+ order = 2,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ width = {
+ order = 3,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ },
+ height = {
+ order = 4,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ verticalSpacing = {
+ order = 5,
+ type = "range",
+ name = L["Vertical Spacing"],
+ min = 0, max = 100, step = 1,
+ },
+ disableDebuffHighlight = {
+ order = 6,
+ type = "toggle",
+ name = L["Disable Debuff Highlight"],
+ desc = L["Forces Debuff Highlight to be disabled for these frames"],
+ disabled = function() return E.db.unitframe.debuffHighlighting == "NONE" end,
+ },
+ orientation = {
+ order = 7,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 8,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ targetsGroup = {
+ order = 700,
+ type = "group",
+ name = L["Tank Target"],
+ get = function(info) return E.db.unitframe.units["tank"]["targetsGroup"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["tank"]["targetsGroup"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("tank") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Tank Target"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ width = {
+ order = 3,
+ name = L["Width"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ },
+ height = {
+ order = 4,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ anchorPoint = {
+ type = "select",
+ order = 5,
+ name = L["Anchor Point"],
+ desc = L["What point to anchor to the frame you set to attach to."],
+ values = petAnchors,
+ },
+ xOffset = {
+ order = 6,
+ type = "range",
+ name = L["xOffset"],
+ desc = L["An X offset (in pixels) to be used when anchoring new frames."],
+ min = -500, max = 500, step = 1,
+ },
+ yOffset = {
+ order = 7,
+ type = "range",
+ name = L["yOffset"],
+ desc = L["An Y offset (in pixels) to be used when anchoring new frames."],
+ min = -500, max = 500, step = 1,
+ },
+ colorOverride = {
+ order = 8,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ --buffs = GetOptionsTable_Auras(true, "buffs", true, UF.CreateAndUpdateHeaderGroup, "tank"),
+ --debuffs = GetOptionsTable_Auras(true, "debuffs", true, UF.CreateAndUpdateHeaderGroup, "tank"),
+ rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, "tank"),
+ buffIndicator = {
+ order = 701,
+ type = "group",
+ name = L["Buff Indicator"],
+ get = function(info) return E.db.unitframe.units["tank"]["buffIndicator"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["tank"]["buffIndicator"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("tank") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Buff Indicator"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ size = {
+ type = "range",
+ name = L["Size"],
+ desc = L["Size of the indicator icon."],
+ order = 3,
+ min = 4, max = 50, step = 1,
+ },
+ fontSize = {
+ type = "range",
+ name = FONT_SIZE,
+ order = 4,
+ min = 7, max = 22, step = 1,
+ },
+ profileSpecific = {
+ type = "toggle",
+ name = L["Profile Specific"],
+ desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
+ order = 5,
+ },
+ configureButton = {
+ type = "execute",
+ name = L["Configure Auras"],
+ func = function()
+ if E.db.unitframe.units["tank"]["buffIndicator"].profileSpecific then
+ E:SetToFilterConfig("Buff Indicator (Profile)")
+ else
+ E:SetToFilterConfig("Buff Indicator")
+ end
+ end,
+ order = 6
+ },
+ },
+ },
+ },
+}
+
+--Assist Frames
+E.Options.args.unitframe.args.assist = {
+ name = L["Assist Frames"],
+ type = "group",
+ order = 1300,
+ childGroups = "tab",
+ get = function(info) return E.db.unitframe.units["assist"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["assist"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("assist") end,
+ disabled = function() return not E.UnitFrames; end,
+ args = {
+ resetSettings = {
+ type = "execute",
+ order = 1,
+ name = L["Restore Defaults"],
+ func = function(info, value) UF:ResetUnitSettings("assist") end,
+ },
+ generalGroup = {
+ order = 2,
+ type = "group",
+ name = L["General"],
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["General"],
+ },
+ enable = {
+ type = "toggle",
+ order = 2,
+ name = L["Enable"],
+ },
+ width = {
+ order = 3,
+ name = L["Width"],
+ type = "range",
+ min = 50, max = 500, step = 1,
+ },
+ height = {
+ order = 4,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ verticalSpacing = {
+ order = 5,
+ type = "range",
+ name = L["Vertical Spacing"],
+ min = 0, max = 100, step = 1,
+ },
+ disableDebuffHighlight = {
+ order = 6,
+ type = "toggle",
+ name = L["Disable Debuff Highlight"],
+ desc = L["Forces Debuff Highlight to be disabled for these frames"],
+ disabled = function() return E.db.unitframe.debuffHighlighting == "NONE" end,
+ },
+ orientation = {
+ order = 7,
+ type = "select",
+ name = L["Frame Orientation"],
+ desc = L["Set the orientation of the UnitFrame."],
+ values = {
+ --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
+ ["LEFT"] = L["Left"],
+ ["MIDDLE"] = L["Middle"],
+ ["RIGHT"] = L["Right"],
+ },
+ },
+ colorOverride = {
+ order = 8,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ targetsGroup = {
+ order = 701,
+ type = "group",
+ name = L["Assist Target"],
+ get = function(info) return E.db.unitframe.units["assist"]["targetsGroup"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["assist"]["targetsGroup"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("assist") end,
+ args = {
+ header = {
+ order = 1,
+ type = "header",
+ name = L["Assist Target"],
+ },
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 2,
+ },
+ width = {
+ order = 3,
+ name = L["Width"],
+ type = "range",
+ min = 10, max = 500, step = 1,
+ },
+ height = {
+ order = 4,
+ name = L["Height"],
+ type = "range",
+ min = 10, max = 250, step = 1,
+ },
+ anchorPoint = {
+ type = "select",
+ order = 5,
+ name = L["Anchor Point"],
+ desc = L["What point to anchor to the frame you set to attach to."],
+ values = petAnchors,
+ },
+ xOffset = {
+ order = 6,
+ type = "range",
+ name = L["xOffset"],
+ desc = L["An X offset (in pixels) to be used when anchoring new frames."],
+ min = -500, max = 500, step = 1,
+ },
+ yOffset = {
+ order = 7,
+ type = "range",
+ name = L["yOffset"],
+ desc = L["An Y offset (in pixels) to be used when anchoring new frames."],
+ min = -500, max = 500, step = 1,
+ },
+ colorOverride = {
+ order = 8,
+ name = L["Class Color Override"],
+ desc = L["Override the default class color setting."],
+ type = "select",
+ values = {
+ ["USE_DEFAULT"] = L["Use Default"],
+ ["FORCE_ON"] = L["Force On"],
+ ["FORCE_OFF"] = L["Force Off"],
+ },
+ },
+ },
+ },
+ --buffs = GetOptionsTable_Auras(true, "buffs", true, UF.CreateAndUpdateHeaderGroup, "assist"),
+ --debuffs = GetOptionsTable_Auras(true, "debuffs", true, UF.CreateAndUpdateHeaderGroup, "assist"),
+ rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, "assist"),
+ buffIndicator = {
+ order = 702,
+ type = "group",
+ name = L["Buff Indicator"],
+ get = function(info) return E.db.unitframe.units["assist"]["buffIndicator"][ info[getn(info)] ] end,
+ set = function(info, value) E.db.unitframe.units["assist"]["buffIndicator"][ info[getn(info)] ] = value; UF:CreateAndUpdateHeaderGroup("assist") end,
+ args = {
+ enable = {
+ type = "toggle",
+ name = L["Enable"],
+ order = 1,
+ },
+ size = {
+ type = "range",
+ name = L["Size"],
+ desc = L["Size of the indicator icon."],
+ order = 3,
+ min = 4, max = 50, step = 1,
+ },
+ fontSize = {
+ type = "range",
+ name = FONT_SIZE,
+ order = 4,
+ min = 7, max = 22, step = 1,
+ },
+ profileSpecific = {
+ type = "toggle",
+ name = L["Profile Specific"],
+ desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
+ order = 5,
+ },
+ configureButton = {
+ type = "execute",
+ name = L["Configure Auras"],
+ func = function()
+ if E.db.unitframe.units["assist"]["buffIndicator"].profileSpecific then
+ E:SetToFilterConfig("Buff Indicator (Profile)")
+ else
+ E:SetToFilterConfig("Buff Indicator")
+ end
+ end,
+ order = 6
+ },
+ },
+ },
+ },
+}
+
+--MORE COLORING STUFF YAY
+E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup = {
+ order = -10,
+ type = "group",
+ name = L["Class Resources"],
+ get = function(info)
+ local t = E.db.unitframe.colors.classResources[ info[getn(info)] ]
+ local d = P.unitframe.colors.classResources[ info[getn(info)] ]
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ local t = E.db.unitframe.colors.classResources[ info[getn(info)] ]
+ t.r, t.g, t.b = r, g, b
+ UF:Update_AllFrames()
+ end,
+ args = {}
+}
+
+E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup.args.bgColor = {
+ order = 1,
+ type = "color",
+ name = L["Backdrop Color"],
+ hasAlpha = false,
+}
+
+for i = 1, 3 do
+ E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup.args["combo"..i] = {
+ order = i + 2,
+ type = "color",
+ name = L["Combo Point"].." #"..i,
+ get = function(info)
+ local t = E.db.unitframe.colors.classResources.comboPoints[i]
+ local d = P.unitframe.colors.classResources.comboPoints[i]
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ local t = E.db.unitframe.colors.classResources.comboPoints[i]
+ t.r, t.g, t.b = r, g, b
+ UF:Update_AllFrames()
+ end,
+ }
+end
+
+
+if P.unitframe.colors.classResources[E.myclass] then
+ E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup.args.spacer2 = {
+ order = 10,
+ name = " ",
+ type = "description",
+ width = "full",
+ }
+
+ local ORDER = 20
+ if E.myclass == "DEATHKNIGHT" then
+ local names = {
+ [1] = L["Blood"],
+ [2] = L["Unholy"],
+ [3] = L["Frost"],
+ [4] = L["Death"]
+ }
+ for i = 1, 4 do
+ E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup.args["resource"..i] = {
+ type = "color",
+ name = names[i],
+ order = ORDER + i,
+ get = function(info)
+ local t = E.db.unitframe.colors.classResources.DEATHKNIGHT[i]
+ local d = P.unitframe.colors.classResources.DEATHKNIGHT[i]
+ return t.r, t.g, t.b, t.a, d.r, d.g, d.b
+ end,
+ set = function(info, r, g, b)
+ local t = E.db.unitframe.colors.classResources.DEATHKNIGHT[i]
+ t.r, t.g, t.b = r, g, b
+ UF:Update_AllFrames()
+ end,
+ }
+ end
+ end
+end
+
+--Custom Texts
+function E:RefreshCustomTextsConfigs()
+ --Hide any custom texts that don"t belong to current profile
+ for _, customText in pairs(CUSTOMTEXT_CONFIGS) do
+ customText.hidden = true
+ end
+ twipe(CUSTOMTEXT_CONFIGS)
+
+ for unit, _ in pairs(E.db.unitframe.units) do
+ if E.db.unitframe.units[unit].customTexts then
+ for objectName, _ in pairs(E.db.unitframe.units[unit].customTexts) do
+ CreateCustomTextGroup(unit, objectName)
+ end
+ end
+ end
+end
+E:RefreshCustomTextsConfigs()
diff --git a/2/3/4/5/6/7/ElvUI_Config/core.lua b/2/3/4/5/6/7/ElvUI_Config/core.lua
index cdc01fc..a36addc 100644
--- a/2/3/4/5/6/7/ElvUI_Config/core.lua
+++ b/2/3/4/5/6/7/ElvUI_Config/core.lua
@@ -14,11 +14,11 @@ local UnitName = UnitName;
local DEFAULT_WIDTH = 890;
local DEFAULT_HEIGHT = 651;
-local AC = LibStub("AceConfig-3.0-ElvUI");
-local ACD = LibStub("AceConfigDialog-3.0-ElvUI");
-local ACR = LibStub("AceConfigRegistry-3.0-ElvUI");
+local AC = LibStub("AceConfig-3.0");
+local ACD = LibStub("AceConfigDialog-3.0");
+local ACR = LibStub("AceConfigRegistry-3.0");
-AC:RegisterOptionsTable("ElvUI", E.Options);
+AC.RegisterOptionsTable(E, "ElvUI", E.Options);
ACD:SetDefaultSize("ElvUI", DEFAULT_WIDTH, DEFAULT_HEIGHT);
function E:RefreshGUI()