update tables

This commit is contained in:
Crum
2018-12-06 19:55:03 -06:00
parent cb90d0f1e5
commit 4d0cc6c85c
68 changed files with 705 additions and 597 deletions
+1 -1
View File
@@ -220,7 +220,7 @@ function E:CreateMoverPopup()
E:Point(header, "CENTER", f, "TOP") E:Point(header, "CENTER", f, "TOP")
header:SetFrameLevel(header:GetFrameLevel() + 2) header:SetFrameLevel(header:GetFrameLevel() + 2)
header:EnableMouse(true) header:EnableMouse(true)
header:RegisterForClicks("AnyUp", "AnyDown") header:RegisterForClicks("LeftButtonUp", "RightButtonUp", "LeftButtonDown", "RightButtonDown")
header:SetScript("OnMouseDown", function() f:StartMoving() end) header:SetScript("OnMouseDown", function() f:StartMoving() end)
header:SetScript("OnMouseUp", function() f:StopMovingOrSizing() end) header:SetScript("OnMouseUp", function() f:StopMovingOrSizing() end)
+1 -1
View File
@@ -230,7 +230,7 @@ function E:GetFormattedText(style, min, max)
elseif style == "PERCENT" then elseif style == "PERCENT" then
return format(gftUseStyle, min / max * 100) return format(gftUseStyle, min / max * 100)
elseif style == "CURRENT" or ((style == "CURRENT_MAX" or style == "CURRENT_MAX_PERCENT" or style == "CURRENT_PERCENT") and min == max) then elseif style == "CURRENT" or ((style == "CURRENT_MAX" or style == "CURRENT_MAX_PERCENT" or style == "CURRENT_PERCENT") and min == max) then
return format(styles["CURRENT"], E:ShortValue(min)) return format(styles.CURRENT, E:ShortValue(min))
elseif style == "CURRENT_MAX" then elseif style == "CURRENT_MAX" then
return format(gftUseStyle, E:ShortValue(min), E:ShortValue(max)) return format(gftUseStyle, E:ShortValue(min), E:ShortValue(max))
elseif style == "CURRENT_PERCENT" then elseif style == "CURRENT_PERCENT" then
+6 -6
View File
@@ -306,9 +306,9 @@ function E:CalculateMoverPoints(mover, nudgeX, nudgeY)
end end
function E:UpdatePositionOverride(name) function E:UpdatePositionOverride(name)
if _G[name] and _G[name]:GetScript("OnDragStop") then local frame = _G[name]
_G[name]:GetScript("OnDragStop")(_G[name]) local OnDragStop = frame and frame.GetScript and frame:GetScript("OnDragStop")
end if OnDragStop then OnDragStop(frame) end
end end
function E:HasMoverBeenMoved(name) function E:HasMoverBeenMoved(name)
@@ -371,7 +371,7 @@ end
function E:ToggleMovers(show, moverType) function E:ToggleMovers(show, moverType)
self.configMode = show self.configMode = show
for name, _ in pairs(E.CreatedMovers) do for name in pairs(E.CreatedMovers) do
if not show then if not show then
_G[name]:Hide() _G[name]:Hide()
else else
@@ -430,7 +430,7 @@ end
function E:ResetMovers(arg) function E:ResetMovers(arg)
if arg == "" or arg == nil then if arg == "" or arg == nil then
for name, _ in pairs(E.CreatedMovers) do for name in pairs(E.CreatedMovers) do
local f = _G[name] local f = _G[name]
local point, anchor, secondaryPoint, x, y = split(",", E.CreatedMovers[name].point) local point, anchor, secondaryPoint, x, y = split(",", E.CreatedMovers[name].point)
f:ClearAllPoints() f:ClearAllPoints()
@@ -444,7 +444,7 @@ function E:ResetMovers(arg)
end end
self.db.movers = nil self.db.movers = nil
else else
for name, _ in pairs(E.CreatedMovers) do for name in pairs(E.CreatedMovers) do
for key, value in pairs(E.CreatedMovers[name]) do for key, value in pairs(E.CreatedMovers[name]) do
if key == "text" then if key == "text" then
if arg == value then if arg == value then
+3 -3
View File
@@ -61,13 +61,13 @@ E.PopupDialogs["ELVUI_EDITBOX"] = {
text = E.title, text = E.title,
button1 = OKAY, button1 = OKAY,
hasEditBox = 1, hasEditBox = 1,
OnShow = function() OnShow = function(data)
this.editBox:SetAutoFocus(false) this.editBox:SetAutoFocus(false)
this.editBox.width = this.editBox:GetWidth() this.editBox.width = this.editBox:GetWidth()
E:Width(this.editBox, 280) E:Width(this.editBox, 280)
this.editBox:AddHistoryLine("text") this.editBox:AddHistoryLine("text")
this.editBox.temptxt = arg1 this.editBox.temptxt = data
this.editBox:SetText(arg1) this.editBox:SetText(data)
this.editBox:HighlightText() this.editBox:HighlightText()
this.editBox:SetJustifyH("CENTER") this.editBox:SetJustifyH("CENTER")
end, end,
+199 -185
View File
@@ -1,14 +1,15 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local LSM = LibStub("LibSharedMedia-3.0"); local LSM = LibStub("LibSharedMedia-3.0");
local LBF = LibStub("LibButtonFacade", true);
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local _G = _G local _G = _G
local tonumber, pairs, ipairs, error, unpack, select, tostring = tonumber, pairs, ipairs, error, unpack, select, tostring local tonumber, pairs, ipairs, error, unpack, select, tostring = tonumber, pairs, ipairs, error, unpack, select, tostring
local assert, print, type, collectgarbage, pcall, date = assert, print, type, collectgarbage, pcall, date local assert, type, collectgarbage, pcall ,print, date = assert, type, collectgarbage, pcall, print, date
local getn, twipe, tinsert, tremove, next = table.getn, table.wipe, tinsert, tremove, next local getn, twipe, tinsert, tremove, next = table.getn, table.wipe, tinsert, tremove, next
local floor = floor local floor = floor
local format, find, match, strrep, len, sub, gsub = string.format, string.find, string.match, strrep, string.len, string.sub, string.gsub local format, find, match, strrep, len, sub, gsub, strjoin = string.format, string.find, string.match, strrep, string.len, string.sub, string.gsub, strjoin
--WoW API / Variables --WoW API / Variables
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local GetCVar = GetCVar local GetCVar = GetCVar
@@ -37,21 +38,22 @@ E.resolution = GetCVar("gxResolution")
E.screenheight = tonumber(match(E.resolution, "%d+x(%d+)")) E.screenheight = tonumber(match(E.resolution, "%d+x(%d+)"))
E.screenwidth = tonumber(match(E.resolution, "(%d+)x+%d")) E.screenwidth = tonumber(match(E.resolution, "(%d+)x+%d"))
E.isMacClient = IsMacClient() E.isMacClient = IsMacClient()
E.PixelMode = false
E["media"] = {} --Tables
E["frames"] = {} E.media = {}
E["unitFrameElements"] = {} E.frames = {}
E["statusBars"] = {} E.unitFrameElements = {}
E["texts"] = {} E.statusBars = {}
E["snapBars"] = {} E.texts = {}
E["RegisteredModules"] = {} E.snapBars = {}
E["RegisteredInitialModules"] = {} E.RegisteredModules = {}
E["ModuleCallbacks"] = {["CallPriority"] = {}} E.RegisteredInitialModules = {}
E["InitialModuleCallbacks"] = {["CallPriority"] = {}} E.ModuleCallbacks = {["CallPriority"] = {}}
E["valueColorUpdateFuncs"] = {} E.InitialModuleCallbacks = {["CallPriority"] = {}}
E.valueColorUpdateFuncs = {}
E.TexCoords = {.08, .92, .08, .92} E.TexCoords = {.08, .92, .08, .92}
E.CreditsList = {} E.CreditsList = {}
E.PixelMode = false
E.InversePoints = { E.InversePoints = {
TOP = "BOTTOM", TOP = "BOTTOM",
@@ -73,7 +75,7 @@ E.DispelClasses = {
["SHAMAN"] = { ["SHAMAN"] = {
["Poison"] = true, ["Poison"] = true,
["Disease"] = true, ["Disease"] = true,
["Curse"] = false ["Curse"] = true
}, },
["PALADIN"] = { ["PALADIN"] = {
["Poison"] = true, ["Poison"] = true,
@@ -144,6 +146,7 @@ function E:Print(msg)
(_G[self.db.general.messageRedirect] or DEFAULT_CHAT_FRAME):AddMessage(strjoin("", self:ColorizedName("ElvUI", true), msg)) -- I put DEFAULT_CHAT_FRAME as a fail safe. (_G[self.db.general.messageRedirect] or DEFAULT_CHAT_FRAME):AddMessage(strjoin("", self:ColorizedName("ElvUI", true), msg)) -- I put DEFAULT_CHAT_FRAME as a fail safe.
end end
--Workaround for people wanting to use white and it reverting to their class color.
E.PriestColors = { E.PriestColors = {
r = 0.99, r = 0.99,
g = 0.99, g = 0.99,
@@ -167,10 +170,11 @@ function E:ShapeshiftDelayedUpdate(func, ...)
end, 0.05) end, 0.05)
end end
--Basically check if another class border is being used on a class that doesn't match. And then return true if a match is found.
function E:CheckClassColor(r, g, b) function E:CheckClassColor(r, g, b)
r, g, b = floor(r*100 + .5) / 100, floor(g*100 + .5) / 100, floor(b*100 + .5) / 100 r, g, b = floor(r*100 + .5) / 100, floor(g*100 + .5) / 100, floor(b*100 + .5) / 100
local matchFound = false local matchFound = false
for class, _ in pairs(RAID_CLASS_COLORS) do for class in pairs(RAID_CLASS_COLORS) do
if class ~= E.myclass then if class ~= E.myclass then
local colorTable = class == "PRIEST" and E.PriestColors or (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]) local colorTable = class == "PRIEST" and E.PriestColors or (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class])
if colorTable.r == r and colorTable.g == g and colorTable.b == b then if colorTable.r == r and colorTable.g == g and colorTable.b == b then
@@ -195,55 +199,56 @@ function E:GetColorTable(data)
end end
function E:UpdateMedia() function E:UpdateMedia()
if not (self.db and self.db["general"] and self.private["general"]) then return end if not self.db.general or not self.private.general then return end --Prevent rare nil value errors
-- Fonts -- Fonts
self["media"].normFont = LSM:Fetch("font", self.db["general"].font) self.media.normFont = LSM:Fetch("font", self.db.general.font)
self["media"].combatFont = LSM:Fetch("font", self.db["general"].dmgfont) self.media.combatFont = LSM:Fetch("font", self.private.general.dmgfont)
-- Textures -- Textures
self["media"].blankTex = LSM:Fetch("background", "ElvUI Blank") self.media.blankTex = LSM:Fetch("background", "ElvUI Blank")
self["media"].normTex = LSM:Fetch("statusbar", self.private["general"].normTex) self.media.normTex = LSM:Fetch("statusbar", self.private.general.normTex)
self["media"].glossTex = LSM:Fetch("statusbar", self.private["general"].glossTex) self.media.glossTex = LSM:Fetch("statusbar", self.private.general.glossTex)
-- Border Color -- Border Color
local border = E.db["general"].bordercolor local border = E.db.general.bordercolor
if self:CheckClassColor(border.r, border.g, border.b) then if self:CheckClassColor(border.r, border.g, border.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]) local classColor = E.myclass == "PRIEST" and E.PriestColors or (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[E.myclass] or RAID_CLASS_COLORS[E.myclass])
E.db["general"].bordercolor.r = classColor.r E.db.general.bordercolor.r = classColor.r
E.db["general"].bordercolor.g = classColor.g E.db.general.bordercolor.g = classColor.g
E.db["general"].bordercolor.b = classColor.b E.db.general.bordercolor.b = classColor.b
end end
self["media"].bordercolor = {border.r, border.g, border.b} self.media.bordercolor = {border.r, border.g, border.b}
-- UnitFrame Border Color -- UnitFrame Border Color
border = E.db["unitframe"].colors.borderColor border = E.db.unitframe.colors.borderColor
if self:CheckClassColor(border.r, border.g, border.b) then if self:CheckClassColor(border.r, border.g, border.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]) local classColor = E.myclass == "PRIEST" and E.PriestColors or (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[E.myclass] or RAID_CLASS_COLORS[E.myclass])
E.db["unitframe"].colors.borderColor.r = classColor.r E.db.unitframe.colors.borderColor.r = classColor.r
E.db["unitframe"].colors.borderColor.g = classColor.g E.db.unitframe.colors.borderColor.g = classColor.g
E.db["unitframe"].colors.borderColor.b = classColor.b E.db.unitframe.colors.borderColor.b = classColor.b
end end
self["media"].unitframeBorderColor = {border.r, border.g, border.b} self.media.unitframeBorderColor = {border.r, border.g, border.b}
-- Backdrop Color -- Backdrop Color
self["media"].backdropcolor = E:GetColorTable(self.db["general"].backdropcolor) self.media.backdropcolor = E:GetColorTable(self.db.general.backdropcolor)
-- Backdrop Fade Color -- Backdrop Fade Color
self["media"].backdropfadecolor = E:GetColorTable(self.db["general"].backdropfadecolor) self.media.backdropfadecolor = E:GetColorTable(self.db.general.backdropfadecolor)
-- Value Color -- Value Color
local value = self.db["general"].valuecolor local value = self.db.general.valuecolor
if self:CheckClassColor(value.r, value.g, value.b) then if self:CheckClassColor(value.r, value.g, value.b) then
value = E.myclass == "PRIEST" and E.PriestColors or (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[E.myclass] or RAID_CLASS_COLORS[E.myclass]) value = E.myclass == "PRIEST" and E.PriestColors or (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[E.myclass] or RAID_CLASS_COLORS[E.myclass])
self.db["general"].valuecolor.r = value.r self.db.general.valuecolor.r = value.r
self.db["general"].valuecolor.g = value.g self.db.general.valuecolor.g = value.g
self.db["general"].valuecolor.b = value.b self.db.general.valuecolor.b = value.b
end end
self["media"].hexvaluecolor = self:RGBToHex(value.r, value.g, value.b) self.media.hexvaluecolor = self:RGBToHex(value.r, value.g, value.b)
self["media"].rgbvaluecolor = {value.r, value.g, value.b} self.media.rgbvaluecolor = {value.r, value.g, value.b}
if LeftChatPanel and LeftChatPanel.tex and RightChatPanel and RightChatPanel.tex then if LeftChatPanel and LeftChatPanel.tex and RightChatPanel and RightChatPanel.tex then
LeftChatPanel.tex:SetTexture(E.db.chat.panelBackdropNameLeft) LeftChatPanel.tex:SetTexture(E.db.chat.panelBackdropNameLeft)
@@ -258,13 +263,14 @@ function E:UpdateMedia()
self:UpdateBlizzardFonts() self:UpdateBlizzardFonts()
end end
--Update font/texture paths when they are registered by the addon providing them
--This helps fix most of the issues with fonts or textures reverting to default because the addon providing them is loading after ElvUI.
--We use a wrapper to avoid errors in :UpdateMedia because "self" is passed to the function with a value other than ElvUI.
local function LSMCallback() local function LSMCallback()
E:UpdateMedia() E:UpdateMedia()
end end
LSM.RegisterCallback(E, "LibSharedMedia_Registered", LSMCallback) LSM.RegisterCallback(E, "LibSharedMedia_Registered", LSMCallback)
local LBF = LibStub("LibButtonFacade", true)
local LBFGroupToTableElement = { local LBFGroupToTableElement = {
["ActionBars"] = "actionbar", ["ActionBars"] = "actionbar",
["Auras"] = "auras" ["Auras"] = "auras"
@@ -308,91 +314,95 @@ function E:PLAYER_ENTERING_WORLD()
end end
function E:ValueFuncCall() function E:ValueFuncCall()
for func, _ in pairs(self["valueColorUpdateFuncs"]) do for func in pairs(self.valueColorUpdateFuncs) do
func(self["media"].hexvaluecolor, unpack(self["media"].rgbvaluecolor)) func(self.media.hexvaluecolor, unpack(self.media.rgbvaluecolor))
end end
end end
function E:UpdateFrameTemplates() function E:UpdateFrameTemplates()
for frame in pairs(self["frames"]) do for frame in pairs(self.frames) do
if frame and frame.template then if frame and frame.template and not frame.ignoreUpdates then
E:SetTemplate(frame, frame.template, frame.glossTex) if not frame.ignoreFrameTemplates then
E:SetTemplate(frame, frame.template, frame.glossTex)
end
else else
self["frames"][frame] = nil self.frames[frame] = nil
end end
end end
for frame in pairs(self["unitFrameElements"]) do for frame in pairs(self.unitFrameElements) do
if frame and frame.template and not frame.ignoreUpdates then if frame and frame.template and not frame.ignoreUpdates then
E:SetTemplate(frame, frame.template, frame.glossTex) if not frame.ignoreFrameTemplates then
E:SetTemplate(frame, frame.template, frame.glossTex)
end
else else
self["unitFrameElements"][frame] = nil self.unitFrameElements[frame] = nil
end end
end end
end end
function E:UpdateBorderColors() function E:UpdateBorderColors()
for frame, _ in pairs(self["frames"]) do for frame in pairs(self.frames) do
if frame and not frame.ignoreUpdates then if frame and not frame.ignoreUpdates then
if not frame.ignoreBorderColors then if not frame.ignoreBorderColors then
if frame.template == "Default" or frame.template == "Transparent" or frame.template == nil then if frame.template == "Default" or frame.template == "Transparent" or frame.template == nil then
frame:SetBackdropBorderColor(unpack(self["media"].bordercolor)) frame:SetBackdropBorderColor(unpack(self.media.bordercolor))
end end
end end
else else
self["frames"][frame] = nil self.frames[frame] = nil
end end
end end
for frame, _ in pairs(self["unitFrameElements"]) do for frame in pairs(self.unitFrameElements) do
if frame and not frame.ignoreUpdates then if frame and not frame.ignoreUpdates then
if not frame.ignoreBorderColors then if not frame.ignoreBorderColors then
if frame.template == "Default" or frame.template == "Transparent" or frame.template == nil then if frame.template == "Default" or frame.template == "Transparent" or frame.template == nil then
frame:SetBackdropBorderColor(unpack(self["media"].unitframeBorderColor)) frame:SetBackdropBorderColor(unpack(self.media.unitframeBorderColor))
end end
end end
else else
self["unitFrameElements"][frame] = nil self.unitFrameElements[frame] = nil
end end
end end
end end
function E:UpdateBackdropColors() function E:UpdateBackdropColors()
for frame, _ in pairs(self["frames"]) do for frame in pairs(self.frames) do
if frame then if frame then
if not frame.ignoreBackdropColors then if not frame.ignoreBackdropColors then
if frame.template == "Default" or frame.template == nil then if frame.template == "Default" or frame.template == nil then
frame:SetBackdropColor(unpack(self["media"].backdropcolor)) frame:SetBackdropColor(unpack(self.media.backdropcolor))
elseif frame.template == "Transparent" then elseif frame.template == "Transparent" then
frame:SetBackdropColor(unpack(self["media"].backdropfadecolor)) frame:SetBackdropColor(unpack(self.media.backdropfadecolor))
end end
end end
else else
self["frames"][frame] = nil self.frames[frame] = nil
end end
end end
for frame, _ in pairs(self["unitFrameElements"]) do for frame in pairs(self.unitFrameElements) do
if frame then if frame then
if not frame.ignoreBackdropColors then if not frame.ignoreBackdropColors then
if frame.template == "Default" or frame.template == nil then if frame.template == "Default" or frame.template == nil then
frame:SetBackdropColor(unpack(self["media"].backdropcolor)) frame:SetBackdropColor(unpack(self.media.backdropcolor))
elseif frame.template == "Transparent" then elseif frame.template == "Transparent" then
frame:SetBackdropColor(unpack(self["media"].backdropfadecolor)) frame:SetBackdropColor(unpack(self.media.backdropfadecolor))
end end
end end
else else
self["unitFrameElements"][frame] = nil self.unitFrameElements[frame] = nil
end end
end end
end end
function E:UpdateFontTemplates() function E:UpdateFontTemplates()
for text, _ in pairs(self["texts"]) do for text in pairs(self.texts) do
if text then if text then
E:FontTemplate(text, text.font, text.fontSize, text.fontStyle) E:FontTemplate(text, text.font, text.fontSize, text.fontStyle)
else else
self["texts"][text] = nil self.texts[text] = nil
end end
end end
end end
@@ -417,7 +427,7 @@ E.UIParent:SetFrameLevel(UIParent:GetFrameLevel())
E.UIParent:SetPoint("CENTER", UIParent, "CENTER") E.UIParent:SetPoint("CENTER", UIParent, "CENTER")
E.UIParent:SetWidth(GetScreenWidth()) E.UIParent:SetWidth(GetScreenWidth())
E.UIParent:SetHeight(GetScreenHeight()) E.UIParent:SetHeight(GetScreenHeight())
E["snapBars"][getn(E["snapBars"]) + 1] = E.UIParent E.snapBars[getn(E["snapBars"]) + 1] = E.UIParent
E.HiddenFrame = CreateFrame("Frame") E.HiddenFrame = CreateFrame("Frame")
E.HiddenFrame:Hide() E.HiddenFrame:Hide()
@@ -554,6 +564,10 @@ function E:RemoveEmptySubTables(tbl)
end end
end end
--Compare 2 tables and remove duplicate key/value pairs
--param cleanTable : table you want cleaned
--param checkTable : table you want to check against.
--return : a copy of cleanTable with duplicate key/value pairs removed
function E:RemoveTableDuplicates(cleanTable, checkTable) function E:RemoveTableDuplicates(cleanTable, checkTable)
if type(cleanTable) ~= "table" then if type(cleanTable) ~= "table" then
E:Print("Bad argument #1 to 'RemoveTableDuplicates' (table expected)") E:Print("Bad argument #1 to 'RemoveTableDuplicates' (table expected)")
@@ -569,12 +583,14 @@ function E:RemoveTableDuplicates(cleanTable, checkTable)
if type(value) == "table" and checkTable[option] and type(checkTable[option]) == "table" then if type(value) == "table" and checkTable[option] and type(checkTable[option]) == "table" then
cleaned[option] = self:RemoveTableDuplicates(value, checkTable[option]) cleaned[option] = self:RemoveTableDuplicates(value, checkTable[option])
else else
-- Add unique data to our clean table
if cleanTable[option] ~= checkTable[option] then if cleanTable[option] ~= checkTable[option] then
cleaned[option] = value cleaned[option] = value
end end
end end
end end
--Clean out empty sub-tables
self:RemoveEmptySubTables(cleaned) self:RemoveEmptySubTables(cleaned)
return cleaned return cleaned
@@ -744,18 +760,21 @@ function E:StringSplitMultiDelim(s, delim)
assert(type (delim) == "string" and len(delim) > 0, "bad delimiter") assert(type (delim) == "string" and len(delim) > 0, "bad delimiter")
local start = 1 local start = 1
local t = {} local t = {} -- results table
-- find each instance of a string followed by the delimiter
while(true) do while(true) do
local pos = find(s, delim, start, true) local pos = find(s, delim, start, true) -- plain find
if not pos then if not pos then
break break
end end
tinsert(t, sub(s, start, pos - 1)) tinsert(t, sub(s, start, pos - 1))
start = pos + len(delim) start = pos + len(delim)
end end -- while
-- insert final one (after last delimiter)
tinsert(t, sub(s, start)) tinsert(t, sub(s, start))
return unpack(t) return unpack(t)
@@ -782,13 +801,11 @@ end
local SendRecieveGroupSize = 0 local SendRecieveGroupSize = 0
local function SendRecieve() local function SendRecieve()
local prefix, message, sender = arg1, arg2, arg4
if event == "CHAT_MSG_ADDON" then if event == "CHAT_MSG_ADDON" then
if sender == E.myname then return end if arg4 == E.myname then return end
if arg1 == "ELVUI_VERSIONCHK" then if arg1 == "ELVUI_VERSIONCHK" then
local msg, ver = tonumber(message), tonumber(E.version) local msg, ver = tonumber(arg2), tonumber(E.version)
if msg and (msg > ver) then -- you're outdated D: if msg and (msg > ver) then -- you're outdated D:
if not E.recievedOutOfDateMessage then if not E.recievedOutOfDateMessage then
E:Print(L["ElvUI is out of date. You can download the newest version from https://github.com/ElvUI-TBC/ElvUI/"]) E:Print(L["ElvUI is out of date. You can download the newest version from https://github.com/ElvUI-TBC/ElvUI/"])
@@ -829,95 +846,78 @@ f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", SendRecieve) f:SetScript("OnEvent", SendRecieve)
function E:UpdateAll(ignoreInstall) function E:UpdateAll(ignoreInstall)
self.private = self.charSettings.profile E.private = E.charSettings.profile
self.db = self.data.profile E.db = E.data.profile
self.global = self.data.global E.global = E.data.global
self.db.theme = nil E.db.theme = nil
self.db.install_complete = nil E.db.install_complete = nil
self:SetMoversPositions() E:DBConversions()
self:UpdateMedia()
self:UpdateCooldownSettings("all")
local UF = self:GetModule("UnitFrames") local ActionBars = E:GetModule("ActionBars")
UF.db = self.db.unitframe local AFK = E:GetModule("AFK")
UF:Update_AllFrames() local Auras = E:GetModule("Auras")
local Bags = E:GetModule("Bags")
local Blizzard = E:GetModule("Blizzard")
local Chat = E:GetModule("Chat")
local DataBars = E:GetModule("DataBars")
local DataTexts = E:GetModule("DataTexts")
local Layout = E:GetModule("Layout")
local Minimap = E:GetModule("Minimap")
local NamePlates = E:GetModule("NamePlates")
local Tooltip = E:GetModule("Tooltip")
local UnitFrames = E:GetModule("UnitFrames")
local CH = self:GetModule("Chat") ActionBars.db = E.db.actionbar
CH.db = self.db.chat Auras.db = E.db.auras
CH:PositionChat(true) Bags.db = E.db.bags
CH:SetupChat() Chat.db = E.db.chat
CH:UpdateAnchors()
local AB = self:GetModule("ActionBars")
AB.db = self.db.actionbar
AB:UpdateButtonSettings()
AB:UpdateMicroPositionDimensions()
local bags = E:GetModule("Bags")
bags.db = self.db.bags
bags:Layout()
bags:Layout(true)
bags:SizeAndPositionBagBar()
bags:UpdateItemLevelDisplay()
bags:UpdateCountDisplay()
-- local totems = E:GetModule("Totems")
-- totems.db = self.db.general.totems
-- totems:PositionAndSize()
-- totems:ToggleEnable()
self:GetModule("Layout"):ToggleChatPanels()
local DT = self:GetModule("DataTexts")
DT.db = self.db.datatexts
DT:LoadDataTexts()
-- local NP = self:GetModule("NamePlates")
-- NP.db = self.db.nameplates
-- NP:StyleFilterInitializeAllFilters()
-- NP:ConfigureAll()
local DataBars = self:GetModule("DataBars")
DataBars.db = E.db.databars DataBars.db = E.db.databars
DataBars:UpdateDataBarDimensions() DataTexts.db = E.db.datatexts
NamePlates.db = E.db.nameplates
Tooltip.db = E.db.tooltip
UnitFrames.db = E.db.unitframe
E:SetMoversPositions()
E:UpdateMedia()
E:UpdateBorderColors()
E:UpdateBackdropColors()
E:UpdateFrameTemplates()
E:UpdateStatusBars()
E:UpdateCooldownSettings("all")
Layout:ToggleChatPanels()
Layout:BottomPanelVisibility()
Layout:TopPanelVisibility()
Layout:SetDataPanelStyle()
ActionBars:UpdateButtonSettings()
ActionBars:UpdateMicroPositionDimensions()
AFK:Toggle()
Bags:Layout()
Bags:Layout(true)
Bags:SizeAndPositionBagBar()
Bags:UpdateCountDisplay()
Bags:UpdateItemLevelDisplay()
Chat:PositionChat(true)
Chat:SetupChat()
Chat:UpdateAnchors()
DataBars:EnableDisable_ExperienceBar() DataBars:EnableDisable_ExperienceBar()
DataBars:EnableDisable_ReputationBar() DataBars:EnableDisable_ReputationBar()
DataBars:UpdateDataBarDimensions()
DataTexts:LoadDataTexts()
Minimap:UpdateSettings()
NamePlates:ConfigureAll()
UnitFrames:Update_AllFrames()
-- local T = self:GetModule("Threat") if E.RefreshGUI then
-- T.db = self.db.general.threat E:RefreshGUI()
-- T:UpdatePosition()
-- T:ToggleEnable()
self:GetModule("Auras").db = self.db.auras
self:GetModule("Tooltip").db = self.db.tooltip
-- if ElvUIPlayerBuffs then
-- E:GetModule("Auras"):UpdateHeader(ElvUIPlayerBuffs)
-- end
-- if ElvUIPlayerDebuffs then
-- E:GetModule("Auras"):UpdateHeader(ElvUIPlayerDebuffs)
-- end
if not (self.private.install_complete or ignoreInstall) then
self:Install()
end end
self:GetModule("Minimap"):UpdateSettings() if not (self.private.install_complete or ignoreInstall) then
self:GetModule("AFK"):Toggle() E:Install()
end
self:UpdateBorderColors()
self:UpdateBackdropColors()
self:UpdateFrameTemplates()
self:UpdateStatusBars()
local LO = E:GetModule("Layout")
LO:ToggleChatPanels()
LO:BottomPanelVisibility()
LO:TopPanelVisibility()
LO:SetDataPanelStyle()
collectgarbage() collectgarbage()
end end
@@ -957,17 +957,16 @@ function E:RegisterModule(name, loadFunc)
--Add module name to registry --Add module name to registry
self.ModuleCallbacks[name] = true self.ModuleCallbacks[name] = true
tinsert(self.ModuleCallbacks["CallPriority"], name) self.ModuleCallbacks.CallPriority[getn(self.ModuleCallbacks.CallPriority) + 1] = name
--Register loadFunc to be called when event is fired --Register loadFunc to be called when event is fired
E:RegisterCallback(name, loadFunc, E:GetModule(name)) E:RegisterCallback(name, loadFunc, E:GetModule(name))
end end
--Old deprecated initialize method
else else
if self.initialized then if self.initialized then
self:GetModule(name):Initialize() self:GetModule(name):Initialize()
else else
tinsert(self["RegisteredModules"], name) self.RegisteredModules[getn(self.RegisteredModules) + 1] = name
end end
end end
end end
@@ -983,26 +982,25 @@ function E:RegisterInitialModule(name, loadFunc)
--Add module name to registry --Add module name to registry
self.InitialModuleCallbacks[name] = true self.InitialModuleCallbacks[name] = true
tinsert(self.InitialModuleCallbacks["CallPriority"], name) self.InitialModuleCallbacks.CallPriority[getn(self.InitialModuleCallbacks.CallPriority) + 1] = name
--Register loadFunc to be called when event is fired --Register loadFunc to be called when event is fired
E:RegisterCallback(name, loadFunc, E:GetModule(name)) E:RegisterCallback(name, loadFunc, E:GetModule(name))
--Old deprecated initialize method
else else
tinsert(self["RegisteredInitialModules"], name) self.RegisteredInitialModules[getn(self.RegisteredInitialModules) + 1] = name
end end
end end
function E:InitializeInitialModules() function E:InitializeInitialModules()
--Fire callbacks for any module using the new system --Fire callbacks for any module using the new system
for index, moduleName in ipairs(self.InitialModuleCallbacks["CallPriority"]) do for index, moduleName in ipairs(self.InitialModuleCallbacks.CallPriority) do
self.InitialModuleCallbacks[moduleName] = nil self.InitialModuleCallbacks[moduleName] = nil
self.InitialModuleCallbacks["CallPriority"][index] = nil self.InitialModuleCallbacks.CallPriority[index] = nil
E.callbacks:Fire(moduleName) E.callbacks:Fire(moduleName)
end end
--Old deprecated initialize method, we keep it for any plugins that may need it --Old deprecated initialize method, we keep it for any plugins that may need it
for _, module in pairs(E["RegisteredInitialModules"]) do for _, module in pairs(E.RegisteredInitialModules) do
module = self:GetModule(module, true) module = self:GetModule(module, true)
if module and module.Initialize then if module and module.Initialize then
local _, catch = pcall(module.Initialize, module) local _, catch = pcall(module.Initialize, module)
@@ -1021,17 +1019,18 @@ end
function E:InitializeModules() function E:InitializeModules()
--Fire callbacks for any module using the new system --Fire callbacks for any module using the new system
for index, moduleName in ipairs(self.ModuleCallbacks["CallPriority"]) do for index, moduleName in ipairs(self.ModuleCallbacks.CallPriority) do
self.ModuleCallbacks[moduleName] = nil self.ModuleCallbacks[moduleName] = nil
self.ModuleCallbacks["CallPriority"][index] = nil self.ModuleCallbacks.CallPriority[index] = nil
E.callbacks:Fire(moduleName) E.callbacks:Fire(moduleName)
end end
--Old deprecated initialize method, we keep it for any plugins that may need it --Old deprecated initialize method, we keep it for any plugins that may need it
for _, module in pairs(E["RegisteredModules"]) do for _, module in pairs(E.RegisteredModules) do
module = self:GetModule(module) module = self:GetModule(module)
if module.Initialize then if module.Initialize then
local _, catch = pcall(module.Initialize, module) local _, catch = pcall(module.Initialize, module)
if catch and GetCVar("ShowErrors") == "1" then if catch and GetCVar("ShowErrors") == "1" then
ScriptErrorsFrame_OnError(catch, false) ScriptErrorsFrame_OnError(catch, false)
end end
@@ -1041,7 +1040,12 @@ end
--DATABASE CONVERSIONS --DATABASE CONVERSIONS
function E:DBConversions() function E:DBConversions()
-- Add conversions here --Vendor Greys option is now in bags table
if E.db.general.vendorGrays then
E.db.bags.vendorGrays.enable = E.db.general.vendorGrays
E.db.general.vendorGrays = nil
E.db.general.vendorGraysDetails = nil
end
end end
local CPU_USAGE = {} local CPU_USAGE = {}
@@ -1060,8 +1064,8 @@ local function CompareCPUDiff(showall, module, minCalls)
end end
newUsage, calls = GetFunctionCPUUsage(mod[newFunc], true) newUsage, calls = GetFunctionCPUUsage(mod[newFunc], true)
differance = newUsage - oldUsage differance = newUsage - oldUsage
if showall and calls > minCalls then if showall and (calls > minCalls) then
E:Print(calls, name, differance) E:Print('Name('..name..') Calls('..calls..') Diff('..(differance > 0 and format("%.3f", differance) or 0)..')')
end end
if (differance > greatestDiff) and calls > minCalls then if (differance > greatestDiff) and calls > minCalls then
greatestName, greatestUsage, greatestCalls, greatestDiff = name, newUsage, calls, differance greatestName, greatestUsage, greatestCalls, greatestDiff = name, newUsage, calls, differance
@@ -1070,10 +1074,12 @@ local function CompareCPUDiff(showall, module, minCalls)
end end
if greatestName then if greatestName then
E:Print(greatestName .. " had the CPU usage difference of: " .. greatestUsage .. "ms. And has been called " .. greatestCalls .. " times.") E:Print(greatestName.. " had the CPU usage difference of: "..(greatestUsage > 0 and format("%.3f", greatestUsage) or 0).."ms. And has been called ".. greatestCalls.." times.")
else else
E:Print("CPU Usage: No CPU Usage differences found.") E:Print("CPU Usage: No CPU Usage differences found.")
end end
twipe(CPU_USAGE)
end end
function E:GetTopCPUFunc(msg) function E:GetTopCPUFunc(msg)
@@ -1085,6 +1091,7 @@ function E:GetTopCPUFunc(msg)
E:Print("cpuusage: module (arg1) is required! This can be set as 'all' too.") E:Print("cpuusage: module (arg1) is required! This can be set as 'all' too.")
return return
end end
local module, showall, delay, minCalls = msg:match("^(%S+)%s*(%S*)%s*(%S*)%s*(.*)$") local module, showall, delay, minCalls = msg:match("^(%S+)%s*(%S*)%s*(%S*)%s*(.*)$")
local checkCore, mod = (not module or module == "") and "E" local checkCore, mod = (not module or module == "") and "E"
@@ -1094,25 +1101,33 @@ function E:GetTopCPUFunc(msg)
twipe(CPU_USAGE) twipe(CPU_USAGE)
if module == "all" then if module == "all" then
for _, registeredModule in pairs(self["RegisteredModules"]) do for moduName, modu in pairs(self.modules) do
mod = self:GetModule(registeredModule, true) or self for funcName, func in pairs(modu) do
for name in pairs(mod) do if (funcName ~= "GetModule") and (type(func) == "function") then
if type(mod[name]) == "function" and name ~= "GetModule" then CPU_USAGE[moduName..":"..funcName] = GetFunctionCPUUsage(func, true)
CPU_USAGE[registeredModule .. ":" .. name] = GetFunctionCPUUsage(mod[name], true)
end end
end end
end end
else else
mod = self:GetModule(module, true) or self if not checkCore then
for name in pairs(mod) do mod = self:GetModule(module, true)
if type(mod[name]) == "function" and name ~= "GetModule" then if not mod then
CPU_USAGE[module .. ":" .. name] = GetFunctionCPUUsage(mod[name], true) self:Print(module.." not found, falling back to checking core.")
mod, checkCore = self, "E"
end
else
mod = self
end
for name, func in pairs(mod) do
if (name ~= "GetModule") and type(func) == "function" then
CPU_USAGE[(checkCore or module)..":"..name] = GetFunctionCPUUsage(func, true)
end end
end end
end end
self:Delay(delay, CompareCPUDiff, showall, module, minCalls) self:Delay(delay, CompareCPUDiff, showall, module, minCalls)
self:Print("Calculating CPU Usage differences (module: " .. (module or "?") .. ", showall: " .. tostring(showall) .. ", minCalls: " .. tostring(minCalls) .. ", delay: " .. tostring(delay) .. ")") self:Print("Calculating CPU Usage differences (module: "..(checkCore or module)..", showall: "..tostring(showall)..", minCalls: "..tostring(minCalls)..", delay: "..tostring(delay)..")")
end end
function E:Initialize() function E:Initialize()
@@ -1126,7 +1141,6 @@ function E:Initialize()
self.data.RegisterCallback(self, "OnProfileChanged", "UpdateAll") self.data.RegisterCallback(self, "OnProfileChanged", "UpdateAll")
self.data.RegisterCallback(self, "OnProfileCopied", "UpdateAll") self.data.RegisterCallback(self, "OnProfileCopied", "UpdateAll")
self.data.RegisterCallback(self, "OnProfileReset", "OnProfileReset") self.data.RegisterCallback(self, "OnProfileReset", "OnProfileReset")
self.charSettings = LibStub("AceDB-3.0"):New("ElvPrivateDB", self.privateVars) self.charSettings = LibStub("AceDB-3.0"):New("ElvPrivateDB", self.privateVars)
self.private = self.charSettings.profile self.private = self.charSettings.profile
self.db = self.data.profile self.db = self.data.profile
@@ -1137,9 +1151,9 @@ function E:Initialize()
-- self:ScheduleTimer("CheckRole", 0.01) -- self:ScheduleTimer("CheckRole", 0.01)
self:UIScale("PLAYER_LOGIN") self:UIScale("PLAYER_LOGIN")
self:LoadCommands() self:LoadCommands() --Load Commands
self:InitializeModules() self:InitializeModules() --Load Modules
self:LoadMovers() self:LoadMovers() --Load Movers
self:UpdateCooldownSettings("all") self:UpdateCooldownSettings("all")
self.initialized = true self.initialized = true
+80 -39
View File
@@ -6,7 +6,7 @@ local LibBase64 = LibStub("LibBase64-1.0");
--Cache global variables --Cache global variables
--Lua functions --Lua functions
local tonumber, type, pcall, loadstring = tonumber, type, pcall, loadstring local tonumber, type, pcall, loadstring = tonumber, type, pcall, loadstring
local len, format, split, find = string.len, string.format, string.split, string.find local len, format, gsub, split, find = string.len, string.format, string.gsub, string.split, string.find
--WoW API / Variables --WoW API / Variables
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local GetNumRaidMembers, UnitInRaid = GetNumRaidMembers, UnitInRaid local GetNumRaidMembers, UnitInRaid = GetNumRaidMembers, UnitInRaid
@@ -85,19 +85,17 @@ function D:Distribute(target, otherServer, isGlobal)
end end
function D:CHAT_MSG_ADDON() function D:CHAT_MSG_ADDON()
local prefix, message, sender = arg1, arg2, arg4 if not Downloads[sender] then return end
if --[[prefix ~= TRANSFER_PREFIX or --]] not Downloads[sender] then return end local cur = len(arg2)
local max = Downloads[arg4].length
Downloads[arg4].current = Downloads[arg4].current + cur
local cur = len(message) if Downloads[arg4].current > max then
local max = Downloads[sender].length Downloads[arg4].current = max
Downloads[sender].current = Downloads[sender].current + cur
if Downloads[sender].current > max then
Downloads[sender].current = max
end end
self.statusBar:SetValue(Downloads[sender].current) self.statusBar:SetValue(Downloads[arg4].current)
end end
function D:OnCommReceived(prefix, msg, dist, sender) function D:OnCommReceived(prefix, msg, dist, sender)
@@ -237,6 +235,61 @@ function D:OnCommReceived(prefix, msg, dist, sender)
end end
end end
--Keys that should not be exported
local blacklistedKeys = {
["profile"] = {
["actionbar"] = {
--[[
["bar1"] = {
["paging"] = true,
},
["bar2"] = {
["paging"] = true,
},
["bar3"] = {
["paging"] = true,
},
["bar4"] = {
["paging"] = true,
},
["bar5"] = {
["paging"] = true,
},
["bar6"] = {
["paging"] = true,
},
["bar7"] = {
["paging"] = true,
},
["bar8"] = {
["paging"] = true,
},
["bar9"] = {
["paging"] = true,
},
["bar10"] = {
["paging"] = true,
},
--]]
}
},
["private"] = {},
["global"] = {
["uiScale"] = true,
["general"] = {
["autoScale"] = true,
["minUiScale"] = true,
["eyefinity"] = true,
},
["chat"] = {
["classColorMentionExcludedNames"] = true
},
["unitframe"] = {
["spellRangeCheck"] = true
}
}
}
local function GetProfileData(profileType) local function GetProfileData(profileType)
if not profileType or type(profileType) ~= "string" then if not profileType or type(profileType) ~= "string" then
E:Print("Bad argument #1 to 'GetProfileData' (string expected)") E:Print("Bad argument #1 to 'GetProfileData' (string expected)")
@@ -257,44 +310,35 @@ local function GetProfileData(profileType)
--This makes the table huge, and will cause the WoW client to lock up for several seconds. --This makes the table huge, and will cause the WoW client to lock up for several seconds.
--We compare against the default table and remove all duplicates from our table. The table is now much smaller. --We compare against the default table and remove all duplicates from our table. The table is now much smaller.
profileData = E:RemoveTableDuplicates(profileData, P) profileData = E:RemoveTableDuplicates(profileData, P)
profileData = E:FilterTableFromBlacklist(profileData, blacklistedKeys.profile)
elseif profileType == "private" then elseif profileType == "private" then
local privateProfileKey = E.myname.." - "..E.myrealm local privateProfileKey = E.myname.." - "..E.myrealm
profileKey = "private" profileKey = "private"
profileData = E:CopyTable(profileData, ElvPrivateDB.profiles[privateProfileKey]) profileData = E:CopyTable(profileData, ElvPrivateDB.profiles[privateProfileKey])
profileData = E:RemoveTableDuplicates(profileData, V) profileData = E:RemoveTableDuplicates(profileData, V)
profileData = E:FilterTableFromBlacklist(profileData, blacklistedKeys.private)
elseif profileType == "global" then elseif profileType == "global" then
profileKey = "global" profileKey = "global"
profileData = E:CopyTable(profileData, ElvDB.global) profileData = E:CopyTable(profileData, ElvDB.global)
profileData = E:RemoveTableDuplicates(profileData, G) profileData = E:RemoveTableDuplicates(profileData, G)
elseif profileType == "filtersNP" then profileData = E:FilterTableFromBlacklist(profileData, blacklistedKeys.global)
profileKey = "filtersNP" elseif profileType == "filters" then
profileKey = "filters"
profileData["nameplates"] = {} profileData.unitframe = {}
profileData["nameplates"]["filter"] = {} profileData.unitframe.aurafilters = {}
profileData["nameplates"]["filter"] = E:CopyTable(profileData["nameplates"]["filter"], ElvDB.global.nameplates.filter) profileData.unitframe.aurafilters = E:CopyTable(profileData.unitframe.aurafilters, ElvDB.global.unitframe.aurafilters)
profileData.unitframe.buffwatch = {}
profileData.unitframe.buffwatch = E:CopyTable(profileData.unitframe.buffwatch, ElvDB.global.unitframe.buffwatch)
profileData = E:RemoveTableDuplicates(profileData, G) profileData = E:RemoveTableDuplicates(profileData, G)
elseif profileType == "filtersUF" then elseif profileType == "styleFilters" then
profileKey = "filtersUF" profileKey = "styleFilters"
profileData["unitframe"] = {} profileData.nameplates = {}
profileData["unitframe"]["aurafilters"] = {} profileData.nameplates.filters = {}
profileData["unitframe"]["aurafilters"] = E:CopyTable(profileData["unitframe"]["aurafilters"], ElvDB.global.unitframe.aurafilters) profileData.nameplates.filters = E:CopyTable(profileData.nameplates.filters, ElvDB.global.nameplates.filters)
profileData["unitframe"]["buffwatch"] = {}
profileData["unitframe"]["buffwatch"] = E:CopyTable(profileData["unitframe"]["buffwatch"], ElvDB.global.unitframe.buffwatch)
profileData = E:RemoveTableDuplicates(profileData, G)
elseif profileType == "filtersAll" then
profileKey = "filtersAll"
profileData["nameplates"] = {}
profileData["nameplates"]["filter"] = {}
profileData["nameplates"]["filter"] = E:CopyTable(profileData["nameplates"]["filter"], ElvDB.global.nameplates.filter)
profileData["unitframe"] = {}
profileData["unitframe"]["aurafilters"] = {}
profileData["unitframe"]["aurafilters"] = E:CopyTable(profileData["unitframe"]["aurafilters"], ElvDB.global.unitframe.aurafilters)
profileData["unitframe"]["buffwatch"] = {}
profileData["unitframe"]["buffwatch"] = E:CopyTable(profileData["unitframe"]["buffwatch"], ElvDB.global.unitframe.buffwatch)
profileData = E:RemoveTableDuplicates(profileData, G) profileData = E:RemoveTableDuplicates(profileData, G)
end end
@@ -443,13 +487,10 @@ local function SetImportedProfile(profileType, profileKey, profileData, force)
elseif profileType == "global" then elseif profileType == "global" then
E:CopyTable(ElvDB.global, profileData) E:CopyTable(ElvDB.global, profileData)
E:StaticPopup_Show("IMPORT_RL") E:StaticPopup_Show("IMPORT_RL")
elseif profileType == "filtersNP" then elseif profileType == "filters" then
E:CopyTable(ElvDB.global.nameplates, profileData.nameplates)
elseif profileType == "filtersUF" then
E:CopyTable(ElvDB.global.unitframe, profileData.unitframe) E:CopyTable(ElvDB.global.unitframe, profileData.unitframe)
elseif profileType == "filtersAll" then elseif profileType == "styleFilters" then
E:CopyTable(ElvDB.global.nameplates, profileData.nameplates) E:CopyTable(ElvDB.global.nameplates, profileData.nameplates)
E:CopyTable(ElvDB.global.unitframe, profileData.unitframe)
end end
--Update all ElvUI modules --Update all ElvUI modules
+38 -45
View File
@@ -1,9 +1,6 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local LSM = LibStub("LibSharedMedia-3.0"); local LSM = LibStub("LibSharedMedia-3.0");
--Cache global variables
--Lua functions
--WoW API / Variables --WoW API / Variables
local SetCVar = SetCVar local SetCVar = SetCVar
@@ -18,9 +15,9 @@ local function SetFont(obj, font, size, style, r, g, b, sr, sg, sb, sox, soy)
end end
function E:UpdateBlizzardFonts() function E:UpdateBlizzardFonts()
local NORMAL = self["media"].normFont local NORMAL = self.media.normFont
local COMBAT = LSM:Fetch("font", self.private.general.dmgfont) local COMBAT = LSM:Fetch("font", self.private.general.dmgfont)
local NUMBER = self["media"].normFont local NUMBER = self.media.normFont
local NAMEFONT = LSM:Fetch("font", self.private.general.namefont) local NAMEFONT = LSM:Fetch("font", self.private.general.namefont)
local MONOCHROME = "" local MONOCHROME = ""
@@ -42,49 +39,45 @@ function E:UpdateBlizzardFonts()
InterfaceOptionsCombatTextPanelPeriodicDamage:Hide() InterfaceOptionsCombatTextPanelPeriodicDamage:Hide()
InterfaceOptionsCombatTextPanelPetDamage:Hide() InterfaceOptionsCombatTextPanelPetDamage:Hide()
InterfaceOptionsCombatTextPanelHealing:Hide() InterfaceOptionsCombatTextPanelHealing:Hide()
SetCVar("CombatLogPeriodicSpells",0) SetCVar("CombatLogPeriodicSpells", 0)
SetCVar("PetMeleeDamage",0) SetCVar("PetMeleeDamage", 0)
SetCVar("CombatDamage",0) SetCVar("CombatDamage", 0)
SetCVar("CombatHealing",0) SetCVar("CombatHealing", 0)
-- set an invisible font for xp, honor kill, etc -- set an invisible font for xp, honor kill, etc
local INVISIBLE = "Interface\\Addons\\ElvUI\\Media\\Fonts\\Invisible.ttf" local INVISIBLE = [[Interface\Addons\ElvUI\media\fonts\Invisible.ttf]]
COMBAT = INVISIBLE COMBAT = INVISIBLE
end end
if(self.private.general.replaceBlizzFonts) then if self.private.general.replaceBlizzFonts then
SetFont(SystemFont, NORMAL, self.db.general.fontSize); SetFont(SystemFont, NORMAL, self.db.general.fontSize)
SetFont(GameFontNormal, NORMAL, self.db.general.fontSize); SetFont(GameFontNormal, NORMAL, self.db.general.fontSize)
SetFont(GameFontNormalSmall, NORMAL, self.db.general.fontSize); SetFont(GameFontNormalSmall, NORMAL, self.db.general.fontSize)
SetFont(GameFontNormalLarge, NORMAL, self.db.general.fontSize); SetFont(GameFontNormalLarge, NORMAL, self.db.general.fontSize)
SetFont(GameFontNormalHuge, NORMAL, 25, MONOCHROME .. "OUTLINE"); SetFont(GameFontNormalHuge, NORMAL, 25, MONOCHROME.."OUTLINE")
-- SetFont(BossEmoteNormalHuge, NORMAL, 25, MONOCHROME .. "OUTLINE"); SetFont(BossEmoteNormalHuge, NORMAL, 25, MONOCHROME.."OUTLINE")
SetFont(GameFontBlack, NORMAL, self.db.general.fontSize); SetFont(GameFontBlack, NORMAL, self.db.general.fontSize)
SetFont(NumberFontNormal, NUMBER, self.db.general.fontSize, MONOCHROME .. "OUTLINE"); SetFont(NumberFontNormal, NUMBER, self.db.general.fontSize, MONOCHROME.."OUTLINE")
SetFont(NumberFontNormalSmall, NUMBER, self.db.general.fontSize); SetFont(NumberFontNormalSmall, NUMBER, self.db.general.fontSize)
SetFont(NumberFontNormalLarge, NUMBER, self.db.general.fontSize); SetFont(NumberFontNormalLarge, NUMBER, self.db.general.fontSize)
SetFont(NumberFontNormalHuge, NUMBER, self.db.general.fontSize); SetFont(NumberFontNormalHuge, NUMBER, self.db.general.fontSize)
SetFont(ChatFontNormal, NORMAL, self.db.general.fontSize); SetFont(ChatFontNormal, NORMAL, self.db.general.fontSize)
SetFont(ChatFontSmall, NORMAL, self.db.general.fontSize); SetFont(ChatFontSmall, NORMAL, self.db.general.fontSize)
SetFont(QuestTitleFont, NORMAL, self.db.general.fontSize + 8); SetFont(QuestTitleFont, NORMAL, self.db.general.fontSize + 8)
SetFont(QuestFont, NORMAL, self.db.general.fontSize); SetFont(QuestFont, NORMAL, self.db.general.fontSize)
SetFont(QuestFontHighlight, NORMAL, self.db.general.fontSize); SetFont(QuestFontHighlight, NORMAL, self.db.general.fontSize)
SetFont(ItemTextFontNormal, NORMAL, self.db.general.fontSize); SetFont(ItemTextFontNormal, NORMAL, self.db.general.fontSize)
SetFont(ItemTextFontNormal, NORMAL, self.db.general.fontSize); SetFont(ItemTextFontNormal, NORMAL, self.db.general.fontSize)
SetFont(MailTextFontNormal, NORMAL, self.db.general.fontSize); SetFont(MailTextFontNormal, NORMAL, self.db.general.fontSize)
SetFont(SubSpellFont, NORMAL, self.db.general.fontSize); SetFont(SubSpellFont, NORMAL, self.db.general.fontSize)
SetFont(DialogButtonNormalText, NORMAL, self.db.general.fontSize); SetFont(DialogButtonNormalText, NORMAL, self.db.general.fontSize)
SetFont(ZoneTextFont, NORMAL, 32, MONOCHROME .. "OUTLINE"); SetFont(ZoneTextFont, NORMAL, 32, MONOCHROME.."OUTLINE")
SetFont(SubZoneTextFont, NORMAL, 25, MONOCHROME .. "OUTLINE"); SetFont(SubZoneTextFont, NORMAL, 24, MONOCHROME.."OUTLINE")
SetFont(PVPInfoTextFont, NORMAL, 22, MONOCHROME .. "OUTLINE"); SetFont(PVPInfoTextFont, NORMAL, 22, MONOCHROME.."OUTLINE")
SetFont(TextStatusBarText, NORMAL, self.db.general.fontSize); SetFont(TextStatusBarText, NORMAL, self.db.general.fontSize)
SetFont(TextStatusBarTextSmall, NORMAL, self.db.general.fontSize); SetFont(TextStatusBarTextSmall, NORMAL, self.db.general.fontSize)
-- SetFont(GameTooltipText, NORMAL, self.db.general.fontSize); SetFont(InvoiceTextFontNormal, NORMAL, self.db.general.fontSize)
-- SetFont(GameTooltipTextSmall, NORMAL, self.db.general.fontSize); SetFont(InvoiceTextFontSmall, NORMAL, self.db.general.fontSize)
-- SetFont(GameTooltipHeaderText, NORMAL, self.db.general.fontSize); SetFont(CombatTextFont, COMBAT, 25, MONOCHROME.."OUTLINE")
SetFont(WorldMapTextFont, NORMAL, 32, MONOCHROME .. "OUTLINE");
SetFont(InvoiceTextFontNormal, NORMAL, self.db.general.fontSize);
SetFont(InvoiceTextFontSmall, NORMAL, self.db.general.fontSize);
SetFont(CombatTextFont, COMBAT, 25, MONOCHROME .. "OUTLINE");
end end
end end
+91 -56
View File
@@ -5,45 +5,44 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, Profi
local _G = _G local _G = _G
local format = string.format local format = string.format
--WoW API / Variables --WoW API / Variables
local ChangeChatColor = ChangeChatColor
local ChatFrame_ActivateCombatMessages = ChatFrame_ActivateCombatMessages
local ChatFrame_AddChannel = ChatFrame_AddChannel
local ChatFrame_AddMessageGroup = ChatFrame_AddMessageGroup
local ChatFrame_RemoveAllMessageGroups = ChatFrame_RemoveAllMessageGroups
local ChatFrame_RemoveChannel = ChatFrame_RemoveChannel
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local FCF_DockFrame, FCF_UnDockFrame = FCF_DockFrame, FCF_UnDockFrame
local FCF_OpenNewWindow = FCF_OpenNewWindow
local FCF_SetChatWindowFontSize = FCF_SetChatWindowFontSize
local FCF_SetLocked = FCF_SetLocked
local FCF_SetWindowName = FCF_SetWindowName
local GetScreenWidth = GetScreenWidth
local IsAddOnLoaded = IsAddOnLoaded local IsAddOnLoaded = IsAddOnLoaded
local GetScreenWidth = GetScreenWidth
local SetCVar = SetCVar
local PlaySoundFile = PlaySoundFile local PlaySoundFile = PlaySoundFile
local ReloadUI = ReloadUI local ReloadUI = ReloadUI
local SetCVar = SetCVar
local UIFrameFadeOut = UIFrameFadeOut local UIFrameFadeOut = UIFrameFadeOut
local ChatFrame_AddMessageGroup = ChatFrame_AddMessageGroup
local RAID_CLASS_COLORS = RAID_CLASS_COLORS local ChatFrame_RemoveAllMessageGroups = ChatFrame_RemoveAllMessageGroups
local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS local ChatFrame_AddChannel = ChatFrame_AddChannel
local ChatFrame_RemoveChannel = ChatFrame_RemoveChannel
local CHAT_LABEL, CLASS, CONTINUE, PREV = CHAT_LABEL, CLASS, CONTINUE, PREV local ChangeChatColor = ChangeChatColor
local GUILD_EVENT_LOG = GUILD_EVENT_LOG local FCF_ResetChatWindows = FCF_ResetChatWindows
local LOOT, GENERAL, TRADE = LOOT, GENERAL, TRADE local FCF_SetLocked = FCF_SetLocked
local FCF_DockFrame, FCF_UnDockFrame = FCF_DockFrame, FCF_UnDockFrame
local FCF_OpenNewWindow = FCF_OpenNewWindow
local FCF_SetWindowName = FCF_SetWindowName
local FCF_StopDragging = FCF_StopDragging
local FCF_SetChatWindowFontSize = FCF_SetChatWindowFontSize
local CLASS, CHAT_LABEL, CONTINUE, PREVIOUS = CLASS, CHAT_LABEL, CONTINUE, PREVIOUS
local NUM_CHAT_WINDOWS = NUM_CHAT_WINDOWS local NUM_CHAT_WINDOWS = NUM_CHAT_WINDOWS
local LOOT, GENERAL, TRADE = LOOT, GENERAL, TRADE
local GUILD_EVENT_LOG = GUILD_EVENT_LOG
local RAID_CLASS_COLORS = RAID_CLASS_COLORS
local CURRENT_PAGE = 0 local CURRENT_PAGE = 0
local MAX_PAGE = 8 local MAX_PAGE = 8
local function FCF_ResetChatWindows() local function FCF_ResetChatWindows()
ChatFrame1:ClearAllPoints() ChatFrame1:ClearAllPoints()
E:Point(ChatFrame1, "BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 32, 95) ChatFrame1:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 32, 95)
E:Size(ChatFrame1, 430, 120) ChatFrame1:SetWidth(430)
ChatFrame1:SetHeight(120)
ChatFrame1.isInitialized = 0 ChatFrame1.isInitialized = 0
FCF_SetButtonSide(ChatFrame1, "left") FCF_SetButtonSide(ChatFrame1, "left")
FCF_SetChatWindowFontSize(ChatFrame1, 14) FCF_SetChatWindowFontSize(ChatFrame1, 14)
FCF_SetWindowName(ChatFrame1, GENERAL) FCF_SetWindowName(ChatFrame1, GENERAL)
FCF_SetWindowColor(ChatFrame1, DEFAULT_CHATFRAME_COLOR.r, DEFAULT_CHATFRAME_COLOR.g, DEFAULT_CHATFRAME_COLOR.b) FCF_SetWindowName(ChatFrame1, DEFAULT_CHATFRAME_COLOR.r, DEFAULT_CHATFRAME_COLOR.g, DEFAULT_CHATFRAME_COLOR.b)
FCF_SetWindowAlpha(ChatFrame1, DEFAULT_CHATFRAME_ALPHA) FCF_SetWindowAlpha(ChatFrame1, DEFAULT_CHATFRAME_ALPHA)
FCF_UnDockFrame(ChatFrame1) FCF_UnDockFrame(ChatFrame1)
FCF_ValidateChatFramePosition(ChatFrame1) FCF_ValidateChatFramePosition(ChatFrame1)
@@ -169,9 +168,6 @@ local function SetupChat()
ChatFrame_AddMessageGroup(ChatFrame1, "DND") ChatFrame_AddMessageGroup(ChatFrame1, "DND")
ChatFrame_AddMessageGroup(ChatFrame1, "IGNORED") ChatFrame_AddMessageGroup(ChatFrame1, "IGNORED")
ChatFrame_AddMessageGroup(ChatFrame1, "CHANNEL") ChatFrame_AddMessageGroup(ChatFrame1, "CHANNEL")
ChatFrame_ActivateCombatMessages(ChatFrame2)
ChatFrame_AddChannel(ChatFrame1, GENERAL) ChatFrame_AddChannel(ChatFrame1, GENERAL)
ChatFrame_RemoveMessageGroup(ChatFrame1, "SKILL") ChatFrame_RemoveMessageGroup(ChatFrame1, "SKILL")
ChatFrame_RemoveMessageGroup(ChatFrame1, "LOOT") ChatFrame_RemoveMessageGroup(ChatFrame1, "LOOT")
@@ -179,6 +175,8 @@ local function SetupChat()
ChatFrame_RemoveMessageGroup(ChatFrame1, "COMBAT_FACTION_CHANGE") ChatFrame_RemoveMessageGroup(ChatFrame1, "COMBAT_FACTION_CHANGE")
ChatFrame_RemoveChannel(ChatFrame1, TRADE) ChatFrame_RemoveChannel(ChatFrame1, TRADE)
ChatFrame_ActivateCombatMessages(ChatFrame2)
ChatFrame_RemoveAllMessageGroups(ChatFrame3) ChatFrame_RemoveAllMessageGroups(ChatFrame3)
ChatFrame_AddMessageGroup(ChatFrame3, "SKILL") ChatFrame_AddMessageGroup(ChatFrame3, "SKILL")
ChatFrame_AddMessageGroup(ChatFrame3, "LOOT") ChatFrame_AddMessageGroup(ChatFrame3, "LOOT")
@@ -198,11 +196,11 @@ local function SetupChat()
if E.Chat then if E.Chat then
E.Chat:PositionChat(true) E.Chat:PositionChat(true)
if E.db["RightChatPanelFaded"] then if E.db.RightChatPanelFaded then
RightChatToggleButton:Click() RightChatToggleButton:Click()
end end
if E.db["LeftChatPanelFaded"] then if E.db.LeftChatPanelFaded then
LeftChatToggleButton:Click() LeftChatToggleButton:Click()
end end
end end
@@ -235,7 +233,6 @@ function E:SetupTheme(theme, noDisplayMsg)
E.db.general.bordercolor = (E.PixelMode and E:GetColor(0, 0, 0) or E:GetColor(.31, .31, .31)) E.db.general.bordercolor = (E.PixelMode and E:GetColor(0, 0, 0) or E:GetColor(.31, .31, .31))
E.db.general.backdropcolor = E:GetColor(.1, .1, .1) E.db.general.backdropcolor = E:GetColor(.1, .1, .1)
E.db.general.backdropfadecolor = E:GetColor(.06, .06, .06, .8) E.db.general.backdropfadecolor = E:GetColor(.06, .06, .06, .8)
E.db.unitframe.colors.borderColor = (E.PixelMode and E:GetColor(0, 0, 0) or E:GetColor(.31, .31, .31)) E.db.unitframe.colors.borderColor = (E.PixelMode and E:GetColor(0, 0, 0) or E:GetColor(.31, .31, .31))
E.db.unitframe.colors.healthclass = false E.db.unitframe.colors.healthclass = false
E.db.unitframe.colors.health = E:GetColor(.31, .31, .31) E.db.unitframe.colors.health = E:GetColor(.31, .31, .31)
@@ -291,6 +288,8 @@ function E:SetupResolution(noDataReset)
if not noDataReset then if not noDataReset then
E.db.chat.panelWidth = 400 E.db.chat.panelWidth = 400
E.db.chat.panelHeight = 180 E.db.chat.panelHeight = 180
E.db.chat.panelWidthRight = 400
E.db.chat.panelHeightRight = 180
E.db.bags.bagWidth = 394 E.db.bags.bagWidth = 394
E.db.bags.bankWidth = 394 E.db.bags.bankWidth = 394
@@ -331,6 +330,9 @@ function E:SetupResolution(noDataReset)
E.db.unitframe.units.targettarget.power.enable = false E.db.unitframe.units.targettarget.power.enable = false
E.db.unitframe.units.targettarget.width = 200 E.db.unitframe.units.targettarget.width = 200
E.db.unitframe.units.targettarget.height = 26 E.db.unitframe.units.targettarget.height = 26
E.db.unitframe.units.arena.width = 200
E.db.unitframe.units.arena.castbar.width = 200
end end
local isPixel = E.private.general.pixelPerfect local isPixel = E.private.general.pixelPerfect
@@ -409,16 +411,11 @@ function E:SetupLayout(layout, noDataReset)
E.db.unitframe.units.raid.debuffs.xOffset = -4 E.db.unitframe.units.raid.debuffs.xOffset = -4
E.db.unitframe.units.raid.debuffs.yOffset = -7 E.db.unitframe.units.raid.debuffs.yOffset = -7
E.db.unitframe.units.raid.height = 45 E.db.unitframe.units.raid.height = 45
E.db.unitframe.units.raid.buffs.noConsolidated = false
E.db.unitframe.units.raid.buffs.xOffset = 50 E.db.unitframe.units.raid.buffs.xOffset = 50
E.db.unitframe.units.raid.buffs.yOffset = -6 E.db.unitframe.units.raid.buffs.yOffset = -6
E.db.unitframe.units.raid.buffs.clickThrough = true E.db.unitframe.units.raid.buffs.clickThrough = true
E.db.unitframe.units.raid.buffs.noDuration = false
E.db.unitframe.units.raid.buffs.playerOnly = false
E.db.unitframe.units.raid.buffs.perrow = 1 E.db.unitframe.units.raid.buffs.perrow = 1
E.db.unitframe.units.raid.buffs.useFilter = "TurtleBuffs"
E.db.unitframe.units.raid.buffs.sizeOverride = 22 E.db.unitframe.units.raid.buffs.sizeOverride = 22
E.db.unitframe.units.raid.buffs.useBlacklist = false
E.db.unitframe.units.raid.buffs.enable = true E.db.unitframe.units.raid.buffs.enable = true
E.db.unitframe.units.raid.growthDirection = "LEFT_UP" E.db.unitframe.units.raid.growthDirection = "LEFT_UP"
@@ -431,18 +428,12 @@ function E:SetupLayout(layout, noDataReset)
E.db.unitframe.units.party.debuffs.xOffset = -4 E.db.unitframe.units.party.debuffs.xOffset = -4
E.db.unitframe.units.party.debuffs.yOffset = -7 E.db.unitframe.units.party.debuffs.yOffset = -7
E.db.unitframe.units.party.height = 45 E.db.unitframe.units.party.height = 45
E.db.unitframe.units.party.buffs.noConsolidated = false
E.db.unitframe.units.party.buffs.xOffset = 50 E.db.unitframe.units.party.buffs.xOffset = 50
E.db.unitframe.units.party.buffs.yOffset = -6 E.db.unitframe.units.party.buffs.yOffset = -6
E.db.unitframe.units.party.buffs.clickThrough = true E.db.unitframe.units.party.buffs.clickThrough = true
E.db.unitframe.units.party.buffs.noDuration = false
E.db.unitframe.units.party.buffs.playerOnly = false
E.db.unitframe.units.party.buffs.perrow = 1 E.db.unitframe.units.party.buffs.perrow = 1
E.db.unitframe.units.party.buffs.useFilter = "TurtleBuffs"
E.db.unitframe.units.party.buffs.sizeOverride = 22 E.db.unitframe.units.party.buffs.sizeOverride = 22
E.db.unitframe.units.party.buffs.useBlacklist = false
E.db.unitframe.units.party.buffs.enable = true E.db.unitframe.units.party.buffs.enable = true
E.db.unitframe.units.party.roleIcon.position = "BOTTOMRIGHT"
E.db.unitframe.units.party.health.text_format = "[healthcolor][health:deficit]" E.db.unitframe.units.party.health.text_format = "[healthcolor][health:deficit]"
E.db.unitframe.units.party.health.position = "BOTTOM" E.db.unitframe.units.party.health.position = "BOTTOM"
E.db.unitframe.units.party.GPSArrow.size = 40 E.db.unitframe.units.party.GPSArrow.size = 40
@@ -452,16 +443,16 @@ function E:SetupLayout(layout, noDataReset)
E.db.unitframe.units.party.name.position = "TOP" E.db.unitframe.units.party.name.position = "TOP"
E.db.unitframe.units.party.power.text_format = "" E.db.unitframe.units.party.power.text_format = ""
-- E.db.unitframe.units.raid40.height = 30 E.db.unitframe.units.raid40.height = 30
-- E.db.unitframe.units.raid40.growthDirection = "LEFT_UP" E.db.unitframe.units.raid40.growthDirection = "LEFT_UP"
E.db.unitframe.units.party.health.frequentUpdates = true E.db.unitframe.units.party.health.frequentUpdates = true
E.db.unitframe.units.raid.health.frequentUpdates = true E.db.unitframe.units.raid.health.frequentUpdates = true
-- E.db.unitframe.units.raid40.health.frequentUpdates = true E.db.unitframe.units.raid40.health.frequentUpdates = true
E.db.unitframe.units.party.healPrediction = true E.db.unitframe.units.party.healPrediction = true
E.db.unitframe.units.raid.healPrediction = true E.db.unitframe.units.raid.healPrediction = true
-- E.db.unitframe.units.raid40.healPrediction = true E.db.unitframe.units.raid40.healPrediction = true
E.db.unitframe.units.player.castbar.insideInfoPanel = false E.db.unitframe.units.player.castbar.insideInfoPanel = false
E.db.actionbar.bar2.enabled = true E.db.actionbar.bar2.enabled = true
@@ -476,6 +467,7 @@ function E:SetupLayout(layout, noDataReset)
end end
if not E.db.movers then E.db.movers = {} end if not E.db.movers then E.db.movers = {} end
--Make sure we account for EyeFinity or other scenarious where ElvUIParent is not the same size as UIParent
local xOffset = ((GetScreenWidth() - E.diffGetLeft - E.diffGetRight) * 0.34375) local xOffset = ((GetScreenWidth() - E.diffGetLeft - E.diffGetRight) * 0.34375)
if E.PixelMode then if E.PixelMode then
@@ -483,7 +475,6 @@ function E:SetupLayout(layout, noDataReset)
E.db.movers.ElvAB_5 = "BOTTOM,ElvUIParent,BOTTOM,-312,4" E.db.movers.ElvAB_5 = "BOTTOM,ElvUIParent,BOTTOM,-312,4"
E.db.movers.ElvUF_PartyMover = "BOTTOMRIGHT,ElvUIParent,BOTTOMLEFT,"..xOffset..",450" E.db.movers.ElvUF_PartyMover = "BOTTOMRIGHT,ElvUIParent,BOTTOMLEFT,"..xOffset..",450"
E.db.movers.ElvUF_RaidMover = "BOTTOMRIGHT,ElvUIParent,BOTTOMLEFT,"..xOffset..",450" E.db.movers.ElvUF_RaidMover = "BOTTOMRIGHT,ElvUIParent,BOTTOMLEFT,"..xOffset..",450"
E.db.movers.ElvUF_Raid40Mover = "BOTTOMRIGHT,ElvUIParent,BOTTOMLEFT,"..xOffset..",450" E.db.movers.ElvUF_Raid40Mover = "BOTTOMRIGHT,ElvUIParent,BOTTOMLEFT,"..xOffset..",450"
if not E.db.lowresolutionset then if not E.db.lowresolutionset then
@@ -559,6 +550,9 @@ function E:SetupLayout(layout, noDataReset)
E.db.unitframe.units.targettarget.power.enable = false E.db.unitframe.units.targettarget.power.enable = false
E.db.unitframe.units.targettarget.width = 200 E.db.unitframe.units.targettarget.width = 200
E.db.unitframe.units.targettarget.height = 26 E.db.unitframe.units.targettarget.height = 26
E.db.unitframe.units.arena.width = 200
E.db.unitframe.units.arena.castbar.width = 200
end end
if layout == "dpsCaster" or layout == "healer" or (layout == "dpsMelee" and E.myclass == "HUNTER") then if layout == "dpsCaster" or layout == "healer" or (layout == "dpsMelee" and E.myclass == "HUNTER") then
@@ -607,6 +601,7 @@ function E:SetupLayout(layout, noDataReset)
E.db.movers.ElvUF_PlayerCastbarMover = "BOTTOM,ElvUIParent,BOTTOM,-2,"..(yOffset + 5) E.db.movers.ElvUF_PlayerCastbarMover = "BOTTOM,ElvUIParent,BOTTOM,-2,"..(yOffset + 5)
end end
elseif (layout == "dpsMelee" or layout == "tank") and not E.db.lowresolutionset and not E.PixelMode then elseif (layout == "dpsMelee" or layout == "tank") and not E.db.lowresolutionset and not E.PixelMode then
if not E.db.movers then E.db.movers = {} end
E.db.movers.ElvUF_PlayerMover = "BOTTOM,ElvUIParent,BOTTOM,-307,76" E.db.movers.ElvUF_PlayerMover = "BOTTOM,ElvUIParent,BOTTOM,-307,76"
E.db.movers.ElvUF_TargetMover = "BOTTOM,ElvUIParent,BOTTOM,307,76" E.db.movers.ElvUF_TargetMover = "BOTTOM,ElvUIParent,BOTTOM,307,76"
E.db.movers.ElvUF_TargetTargetMover = "BOTTOM,ElvUIParent,BOTTOM,0,76" E.db.movers.ElvUF_TargetTargetMover = "BOTTOM,ElvUIParent,BOTTOM,0,76"
@@ -644,7 +639,7 @@ end
local function SetupAuras(style) local function SetupAuras(style)
local UF = E:GetModule("UnitFrames") local UF = E:GetModule("UnitFrames")
local frame = UF["player"] local frame = UF.player
E:CopyTable(E.db.unitframe.units.player.buffs, P.unitframe.units.player.buffs) E:CopyTable(E.db.unitframe.units.player.buffs, P.unitframe.units.player.buffs)
E:CopyTable(E.db.unitframe.units.player.debuffs, P.unitframe.units.player.debuffs) E:CopyTable(E.db.unitframe.units.player.debuffs, P.unitframe.units.player.debuffs)
E:CopyTable(E.db.unitframe.units.player.aurabar, P.unitframe.units.player.aurabar) E:CopyTable(E.db.unitframe.units.player.aurabar, P.unitframe.units.player.aurabar)
@@ -655,11 +650,10 @@ local function SetupAuras(style)
-- UF:Configure_AuraBars(frame) -- UF:Configure_AuraBars(frame)
end end
frame = UF["target"] frame = UF.target
E:CopyTable(E.db.unitframe.units.target.buffs, P.unitframe.units.target.buffs) E:CopyTable(E.db.unitframe.units.target.buffs, P.unitframe.units.target.buffs)
E:CopyTable(E.db.unitframe.units.target.debuffs, P.unitframe.units.target.debuffs) E:CopyTable(E.db.unitframe.units.target.debuffs, P.unitframe.units.target.debuffs)
E:CopyTable(E.db.unitframe.units.target.aurabar, P.unitframe.units.target.aurabar) E:CopyTable(E.db.unitframe.units.target.aurabar, P.unitframe.units.target.aurabar)
E.db.unitframe.units.target.smartAuraDisplay = P.unitframe.units.target.smartAuraDisplay
if frame then if frame then
UF:Configure_Auras(frame, "Buffs") UF:Configure_Auras(frame, "Buffs")
@@ -667,18 +661,33 @@ local function SetupAuras(style)
-- UF:Configure_AuraBars(frame) -- UF:Configure_AuraBars(frame)
end end
frame = UF.focus
E:CopyTable(E.db.unitframe.units.focus.buffs, P.unitframe.units.focus.buffs)
E:CopyTable(E.db.unitframe.units.focus.debuffs, P.unitframe.units.focus.debuffs)
E:CopyTable(E.db.unitframe.units.focus.aurabar, P.unitframe.units.focus.aurabar)
if frame then
UF:Configure_Auras(frame, "Buffs")
UF:Configure_Auras(frame, "Debuffs")
UF:Configure_AuraBars(frame)
end
if not style then if not style then
--PLAYER
E.db.unitframe.units.player.buffs.enable = true E.db.unitframe.units.player.buffs.enable = true
E.db.unitframe.units.player.buffs.attachTo = "FRAME" E.db.unitframe.units.player.buffs.attachTo = "FRAME"
E.db.unitframe.units.player.buffs.noDuration = false
E.db.unitframe.units.player.debuffs.attachTo = "BUFFS" E.db.unitframe.units.player.debuffs.attachTo = "BUFFS"
E.db.unitframe.units.player.aurabar.enable = false E.db.unitframe.units.player.aurabar.enable = false
E:GetModule("UnitFrames"):CreateAndUpdateUF("player") if E.private.unitframe.enable then
E:GetModule("UnitFrames"):CreateAndUpdateUF("player")
end
E.db.unitframe.units.target.smartAuraDisplay = "DISABLED" --TARGET
E.db.unitframe.units.target.debuffs.enable = true E.db.unitframe.units.target.debuffs.enable = true
E.db.unitframe.units.target.aurabar.enable = false E.db.unitframe.units.target.aurabar.enable = false
E:GetModule("UnitFrames"):CreateAndUpdateUF("target") if E.private.unitframe.enable then
E:GetModule("UnitFrames"):CreateAndUpdateUF("target")
end
end end
if InstallStepComplete then if InstallStepComplete then
@@ -834,8 +843,12 @@ local function SetPage(PageNum)
f.Desc1:SetText(L["You are now finished with the installation process. If you are in need of technical support please visit us at https://github.com/ElvUI-Vanilla/ElvUI"]) f.Desc1:SetText(L["You are now finished with the installation process. If you are in need of technical support please visit us at https://github.com/ElvUI-Vanilla/ElvUI"])
f.Desc2:SetText(L["Please click the button below so you can setup variables and ReloadUI."]) f.Desc2:SetText(L["Please click the button below so you can setup variables and ReloadUI."])
InstallOption1Button:Show() InstallOption1Button:Show()
InstallOption1Button:SetScript("OnClick", InstallComplete) InstallOption1Button:SetScript("OnClick", function() E:StaticPopup_Show("ELVUI_EDITBOX", nil, nil, "https://discord.gg/Uatdmm7") end)
InstallOption1Button:SetText(L["Finished"]) InstallOption1Button:SetText("Discord") -- No need for a locale
InstallOption2Button:Show()
InstallOption2Button:SetScript("OnClick", InstallComplete)
InstallOption2Button:SetText(L["Finished"])
E:Size(ElvUIInstallFrame, 550, 350) E:Size(ElvUIInstallFrame, 550, 350)
end end
end end
@@ -875,6 +888,27 @@ function E:Install()
imsg.firstShow = false imsg.firstShow = false
imsg.bg = imsg:CreateTexture(nil, "BACKGROUND")
imsg.bg:SetTexture([[Interface\AddOns\ElvUI\media\textures\LevelUpTex]])
E:Point(imsg.bg, "BOTTOM")
E:Size(imsg.bg, 326, 103)
imsg.bg:SetTexCoord(0.00195313, 0.63867188, 0.03710938, 0.23828125)
imsg.bg:SetVertexColor(1, 1, 1, 0.6)
imsg.lineTop = imsg:CreateTexture(nil, "BACKGROUND")
imsg.lineTop:SetDrawLayer('BACKGROUND', 2)
imsg.lineTop:SetTexture([[Interface\AddOns\ElvUI\media\textures\LevelUpTex]])
E:Point(imsg.lineTop, "TOP")
E:Size(imsg.lineTop, 418, 7)
imsg.lineTop:SetTexCoord(0.00195313, 0.81835938, 0.01953125, 0.03320313)
imsg.lineBottom = imsg:CreateTexture(nil, "BACKGROUND")
imsg.lineBottom:SetDrawLayer('BACKGROUND', 2)
imsg.lineBottom:SetTexture([[Interface\AddOns\ElvUI\media\textures\LevelUpTex]])
E:Point(imsg.lineBottom, "BOTTOM")
E:Size(imsg.lineBottom, 418, 7)
imsg.lineBottom:SetTexCoord(0.00195313, 0.81835938, 0.01953125, 0.03320313)
imsg.text = imsg:CreateFontString(nil, "OVERLAY") imsg.text = imsg:CreateFontString(nil, "OVERLAY")
E:FontTemplate(imsg.text, E["media"].normFont, 32, "OUTLINE") E:FontTemplate(imsg.text, E["media"].normFont, 32, "OUTLINE")
E:Point(imsg.text, "BOTTOM", 0, 16) E:Point(imsg.text, "BOTTOM", 0, 16)
@@ -882,6 +916,7 @@ function E:Install()
imsg.text:SetJustifyH("CENTER") imsg.text:SetJustifyH("CENTER")
end end
--Create Frame
if not ElvUIInstallFrame then if not ElvUIInstallFrame then
local f = CreateFrame("Button", "ElvUIInstallFrame", E.UIParent) local f = CreateFrame("Button", "ElvUIInstallFrame", E.UIParent)
f.SetPage = SetPage f.SetPage = SetPage
@@ -918,7 +953,7 @@ function E:Install()
f.Status = CreateFrame("StatusBar", "InstallStatus", f) f.Status = CreateFrame("StatusBar", "InstallStatus", f)
f.Status:SetFrameLevel(f.Status:GetFrameLevel() + 2) f.Status:SetFrameLevel(f.Status:GetFrameLevel() + 2)
E:CreateBackdrop(f.Status, "Default") E:CreateBackdrop(f.Status, "Default")
f.Status:SetStatusBarTexture(E["media"].normTex) f.Status:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(f.Status) E:RegisterStatusBar(f.Status)
f.Status:SetMinMaxValues(0, MAX_PAGE) f.Status:SetMinMaxValues(0, MAX_PAGE)
E:Point(f.Status, "TOPLEFT", f.Prev, "TOPRIGHT", 6, -2) E:Point(f.Status, "TOPLEFT", f.Prev, "TOPRIGHT", 6, -2)
@@ -1015,4 +1050,4 @@ function E:Install()
ElvUIInstallFrame:Show() ElvUIInstallFrame:Show()
NextPage() NextPage()
end end
+13 -13
View File
@@ -44,7 +44,7 @@ function CP:CreateModuleConfigGroup(Name, section, pluginSection)
type = "execute", type = "execute",
name = L["Import Now"], name = L["Import Now"],
func = function() func = function()
E.PopupDialogs["MODULE_COPY_CONFIRM"].text = format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from |cff4beb2c\"%s\"|r profile to your current |cff4beb2c\"%s\"|r profile. Are you sure?"], Name, E.global.profileCopy.selected, ElvDB["profileKeys"][E.myname.." - "..E.myrealm]) E.PopupDialogs["MODULE_COPY_CONFIRM"].text = format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from |cff4beb2c\"%s\"|r profile to your current |cff4beb2c\"%s\"|r profile. Are you sure?"], Name, E.global.profileCopy.selected, ElvDB.profileKeys[E.myname.." - "..E.myrealm])
E.PopupDialogs["MODULE_COPY_CONFIRM"].OnAccept = function() E.PopupDialogs["MODULE_COPY_CONFIRM"].OnAccept = function()
CP:ImportFromProfile(section, pluginSection) CP:ImportFromProfile(section, pluginSection)
end end
@@ -56,7 +56,7 @@ function CP:CreateModuleConfigGroup(Name, section, pluginSection)
type = "execute", type = "execute",
name = L["Export Now"], name = L["Export Now"],
func = function() func = function()
E.PopupDialogs["MODULE_COPY_CONFIRM"].text = format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from your current |cff4beb2c\"%s\"|r profile to |cff4beb2c\"%s\"|r profile. Are you sure?"], Name, ElvDB["profileKeys"][E.myname.." - "..E.myrealm], E.global.profileCopy.selected) E.PopupDialogs["MODULE_COPY_CONFIRM"].text = format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from your current |cff4beb2c\"%s\"|r profile to |cff4beb2c\"%s\"|r profile. Are you sure?"], Name, ElvDB.profileKeys[E.myname.." - "..E.myrealm], E.global.profileCopy.selected)
E.PopupDialogs["MODULE_COPY_CONFIRM"].OnAccept = function() E.PopupDialogs["MODULE_COPY_CONFIRM"].OnAccept = function()
CP:ExportToProfile(section, pluginSection) CP:ExportToProfile(section, pluginSection)
end end
@@ -94,7 +94,7 @@ function CP:CreateMoversConfigGroup()
type = "execute", type = "execute",
name = L["Import Now"], name = L["Import Now"],
func = function() func = function()
E.PopupDialogs["MODULE_COPY_CONFIRM"].text = format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from |cff4beb2c\"%s\"|r profile to your current |cff4beb2c\"%s\"|r profile. Are you sure?"], L["Movers"], E.global.profileCopy.selected, ElvDB["profileKeys"][E.myname.." - "..E.myrealm]) E.PopupDialogs["MODULE_COPY_CONFIRM"].text = format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from |cff4beb2c\"%s\"|r profile to your current |cff4beb2c\"%s\"|r profile. Are you sure?"], L["Movers"], E.global.profileCopy.selected, ElvDB.profileKeys[E.myname.." - "..E.myrealm])
E.PopupDialogs["MODULE_COPY_CONFIRM"].OnAccept = function() E.PopupDialogs["MODULE_COPY_CONFIRM"].OnAccept = function()
CP:CopyMovers("import") CP:CopyMovers("import")
end end
@@ -106,7 +106,7 @@ function CP:CreateMoversConfigGroup()
type = "execute", type = "execute",
name = L["Export Now"], name = L["Export Now"],
func = function() func = function()
E.PopupDialogs["MODULE_COPY_CONFIRM"].text = format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from your current |cff4beb2c\"%s\"|r profile to |cff4beb2c\"%s\"|r profile. Are you sure?"], L["Movers"], ElvDB["profileKeys"][E.myname.." - "..E.myrealm], E.global.profileCopy.selected) E.PopupDialogs["MODULE_COPY_CONFIRM"].text = format(L["You are going to copy settings for |cffD3CF00\"%s\"|r from your current |cff4beb2c\"%s\"|r profile to |cff4beb2c\"%s\"|r profile. Are you sure?"], L["Movers"], ElvDB.profileKeys[E.myname.." - "..E.myrealm], E.global.profileCopy.selected)
E.PopupDialogs["MODULE_COPY_CONFIRM"].OnAccept = function() E.PopupDialogs["MODULE_COPY_CONFIRM"].OnAccept = function()
CP:CopyMovers("export") CP:CopyMovers("export")
end end
@@ -154,7 +154,7 @@ function CP:CopyTable(CopyFrom, CopyTo, CopyDefault, module)
E:CopyTable(CopyTo, CopyDefault) E:CopyTable(CopyTo, CopyDefault)
E:CopyTable(CopyTo, CopyFrom) E:CopyTable(CopyTo, CopyFrom)
elseif module[key] ~= nil then elseif module[key] ~= nil then
--Making sure tables actually exist in profiles (e.g absent values in ElvDB["profiles"] are for default values) --Making sure tables actually exist in profiles (e.g absent values in ElvDB.profiles are for default values)
CopyFrom[key], CopyTo[key] = CP:TablesExist(CopyFrom[key], CopyTo[key], CopyDefault[key]) CopyFrom[key], CopyTo[key] = CP:TablesExist(CopyFrom[key], CopyTo[key], CopyDefault[key])
--If key exists, then copy. If not, then clear obsolite key from the profile. --If key exists, then copy. If not, then clear obsolite key from the profile.
--Someone should double check this logic. Cause for single keys it is fine, but I'm no sure bout whole tables @Darth --Someone should double check this logic. Cause for single keys it is fine, but I'm no sure bout whole tables @Darth
@@ -176,7 +176,7 @@ G["profileCopy"][YourOptionGroupName] = {
... ...
} }
* For example * For example
G["profileCopy"]["auras"] = { G["profileCopy"].auras = {
["general"] = true, ["general"] = true,
["buffs"] = true, ["buffs"] = true,
["debuffs"] = true, ["debuffs"] = true,
@@ -205,10 +205,10 @@ function CP:ImportFromProfile(section, pluginSection)
local module = pluginSection and E.global.profileCopy[pluginSection][section] or E.global.profileCopy[section] local module = pluginSection and E.global.profileCopy[pluginSection][section] or E.global.profileCopy[section]
if not module then error(format("Provided section name \"%s\" does not have a template for profile copy.", section)) end if not module then error(format("Provided section name \"%s\" does not have a template for profile copy.", section)) end
--Starting digging through the settings --Starting digging through the settings
local CopyFrom = pluginSection and ElvDB["profiles"][E.global.profileCopy.selected][pluginSection][section] or ElvDB["profiles"][E.global.profileCopy.selected][section] local CopyFrom = pluginSection and ElvDB.profiles[E.global.profileCopy.selected][pluginSection][section] or ElvDB.profiles[E.global.profileCopy.selected][section]
local CopyTo = pluginSection and E.db[pluginSection][section] or E.db[section] local CopyTo = pluginSection and E.db[pluginSection][section] or E.db[section]
local CopyDefault = pluginSection and P[pluginSection][section] or P[section] local CopyDefault = pluginSection and P[pluginSection][section] or P[section]
--Making sure tables actually exist in profiles (e.g absent values in ElvDB["profiles"] are for default values) --Making sure tables actually exist in profiles (e.g absent values in ElvDB.profiles are for default values)
CopyFrom, CopyTo = CP:TablesExist(CopyFrom, CopyTo, CopyDefault) CopyFrom, CopyTo = CP:TablesExist(CopyFrom, CopyTo, CopyDefault)
if type(module) == "table" and next(module) then --This module is not an empty table if type(module) == "table" and next(module) then --This module is not an empty table
CP:CopyTable(CopyFrom, CopyTo, CopyDefault, module) CP:CopyTable(CopyFrom, CopyTo, CopyDefault, module)
@@ -230,11 +230,11 @@ function CP:ExportToProfile(section, pluginSection)
local module = pluginSection and E.global.profileCopy[pluginSection][section] or E.global.profileCopy[section] local module = pluginSection and E.global.profileCopy[pluginSection][section] or E.global.profileCopy[section]
if not module then error(format("Provided section name \"%s\" does not have a template for profile copy.", section)) end if not module then error(format("Provided section name \"%s\" does not have a template for profile copy.", section)) end
--Making sure tables actually exist --Making sure tables actually exist
if not ElvDB["profiles"][E.global.profileCopy.selected][section] then ElvDB["profiles"][E.global.profileCopy.selected][section] = {} end if not ElvDB.profiles[E.global.profileCopy.selected][section] then ElvDB.profiles[E.global.profileCopy.selected][section] = {} end
if not E.db[section] then E.db[section] = {} end if not E.db[section] then E.db[section] = {} end
--Starting digging through the settings --Starting digging through the settings
local CopyFrom = pluginSection and E.db[pluginSection][section] or E.db[section] local CopyFrom = pluginSection and E.db[pluginSection][section] or E.db[section]
local CopyTo = pluginSection and ElvDB["profiles"][E.global.profileCopy.selected][pluginSection][section] or ElvDB["profiles"][E.global.profileCopy.selected][section] local CopyTo = pluginSection and ElvDB.profiles[E.global.profileCopy.selected][pluginSection][section] or ElvDB.profiles[E.global.profileCopy.selected][section]
local CopyDefault = pluginSection and P[pluginSection][section] or P[section] local CopyDefault = pluginSection and P[pluginSection][section] or P[section]
if type(module) == "table" and next(module) then --This module is not an empty table if type(module) == "table" and next(module) then --This module is not an empty table
CP:CopyTable(CopyFrom, CopyTo, CopyDefault, module) CP:CopyTable(CopyFrom, CopyTo, CopyDefault, module)
@@ -248,12 +248,12 @@ end
function CP:CopyMovers(mode) function CP:CopyMovers(mode)
if not E.db.movers then E.db.movers = {} end --Nothing was moved in cutrrent profile if not E.db.movers then E.db.movers = {} end --Nothing was moved in cutrrent profile
if not ElvDB["profiles"][E.global.profileCopy.selected].movers then ElvDB["profiles"][E.global.profileCopy.selected].movers = {} end --Nothing was moved in selected profile if not ElvDB.profiles[E.global.profileCopy.selected].movers then ElvDB.profiles[E.global.profileCopy.selected].movers = {} end --Nothing was moved in selected profile
local CopyFrom, CopyTo local CopyFrom, CopyTo
if mode == "export" then if mode == "export" then
CopyFrom, CopyTo = E.db.movers, ElvDB["profiles"][E.global.profileCopy.selected].movers CopyFrom, CopyTo = E.db.movers, ElvDB.profiles[E.global.profileCopy.selected].movers
else else
CopyFrom, CopyTo = ElvDB["profiles"][E.global.profileCopy.selected].movers or {}, E.db.movers CopyFrom, CopyTo = ElvDB.profiles[E.global.profileCopy.selected].movers or {}, E.db.movers
end end
for moverName in pairs(E.CreatedMovers) do for moverName in pairs(E.CreatedMovers) do
+5 -5
View File
@@ -193,7 +193,7 @@ function PI:CreateStepComplete()
imsg.lineBottom:SetTexCoord(0.00195313, 0.81835938, 0.01953125, 0.03320313) imsg.lineBottom:SetTexCoord(0.00195313, 0.81835938, 0.01953125, 0.03320313)
imsg.text = imsg:CreateFontString(nil, "ARTWORK") imsg.text = imsg:CreateFontString(nil, "ARTWORK")
E:FontTemplate(imsg.text, E["media"].normFont, 32, "OUTLINE") E:FontTemplate(imsg.text, E.media.normFont, 32, "OUTLINE")
E:Point(imsg.text, "BOTTOM", 0, 12) E:Point(imsg.text, "BOTTOM", 0, 12)
imsg.text:SetTextColor(1, 0.82, 0) imsg.text:SetTextColor(1, 0.82, 0)
imsg.text:SetJustifyH("CENTER") imsg.text:SetJustifyH("CENTER")
@@ -234,8 +234,8 @@ function PI:CreateFrame()
f.Status = CreateFrame("StatusBar", "PluginInstallStatus", f) f.Status = CreateFrame("StatusBar", "PluginInstallStatus", f)
f.Status:SetFrameLevel(f.Status:GetFrameLevel() + 2) f.Status:SetFrameLevel(f.Status:GetFrameLevel() + 2)
E:CreateBackdrop(f.Status, "Default", true) E:CreateBackdrop(f.Status, "Default", true)
f.Status:SetStatusBarTexture(E["media"].normTex) f.Status:SetStatusBarTexture(E.media.normTex)
f.Status:SetStatusBarColor(unpack(E["media"].rgbvaluecolor)) f.Status:SetStatusBarColor(unpack(E.media.rgbvaluecolor))
E:Point(f.Status, "TOPLEFT", f.Prev, "TOPRIGHT", 6, -2) E:Point(f.Status, "TOPLEFT", f.Prev, "TOPRIGHT", 6, -2)
E:Point(f.Status, "BOTTOMRIGHT", f.Next, "BOTTOMLEFT", -6, 2) E:Point(f.Status, "BOTTOMRIGHT", f.Next, "BOTTOMLEFT", -6, 2)
-- Setup StatusBar Animation -- Setup StatusBar Animation
@@ -355,7 +355,7 @@ function PI:CreateFrame()
E:Width(f.side, 140) E:Width(f.side, 140)
f.side.text = f.side:CreateFontString(nil, "OVERLAY") f.side.text = f.side:CreateFontString(nil, "OVERLAY")
E:Point(f.side.text, "TOP", f.side, "TOP", 0, -4) E:Point(f.side.text, "TOP", f.side, "TOP", 0, -4)
f.side.text:SetFont(E["media"].normFont, 18, "OUTLINE") f.side.text:SetFont(E.media.normFont, 18, "OUTLINE")
f.side.text:SetText(L["Steps"]) f.side.text:SetText(L["Steps"])
f.side.Lines = {} --Table to keep shown lines f.side.Lines = {} --Table to keep shown lines
f.side:Hide() f.side:Hide()
@@ -370,7 +370,7 @@ function PI:CreateFrame()
button.text = button:CreateFontString(nil, "OVERLAY") button.text = button:CreateFontString(nil, "OVERLAY")
E:Point(button.text, "TOPLEFT", button, "TOPLEFT", 2, -2) E:Point(button.text, "TOPLEFT", button, "TOPLEFT", 2, -2)
E:Point(button.text, "BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2) E:Point(button.text, "BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2)
button.text:SetFont(E["media"].normFont, 14, "OUTLINE") button.text:SetFont(E.media.normFont, 14, "OUTLINE")
button:SetScript("OnClick", function() if i <= f.MaxPage then SetPage(i, f.CurrentPage) end end) button:SetScript("OnClick", function() if i <= f.MaxPage then SetPage(i, f.CurrentPage) end end)
button.text:SetText("") button.text:SetText("")
f.side.Lines[i] = button f.side.Lines[i] = button
+11 -9
View File
@@ -26,10 +26,10 @@ AddOn.callbacks = AddOn.callbacks or LibStub("CallbackHandler-1.0"):New(AddOn)
-- Defaults -- Defaults
AddOn.DF = {} AddOn.DF = {}
AddOn.DF["profile"] = {} AddOn.DF.profile = {}
AddOn.DF["global"] = {} AddOn.DF.global = {}
AddOn.privateVars = {} AddOn.privateVars = {}
AddOn.privateVars["profile"] = {} AddOn.privateVars.profile = {}
AddOn.Options = { AddOn.Options = {
type = "group", type = "group",
@@ -40,9 +40,9 @@ AddOn.Options = {
local Locale = LibStub("AceLocale-3.0"):GetLocale(AddOnName, false) local Locale = LibStub("AceLocale-3.0"):GetLocale(AddOnName, false)
Engine[1] = AddOn Engine[1] = AddOn
Engine[2] = Locale Engine[2] = Locale
Engine[3] = AddOn.privateVars["profile"] Engine[3] = AddOn.privateVars.profile
Engine[4] = AddOn.DF["profile"] Engine[4] = AddOn.DF.profile
Engine[5] = AddOn.DF["global"] Engine[5] = AddOn.DF.global
_G[AddOnName] = Engine _G[AddOnName] = Engine
local tcopy = table.copy local tcopy = table.copy
@@ -125,6 +125,9 @@ function AddOn:OnInitialize()
GameMenuButtonLogout:SetPoint("TOPLEFT", GameMenuFrame[AddOnName], "BOTTOMLEFT", 0, -16) GameMenuButtonLogout:SetPoint("TOPLEFT", GameMenuFrame[AddOnName], "BOTTOMLEFT", 0, -16)
end end
end) end)
if AddOn.private.skins.blizzard.enable ~= true or AddOn.private.skins.blizzard.misc ~= true then return end
local S = AddOn:GetModule("Skins") local S = AddOn:GetModule("Skins")
S:HandleButton(GameMenuButton) S:HandleButton(GameMenuButton)
end end
@@ -147,7 +150,8 @@ function AddOn:OnProfileReset()
self:StaticPopup_Show("RESET_PROFILE_PROMPT") self:StaticPopup_Show("RESET_PROFILE_PROMPT")
end end
function AddOn:ToggleConfig() local pageNodes = {}
function AddOn:ToggleConfig(msg)
if not IsAddOnLoaded("ElvUI_Config") then if not IsAddOnLoaded("ElvUI_Config") then
local _, _, _, _, _, reason = GetAddOnInfo("ElvUI_Config") local _, _, _, _, _, reason = GetAddOnInfo("ElvUI_Config")
if reason ~= "MISSING" and reason ~= "DISABLED" then if reason ~= "MISSING" and reason ~= "DISABLED" then
@@ -227,7 +231,5 @@ function AddOn:ToggleConfig()
PlaySound("igMainMenuClose") PlaySound("igMainMenuClose")
end end
ACD[mode](ACD, AddOnName)
GameTooltip:Hide() --Just in case you're mouseovered something and it closes. GameTooltip:Hide() --Just in case you're mouseovered something and it closes.
end end
+2 -2
View File
@@ -379,12 +379,12 @@ function LO:CreateChatPanels()
rchattb.text:SetText(">") rchattb.text:SetText(">")
--Load Settings --Load Settings
if E.db["LeftChatPanelFaded"] then if E.db.LeftChatPanelFaded then
LeftChatToggleButton:SetAlpha(0) LeftChatToggleButton:SetAlpha(0)
LeftChatPanel:Hide() LeftChatPanel:Hide()
end end
if E.db["RightChatPanelFaded"] then if E.db.RightChatPanelFaded then
RightChatToggleButton:SetAlpha(0) RightChatToggleButton:SetAlpha(0)
RightChatPanel:Hide() RightChatPanel:Hide()
end end
+2 -2
View File
@@ -821,7 +821,7 @@ function B:OnEvent()
end end
function B:UpdateGoldText() function B:UpdateGoldText()
self.BagFrame.goldText:SetText(E:FormatMoney(GetMoney(), E.db["bags"].moneyFormat)) self.BagFrame.goldText:SetText(E:FormatMoney(GetMoney(), E.db.bags.moneyFormat))
end end
function B:FormatMoney(amount) function B:FormatMoney(amount)
@@ -1530,7 +1530,7 @@ function B:CreateSellFrame()
B.SellFrame.statusbar = CreateFrame("StatusBar", "ElvUIVendorGraysFrameStatusbar", B.SellFrame) B.SellFrame.statusbar = CreateFrame("StatusBar", "ElvUIVendorGraysFrameStatusbar", B.SellFrame)
E:Size(B.SellFrame.statusbar, 180, 16) E:Size(B.SellFrame.statusbar, 180, 16)
E:Point(B.SellFrame.statusbar, "BOTTOM", B.SellFrame, "BOTTOM", 0, 4) E:Point(B.SellFrame.statusbar, "BOTTOM", B.SellFrame, "BOTTOM", 0, 4)
B.SellFrame.statusbar:SetStatusBarTexture(E["media"].normTex) B.SellFrame.statusbar:SetStatusBarTexture(E.media.normTex)
B.SellFrame.statusbar:SetStatusBarColor(1, 0, 0) B.SellFrame.statusbar:SetStatusBarColor(1, 0, 0)
E:CreateBackdrop(B.SellFrame.statusbar, "Transparent") E:CreateBackdrop(B.SellFrame.statusbar, "Transparent")
+6 -6
View File
@@ -606,17 +606,17 @@ function B.SortBags(...)
for bagType, sortedBags in pairs(bagCache) do for bagType, sortedBags in pairs(bagCache) do
if bagType ~= "Normal" then if bagType ~= "Normal" then
B.Stack(sortedBags, sortedBags, B.IsPartial) B.Stack(sortedBags, sortedBags, B.IsPartial)
B.Stack(bagCache["Normal"], sortedBags) B.Stack(bagCache.Normal, sortedBags)
B.Fill(bagCache["Normal"], sortedBags, B.db.sortInverted) B.Fill(bagCache.Normal, sortedBags, B.db.sortInverted)
B.Sort(sortedBags, nil, B.db.sortInverted) B.Sort(sortedBags, nil, B.db.sortInverted)
twipe(sortedBags) twipe(sortedBags)
end end
end end
if bagCache["Normal"] then if bagCache.Normal then
B.Stack(bagCache["Normal"], bagCache["Normal"], B.IsPartial) B.Stack(bagCache.Normal, bagCache.Normal, B.IsPartial)
B.Sort(bagCache["Normal"], nil, B.db.sortInverted) B.Sort(bagCache.Normal, nil, B.db.sortInverted)
twipe(bagCache["Normal"]) twipe(bagCache.Normal)
end end
twipe(bagCache) twipe(bagCache)
twipe(bagGroups) twipe(bagGroups)
+10 -10
View File
@@ -204,9 +204,9 @@ function CH:StyleChat(frame)
end) end)
tab.text = _G[name.."TabText"] tab.text = _G[name.."TabText"]
tab.text:SetTextColor(unpack(E["media"].rgbvaluecolor)) tab.text:SetTextColor(unpack(E.media.rgbvaluecolor))
hooksecurefunc(tab.text, "SetTextColor", function(self, r, g, b) hooksecurefunc(tab.text, "SetTextColor", function(self, r, g, b)
local rR, gG, bB = unpack(E["media"].rgbvaluecolor) local rR, gG, bB = unpack(E.media.rgbvaluecolor)
if r ~= rR or g ~= gG or b ~= bB then if r ~= rR or g ~= gG or b ~= bB then
self:SetTextColor(rR, gG, bB) self:SetTextColor(rR, gG, bB)
end end
@@ -370,8 +370,8 @@ local function FindRightChatID()
end end
function CH:UpdateChatTabs() function CH:UpdateChatTabs()
local fadeUndockedTabs = E.db["chat"].fadeUndockedTabs local fadeUndockedTabs = E.db.chat.fadeUndockedTabs
local fadeTabsNoBackdrop = E.db["chat"].fadeTabsNoBackdrop local fadeTabsNoBackdrop = E.db.chat.fadeTabsNoBackdrop
for i = 1, CreatedFrames do for i = 1, CreatedFrames do
local chat = _G[format("ChatFrame%d", i)] local chat = _G[format("ChatFrame%d", i)]
@@ -420,8 +420,8 @@ function CH:PositionChat(override)
if not self.db.lockPositions or E.private.chat.enable ~= true then return end if not self.db.lockPositions or E.private.chat.enable ~= true then return end
local chat, tab, id, isDocked local chat, tab, id, isDocked
local fadeUndockedTabs = E.db["chat"].fadeUndockedTabs local fadeUndockedTabs = E.db.chat.fadeUndockedTabs
local fadeTabsNoBackdrop = E.db["chat"].fadeTabsNoBackdrop local fadeTabsNoBackdrop = E.db.chat.fadeTabsNoBackdrop
for i = 1, CreatedFrames do for i = 1, CreatedFrames do
local BASE_OFFSET = 57 + E.Spacing*3 local BASE_OFFSET = 57 + E.Spacing*3
@@ -514,7 +514,7 @@ local function UpdateChatTabColor(_, r, g, b)
_G["ChatFrame"..i.."TabText"]:SetTextColor(r, g, b) _G["ChatFrame"..i.."TabText"]:SetTextColor(r, g, b)
end end
end end
E["valueColorUpdateFuncs"][UpdateChatTabColor] = true E.valueColorUpdateFuncs[UpdateChatTabColor] = true
function CH:ScrollToBottom(frame) function CH:ScrollToBottom(frame)
frame:ScrollToBottom() frame:ScrollToBottom()
@@ -1158,7 +1158,7 @@ local protectLinks = {}
function CH:CheckKeyword(message) function CH:CheckKeyword(message)
for itemLink in gmatch(message, "|%x+|Hitem:.-|h.-|h|r") do for itemLink in gmatch(message, "|%x+|Hitem:.-|h.-|h|r") do
protectLinks[itemLink] = gsub(itemLink, "%s","|s") protectLinks[itemLink] = gsub(itemLink, "%s","|s")
for keyword, _ in pairs(CH.Keywords) do for keyword in pairs(CH.Keywords) do
if itemLink == keyword then if itemLink == keyword then
if self.db.keywordSound ~= "None" and not self.SoundPlayed then if self.db.keywordSound ~= "None" and not self.SoundPlayed then
PlaySoundFile(LSM:Fetch("sound", self.db.keywordSound), "Master") PlaySoundFile(LSM:Fetch("sound", self.db.keywordSound), "Master")
@@ -1358,10 +1358,10 @@ function CH:DisplayChatHistory()
CH.SoundPlayed = nil CH.SoundPlayed = nil
end end
tremove(ChatTypeGroup["GUILD"], 3) tremove(ChatTypeGroup.GUILD, 3)
function CH:DelayGuildMOTD() function CH:DelayGuildMOTD()
local delay, delayFrame, chat = 0, CreateFrame("Frame") local delay, delayFrame, chat = 0, CreateFrame("Frame")
tinsert(ChatTypeGroup["GUILD"], 3, "GUILD_MOTD") tinsert(ChatTypeGroup.GUILD, 3, "GUILD_MOTD")
delayFrame:SetScript("OnUpdate", function() delayFrame:SetScript("OnUpdate", function()
delay = delay + arg1 delay = delay + arg1
if delay < 7 then return end if delay < 7 then return end
+1 -1
View File
@@ -65,6 +65,6 @@ local function ValueColorUpdate(hex)
OnEvent(lastPanel) OnEvent(lastPanel)
end end
end end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Armor", {"UNIT_RESISTANCES"}, OnEvent, nil, nil, OnEnter, nil, ARMOR) DT:RegisterDatatext("Armor", {"UNIT_RESISTANCES"}, OnEvent, nil, nil, OnEnter, nil, ARMOR)
+1 -1
View File
@@ -61,6 +61,6 @@ local function ValueColorUpdate(hex)
OnEvent(lastPanel) OnEvent(lastPanel)
end end
end end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Attack Power", {"UNIT_ATTACK_POWER", "UNIT_RANGED_ATTACK_POWER"}, OnEvent, nil, nil, OnEnter, nil, ATTACK_POWER_TOOLTIP) DT:RegisterDatatext("Attack Power", {"UNIT_ATTACK_POWER", "UNIT_RANGED_ATTACK_POWER"}, OnEvent, nil, nil, OnEnter, nil, ATTACK_POWER_TOOLTIP)
+1 -1
View File
@@ -122,6 +122,6 @@ local function ValueColorUpdate(hex)
OnEvent(lastPanel) OnEvent(lastPanel)
end end
end end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Avoidance", {"COMBAT_RATING_UPDATE", "PLAYER_TARGET_CHANGED"}, OnEvent, nil, nil, OnEnter, nil, L["Avoidance Breakdown"]) DT:RegisterDatatext("Avoidance", {"COMBAT_RATING_UPDATE", "PLAYER_TARGET_CHANGED"}, OnEvent, nil, nil, OnEnter, nil, L["Avoidance Breakdown"])
+27 -27
View File
@@ -110,7 +110,7 @@ end
local function ValueColorUpdate(newHex) local function ValueColorUpdate(newHex)
hex = newHex hex = newHex
end end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
function DT:GetDataPanelPoint(panel, i, numPoints) function DT:GetDataPanelPoint(panel, i, numPoints)
if(numPoints == 1) then if(numPoints == 1) then
@@ -119,9 +119,9 @@ function DT:GetDataPanelPoint(panel, i, numPoints)
if(i == 1) then if(i == 1) then
return "CENTER", panel, "CENTER" return "CENTER", panel, "CENTER"
elseif(i == 2) then elseif(i == 2) then
return "RIGHT", panel.dataPanels["middle"], "LEFT", -4, 0 return "RIGHT", panel.dataPanels.middle, "LEFT", -4, 0
elseif(i == 3) then elseif(i == 3) then
return "LEFT", panel.dataPanels["middle"], "RIGHT", 4, 0 return "LEFT", panel.dataPanels.middle, "RIGHT", 4, 0
end end
end end
end end
@@ -180,12 +180,12 @@ end
function DT:AssignPanelToDataText(panel, data) function DT:AssignPanelToDataText(panel, data)
panel.name = "" panel.name = ""
if data["name"] then if data.name then
panel.name = data["name"] panel.name = data.name
end end
if data["events"] then if data.events then
for _, event in pairs(data["events"]) do for _, event in pairs(data.events) do
-- random error 132 -- random error 132
if event == "PLAYER_ENTERING_WORLD" then if event == "PLAYER_ENTERING_WORLD" then
event = "PLAYER_LOGIN" event = "PLAYER_LOGIN"
@@ -194,35 +194,35 @@ function DT:AssignPanelToDataText(panel, data)
end end
end end
if data["eventFunc"] then if data.eventFunc then
panel:SetScript("OnEvent", function() panel:SetScript("OnEvent", function()
data["eventFunc"](this, event) data.eventFunc(this, event)
end) end)
data["eventFunc"](panel, "ELVUI_FORCE_RUN") data.eventFunc(panel, "ELVUI_FORCE_RUN")
end end
if data["onUpdate"] then if data.onUpdate then
panel:SetScript("OnUpdate", function() panel:SetScript("OnUpdate", function()
data["onUpdate"](this, arg1) data.onUpdate(this, arg1)
end) end)
data["onUpdate"](panel, 20000) data.onUpdate(panel, 20000)
end end
if data["onClick"] then if data.onClick then
panel:SetScript("OnClick", function() panel:SetScript("OnClick", function()
data["onClick"](this) data.onClick(this)
end) end)
end end
if data["onEnter"] then if data.onEnter then
panel:SetScript("OnEnter", function() panel:SetScript("OnEnter", function()
data["onEnter"](this) data.onEnter(this)
end) end)
end end
if data["onLeave"] then if data.onLeave then
panel:SetScript("OnLeave", function() panel:SetScript("OnLeave", function()
data["onLeave"](this) data.onLeave(this)
end) end)
else else
panel:SetScript("OnLeave", DT.Data_OnLeave) panel:SetScript("OnLeave", DT.Data_OnLeave)
@@ -285,33 +285,33 @@ function DT:RegisterDatatext(name, events, eventFunc, updateFunc, clickFunc, onE
error("Cannot register datatext no name was provided.") error("Cannot register datatext no name was provided.")
end end
DT.RegisteredDataTexts[name]["name"] = name DT.RegisteredDataTexts[name].name = name
if type(events) ~= "table" and events ~= nil then if type(events) ~= "table" and events ~= nil then
error("Events must be registered as a table.") error("Events must be registered as a table.")
else else
DT.RegisteredDataTexts[name]["events"] = events DT.RegisteredDataTexts[name].events = events
DT.RegisteredDataTexts[name]["eventFunc"] = eventFunc DT.RegisteredDataTexts[name].eventFunc = eventFunc
end end
if updateFunc and type(updateFunc) == "function" then if updateFunc and type(updateFunc) == "function" then
DT.RegisteredDataTexts[name]["onUpdate"] = updateFunc DT.RegisteredDataTexts[name].onUpdate = updateFunc
end end
if clickFunc and type(clickFunc) == "function" then if clickFunc and type(clickFunc) == "function" then
DT.RegisteredDataTexts[name]["onClick"] = clickFunc DT.RegisteredDataTexts[name].onClick = clickFunc
end end
if onEnterFunc and type(onEnterFunc) == "function" then if onEnterFunc and type(onEnterFunc) == "function" then
DT.RegisteredDataTexts[name]["onEnter"] = onEnterFunc DT.RegisteredDataTexts[name].onEnter = onEnterFunc
end end
if onLeaveFunc and type(onLeaveFunc) == "function" then if onLeaveFunc and type(onLeaveFunc) == "function" then
DT.RegisteredDataTexts[name]["onLeave"] = onLeaveFunc DT.RegisteredDataTexts[name].onLeave = onLeaveFunc
end end
if localizedName and type(localizedName) == "string" then if localizedName and type(localizedName) == "string" then
DT.RegisteredDataTexts[name]["localizedName"] = localizedName DT.RegisteredDataTexts[name].localizedName = localizedName
end end
end end
+1 -1
View File
@@ -73,6 +73,6 @@ local function ValueColorUpdate(hex)
OnEvent(lastPanel, "ELVUI_COLOR_UPDATE") OnEvent(lastPanel, "ELVUI_COLOR_UPDATE")
end end
end end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Durability", {"PLAYER_ENTERING_WORLD", "UPDATE_INVENTORY_ALERTS", "MERCHANT_SHOW"}, OnEvent, nil, OnClick, OnEnter, nil, DURABILITY) DT:RegisterDatatext("Durability", {"PLAYER_ENTERING_WORLD", "UPDATE_INVENTORY_ALERTS", "MERCHANT_SHOW"}, OnEvent, nil, OnClick, OnEnter, nil, DURABILITY)
+1 -1
View File
@@ -172,6 +172,6 @@ local function ValueColorUpdate(hex)
OnEvent(lastPanel, "ELVUI_COLOR_UPDATE") OnEvent(lastPanel, "ELVUI_COLOR_UPDATE")
end end
end end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Friends", {"PLAYER_LOGIN", "FRIENDLIST_UPDATE", "CHAT_MSG_SYSTEM"}, OnEvent, nil, OnClick, OnEnter, nil, FRIENDS) DT:RegisterDatatext("Friends", {"PLAYER_LOGIN", "FRIENDLIST_UPDATE", "CHAT_MSG_SYSTEM"}, OnEvent, nil, OnClick, OnEnter, nil, FRIENDS)
+12 -12
View File
@@ -16,11 +16,11 @@ local resetInfoFormatter = join("", "|cffaaaaaa", L["Reset Data: Hold Shift + Ri
local function OnEvent(self) local function OnEvent(self)
local NewMoney = GetMoney() local NewMoney = GetMoney()
ElvDB = ElvDB or {} ElvDB = ElvDB or {}
ElvDB["gold"] = ElvDB["gold"] or {} ElvDB.gold = ElvDB.gold or {}
ElvDB["gold"][E.myrealm] = ElvDB["gold"][E.myrealm] or {} ElvDB.gold[E.myrealm] = ElvDB.gold[E.myrealm] or {}
ElvDB["gold"][E.myrealm][E.myname] = ElvDB["gold"][E.myrealm][E.myname] or NewMoney ElvDB.gold[E.myrealm][E.myname] = ElvDB.gold[E.myrealm][E.myname] or NewMoney
local OldMoney = ElvDB["gold"][E.myrealm][E.myname] or NewMoney local OldMoney = ElvDB.gold[E.myrealm][E.myname] or NewMoney
local Change = NewMoney - OldMoney local Change = NewMoney - OldMoney
if OldMoney > NewMoney then if OldMoney > NewMoney then
@@ -31,7 +31,7 @@ local function OnEvent(self)
self.text:SetText(E:FormatMoney(NewMoney, E.db.datatexts.goldFormat or "BLIZZARD")) self.text:SetText(E:FormatMoney(NewMoney, E.db.datatexts.goldFormat or "BLIZZARD"))
ElvDB["gold"][E.myrealm][E.myname] = NewMoney ElvDB.gold[E.myrealm][E.myname] = NewMoney
end end
local function OnClick(self) local function OnClick(self)
@@ -52,19 +52,19 @@ local function OnEnter(self)
DT.tooltip:AddDoubleLine(L["Earned:"], E:FormatMoney(Profit, style), 1, 1, 1, 1, 1, 1) DT.tooltip:AddDoubleLine(L["Earned:"], E:FormatMoney(Profit, style), 1, 1, 1, 1, 1, 1)
DT.tooltip:AddDoubleLine(L["Spent:"], E:FormatMoney(Spent, style), 1, 1, 1, 1, 1, 1) DT.tooltip:AddDoubleLine(L["Spent:"], E:FormatMoney(Spent, style), 1, 1, 1, 1, 1, 1)
if Profit < Spent then if Profit < Spent then
DT.tooltip:AddDoubleLine(L["Deficit:"], E:FormatMoney(Profit-Spent, style), 1, 0, 0, 1, 1, 1) DT.tooltip:AddDoubleLine(L["Deficit:"], E:FormatMoney(Profit - Spent, style), 1, 0, 0, 1, 1, 1)
elseif (Profit - Spent) > 0 then elseif (Profit - Spent) > 0 then
DT.tooltip:AddDoubleLine(L["Profit:"], E:FormatMoney(Profit-Spent, style), 0, 1, 0, 1, 1, 1) DT.tooltip:AddDoubleLine(L["Profit:"], E:FormatMoney(Profit - Spent, style), 0, 1, 0, 1, 1, 1)
end end
DT.tooltip:AddLine(" ") DT.tooltip:AddLine(" ")
local totalGold = 0; local totalGold = 0;
DT.tooltip:AddLine(L["Character: "]) DT.tooltip:AddLine(L["Character: "])
for k, _ in pairs(ElvDB["gold"][E.myrealm]) do for k in pairs(ElvDB.gold[E.myrealm]) do
if ElvDB["gold"][E.myrealm][k] then if ElvDB.gold[E.myrealm][k] then
DT.tooltip:AddDoubleLine(k, E:FormatMoney(ElvDB["gold"][E.myrealm][k], style), 1, 1, 1, 1, 1, 1) DT.tooltip:AddDoubleLine(k, E:FormatMoney(ElvDB.gold[E.myrealm][k], style), 1, 1, 1, 1, 1, 1)
totalGold = totalGold + ElvDB["gold"][E.myrealm][k] totalGold = totalGold + ElvDB.gold[E.myrealm][k]
end end
end end
@@ -78,4 +78,4 @@ local function OnEnter(self)
DT.tooltip:Show() DT.tooltip:Show()
end end
DT:RegisterDatatext("Gold", {"PLAYER_ENTERING_WORLD", "PLAYER_MONEY", "SEND_MAIL_MONEY_CHANGED", "SEND_MAIL_COD_CHANGED", "PLAYER_TRADE_MONEY", "TRADE_MONEY_CHANGED"}, OnEvent, nil, OnClick, OnEnter, nil, L["Gold"]) DT:RegisterDatatext("Gold", {"PLAYER_ENTERING_WORLD", "PLAYER_MONEY", "SEND_MAIL_MONEY_CHANGED", "SEND_MAIL_COD_CHANGED", "PLAYER_TRADE_MONEY", "TRADE_MONEY_CHANGED"}, OnEvent, nil, OnClick, OnEnter, nil, L.gold)
+1 -1
View File
@@ -229,6 +229,6 @@ local function ValueColorUpdate(hex)
OnEvent(lastPanel, "ELVUI_COLOR_UPDATE") OnEvent(lastPanel, "ELVUI_COLOR_UPDATE")
end end
end end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Guild", {"PLAYER_ENTERING_WORLD", "GUILD_ROSTER_UPDATE", "PLAYER_GUILD_UPDATE", "GUILD_MOTD"}, OnEvent, nil, OnClick, OnEnter, nil, GUILD) DT:RegisterDatatext("Guild", {"PLAYER_ENTERING_WORLD", "GUILD_ROSTER_UPDATE", "PLAYER_GUILD_UPDATE", "GUILD_MOTD"}, OnEvent, nil, OnClick, OnEnter, nil, GUILD)
+1 -1
View File
@@ -89,6 +89,6 @@ local function ValueColorUpdate(hex)
OnUpdate(lastPanel, 20000) OnUpdate(lastPanel, 20000)
end end
end end
E["valueColorUpdateFuncs"][ValueColorUpdate] = true E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Time", nil, nil, OnUpdate, OnClick, OnEnter, OnLeave) DT:RegisterDatatext("Time", nil, nil, OnUpdate, OnClick, OnEnter, OnLeave)
+2 -2
View File
@@ -112,8 +112,8 @@ function M:SkinBubble(frame)
if E.private.general.chatBubbles == "backdrop" then if E.private.general.chatBubbles == "backdrop" then
if E.PixelMode then if E.PixelMode then
frame:SetBackdrop({ frame:SetBackdrop({
bgFile = E["media"].blankTex, bgFile = E.media.blankTex,
edgeFile = E["media"].blankTex, edgeFile = E.media.blankTex,
tile = false, tileSize = 0, edgeSize = mult, tile = false, tileSize = 0, edgeSize = mult,
insets = {left = 0, right = 0, top = 0, bottom = 0} insets = {left = 0, right = 0, top = 0, bottom = 0}
}) })
+2 -2
View File
@@ -107,7 +107,7 @@ local function createSlot(id)
iconFrame:SetPoint("RIGHT", frame) iconFrame:SetPoint("RIGHT", frame)
E:SetTemplate(iconFrame, "Default") E:SetTemplate(iconFrame, "Default")
frame.iconFrame = iconFrame frame.iconFrame = iconFrame
E["frames"][iconFrame] = nil E.frames[iconFrame] = nil
local icon = iconFrame:CreateTexture(nil, "ARTWORK") local icon = iconFrame:CreateTexture(nil, "ARTWORK")
icon:SetTexCoord(unpack(E.TexCoords)) icon:SetTexCoord(unpack(E.TexCoords))
@@ -290,7 +290,7 @@ function M:LoadLoot()
StaticPopup_Hide("CONFIRM_LOOT_DISTRIBUTION") StaticPopup_Hide("CONFIRM_LOOT_DISTRIBUTION")
CloseLoot() CloseLoot()
end) end)
E["frames"][lootFrame] = nil E.frames[lootFrame] = nil
self:RegisterEvent("LOOT_OPENED") self:RegisterEvent("LOOT_OPENED")
self:RegisterEvent("LOOT_SLOT_CLEARED") self:RegisterEvent("LOOT_SLOT_CLEARED")
+1 -1
View File
@@ -189,7 +189,7 @@ function M:CreateRollFrame()
E:SetInside(status) E:SetInside(status)
status:SetScript("OnUpdate", function() StatusUpdate(status) end) status:SetScript("OnUpdate", function() StatusUpdate(status) end)
status:SetFrameLevel(status:GetFrameLevel() - 1) status:SetFrameLevel(status:GetFrameLevel() - 1)
status:SetStatusBarTexture(E["media"].normTex) status:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(status) E:RegisterStatusBar(status)
status:SetStatusBarColor(.8, .8, .8, .9) status:SetStatusBarColor(.8, .8, .8, .9)
status.parent = frame status.parent = frame
+9 -9
View File
@@ -200,7 +200,7 @@ function mod:StyleFrame(parent, noBackdrop, point)
if not noBackdrop then if not noBackdrop then
point.backdrop = parent:CreateTexture(nil, "BACKGROUND") point.backdrop = parent:CreateTexture(nil, "BACKGROUND")
point.backdrop:SetAllPoints(point) point.backdrop:SetAllPoints(point)
point.backdrop:SetTexture(unpack(E["media"].backdropfadecolor)) point.backdrop:SetTexture(unpack(E.media.backdropfadecolor))
end end
if E.PixelMode then if E.PixelMode then
@@ -208,25 +208,25 @@ function mod:StyleFrame(parent, noBackdrop, point)
point.bordertop:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult) point.bordertop:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult)
point.bordertop:SetPoint("TOPRIGHT", point, "TOPRIGHT", noscalemult, noscalemult) point.bordertop:SetPoint("TOPRIGHT", point, "TOPRIGHT", noscalemult, noscalemult)
point.bordertop:SetHeight(noscalemult) point.bordertop:SetHeight(noscalemult)
point.bordertop:SetTexture(unpack(E["media"].bordercolor)) point.bordertop:SetTexture(unpack(E.media.bordercolor))
point.borderbottom = parent:CreateTexture() point.borderbottom = parent:CreateTexture()
point.borderbottom:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", -noscalemult, -noscalemult) point.borderbottom:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", -noscalemult, -noscalemult)
point.borderbottom:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", noscalemult, -noscalemult) point.borderbottom:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", noscalemult, -noscalemult)
point.borderbottom:SetHeight(noscalemult) point.borderbottom:SetHeight(noscalemult)
point.borderbottom:SetTexture(unpack(E["media"].bordercolor)) point.borderbottom:SetTexture(unpack(E.media.bordercolor))
point.borderleft = parent:CreateTexture() point.borderleft = parent:CreateTexture()
point.borderleft:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult) point.borderleft:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult)
point.borderleft:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", noscalemult, -noscalemult) point.borderleft:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", noscalemult, -noscalemult)
point.borderleft:SetWidth(noscalemult) point.borderleft:SetWidth(noscalemult)
point.borderleft:SetTexture(unpack(E["media"].bordercolor)) point.borderleft:SetTexture(unpack(E.media.bordercolor))
point.borderright = parent:CreateTexture() point.borderright = parent:CreateTexture()
point.borderright:SetPoint("TOPRIGHT", point, "TOPRIGHT", noscalemult, noscalemult) point.borderright:SetPoint("TOPRIGHT", point, "TOPRIGHT", noscalemult, noscalemult)
point.borderright:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", -noscalemult, -noscalemult) point.borderright:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", -noscalemult, -noscalemult)
point.borderright:SetWidth(noscalemult) point.borderright:SetWidth(noscalemult)
point.borderright:SetTexture(unpack(E["media"].bordercolor)) point.borderright:SetTexture(unpack(E.media.bordercolor))
else else
point.bordertop = parent:CreateTexture(nil, "OVERLAY") point.bordertop = parent:CreateTexture(nil, "OVERLAY")
point.bordertop:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult*2) point.bordertop:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult*2)
@@ -521,7 +521,7 @@ function mod:AnimatedHide()
num = num + 1 num = num + 1
end end
if num < 1 then if num < 1 then
end end
end end
@@ -649,7 +649,7 @@ function mod:OnUpdate()
end end
for frame in pairs(mod.VisiblePlates) do for frame in pairs(mod.VisiblePlates) do
if mod.hasTarget then if mod.hasTarget then
frame.alpha = frame:GetParent():GetAlpha() frame.alpha = frame:GetParent():GetAlpha()
else else
frame.alpha = 1 frame.alpha = 1
@@ -801,8 +801,8 @@ function mod:ClassCache_ClassUpdated(_, name, class)
end end
function mod:Initialize() function mod:Initialize()
self.db = E.db["nameplates"] self.db = E.db.nameplates
if E.private["nameplates"].enable ~= true then return end if E.private.nameplates.enable ~= true then return end
self.hasTarget = false self.hasTarget = false
@@ -92,7 +92,7 @@ local function LoadSkin()
E:StyleButton(AuctionsItemButton, false, true) E:StyleButton(AuctionsItemButton, false, true)
HookScript(AuctionsItemButton, "OnEvent", function() HookScript(AuctionsItemButton, "OnEvent", function()
this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) this:SetBackdropBorderColor(unpack(E.media.bordercolor))
if event == "NEW_AUCTION_UPDATE" and this:GetNormalTexture() then if event == "NEW_AUCTION_UPDATE" and this:GetNormalTexture() then
this:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) this:GetNormalTexture():SetTexCoord(unpack(E.TexCoords))
E:SetInside(this:GetNormalTexture()) E:SetInside(this:GetNormalTexture())
@@ -104,11 +104,11 @@ local function LoadSkin()
if quality then if quality then
this:SetBackdropBorderColor(GetItemQualityColor(quality)) this:SetBackdropBorderColor(GetItemQualityColor(quality))
else else
this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) this:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end end
else else
this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) this:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end) end)
@@ -221,7 +221,7 @@ local function LoadSkin()
icon:SetBackdropBorderColor(r, g, b) icon:SetBackdropBorderColor(r, g, b)
end) end)
hooksecurefunc(name, "Hide", function() hooksecurefunc(name, "Hide", function()
icon:SetBackdropBorderColor(unpack(E["media"].bordercolor)) icon:SetBackdropBorderColor(unpack(E.media.bordercolor))
end) end)
end end
@@ -254,7 +254,7 @@ local function LoadSkin()
icon:SetBackdropBorderColor(r, g, b) icon:SetBackdropBorderColor(r, g, b)
end) end)
hooksecurefunc(name, "Hide", function(_, r, g, b) hooksecurefunc(name, "Hide", function(_, r, g, b)
icon:SetBackdropBorderColor(unpack(E["media"].bordercolor)) icon:SetBackdropBorderColor(unpack(E.media.bordercolor))
end) end)
end end
@@ -287,7 +287,7 @@ local function LoadSkin()
icon:SetBackdropBorderColor(r, g, b) icon:SetBackdropBorderColor(r, g, b)
end) end)
hooksecurefunc(name, "Hide", function(_, r, g, b) hooksecurefunc(name, "Hide", function(_, r, g, b)
icon:SetBackdropBorderColor(unpack(E["media"].bordercolor)) icon:SetBackdropBorderColor(unpack(E.media.bordercolor))
end) end)
end end
+2 -2
View File
@@ -100,7 +100,7 @@ local function LoadSkin()
local rarity = GetInventoryItemQuality("player", this:GetID()) local rarity = GetInventoryItemQuality("player", this:GetID())
this:SetBackdropBorderColor(GetItemQualityColor(rarity)) this:SetBackdropBorderColor(GetItemQualityColor(rarity))
else else
this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) this:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end) end)
@@ -133,7 +133,7 @@ local function LoadSkin()
PetMagicResFrame5:GetRegions():SetTexCoord(0.21875, 0.78125, 0.4765625, 0.546875) PetMagicResFrame5:GetRegions():SetTexCoord(0.21875, 0.78125, 0.4765625, 0.546875)
E:StripTextures(PetPaperDollFrameExpBar) E:StripTextures(PetPaperDollFrameExpBar)
PetPaperDollFrameExpBar:SetStatusBarTexture(E["media"].normTex) PetPaperDollFrameExpBar:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(PetPaperDollFrameExpBar) E:RegisterStatusBar(PetPaperDollFrameExpBar)
E:CreateBackdrop(PetPaperDollFrameExpBar, "Default") E:CreateBackdrop(PetPaperDollFrameExpBar, "Default")
+4 -4
View File
@@ -47,7 +47,7 @@ local function LoadSkin()
E:Size(CraftRankFrame, 420, 18) E:Size(CraftRankFrame, 420, 18)
CraftRankFrame:ClearAllPoints() CraftRankFrame:ClearAllPoints()
CraftRankFrame:SetPoint("TOP", -10, -38) CraftRankFrame:SetPoint("TOP", -10, -38)
CraftRankFrame:SetStatusBarTexture(E["media"].normTex) CraftRankFrame:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(CraftRankFrame) E:RegisterStatusBar(CraftRankFrame)
CraftRankFrameSkillName:Hide() CraftRankFrameSkillName:Hide()
@@ -204,7 +204,7 @@ local function LoadSkin()
CraftIcon:SetBackdropBorderColor(GetItemQualityColor(quality)) CraftIcon:SetBackdropBorderColor(GetItemQualityColor(quality))
CraftName:SetTextColor(GetItemQualityColor(quality)) CraftName:SetTextColor(GetItemQualityColor(quality))
else else
CraftIcon:SetBackdropBorderColor(unpack(E["media"].bordercolor)) CraftIcon:SetBackdropBorderColor(unpack(E.media.bordercolor))
CraftName:SetTextColor(1, 1, 1) CraftName:SetTextColor(1, 1, 1)
end end
end end
@@ -228,8 +228,8 @@ local function LoadSkin()
name:SetTextColor(GetItemQualityColor(quality)) name:SetTextColor(GetItemQualityColor(quality))
end end
else else
reagent:SetBackdropBorderColor(unpack(E["media"].bordercolor)) reagent:SetBackdropBorderColor(unpack(E.media.bordercolor))
icon.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) icon.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end end
end end
+2 -2
View File
@@ -65,8 +65,8 @@ local function LoadSkin()
HookScript(FrameStackTooltip, "OnShow", function() HookScript(FrameStackTooltip, "OnShow", function()
E:SetTemplate(this, "Transparent") E:SetTemplate(this, "Transparent")
this:SetBackdropColor(unpack(E["media"].backdropfadecolor)) this:SetBackdropColor(unpack(E.media.backdropfadecolor))
this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) this:SetBackdropBorderColor(unpack(E.media.bordercolor))
end) end)
HookScript(EventTraceTooltip, "OnShow", function() HookScript(EventTraceTooltip, "OnShow", function()
@@ -9,6 +9,7 @@ local SetDressUpBackground = SetDressUpBackground
local function LoadSkin() local function LoadSkin()
if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.dressingroom ~= true then return end if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.dressingroom ~= true then return end
local DressUpFrame = _G["DressUpFrame"]
E:StripTextures(DressUpFrame) E:StripTextures(DressUpFrame)
E:CreateBackdrop(DressUpFrame, "Transparent") E:CreateBackdrop(DressUpFrame, "Transparent")
E:Point(DressUpFrame.backdrop, "TOPLEFT", 10, -12) E:Point(DressUpFrame.backdrop, "TOPLEFT", 10, -12)
+1
View File
@@ -27,6 +27,7 @@ local function LoadSkin()
"VerbalHarassmentButton", "VerbalHarassmentButton",
} }
local HelpFrame = _G["HelpFrame"]
E:StripTextures(HelpFrame) E:StripTextures(HelpFrame)
E:CreateBackdrop(HelpFrame, "Transparent") E:CreateBackdrop(HelpFrame, "Transparent")
E:Point(HelpFrame.backdrop, "TOPLEFT", 6, -2) E:Point(HelpFrame.backdrop, "TOPLEFT", 6, -2)
+1
View File
@@ -16,6 +16,7 @@ local hooksecurefunc = hooksecurefunc
local function LoadSkin() local function LoadSkin()
if not E.private.skins.blizzard.enable or not E.private.skins.blizzard.inspect then return end if not E.private.skins.blizzard.enable or not E.private.skins.blizzard.inspect then return end
local InspectFrame = _G["InspectFrame"]
E:StripTextures(InspectFrame, true) E:StripTextures(InspectFrame, true)
E:CreateBackdrop(InspectFrame, "Transparent") E:CreateBackdrop(InspectFrame, "Transparent")
E:Point(InspectFrame.backdrop, "TOPLEFT", 10, -12) E:Point(InspectFrame.backdrop, "TOPLEFT", 10, -12)
+3 -3
View File
@@ -70,10 +70,10 @@ local function LoadSkin()
if quality then if quality then
lootButton.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality)) lootButton.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality))
else else
lootButton.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) lootButton.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
else else
lootButton.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) lootButton.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end end
end end
@@ -121,7 +121,7 @@ local function LoadRollSkin()
local statusBar = _G[frameName.."Timer"] local statusBar = _G[frameName.."Timer"]
E:StripTextures(statusBar) E:StripTextures(statusBar)
E:CreateBackdrop(statusBar, "Default") E:CreateBackdrop(statusBar, "Default")
statusBar:SetStatusBarTexture(E["media"].normTex) statusBar:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(statusBar) E:RegisterStatusBar(statusBar)
local decoration = _G[frameName.."Decoration"] local decoration = _G[frameName.."Decoration"]
+1
View File
@@ -11,6 +11,7 @@ local getn = table.getn
local function LoadSkin() local function LoadSkin()
if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.macro ~= true then return end if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.macro ~= true then return end
local MacroFrame = _G["MacroFrame"]
E:StripTextures(MacroFrame) E:StripTextures(MacroFrame)
E:CreateBackdrop(MacroFrame, "Transparent") E:CreateBackdrop(MacroFrame, "Transparent")
E:Point(MacroFrame.backdrop, "TOPLEFT", 10, -11) E:Point(MacroFrame.backdrop, "TOPLEFT", 10, -11)
+6 -6
View File
@@ -73,13 +73,13 @@ local function LoadSkin()
if quality then if quality then
button:SetBackdropBorderColor(GetItemQualityColor(quality)) button:SetBackdropBorderColor(GetItemQualityColor(quality))
else else
button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) button:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end end
elseif isGM then elseif isGM then
button:SetBackdropBorderColor(0, 0.56, 0.94) button:SetBackdropBorderColor(0, 0.56, 0.94)
else else
button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) button:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end end
@@ -123,12 +123,12 @@ local function LoadSkin()
if quality then if quality then
button:SetBackdropBorderColor(GetItemQualityColor(quality)) button:SetBackdropBorderColor(GetItemQualityColor(quality))
else else
button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) button:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
texture:SetTexCoord(unpack(E.TexCoords)) texture:SetTexCoord(unpack(E.TexCoords))
E:SetInside(texture) E:SetInside(texture)
else else
button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) button:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end) end)
@@ -189,12 +189,12 @@ local function LoadSkin()
if quality then if quality then
button:SetBackdropBorderColor(GetItemQualityColor(quality)) button:SetBackdropBorderColor(GetItemQualityColor(quality))
else else
button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) button:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
texture:SetTexCoord(unpack(E.TexCoords)) texture:SetTexCoord(unpack(E.TexCoords))
E:SetInside(texture) E:SetInside(texture)
else else
button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) button:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end end
end) end)
+6 -6
View File
@@ -30,7 +30,7 @@ local function LoadSkin()
else else
if MerchantNextPageButton:IsShown() and MerchantNextPageButton:IsEnabled() == 1 then if MerchantNextPageButton:IsShown() and MerchantNextPageButton:IsEnabled() == 1 then
MerchantNextPageButton_OnClick() MerchantNextPageButton_OnClick()
end end
end end
end) end)
@@ -112,15 +112,15 @@ local function LoadSkin()
itemName:SetTextColor(GetItemQualityColor(quality)) itemName:SetTextColor(GetItemQualityColor(quality))
itemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) itemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
else else
itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) itemButton:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
else else
itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) itemButton:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end end
HookScript(MerchantBuyBackItemItemButton, "OnEvent", function() HookScript(MerchantBuyBackItemItemButton, "OnEvent", function()
this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) this:SetBackdropBorderColor(unpack(E.media.bordercolor))
end) end)
local buybackName = GetBuybackItemInfo(GetNumBuybackItems()) local buybackName = GetBuybackItemInfo(GetNumBuybackItems())
@@ -130,7 +130,7 @@ local function LoadSkin()
MerchantBuyBackItemName:SetTextColor(GetItemQualityColor(quality)) MerchantBuyBackItemName:SetTextColor(GetItemQualityColor(quality))
MerchantBuyBackItemItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) MerchantBuyBackItemItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
else else
MerchantBuyBackItemItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) MerchantBuyBackItemItemButton:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end end
end end
@@ -150,7 +150,7 @@ local function LoadSkin()
itemName:SetTextColor(GetItemQualityColor(quality)) itemName:SetTextColor(GetItemQualityColor(quality))
itemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) itemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
else else
itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) itemButton:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end end
end end
@@ -40,7 +40,7 @@ local function LoadSkin()
E:StripTextures(mirrorTimer) E:StripTextures(mirrorTimer)
E:Size(mirrorTimer, 222, 18) E:Size(mirrorTimer, 222, 18)
mirrorTimer.label = text mirrorTimer.label = text
statusBar:SetStatusBarTexture(E["media"].normTex) statusBar:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(statusBar) E:RegisterStatusBar(statusBar)
E:CreateBackdrop(statusBar) E:CreateBackdrop(statusBar)
E:Size(statusBar, 222, 18) E:Size(statusBar, 222, 18)
@@ -9,6 +9,7 @@ local _G = _G
local function LoadSkin() local function LoadSkin()
if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.petition ~= true then return end if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.petition ~= true then return end
local PetitionFrame = _G["PetitionFrame"]
E:StripTextures(PetitionFrame, true) E:StripTextures(PetitionFrame, true)
E:CreateBackdrop(PetitionFrame, "Transparent") E:CreateBackdrop(PetitionFrame, "Transparent")
E:Point(PetitionFrame.backdrop, "TOPLEFT", 12, -17) E:Point(PetitionFrame.backdrop, "TOPLEFT", 12, -17)
+3 -3
View File
@@ -126,8 +126,8 @@ local function LoadSkin()
text:SetTextColor(GetItemQualityColor(quality)) text:SetTextColor(GetItemQualityColor(quality))
else else
if frame then if frame then
frame:SetBackdropBorderColor(unpack(E["media"].bordercolor)) frame:SetBackdropBorderColor(unpack(E.media.bordercolor))
frame.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) frame.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
text:SetTextColor(1, 1, 1) text:SetTextColor(1, 1, 1)
end end
@@ -140,7 +140,7 @@ local function LoadSkin()
E:Size(QuestRewardItemHighlight, 142, 40) E:Size(QuestRewardItemHighlight, 142, 40)
hooksecurefunc("QuestRewardItem_OnClick", function() hooksecurefunc("QuestRewardItem_OnClick", function()
QuestRewardItemHighlight:ClearAllPoints(); QuestRewardItemHighlight:ClearAllPoints()
E:SetOutside(QuestRewardItemHighlight, this:GetName().."IconTexture") E:SetOutside(QuestRewardItemHighlight, this:GetName().."IconTexture")
_G[this:GetName().."Name"]:SetTextColor(1, 1, 0) _G[this:GetName().."Name"]:SetTextColor(1, 1, 0)
+1 -1
View File
@@ -69,7 +69,7 @@ local function LoadSkin()
for _, v in pairs{"HealthBar", "ManaBar", "Target", "TargetTarget"} do for _, v in pairs{"HealthBar", "ManaBar", "Target", "TargetTarget"} do
local sBar = pfBName..v local sBar = pfBName..v
E:StripTextures(_G[sBar]) E:StripTextures(_G[sBar])
_G[sBar]:SetStatusBarTexture(E["media"].normTex) _G[sBar]:SetStatusBarTexture(E.media.normTex)
end end
E:Point(_G[pfBName.."ManaBar"], "TOP", "$parentHealthBar", "BOTTOM", 0, 0) E:Point(_G[pfBName.."ManaBar"], "TOP", "$parentHealthBar", "BOTTOM", 0, 0)
+4 -1
View File
@@ -6,10 +6,13 @@ local S = E:GetModule("Skins");
local _G = _G local _G = _G
local unpack = unpack local unpack = unpack
--WoW API / Variables --WoW API / Variables
local CreateFrame = CreateFrame
local hooksecurefunc = hooksecurefunc
local function LoadSkin() local function LoadSkin()
if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.spellbook ~= true then return end if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.spellbook ~= true then return end
local SpellBookFrame = _G["SpellBookFrame"]
E:StripTextures(SpellBookFrame, true) E:StripTextures(SpellBookFrame, true)
E:CreateBackdrop(SpellBookFrame, "Transparent") E:CreateBackdrop(SpellBookFrame, "Transparent")
E:Point(SpellBookFrame.backdrop, "TOPLEFT", 10, -12) E:Point(SpellBookFrame.backdrop, "TOPLEFT", 10, -12)
@@ -28,7 +31,7 @@ local function LoadSkin()
if currentPage > 1 then if currentPage > 1 then
PrevPageButton_OnClick() PrevPageButton_OnClick()
end end
else else
if currentPage < maxPages then if currentPage < maxPages then
NextPageButton_OnClick() NextPageButton_OnClick()
end end
+1
View File
@@ -13,6 +13,7 @@ local UnitExists = UnitExists
local function LoadSkin() local function LoadSkin()
if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.stable ~= true then return end if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.stable ~= true then return end
local PetStableFrame = _G["PetStableFrame"]
E:StripTextures(PetStableFrame) E:StripTextures(PetStableFrame)
E:Kill(PetStableFramePortrait) E:Kill(PetStableFramePortrait)
E:CreateBackdrop(PetStableFrame, "Transparent") E:CreateBackdrop(PetStableFrame, "Transparent")
+1
View File
@@ -10,6 +10,7 @@ local hooksecurefunc = hooksecurefunc
local function LoadSkin() local function LoadSkin()
if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.tabard ~= true then return end if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.tabard ~= true then return end
local TabardFrame = _G["TabardFrame"]
E:StripTextures(TabardFrame) E:StripTextures(TabardFrame)
E:Kill(TabardFramePortrait) E:Kill(TabardFramePortrait)
E:CreateBackdrop(TabardFrame, "Transparent") E:CreateBackdrop(TabardFrame, "Transparent")
+1
View File
@@ -12,6 +12,7 @@ local function LoadSkin()
UIPanelWindows["TalentFrame"] = {area = "left", pushable = 0, whileDead = 1} UIPanelWindows["TalentFrame"] = {area = "left", pushable = 0, whileDead = 1}
local PlayerTalentFrame = _G["PlayerTalentFrame"]
E:StripTextures(TalentFrame) E:StripTextures(TalentFrame)
E:CreateBackdrop(TalentFrame, "Transparent") E:CreateBackdrop(TalentFrame, "Transparent")
E:Point(TalentFrame.backdrop, "TOPLEFT", 13, -12) E:Point(TalentFrame.backdrop, "TOPLEFT", 13, -12)
+4
View File
@@ -1,6 +1,10 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins"); local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = _G
local function LoadSkin() local function LoadSkin()
if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.taxi ~= true then return end if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.taxi ~= true then return end
+2 -2
View File
@@ -14,7 +14,7 @@ local function LoadSkin()
S:HandleCloseButton(ItemRefCloseButton) S:HandleCloseButton(ItemRefCloseButton)
local GameTooltip = _G["GameTooltip"] local GameTooltip = _G["GameTooltip"]
local GameTooltipStatusBar = _G["GameTooltipStatusBar"] local GameTooltipStatusBar = _G["GameTooltipStatusBar"]
local tooltips = { local tooltips = {
GameTooltip, GameTooltip,
ItemRefTooltip, ItemRefTooltip,
@@ -37,7 +37,7 @@ local function LoadSkin()
TT:SecureHookScript(tt, "OnShow", "CheckBackdropColor") TT:SecureHookScript(tt, "OnShow", "CheckBackdropColor")
end end
GameTooltipStatusBar:SetStatusBarTexture(E["media"].normTex) GameTooltipStatusBar:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(GameTooltipStatusBar) E:RegisterStatusBar(GameTooltipStatusBar)
E:CreateBackdrop(GameTooltipStatusBar, "Transparent") E:CreateBackdrop(GameTooltipStatusBar, "Transparent")
GameTooltipStatusBar:ClearAllPoints() GameTooltipStatusBar:ClearAllPoints()
+5 -3
View File
@@ -6,14 +6,16 @@ local S = E:GetModule("Skins");
local _G = _G local _G = _G
local unpack = unpack local unpack = unpack
--WoW API / Variables --WoW API / Variables
local CreateFrame = CreateFrame
local hooksecurefunc = hooksecurefunc
local GetItemQualityColor = GetItemQualityColor local GetItemQualityColor = GetItemQualityColor
local GetTradePlayerItemInfo = GetTradePlayerItemInfo local GetTradePlayerItemInfo = GetTradePlayerItemInfo
local GetTradeTargetItemInfo = GetTradeTargetItemInfo local GetTradeTargetItemInfo = GetTradeTargetItemInfo
local hooksecurefunc = hooksecurefunc
local function LoadSkin() local function LoadSkin()
if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.trade ~= true then return end if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.trade ~= true then return end
local TradeFrame = _G["TradeFrame"]
E:StripTextures(TradeFrame, true) E:StripTextures(TradeFrame, true)
E:Width(TradeFrame, 400) E:Width(TradeFrame, 400)
E:CreateBackdrop(TradeFrame, "Transparent") E:CreateBackdrop(TradeFrame, "Transparent")
@@ -101,7 +103,7 @@ local function LoadSkin()
tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
end end
else else
tradeItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) tradeItemButton:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end) end)
@@ -117,7 +119,7 @@ local function LoadSkin()
tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality))
end end
else else
tradeItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) tradeItemButton:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end) end)
end end
+5 -4
View File
@@ -22,6 +22,7 @@ local function LoadSkin()
UIPanelWindows["TradeSkillFrame"] = {area = "doublewide", pushable = 0, whileDead = 1} UIPanelWindows["TradeSkillFrame"] = {area = "doublewide", pushable = 0, whileDead = 1}
local TradeSkillFrame = _G["TradeSkillFrame"]
E:StripTextures(TradeSkillFrame, true) E:StripTextures(TradeSkillFrame, true)
E:CreateBackdrop(TradeSkillFrame, "Transparent") E:CreateBackdrop(TradeSkillFrame, "Transparent")
TradeSkillFrame.backdrop:SetPoint("TOPLEFT", 10, -12) TradeSkillFrame.backdrop:SetPoint("TOPLEFT", 10, -12)
@@ -47,7 +48,7 @@ local function LoadSkin()
E:Size(TradeSkillRankFrame, 420, 18) E:Size(TradeSkillRankFrame, 420, 18)
TradeSkillRankFrame:ClearAllPoints() TradeSkillRankFrame:ClearAllPoints()
TradeSkillRankFrame:SetPoint("TOP", -10, -38) TradeSkillRankFrame:SetPoint("TOP", -10, -38)
TradeSkillRankFrame:SetStatusBarTexture(E["media"].normTex) TradeSkillRankFrame:SetStatusBarTexture(E.media.normTex)
E:RegisterStatusBar(TradeSkillRankFrame) E:RegisterStatusBar(TradeSkillRankFrame)
TradeSkillRankFrameSkillName:Hide() TradeSkillRankFrameSkillName:Hide()
@@ -224,7 +225,7 @@ local function LoadSkin()
TradeSkillSkillIcon:SetBackdropBorderColor(GetItemQualityColor(quality)) TradeSkillSkillIcon:SetBackdropBorderColor(GetItemQualityColor(quality))
TradeSkillSkillName:SetTextColor(GetItemQualityColor(quality)) TradeSkillSkillName:SetTextColor(GetItemQualityColor(quality))
else else
TradeSkillSkillIcon:SetBackdropBorderColor(unpack(E["media"].bordercolor)) TradeSkillSkillIcon:SetBackdropBorderColor(unpack(E.media.bordercolor))
TradeSkillSkillName:SetTextColor(1, 1, 1) TradeSkillSkillName:SetTextColor(1, 1, 1)
end end
end end
@@ -248,8 +249,8 @@ local function LoadSkin()
name:SetTextColor(GetItemQualityColor(quality)) name:SetTextColor(GetItemQualityColor(quality))
end end
else else
reagent:SetBackdropBorderColor(unpack(E["media"].bordercolor)) reagent:SetBackdropBorderColor(unpack(E.media.bordercolor))
icon.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) icon.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
end end
end end
@@ -1,9 +1,14 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local S = E:GetModule("Skins"); local S = E:GetModule("Skins");
--Cache global variables
--Lua functions
local _G = _G
local function LoadSkin() local function LoadSkin()
if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.worldmap ~= true then return end if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.worldmap ~= true then return end
local WorldMapFrame = _G["WorldMapFrame"]
E:StripTextures(WorldMapFrame) E:StripTextures(WorldMapFrame)
E:CreateBackdrop(WorldMapPositioningGuide, "Transparent") E:CreateBackdrop(WorldMapPositioningGuide, "Transparent")
+13 -13
View File
@@ -38,12 +38,12 @@ end
function S:SetModifiedBackdrop() function S:SetModifiedBackdrop()
if this.backdrop then this = this.backdrop end if this.backdrop then this = this.backdrop end
this:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor)) this:SetBackdropBorderColor(unpack(E.media.rgbvaluecolor))
end end
function S:SetOriginalBackdrop() function S:SetOriginalBackdrop()
if this.backdrop then this = this.backdrop end if this.backdrop then this = this.backdrop end
this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) this:SetBackdropBorderColor(unpack(E.media.bordercolor))
end end
function S:HandleButton(f, strip) function S:HandleButton(f, strip)
@@ -389,7 +389,7 @@ function S:HandleSliderFrame(frame)
frame:SetBackdrop(nil) frame:SetBackdrop(nil)
end end
end) end)
frame:SetThumbTexture(E["media"].blankTex) frame:SetThumbTexture(E.media.blankTex)
frame:GetThumbTexture():SetVertexColor(0.3, 0.3, 0.3) frame:GetThumbTexture():SetVertexColor(0.3, 0.3, 0.3)
E:Size(frame:GetThumbTexture(), SIZE-2) E:Size(frame:GetThumbTexture(), SIZE-2)
if orientation == "VERTICAL" then if orientation == "VERTICAL" then
@@ -460,9 +460,9 @@ function S:ADDON_LOADED()
self.addonsToLoad[arg1] = nil self.addonsToLoad[arg1] = nil
elseif self.addonCallbacks[arg1] then elseif self.addonCallbacks[arg1] then
--Fire events to the skins that rely on this addon --Fire events to the skins that rely on this addon
for index, event in ipairs(self.addonCallbacks[arg1]["CallPriority"]) do for index, event in ipairs(self.addonCallbacks[arg1].CallPriority) do
self.addonCallbacks[arg1][event] = nil self.addonCallbacks[arg1][event] = nil
self.addonCallbacks[arg1]["CallPriority"][index] = nil self.addonCallbacks[arg1].CallPriority[index] = nil
E.callbacks:Fire(event) E.callbacks:Fire(event)
end end
end end
@@ -475,9 +475,9 @@ function S:ADDON_LOADED()
self.addonsToLoad[arg1]() self.addonsToLoad[arg1]()
self.addonsToLoad[arg1] = nil self.addonsToLoad[arg1] = nil
elseif self.addonCallbacks[arg1] then elseif self.addonCallbacks[arg1] then
for index, event in ipairs(self.addonCallbacks[arg1]["CallPriority"]) do for index, event in ipairs(self.addonCallbacks[arg1].CallPriority) do
self.addonCallbacks[arg1][event] = nil self.addonCallbacks[arg1][event] = nil
self.addonCallbacks[arg1]["CallPriority"][index] = nil self.addonCallbacks[arg1].CallPriority[index] = nil
E.callbacks:Fire(event) E.callbacks:Fire(event)
end end
end end
@@ -536,7 +536,7 @@ function S:AddCallbackForAddon(addonName, eventName, loadFunc, forceLoad, bypass
else else
--Insert eventName in this addons' registry --Insert eventName in this addons' registry
self.addonCallbacks[addonName][eventName] = true self.addonCallbacks[addonName][eventName] = true
tinsert(self.addonCallbacks[addonName]["CallPriority"], eventName) tinsert(self.addonCallbacks[addonName].CallPriority, eventName)
end end
end end
@@ -559,7 +559,7 @@ function S:AddCallback(eventName, loadFunc)
--Add event name to registry --Add event name to registry
self.nonAddonCallbacks[eventName] = true self.nonAddonCallbacks[eventName] = true
tinsert(self.nonAddonCallbacks["CallPriority"], eventName) tinsert(self.nonAddonCallbacks.CallPriority, eventName)
--Register loadFunc to be called when event is fired --Register loadFunc to be called when event is fired
E.RegisterCallback(E, eventName, loadFunc) E.RegisterCallback(E, eventName, loadFunc)
@@ -571,17 +571,17 @@ function S:Initialize()
--Fire events for Blizzard addons that are already loaded --Fire events for Blizzard addons that are already loaded
for addon in pairs(self.addonCallbacks) do for addon in pairs(self.addonCallbacks) do
if IsAddOnLoaded(addon) then if IsAddOnLoaded(addon) then
for index, event in ipairs(self.addonCallbacks[addon]["CallPriority"]) do for index, event in ipairs(self.addonCallbacks[addon].CallPriority) do
self.addonCallbacks[addon][event] = nil self.addonCallbacks[addon][event] = nil
self.addonCallbacks[addon]["CallPriority"][index] = nil self.addonCallbacks[addon].CallPriority[index] = nil
E.callbacks:Fire(event) E.callbacks:Fire(event)
end end
end end
end end
--Fire event for all skins that doesn't rely on a Blizzard addon --Fire event for all skins that doesn't rely on a Blizzard addon
for index, event in ipairs(self.nonAddonCallbacks["CallPriority"]) do for index, event in ipairs(self.nonAddonCallbacks.CallPriority) do
self.nonAddonCallbacks[event] = nil self.nonAddonCallbacks[event] = nil
self.nonAddonCallbacks["CallPriority"][index] = nil self.nonAddonCallbacks.CallPriority[index] = nil
E.callbacks:Fire(event) E.callbacks:Fire(event)
end end
+4 -4
View File
@@ -97,7 +97,7 @@ function TT:GameTooltip_SetDefaultAnchor(tt, parent)
end end
if self.db.cursorAnchor then if self.db.cursorAnchor then
tt:SetOwner(parent, "ANCHOR_CURSOR") tt:SetOwner(parent, "ANCHOR_CURSOR")
return; return
else else
tt:SetOwner(parent, "ANCHOR_NONE") tt:SetOwner(parent, "ANCHOR_NONE")
end end
@@ -207,10 +207,10 @@ function TT:UPDATE_MOUSEOVER_UNIT(_, unit)
local unitTarget = unit.."target" local unitTarget = unit.."target"
if self.db.targetInfo and unit ~= "player" and UnitExists(unitTarget) then if self.db.targetInfo and unit ~= "player" and UnitExists(unitTarget) then
local targetColor; local targetColor
if UnitIsPlayer(unitTarget) then if UnitIsPlayer(unitTarget) then
local _, class = UnitClass(unitTarget); local _, class = UnitClass(unitTarget)
targetColor = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]; targetColor = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
else else
local reaction = UnitReaction(unitTarget, "player") or 4 local reaction = UnitReaction(unitTarget, "player") or 4
targetColor = E.db.tooltip.useCustomFactionColors and E.db.tooltip.factionColors[reaction] or FACTION_BAR_COLORS[reaction] targetColor = E.db.tooltip.useCustomFactionColors and E.db.tooltip.factionColors[reaction] or FACTION_BAR_COLORS[reaction]
@@ -259,17 +259,17 @@ function UF:HeaderConfig(header, configMode)
end end
end end
UF["headerFunctions"][header.groupName]:AdjustVisibility(header) UF.headerFunctions[header.groupName]:AdjustVisibility(header)
end end
function UF:PLAYER_REGEN_DISABLED() function UF:PLAYER_REGEN_DISABLED()
for _, header in pairs(UF["headers"]) do for _, header in pairs(UF.headers) do
if header.forceShow then if header.forceShow then
self:HeaderConfig(header) self:HeaderConfig(header)
end end
end end
for _, unit in pairs(UF["units"]) do for _, unit in pairs(UF.units) do
local frame = self[unit] local frame = self[unit]
if frame and frame.forceShow then if frame and frame.forceShow then
self:UnforceShow(frame) self:UnforceShow(frame)
@@ -24,7 +24,7 @@ function UF:Construct_AuraBars()
E:SetTemplate(self, "Default", nil, nil, UF.thinBorders, true) E:SetTemplate(self, "Default", nil, nil, UF.thinBorders, true)
local inset = UF.thinBorders and E.mult or nil local inset = UF.thinBorders and E.mult or nil
E:SetInside(bar, self, inset, inset) E:SetInside(bar, self, inset, inset)
UF["statusbars"][bar] = true UF.statusbars[bar] = true
UF:Update_StatusBar(bar) UF:Update_StatusBar(bar)
UF:Configure_FontString(bar.spelltime) UF:Configure_FontString(bar.spelltime)
+4 -4
View File
@@ -79,7 +79,7 @@ function UF:Construct_AuraIcon(button)
if auraName then if auraName then
E:Print(format(L["The spell '%s' has been added to the Blacklist unitframe aura filter."], auraName)) E:Print(format(L["The spell '%s' has been added to the Blacklist unitframe aura filter."], auraName))
E.global["unitframe"]["aurafilters"]["Blacklist"]["spells"][auraName] = { E.global.unitframe.aurafilters.Blacklist.spells[auraName] = {
["enable"] = true, ["enable"] = true,
["priority"] = 0, ["priority"] = 0,
} }
@@ -319,8 +319,8 @@ function UF:UpdateAuraIconSettings(auras, noCycle)
if not frame.db then return end if not frame.db then return end
local db = frame.db[type] local db = frame.db[type]
local unitframeFont = LSM:Fetch("font", E.db["unitframe"].font) local unitframeFont = LSM:Fetch("font", E.db.unitframe.font)
local unitframeFontOutline = E.db["unitframe"].fontOutline local unitframeFontOutline = E.db.unitframe.fontOutline
local index = 1 local index = 1
auras.db = db auras.db = db
if db then if db then
@@ -421,7 +421,7 @@ function UF:UpdateAuraTimer(elapsed)
if self.text:GetFont() then if self.text:GetFont() then
self.text:SetText(format("%s%s|r", E.TimeColors[formatid], E.TimeFormats[formatid][2]), timervalue) self.text:SetText(format("%s%s|r", E.TimeColors[formatid], E.TimeFormats[formatid][2]), timervalue)
elseif self:GetParent():GetParent().db then elseif self:GetParent():GetParent().db then
E:FontTemplate(self.text, LSM:Fetch("font", E.db["unitframe"].font), self:GetParent():GetParent().db[self:GetParent().type].fontSize, E.db["unitframe"].fontOutline) E:FontTemplate(self.text, LSM:Fetch("font", E.db.unitframe.font), self:GetParent():GetParent().db[self:GetParent().type].fontSize, E.db.unitframe.fontOutline)
self.text:SetText(format("%s%s|r", E.TimeColors[formatid], E.TimeFormats[formatid][2]), timervalue) self.text:SetText(format("%s%s|r", E.TimeColors[formatid], E.TimeFormats[formatid][2]), timervalue)
end end
end end
@@ -30,7 +30,7 @@ local INVERT_ANCHORPOINT = {
function UF:Construct_Castbar(frame, moverName) function UF:Construct_Castbar(frame, moverName)
local castbar = CreateFrame("StatusBar", nil, frame) local castbar = CreateFrame("StatusBar", nil, frame)
castbar:SetFrameLevel(frame.RaisedElementParent:GetFrameLevel() + 30) --Make it appear above everything else castbar:SetFrameLevel(frame.RaisedElementParent:GetFrameLevel() + 30) --Make it appear above everything else
self["statusbars"][castbar] = true self.statusbars[castbar] = true
castbar.CustomDelayText = self.CustomCastDelayText castbar.CustomDelayText = self.CustomCastDelayText
castbar.CustomTimeText = self.CustomTimeText castbar.CustomTimeText = self.CustomTimeText
castbar.PostCastStart = self.PostCastStart castbar.PostCastStart = self.PostCastStart
+2 -2
View File
@@ -13,7 +13,7 @@ assert(ElvUF, "ElvUI was unable to locate oUF.")
function UF:Construct_PowerBar(frame, bg, text, textPos) function UF:Construct_PowerBar(frame, bg, text, textPos)
local power = CreateFrame("StatusBar", nil, frame) local power = CreateFrame("StatusBar", nil, frame)
UF["statusbars"][power] = true UF.statusbars[power] = true
power.PostUpdate = self.PostUpdatePower power.PostUpdate = self.PostUpdatePower
@@ -22,7 +22,7 @@ function UF:Construct_PowerBar(frame, bg, text, textPos)
if bg then if bg then
power.bg = power:CreateTexture(nil, "BORDER") power.bg = power:CreateTexture(nil, "BORDER")
power.bg:SetAllPoints() power.bg:SetAllPoints()
power.bg:SetTexture(E["media"].blankTex) power.bg:SetTexture(E.media.blankTex)
power.bg.multiplier = 0.2 power.bg.multiplier = 0.2
end end
+3 -3
View File
@@ -35,7 +35,7 @@ function UF:Construct_PartyFrames()
UF:Update_StatusBars() UF:Update_StatusBars()
UF:Update_FontStrings() UF:Update_FontStrings()
UF:Update_PartyFrames(self, UF.db["units"]["party"]) UF:Update_PartyFrames(self, UF.db.units.party)
return self; return self;
end end
@@ -59,7 +59,7 @@ function UF:Update_PartyHeader(header)
header:RegisterEvent("PARTY_MEMBERS_CHANGED") header:RegisterEvent("PARTY_MEMBERS_CHANGED")
header:RegisterEvent("RAID_ROSTER_UPDATE") header:RegisterEvent("RAID_ROSTER_UPDATE")
header:SetScript("OnEvent", UF["PartySmartVisibility"]) header:SetScript("OnEvent", UF.PartySmartVisibility)
header.positioned = true header.positioned = true
end end
@@ -136,4 +136,4 @@ function UF:Update_PartyFrames(frame, db)
frame:UpdateAllElements("ElvUI_UpdateAllElements") frame:UpdateAllElements("ElvUI_UpdateAllElements")
end end
UF["headerstoload"]["party"] = true UF.headerstoload.party = true
+3 -3
View File
@@ -37,7 +37,7 @@ function UF:Construct_RaidFrames()
UF:Update_FontStrings() UF:Update_FontStrings()
self.unitframeType = "raid" self.unitframeType = "raid"
UF:Update_RaidFrames(self, UF.db["units"]["raid"]) UF:Update_RaidFrames(self, UF.db.units.raid)
return self return self
end end
@@ -61,7 +61,7 @@ function UF:Update_RaidHeader(header)
header:RegisterEvent("PARTY_MEMBERS_CHANGED") header:RegisterEvent("PARTY_MEMBERS_CHANGED")
header:RegisterEvent("RAID_ROSTER_UPDATE") header:RegisterEvent("RAID_ROSTER_UPDATE")
header:SetScript("OnEvent", UF["RaidSmartVisibility"]) header:SetScript("OnEvent", UF.RaidSmartVisibility)
header.positioned = true header.positioned = true
end end
@@ -140,4 +140,4 @@ function UF:Update_RaidFrames(frame, db)
frame:UpdateAllElements("ElvUI_UpdateAllElements") frame:UpdateAllElements("ElvUI_UpdateAllElements")
end end
UF["headerstoload"]["raid"] = true UF.headerstoload.raid = true
+6 -6
View File
@@ -161,7 +161,7 @@ ElvUF.Tags.Methods["health:deficit-percent:name"] = function(unit)
if (deficit > 0 and currentHealth > 0) then if (deficit > 0 and currentHealth > 0) then
return _TAGS["health:percent-nostatus"](unit); return _TAGS["health:percent-nostatus"](unit);
else else
return _TAGS["name"](unit); return _TAGS.name(unit);
end end
end end
@@ -215,11 +215,11 @@ end
ElvUF.Tags.Events["powercolor"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_MAXPOWER" ElvUF.Tags.Events["powercolor"] = "UNIT_ENERGY UNIT_FOCUS UNIT_MANA UNIT_RAGE UNIT_RUNIC_POWER UNIT_MAXPOWER"
ElvUF.Tags.Methods["powercolor"] = function(unit) ElvUF.Tags.Methods["powercolor"] = function(unit)
local color = ElvUF["colors"].power[UnitPowerType(unit)] local color = ElvUF.colors.power[UnitPowerType(unit)]
if color then if color then
return Hex(color[1], color[2], color[3]) return Hex(color[1], color[2], color[3])
else else
return Hex(unpack(ElvUF["colors"].power[0])) return Hex(unpack(ElvUF.colors.power[0]))
end end
end end
@@ -271,8 +271,8 @@ ElvUF.Tags.Methods["power:max"] = function(unit)
end end
ElvUF.Tags.Methods["manacolor"] = function() ElvUF.Tags.Methods["manacolor"] = function()
local altR, altG, altB = PowerBarColor["MANA"].r, PowerBarColor["MANA"].g, PowerBarColor["MANA"].b local altR, altG, altB = PowerBarColor.MANA.r, PowerBarColor.MANA.g, PowerBarColor.MANA.b
local color = ElvUF["colors"].power["MANA"] local color = ElvUF.colors.power[0]
if color then if color then
return Hex(color[1], color[2], color[3]) return Hex(color[1], color[2], color[3])
else else
@@ -358,7 +358,7 @@ ElvUF.Tags.Methods["namecolor"] = function(unit)
if not class then return "" end if not class then return "" end
return Hex(class[1], class[2], class[3]) return Hex(class[1], class[2], class[3])
elseif (unitReaction) then elseif (unitReaction) then
local reaction = ElvUF["colors"].reaction[unitReaction] local reaction = ElvUF.colors.reaction[unitReaction]
return Hex(reaction[1], reaction[2], reaction[3]) return Hex(reaction[1], reaction[2], reaction[3])
else else
return "|cFFC2C2C2" return "|cFFC2C2C2"
+65 -65
View File
@@ -24,37 +24,37 @@ local ns = oUF
ElvUF = ns.oUF ElvUF = ns.oUF
assert(ElvUF, "ElvUI was unable to locate oUF.") assert(ElvUF, "ElvUI was unable to locate oUF.")
UF["headerstoload"] = {} UF.headerstoload = {}
UF["unitstoload"] = {} UF.unitstoload = {}
UF["groupPrototype"] = {} UF.groupPrototype = {}
UF["headerPrototype"] = {} UF.headerPrototype = {}
UF["headers"] = {} UF.headers = {}
UF["units"] = {} UF.units = {}
UF["statusbars"] = {} UF.statusbars = {}
UF["fontstrings"] = {} UF.fontstrings = {}
UF["badHeaderPoints"] = { UF.badHeaderPoints = {
["TOP"] = "BOTTOM", ["TOP"] = "BOTTOM",
["LEFT"] = "RIGHT", ["LEFT"] = "RIGHT",
["BOTTOM"] = "TOP", ["BOTTOM"] = "TOP",
["RIGHT"] = "LEFT" ["RIGHT"] = "LEFT"
} }
UF["headerFunctions"] = {} UF.headerFunctions = {}
UF["classMaxResourceBar"] = { UF.classMaxResourceBar = {
["DRUID"] = 1 ["DRUID"] = 1
} }
UF["mapIDs"] = { UF.mapIDs = {
[443] = 10, -- Warsong Gulch [443] = 10, -- Warsong Gulch
[461] = 15, -- Arathi Basin [461] = 15, -- Arathi Basin
[401] = 40, -- Alterac Valley [401] = 40, -- Alterac Valley
[566] = 15, -- Eye of the Storm [566] = 15, -- Eye of the Storm
} }
UF["headerGroupBy"] = { UF.headerGroupBy = {
["CLASS"] = function(header) ["CLASS"] = function(header)
header:SetAttribute("groupingOrder", "DRUID,HUNTER,MAGE,PALADIN,PRIEST,SHAMAN,WARLOCK,WARRIOR") header:SetAttribute("groupingOrder", "DRUID,HUNTER,MAGE,PALADIN,PRIEST,SHAMAN,WARLOCK,WARRIOR")
header:SetAttribute("sortMethod", "NAME") header:SetAttribute("sortMethod", "NAME")
@@ -325,7 +325,7 @@ end
function UF:Update_StatusBars() function UF:Update_StatusBars()
local statusBarTexture = LSM:Fetch("statusbar", self.db.statusbar) local statusBarTexture = LSM:Fetch("statusbar", self.db.statusbar)
for statusbar in pairs(UF["statusbars"]) do for statusbar in pairs(UF.statusbars) do
if statusbar and statusbar:GetObjectType() == "StatusBar" and not statusbar.isTransparent then if statusbar and statusbar:GetObjectType() == "StatusBar" and not statusbar.isTransparent then
statusbar:SetStatusBarTexture(statusBarTexture) statusbar:SetStatusBarTexture(statusBarTexture)
elseif statusbar and statusbar:GetObjectType() == "Texture" then elseif statusbar and statusbar:GetObjectType() == "Texture" then
@@ -344,24 +344,24 @@ end
function UF:Update_FontStrings() function UF:Update_FontStrings()
local stringFont = LSM:Fetch("font", self.db.font) local stringFont = LSM:Fetch("font", self.db.font)
for font in pairs(UF["fontstrings"]) do for font in pairs(UF.fontstrings) do
E:FontTemplate(font, stringFont, self.db.fontSize, self.db.fontOutline) E:FontTemplate(font, stringFont, self.db.fontSize, self.db.fontOutline)
end end
end end
function UF:Configure_FontString(obj) function UF:Configure_FontString(obj)
UF["fontstrings"][obj] = true UF.fontstrings[obj] = true
E:FontTemplate(obj) --This is temporary. E:FontTemplate(obj) --This is temporary.
end end
function UF:Update_AllFrames() function UF:Update_AllFrames()
if E.private["unitframe"].enable ~= true then return; end if E.private.unitframe.enable ~= true then return; end
self:UpdateColors() self:UpdateColors()
self:Update_FontStrings() self:Update_FontStrings()
self:Update_StatusBars() self:Update_StatusBars()
for unit in pairs(self["units"]) do for unit in pairs(self.units) do
if self.db["units"][unit].enable then if self.db.units[unit].enable then
self[unit]:Enable() self[unit]:Enable()
self[unit]:Update() self[unit]:Update()
E:EnableMover(self[unit].mover:GetName()) E:EnableMover(self[unit].mover:GetName())
@@ -519,9 +519,9 @@ end
function UF.groupPrototype:Update(self) function UF.groupPrototype:Update(self)
local group = self.groupName local group = self.groupName
UF[group].db = UF.db["units"][group] UF[group].db = UF.db.units[group]
for i = 1, getn(self.groups) do for i = 1, getn(self.groups) do
self.groups[i].db = UF.db["units"][group] self.groups[i].db = UF.db.units[group]
self.groups[i]:Update() self.groups[i]:Update()
end end
end end
@@ -548,7 +548,7 @@ end
function UF.groupPrototype:UpdateHeader(self) function UF.groupPrototype:UpdateHeader(self)
local group = self.groupName; local group = self.groupName;
UF["Update_"..E:StringTitle(group).."Header"](UF, self, UF.db["units"][group]); UF["Update_"..E:StringTitle(group).."Header"](UF, self, UF.db.units[group]);
end end
function UF.headerPrototype:ClearChildPoints() function UF.headerPrototype:ClearChildPoints()
@@ -560,7 +560,7 @@ end
function UF.headerPrototype:Update(isForced) function UF.headerPrototype:Update(isForced)
local group = self.groupName local group = self.groupName
local db = UF.db["units"][group] local db = UF.db.units[group]
local i = 1 local i = 1
local child = self:GetAttribute("child" .. i) local child = self:GetAttribute("child" .. i)
@@ -609,7 +609,7 @@ end
function UF:CreateHeader(parent, groupFilter, overrideName, template, groupName, headerTemplate) function UF:CreateHeader(parent, groupFilter, overrideName, template, groupName, headerTemplate)
local group = parent.groupName or groupName local group = parent.groupName or groupName
local db = UF.db["units"][group] local db = UF.db.units[group]
ElvUF:SetActiveStyle("ElvUF_"..E:StringTitle(group)) ElvUF:SetActiveStyle("ElvUF_"..E:StringTitle(group))
local header = ElvUF:SpawnHeader(overrideName, headerTemplate, nil, local header = ElvUF:SpawnHeader(overrideName, headerTemplate, nil,
"groupFilter", groupFilter, "groupFilter", groupFilter,
@@ -630,7 +630,7 @@ function UF:CreateHeader(parent, groupFilter, overrideName, template, groupName,
end end
function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdate, headerTemplate) function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdate, headerTemplate)
local db = self.db["units"][group] local db = self.db.units[group]
local numGroups = db.numGroups local numGroups = db.numGroups
if not self[group] then if not self[group] then
@@ -645,16 +645,16 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat
self[group].groupName = group self[group].groupName = group
self[group].template = self[group].template or template self[group].template = self[group].template or template
self[group].headerTemplate = self[group].headerTemplate or headerTemplate self[group].headerTemplate = self[group].headerTemplate or headerTemplate
if not UF["headerFunctions"][group] then UF["headerFunctions"][group] = {} end if not UF.headerFunctions[group] then UF.headerFunctions[group] = {} end
for k, v in pairs(self.groupPrototype) do for k, v in pairs(self.groupPrototype) do
UF["headerFunctions"][group][k] = v UF.headerFunctions[group][k] = v
end end
else else
self[group] = self:CreateHeader(E.UIParent, groupFilter, "ElvUF_"..E:StringTitle(group), template, group, headerTemplate) self[group] = self:CreateHeader(E.UIParent, groupFilter, "ElvUF_"..E:StringTitle(group), template, group, headerTemplate)
end end
self[group].db = db self[group].db = db
self["headers"][group] = self[group] self.headers[group] = self[group]
self[group]:Show() self[group]:Show()
end end
@@ -671,17 +671,17 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat
end end
end end
UF["headerFunctions"][group]:AdjustVisibility(self[group]) UF.headerFunctions[group]:AdjustVisibility(self[group])
if headerUpdate or not self[group].mover then if headerUpdate or not self[group].mover then
UF["headerFunctions"][group]:Configure_Groups(self[group]) UF.headerFunctions[group]:Configure_Groups(self[group])
if not self[group].isForced and not self[group].blockVisibilityChanges then if not self[group].isForced and not self[group].blockVisibilityChanges then
-- RegisterStateDriver(self[group], "visibility", db.visibility) -- RegisterStateDriver(self[group], "visibility", db.visibility)
end end
else else
UF["headerFunctions"][group]:Configure_Groups(self[group]) UF.headerFunctions[group]:Configure_Groups(self[group])
UF["headerFunctions"][group]:UpdateHeader(self[group]) UF.headerFunctions[group]:UpdateHeader(self[group])
UF["headerFunctions"][group]:Update(self[group]) UF.headerFunctions[group]:Update(self[group])
end end
if db.enable then if db.enable then
@@ -700,9 +700,9 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat
else else
self[group].db = db self[group].db = db
if not UF["headerFunctions"][group] then UF["headerFunctions"][group] = {} end if not UF.headerFunctions[group] then UF.headerFunctions[group] = {} end
UF["headerFunctions"][group]["Update"] = function() UF.headerFunctions[group]["Update"] = function()
local db = UF.db["units"][group] local db = UF.db.units[group]
if db.enable ~= true then if db.enable ~= true then
--UnregisterStateDriver(UF[group], "visibility") --UnregisterStateDriver(UF[group], "visibility")
UF[group]:Hide() UF[group]:Hide()
@@ -715,14 +715,14 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat
for i = 1, UF[group]:GetNumChildren() do for i = 1, UF[group]:GetNumChildren() do
local child = select(i, UF[group]:GetChildren()) local child = select(i, UF[group]:GetChildren())
UF["Update_"..E:StringTitle(group).."Frames"](UF, child, UF.db["units"][group]) UF["Update_"..E:StringTitle(group).."Frames"](UF, child, UF.db.units[group])
if _G[child:GetName().."Target"] then if _G[child:GetName().."Target"] then
UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Target"], UF.db["units"][group]) UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Target"], UF.db.units[group])
end end
if _G[child:GetName().."Pet"] then if _G[child:GetName().."Pet"] then
UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Pet"], UF.db["units"][group]) UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Pet"], UF.db.units[group])
end end
end end
@@ -732,7 +732,7 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat
if headerUpdate then if headerUpdate then
UF["Update_"..E:StringTitle(group).."Header"](self, self[group], db) UF["Update_"..E:StringTitle(group).."Header"](self, self[group], db)
else else
UF["headerFunctions"][group]:Update(self[group]) UF.headerFunctions[group]:Update(self[group])
end end
end end
end end
@@ -749,14 +749,14 @@ function UF:CreateAndUpdateUF(unit)
frameName = gsub(frameName, "t(arget)", "T%1") frameName = gsub(frameName, "t(arget)", "T%1")
if not self[unit] then if not self[unit] then
self[unit] = ElvUF:Spawn(unit, "ElvUF_"..frameName) self[unit] = ElvUF:Spawn(unit, "ElvUF_"..frameName)
self["units"][unit] = unit self.units[unit] = unit
end end
self[unit].Update = function() self[unit].Update = function()
UF["Update_"..frameName.."Frame"](self, self[unit], self.db["units"][unit]) UF["Update_"..frameName.."Frame"](self, self[unit], self.db.units[unit])
end end
if self.db["units"][unit].enable then if self.db.units[unit].enable then
self[unit]:Enable() self[unit]:Enable()
self[unit].Update() self[unit].Update()
E:EnableMover(self[unit].mover:GetName()) E:EnableMover(self[unit].mover:GetName())
@@ -767,12 +767,12 @@ function UF:CreateAndUpdateUF(unit)
end end
function UF:LoadUnits() function UF:LoadUnits()
for _, unit in pairs(self["unitstoload"]) do for _, unit in pairs(self.unitstoload) do
self:CreateAndUpdateUF(unit) self:CreateAndUpdateUF(unit)
end end
self["unitstoload"] = nil self.unitstoload = nil
for group, groupOptions in pairs(self["headerstoload"]) do for group, groupOptions in pairs(self.headerstoload) do
local groupFilter, template, headerTemplate local groupFilter, template, headerTemplate
if type(groupOptions) == "table" then if type(groupOptions) == "table" then
groupFilter, template, headerTemplate = unpack(groupOptions) groupFilter, template, headerTemplate = unpack(groupOptions)
@@ -780,7 +780,7 @@ function UF:LoadUnits()
self:CreateAndUpdateHeaderGroup(group, groupFilter, template, nil, headerTemplate) self:CreateAndUpdateHeaderGroup(group, groupFilter, template, nil, headerTemplate)
end end
self["headerstoload"] = nil self.headerstoload = nil
end end
function UF:UpdateAllHeaders(event) function UF:UpdateAllHeaders(event)
@@ -796,15 +796,15 @@ function UF:UpdateAllHeaders(event)
end end
end end
if E.private["unitframe"]["disabledBlizzardFrames"].party then if E.private.unitframe.disabledBlizzardFrames.party then
ElvUF:DisableBlizzard("party") ElvUF:DisableBlizzard("party")
end end
for group, header in pairs(self["headers"]) do for group, header in pairs(self.headers) do
if header.numGroups then if header.numGroups then
UF["headerFunctions"][group]:UpdateHeader(header) UF.headerFunctions[group]:UpdateHeader(header)
end end
UF["headerFunctions"][group]:Update(header) UF.headerFunctions[group]:Update(header)
if group == "party" or group == "raid" then if group == "party" or group == "raid" then
--Update BuffIndicators on profile change as they might be using profile specific data --Update BuffIndicators on profile change as they might be using profile specific data
@@ -851,19 +851,19 @@ end
function ElvUF:DisableBlizzard(unit) function ElvUF:DisableBlizzard(unit)
if not unit then return end if not unit then return end
if(unit == "player") and E.private["unitframe"]["disabledBlizzardFrames"].player then if(unit == "player") and E.private.unitframe.disabledBlizzardFrames.player then
HandleFrame(PlayerFrame) HandleFrame(PlayerFrame)
elseif(unit == "pet") and E.private["unitframe"]["disabledBlizzardFrames"].player then elseif(unit == "pet") and E.private.unitframe.disabledBlizzardFrames.player then
HandleFrame(PetFrame) HandleFrame(PetFrame)
elseif(unit == "target") and E.private["unitframe"]["disabledBlizzardFrames"].target then elseif(unit == "target") and E.private.unitframe.disabledBlizzardFrames.target then
HandleFrame(TargetFrame) HandleFrame(TargetFrame)
HandleFrame(ComboFrame) HandleFrame(ComboFrame)
-- elseif(unit == "focus") and E.private["unitframe"]["disabledBlizzardFrames"].focus then -- elseif(unit == "focus") and E.private.unitframe.disabledBlizzardFrames.focus then
-- HandleFrame(FocusFrame) -- HandleFrame(FocusFrame)
-- HandleFrame(FocusFrameToT) -- HandleFrame(FocusFrameToT)
elseif(unit == "targettarget") and E.private["unitframe"]["disabledBlizzardFrames"].target then elseif(unit == "targettarget") and E.private.unitframe.disabledBlizzardFrames.target then
HandleFrame(TargetofTargetFrame) HandleFrame(TargetofTargetFrame)
elseif string.match(unit, "(party)%d?$") == "party" and E.private["unitframe"]["disabledBlizzardFrames"].party then elseif string.match(unit, "(party)%d?$") == "party" and E.private.unitframe.disabledBlizzardFrames.party then
local id = string.match(unit, "party(%d)") local id = string.match(unit, "party(%d)")
if id then if id then
HandleFrame("PartyMemberFrame"..id) HandleFrame("PartyMemberFrame"..id)
@@ -892,9 +892,9 @@ function UF:PLAYER_ENTERING_WORLD()
end end
function UF:Initialize() function UF:Initialize()
self.db = E.db["unitframe"] self.db = E.db.unitframe
self.thinBorders = self.db.thinBorders or E.PixelMode self.thinBorders = self.db.thinBorders or E.PixelMode
if E.private["unitframe"].enable ~= true then return; end if E.private.unitframe.enable ~= true then return; end
E.UnitFrames = UF E.UnitFrames = UF
self:UpdateColors() self:UpdateColors()
@@ -915,14 +915,14 @@ function UF:Initialize()
end end
function UF:ResetUnitSettings(unit) function UF:ResetUnitSettings(unit)
E:CopyTable(self.db["units"][unit], P["unitframe"]["units"][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 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 self.db.units[unit].buffs.sizeOverride = P.unitframe.units[unit].buffs.sizeOverride or 0
end end
if self.db["units"][unit].debuffs and self.db["units"][unit].debuffs.sizeOverride then 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 self.db.units[unit].debuffs.sizeOverride = P.unitframe.units[unit].debuffs.sizeOverride or 0
end end
self:Update_AllFrames() self:Update_AllFrames()
@@ -958,7 +958,7 @@ local allowPass = {
} }
function UF:MergeUnitSettings(fromUnit, toUnit, isGroupUnit) function UF:MergeUnitSettings(fromUnit, toUnit, isGroupUnit)
local db = self.db["units"] local db = self.db.units
local filter = ignoreSettings local filter = ignoreSettings
if isGroupUnit then if isGroupUnit then
filter = ignoreSettingsGroup filter = ignoreSettingsGroup
+1 -1
View File
@@ -86,4 +86,4 @@ function UF:Update_PetFrame(frame, db)
frame:UpdateAllElements("ElvUI_UpdateAllElements") frame:UpdateAllElements("ElvUI_UpdateAllElements")
end end
tinsert(UF["unitstoload"], "pet") tinsert(UF.unitstoload, "pet")
+1 -1
View File
@@ -83,4 +83,4 @@ function UF:Update_PetTargetFrame(frame, db)
frame:UpdateAllElements("ElvUI_UpdateAllElements") frame:UpdateAllElements("ElvUI_UpdateAllElements")
end end
tinsert(UF["unitstoload"], "pettarget") tinsert(UF.unitstoload, "pettarget")
+1 -1
View File
@@ -113,4 +113,4 @@ function UF:Update_PlayerFrame(frame, db)
frame:UpdateAllElements("ElvUI_UpdateAllElements") frame:UpdateAllElements("ElvUI_UpdateAllElements")
end end
tinsert(UF["unitstoload"], "player") tinsert(UF.unitstoload, "player")
+1 -1
View File
@@ -102,4 +102,4 @@ function UF:Update_TargetFrame(frame, db)
frame:UpdateAllElements("ElvUI_UpdateAllElements") frame:UpdateAllElements("ElvUI_UpdateAllElements")
end end
tinsert(UF["unitstoload"], "target") tinsert(UF.unitstoload, "target")
@@ -82,4 +82,4 @@ function UF:Update_TargetTargetFrame(frame, db)
frame:UpdateAllElements("ElvUI_UpdateAllElements") frame:UpdateAllElements("ElvUI_UpdateAllElements")
end end
tinsert(UF["unitstoload"], "targettarget") tinsert(UF.unitstoload, "targettarget")