diff --git a/ElvUI/Core/Config.lua b/ElvUI/Core/Config.lua index f80c8b9..4f5ee07 100644 --- a/ElvUI/Core/Config.lua +++ b/ElvUI/Core/Config.lua @@ -220,7 +220,7 @@ function E:CreateMoverPopup() E:Point(header, "CENTER", f, "TOP") header:SetFrameLevel(header:GetFrameLevel() + 2) header:EnableMouse(true) - header:RegisterForClicks("AnyUp", "AnyDown") + header:RegisterForClicks("LeftButtonUp", "RightButtonUp", "LeftButtonDown", "RightButtonDown") header:SetScript("OnMouseDown", function() f:StartMoving() end) header:SetScript("OnMouseUp", function() f:StopMovingOrSizing() end) diff --git a/ElvUI/Core/Math.lua b/ElvUI/Core/Math.lua index 74d9f88..9a6c12c 100644 --- a/ElvUI/Core/Math.lua +++ b/ElvUI/Core/Math.lua @@ -230,7 +230,7 @@ function E:GetFormattedText(style, min, max) elseif style == "PERCENT" then 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 - return format(styles["CURRENT"], E:ShortValue(min)) + return format(styles.CURRENT, E:ShortValue(min)) elseif style == "CURRENT_MAX" then return format(gftUseStyle, E:ShortValue(min), E:ShortValue(max)) elseif style == "CURRENT_PERCENT" then diff --git a/ElvUI/Core/Movers.lua b/ElvUI/Core/Movers.lua index 403dba5..44e00c4 100644 --- a/ElvUI/Core/Movers.lua +++ b/ElvUI/Core/Movers.lua @@ -306,9 +306,9 @@ function E:CalculateMoverPoints(mover, nudgeX, nudgeY) end function E:UpdatePositionOverride(name) - if _G[name] and _G[name]:GetScript("OnDragStop") then - _G[name]:GetScript("OnDragStop")(_G[name]) - end + local frame = _G[name] + local OnDragStop = frame and frame.GetScript and frame:GetScript("OnDragStop") + if OnDragStop then OnDragStop(frame) end end function E:HasMoverBeenMoved(name) @@ -371,7 +371,7 @@ end function E:ToggleMovers(show, moverType) self.configMode = show - for name, _ in pairs(E.CreatedMovers) do + for name in pairs(E.CreatedMovers) do if not show then _G[name]:Hide() else @@ -430,7 +430,7 @@ end function E:ResetMovers(arg) 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 point, anchor, secondaryPoint, x, y = split(",", E.CreatedMovers[name].point) f:ClearAllPoints() @@ -444,7 +444,7 @@ function E:ResetMovers(arg) end self.db.movers = nil else - for name, _ in pairs(E.CreatedMovers) do + for name in pairs(E.CreatedMovers) do for key, value in pairs(E.CreatedMovers[name]) do if key == "text" then if arg == value then diff --git a/ElvUI/Core/StaticPopups.lua b/ElvUI/Core/StaticPopups.lua index 752d401..80f9832 100644 --- a/ElvUI/Core/StaticPopups.lua +++ b/ElvUI/Core/StaticPopups.lua @@ -61,13 +61,13 @@ E.PopupDialogs["ELVUI_EDITBOX"] = { text = E.title, button1 = OKAY, hasEditBox = 1, - OnShow = function() + OnShow = function(data) this.editBox:SetAutoFocus(false) this.editBox.width = this.editBox:GetWidth() E:Width(this.editBox, 280) this.editBox:AddHistoryLine("text") - this.editBox.temptxt = arg1 - this.editBox:SetText(arg1) + this.editBox.temptxt = data + this.editBox:SetText(data) this.editBox:HighlightText() this.editBox:SetJustifyH("CENTER") end, diff --git a/ElvUI/Core/core.lua b/ElvUI/Core/core.lua index 14b57a9..a00ac7d 100644 --- a/ElvUI/Core/core.lua +++ b/ElvUI/Core/core.lua @@ -1,14 +1,15 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local LSM = LibStub("LibSharedMedia-3.0"); +local LBF = LibStub("LibButtonFacade", true); --Cache global variables --Lua functions local _G = _G 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 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 local CreateFrame = CreateFrame local GetCVar = GetCVar @@ -37,21 +38,22 @@ E.resolution = GetCVar("gxResolution") E.screenheight = tonumber(match(E.resolution, "%d+x(%d+)")) E.screenwidth = tonumber(match(E.resolution, "(%d+)x+%d")) E.isMacClient = IsMacClient() +E.PixelMode = false -E["media"] = {} -E["frames"] = {} -E["unitFrameElements"] = {} -E["statusBars"] = {} -E["texts"] = {} -E["snapBars"] = {} -E["RegisteredModules"] = {} -E["RegisteredInitialModules"] = {} -E["ModuleCallbacks"] = {["CallPriority"] = {}} -E["InitialModuleCallbacks"] = {["CallPriority"] = {}} -E["valueColorUpdateFuncs"] = {} +--Tables +E.media = {} +E.frames = {} +E.unitFrameElements = {} +E.statusBars = {} +E.texts = {} +E.snapBars = {} +E.RegisteredModules = {} +E.RegisteredInitialModules = {} +E.ModuleCallbacks = {["CallPriority"] = {}} +E.InitialModuleCallbacks = {["CallPriority"] = {}} +E.valueColorUpdateFuncs = {} E.TexCoords = {.08, .92, .08, .92} E.CreditsList = {} -E.PixelMode = false E.InversePoints = { TOP = "BOTTOM", @@ -73,7 +75,7 @@ E.DispelClasses = { ["SHAMAN"] = { ["Poison"] = true, ["Disease"] = true, - ["Curse"] = false + ["Curse"] = true }, ["PALADIN"] = { ["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. end +--Workaround for people wanting to use white and it reverting to their class color. E.PriestColors = { r = 0.99, g = 0.99, @@ -167,10 +170,11 @@ function E:ShapeshiftDelayedUpdate(func, ...) end, 0.05) 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) r, g, b = floor(r*100 + .5) / 100, floor(g*100 + .5) / 100, floor(b*100 + .5) / 100 local matchFound = false - for class, _ in pairs(RAID_CLASS_COLORS) do + for class in pairs(RAID_CLASS_COLORS) do 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]) if colorTable.r == r and colorTable.g == g and colorTable.b == b then @@ -195,55 +199,56 @@ function E:GetColorTable(data) end 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 - self["media"].normFont = LSM:Fetch("font", self.db["general"].font) - self["media"].combatFont = LSM:Fetch("font", self.db["general"].dmgfont) + self.media.normFont = LSM:Fetch("font", self.db.general.font) + self.media.combatFont = LSM:Fetch("font", self.private.general.dmgfont) -- Textures - self["media"].blankTex = LSM:Fetch("background", "ElvUI Blank") - self["media"].normTex = LSM:Fetch("statusbar", self.private["general"].normTex) - self["media"].glossTex = LSM:Fetch("statusbar", self.private["general"].glossTex) + self.media.blankTex = LSM:Fetch("background", "ElvUI Blank") + self.media.normTex = LSM:Fetch("statusbar", self.private.general.normTex) + self.media.glossTex = LSM:Fetch("statusbar", self.private.general.glossTex) -- Border Color - local border = E.db["general"].bordercolor + local border = E.db.general.bordercolor 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]) - E.db["general"].bordercolor.r = classColor.r - E.db["general"].bordercolor.g = classColor.g - E.db["general"].bordercolor.b = classColor.b + E.db.general.bordercolor.r = classColor.r + E.db.general.bordercolor.g = classColor.g + E.db.general.bordercolor.b = classColor.b end - self["media"].bordercolor = {border.r, border.g, border.b} + self.media.bordercolor = {border.r, border.g, border.b} -- 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 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.g = classColor.g - E.db["unitframe"].colors.borderColor.b = classColor.b + E.db.unitframe.colors.borderColor.r = classColor.r + E.db.unitframe.colors.borderColor.g = classColor.g + E.db.unitframe.colors.borderColor.b = classColor.b end - self["media"].unitframeBorderColor = {border.r, border.g, border.b} + self.media.unitframeBorderColor = {border.r, border.g, border.b} -- Backdrop Color - self["media"].backdropcolor = E:GetColorTable(self.db["general"].backdropcolor) + self.media.backdropcolor = E:GetColorTable(self.db.general.backdropcolor) -- Backdrop Fade Color - self["media"].backdropfadecolor = E:GetColorTable(self.db["general"].backdropfadecolor) + self.media.backdropfadecolor = E:GetColorTable(self.db.general.backdropfadecolor) -- Value Color - local value = self.db["general"].valuecolor + local value = self.db.general.valuecolor + 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]) - self.db["general"].valuecolor.r = value.r - self.db["general"].valuecolor.g = value.g - self.db["general"].valuecolor.b = value.b + self.db.general.valuecolor.r = value.r + self.db.general.valuecolor.g = value.g + self.db.general.valuecolor.b = value.b end - self["media"].hexvaluecolor = self:RGBToHex(value.r, value.g, value.b) - self["media"].rgbvaluecolor = {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} if LeftChatPanel and LeftChatPanel.tex and RightChatPanel and RightChatPanel.tex then LeftChatPanel.tex:SetTexture(E.db.chat.panelBackdropNameLeft) @@ -258,13 +263,14 @@ function E:UpdateMedia() self:UpdateBlizzardFonts() 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() E:UpdateMedia() end LSM.RegisterCallback(E, "LibSharedMedia_Registered", LSMCallback) -local LBF = LibStub("LibButtonFacade", true) - local LBFGroupToTableElement = { ["ActionBars"] = "actionbar", ["Auras"] = "auras" @@ -308,91 +314,95 @@ function E:PLAYER_ENTERING_WORLD() end function E:ValueFuncCall() - for func, _ in pairs(self["valueColorUpdateFuncs"]) do - func(self["media"].hexvaluecolor, unpack(self["media"].rgbvaluecolor)) + for func in pairs(self.valueColorUpdateFuncs) do + func(self.media.hexvaluecolor, unpack(self.media.rgbvaluecolor)) end end function E:UpdateFrameTemplates() - for frame in pairs(self["frames"]) do - if frame and frame.template then - E:SetTemplate(frame, frame.template, frame.glossTex) + for frame in pairs(self.frames) do + if frame and frame.template and not frame.ignoreUpdates then + if not frame.ignoreFrameTemplates then + E:SetTemplate(frame, frame.template, frame.glossTex) + end else - self["frames"][frame] = nil + self.frames[frame] = nil 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 - E:SetTemplate(frame, frame.template, frame.glossTex) + if not frame.ignoreFrameTemplates then + E:SetTemplate(frame, frame.template, frame.glossTex) + end else - self["unitFrameElements"][frame] = nil + self.unitFrameElements[frame] = nil end end end 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 not frame.ignoreBorderColors 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 else - self["frames"][frame] = nil + self.frames[frame] = nil end end - for frame, _ in pairs(self["unitFrameElements"]) do + for frame in pairs(self.unitFrameElements) do if frame and not frame.ignoreUpdates then if not frame.ignoreBorderColors 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 else - self["unitFrameElements"][frame] = nil + self.unitFrameElements[frame] = nil end end end function E:UpdateBackdropColors() - for frame, _ in pairs(self["frames"]) do + for frame in pairs(self.frames) do if frame then if not frame.ignoreBackdropColors 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 - frame:SetBackdropColor(unpack(self["media"].backdropfadecolor)) + frame:SetBackdropColor(unpack(self.media.backdropfadecolor)) end end else - self["frames"][frame] = nil + self.frames[frame] = nil end end - for frame, _ in pairs(self["unitFrameElements"]) do + for frame in pairs(self.unitFrameElements) do if frame then if not frame.ignoreBackdropColors 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 - frame:SetBackdropColor(unpack(self["media"].backdropfadecolor)) + frame:SetBackdropColor(unpack(self.media.backdropfadecolor)) end end else - self["unitFrameElements"][frame] = nil + self.unitFrameElements[frame] = nil end end end function E:UpdateFontTemplates() - for text, _ in pairs(self["texts"]) do + for text in pairs(self.texts) do if text then E:FontTemplate(text, text.font, text.fontSize, text.fontStyle) else - self["texts"][text] = nil + self.texts[text] = nil end end end @@ -417,7 +427,7 @@ E.UIParent:SetFrameLevel(UIParent:GetFrameLevel()) E.UIParent:SetPoint("CENTER", UIParent, "CENTER") E.UIParent:SetWidth(GetScreenWidth()) 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:Hide() @@ -554,6 +564,10 @@ function E:RemoveEmptySubTables(tbl) 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) if type(cleanTable) ~= "table" then 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 cleaned[option] = self:RemoveTableDuplicates(value, checkTable[option]) else + -- Add unique data to our clean table if cleanTable[option] ~= checkTable[option] then cleaned[option] = value end end end + --Clean out empty sub-tables self:RemoveEmptySubTables(cleaned) return cleaned @@ -744,18 +760,21 @@ function E:StringSplitMultiDelim(s, delim) assert(type (delim) == "string" and len(delim) > 0, "bad delimiter") local start = 1 - local t = {} + local t = {} -- results table + -- find each instance of a string followed by the delimiter while(true) do - local pos = find(s, delim, start, true) + local pos = find(s, delim, start, true) -- plain find + if not pos then break end tinsert(t, sub(s, start, pos - 1)) start = pos + len(delim) - end + end -- while + -- insert final one (after last delimiter) tinsert(t, sub(s, start)) return unpack(t) @@ -782,13 +801,11 @@ end local SendRecieveGroupSize = 0 local function SendRecieve() - local prefix, message, sender = arg1, arg2, arg4 - 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 - 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 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/"]) @@ -829,95 +846,78 @@ f:RegisterEvent("PLAYER_ENTERING_WORLD") f:SetScript("OnEvent", SendRecieve) function E:UpdateAll(ignoreInstall) - self.private = self.charSettings.profile - self.db = self.data.profile - self.global = self.data.global - self.db.theme = nil - self.db.install_complete = nil + E.private = E.charSettings.profile + E.db = E.data.profile + E.global = E.data.global + E.db.theme = nil + E.db.install_complete = nil - self:SetMoversPositions() - self:UpdateMedia() - self:UpdateCooldownSettings("all") + E:DBConversions() - local UF = self:GetModule("UnitFrames") - UF.db = self.db.unitframe - UF:Update_AllFrames() + local ActionBars = E:GetModule("ActionBars") + local AFK = E:GetModule("AFK") + 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") - CH.db = self.db.chat - CH:PositionChat(true) - CH:SetupChat() - 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") + ActionBars.db = E.db.actionbar + Auras.db = E.db.auras + Bags.db = E.db.bags + Chat.db = E.db.chat 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_ReputationBar() + DataBars:UpdateDataBarDimensions() + DataTexts:LoadDataTexts() + Minimap:UpdateSettings() + NamePlates:ConfigureAll() + UnitFrames:Update_AllFrames() - -- local T = self:GetModule("Threat") - -- T.db = self.db.general.threat - -- 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() + if E.RefreshGUI then + E:RefreshGUI() end - self:GetModule("Minimap"):UpdateSettings() - self:GetModule("AFK"):Toggle() - - self:UpdateBorderColors() - self:UpdateBackdropColors() - - self:UpdateFrameTemplates() - self:UpdateStatusBars() - - local LO = E:GetModule("Layout") - LO:ToggleChatPanels() - LO:BottomPanelVisibility() - LO:TopPanelVisibility() - LO:SetDataPanelStyle() + if not (self.private.install_complete or ignoreInstall) then + E:Install() + end collectgarbage() end @@ -957,17 +957,16 @@ function E:RegisterModule(name, loadFunc) --Add module name to registry 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 E:RegisterCallback(name, loadFunc, E:GetModule(name)) end - --Old deprecated initialize method else if self.initialized then self:GetModule(name):Initialize() else - tinsert(self["RegisteredModules"], name) + self.RegisteredModules[getn(self.RegisteredModules) + 1] = name end end end @@ -983,26 +982,25 @@ function E:RegisterInitialModule(name, loadFunc) --Add module name to registry 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 E:RegisterCallback(name, loadFunc, E:GetModule(name)) - --Old deprecated initialize method else - tinsert(self["RegisteredInitialModules"], name) + self.RegisteredInitialModules[getn(self.RegisteredInitialModules) + 1] = name end end function E:InitializeInitialModules() --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["CallPriority"][index] = nil + self.InitialModuleCallbacks.CallPriority[index] = nil E.callbacks:Fire(moduleName) end --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) if module and module.Initialize then local _, catch = pcall(module.Initialize, module) @@ -1021,17 +1019,18 @@ end function E:InitializeModules() --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["CallPriority"][index] = nil + self.ModuleCallbacks.CallPriority[index] = nil E.callbacks:Fire(moduleName) end --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) if module.Initialize then local _, catch = pcall(module.Initialize, module) + if catch and GetCVar("ShowErrors") == "1" then ScriptErrorsFrame_OnError(catch, false) end @@ -1041,7 +1040,12 @@ end --DATABASE CONVERSIONS 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 local CPU_USAGE = {} @@ -1060,8 +1064,8 @@ local function CompareCPUDiff(showall, module, minCalls) end newUsage, calls = GetFunctionCPUUsage(mod[newFunc], true) differance = newUsage - oldUsage - if showall and calls > minCalls then - E:Print(calls, name, differance) + if showall and (calls > minCalls) then + E:Print('Name('..name..') Calls('..calls..') Diff('..(differance > 0 and format("%.3f", differance) or 0)..')') end if (differance > greatestDiff) and calls > minCalls then greatestName, greatestUsage, greatestCalls, greatestDiff = name, newUsage, calls, differance @@ -1070,10 +1074,12 @@ local function CompareCPUDiff(showall, module, minCalls) end 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 E:Print("CPU Usage: No CPU Usage differences found.") end + + twipe(CPU_USAGE) end 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.") return end + local module, showall, delay, minCalls = msg:match("^(%S+)%s*(%S*)%s*(%S*)%s*(.*)$") local checkCore, mod = (not module or module == "") and "E" @@ -1094,25 +1101,33 @@ function E:GetTopCPUFunc(msg) twipe(CPU_USAGE) if module == "all" then - for _, registeredModule in pairs(self["RegisteredModules"]) do - mod = self:GetModule(registeredModule, true) or self - for name in pairs(mod) do - if type(mod[name]) == "function" and name ~= "GetModule" then - CPU_USAGE[registeredModule .. ":" .. name] = GetFunctionCPUUsage(mod[name], true) + for moduName, modu in pairs(self.modules) do + for funcName, func in pairs(modu) do + if (funcName ~= "GetModule") and (type(func) == "function") then + CPU_USAGE[moduName..":"..funcName] = GetFunctionCPUUsage(func, true) end end end else - mod = self:GetModule(module, true) or self - for name in pairs(mod) do - if type(mod[name]) == "function" and name ~= "GetModule" then - CPU_USAGE[module .. ":" .. name] = GetFunctionCPUUsage(mod[name], true) + if not checkCore then + mod = self:GetModule(module, true) + if not mod then + 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 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 function E:Initialize() @@ -1126,7 +1141,6 @@ function E:Initialize() self.data.RegisterCallback(self, "OnProfileChanged", "UpdateAll") self.data.RegisterCallback(self, "OnProfileCopied", "UpdateAll") self.data.RegisterCallback(self, "OnProfileReset", "OnProfileReset") - self.charSettings = LibStub("AceDB-3.0"):New("ElvPrivateDB", self.privateVars) self.private = self.charSettings.profile self.db = self.data.profile @@ -1137,9 +1151,9 @@ function E:Initialize() -- self:ScheduleTimer("CheckRole", 0.01) self:UIScale("PLAYER_LOGIN") - self:LoadCommands() - self:InitializeModules() - self:LoadMovers() + self:LoadCommands() --Load Commands + self:InitializeModules() --Load Modules + self:LoadMovers() --Load Movers self:UpdateCooldownSettings("all") self.initialized = true diff --git a/ElvUI/Core/distributor.lua b/ElvUI/Core/distributor.lua index ed2db79..92bde8d 100644 --- a/ElvUI/Core/distributor.lua +++ b/ElvUI/Core/distributor.lua @@ -6,7 +6,7 @@ local LibBase64 = LibStub("LibBase64-1.0"); --Cache global variables --Lua functions 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 local CreateFrame = CreateFrame local GetNumRaidMembers, UnitInRaid = GetNumRaidMembers, UnitInRaid @@ -85,19 +85,17 @@ function D:Distribute(target, otherServer, isGlobal) end 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) - local max = Downloads[sender].length - Downloads[sender].current = Downloads[sender].current + cur - - if Downloads[sender].current > max then - Downloads[sender].current = max + if Downloads[arg4].current > max then + Downloads[arg4].current = max end - self.statusBar:SetValue(Downloads[sender].current) + self.statusBar:SetValue(Downloads[arg4].current) end function D:OnCommReceived(prefix, msg, dist, sender) @@ -237,6 +235,61 @@ function D:OnCommReceived(prefix, msg, dist, sender) 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) if not profileType or type(profileType) ~= "string" then 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. --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:FilterTableFromBlacklist(profileData, blacklistedKeys.profile) elseif profileType == "private" then local privateProfileKey = E.myname.." - "..E.myrealm profileKey = "private" profileData = E:CopyTable(profileData, ElvPrivateDB.profiles[privateProfileKey]) profileData = E:RemoveTableDuplicates(profileData, V) + profileData = E:FilterTableFromBlacklist(profileData, blacklistedKeys.private) elseif profileType == "global" then profileKey = "global" profileData = E:CopyTable(profileData, ElvDB.global) profileData = E:RemoveTableDuplicates(profileData, G) - elseif profileType == "filtersNP" then - profileKey = "filtersNP" + profileData = E:FilterTableFromBlacklist(profileData, blacklistedKeys.global) + elseif profileType == "filters" then + profileKey = "filters" - 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) - elseif profileType == "filtersUF" then - profileKey = "filtersUF" + elseif profileType == "styleFilters" then + profileKey = "styleFilters" - 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) - 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.nameplates = {} + profileData.nameplates.filters = {} + profileData.nameplates.filters = E:CopyTable(profileData.nameplates.filters, ElvDB.global.nameplates.filters) profileData = E:RemoveTableDuplicates(profileData, G) end @@ -443,13 +487,10 @@ local function SetImportedProfile(profileType, profileKey, profileData, force) elseif profileType == "global" then E:CopyTable(ElvDB.global, profileData) E:StaticPopup_Show("IMPORT_RL") - elseif profileType == "filtersNP" then - E:CopyTable(ElvDB.global.nameplates, profileData.nameplates) - elseif profileType == "filtersUF" then + elseif profileType == "filters" then 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.unitframe, profileData.unitframe) end --Update all ElvUI modules diff --git a/ElvUI/Core/fonts.lua b/ElvUI/Core/fonts.lua index 64e12e4..7a3f831 100644 --- a/ElvUI/Core/fonts.lua +++ b/ElvUI/Core/fonts.lua @@ -1,9 +1,6 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local LSM = LibStub("LibSharedMedia-3.0"); ---Cache global variables ---Lua functions - --WoW API / Variables local SetCVar = SetCVar @@ -18,9 +15,9 @@ local function SetFont(obj, font, size, style, r, g, b, sr, sg, sb, sox, soy) end function E:UpdateBlizzardFonts() - local NORMAL = self["media"].normFont + local NORMAL = self.media.normFont 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 MONOCHROME = "" @@ -42,49 +39,45 @@ function E:UpdateBlizzardFonts() InterfaceOptionsCombatTextPanelPeriodicDamage:Hide() InterfaceOptionsCombatTextPanelPetDamage:Hide() InterfaceOptionsCombatTextPanelHealing:Hide() - SetCVar("CombatLogPeriodicSpells",0) - SetCVar("PetMeleeDamage",0) - SetCVar("CombatDamage",0) - SetCVar("CombatHealing",0) + SetCVar("CombatLogPeriodicSpells", 0) + SetCVar("PetMeleeDamage", 0) + SetCVar("CombatDamage", 0) + SetCVar("CombatHealing", 0) -- 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 end - if(self.private.general.replaceBlizzFonts) then - SetFont(SystemFont, NORMAL, self.db.general.fontSize); - SetFont(GameFontNormal, NORMAL, self.db.general.fontSize); - SetFont(GameFontNormalSmall, NORMAL, self.db.general.fontSize); - SetFont(GameFontNormalLarge, NORMAL, self.db.general.fontSize); - SetFont(GameFontNormalHuge, NORMAL, 25, MONOCHROME .. "OUTLINE"); - -- SetFont(BossEmoteNormalHuge, NORMAL, 25, MONOCHROME .. "OUTLINE"); - SetFont(GameFontBlack, NORMAL, self.db.general.fontSize); - SetFont(NumberFontNormal, NUMBER, self.db.general.fontSize, MONOCHROME .. "OUTLINE"); - SetFont(NumberFontNormalSmall, NUMBER, self.db.general.fontSize); - SetFont(NumberFontNormalLarge, NUMBER, self.db.general.fontSize); - SetFont(NumberFontNormalHuge, NUMBER, self.db.general.fontSize); - SetFont(ChatFontNormal, NORMAL, self.db.general.fontSize); - SetFont(ChatFontSmall, NORMAL, self.db.general.fontSize); - SetFont(QuestTitleFont, NORMAL, self.db.general.fontSize + 8); - SetFont(QuestFont, 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(MailTextFontNormal, NORMAL, self.db.general.fontSize); - SetFont(SubSpellFont, NORMAL, self.db.general.fontSize); - SetFont(DialogButtonNormalText, NORMAL, self.db.general.fontSize); - SetFont(ZoneTextFont, NORMAL, 32, MONOCHROME .. "OUTLINE"); - SetFont(SubZoneTextFont, NORMAL, 25, MONOCHROME .. "OUTLINE"); - SetFont(PVPInfoTextFont, NORMAL, 22, MONOCHROME .. "OUTLINE"); - SetFont(TextStatusBarText, NORMAL, self.db.general.fontSize); - SetFont(TextStatusBarTextSmall, NORMAL, self.db.general.fontSize); - -- SetFont(GameTooltipText, NORMAL, self.db.general.fontSize); - -- SetFont(GameTooltipTextSmall, NORMAL, self.db.general.fontSize); - -- SetFont(GameTooltipHeaderText, NORMAL, self.db.general.fontSize); - 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"); + if self.private.general.replaceBlizzFonts then + SetFont(SystemFont, NORMAL, self.db.general.fontSize) + SetFont(GameFontNormal, NORMAL, self.db.general.fontSize) + SetFont(GameFontNormalSmall, NORMAL, self.db.general.fontSize) + SetFont(GameFontNormalLarge, NORMAL, self.db.general.fontSize) + SetFont(GameFontNormalHuge, NORMAL, 25, MONOCHROME.."OUTLINE") + SetFont(BossEmoteNormalHuge, NORMAL, 25, MONOCHROME.."OUTLINE") + SetFont(GameFontBlack, NORMAL, self.db.general.fontSize) + SetFont(NumberFontNormal, NUMBER, self.db.general.fontSize, MONOCHROME.."OUTLINE") + SetFont(NumberFontNormalSmall, NUMBER, self.db.general.fontSize) + SetFont(NumberFontNormalLarge, NUMBER, self.db.general.fontSize) + SetFont(NumberFontNormalHuge, NUMBER, self.db.general.fontSize) + SetFont(ChatFontNormal, NORMAL, self.db.general.fontSize) + SetFont(ChatFontSmall, NORMAL, self.db.general.fontSize) + SetFont(QuestTitleFont, NORMAL, self.db.general.fontSize + 8) + SetFont(QuestFont, 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(MailTextFontNormal, NORMAL, self.db.general.fontSize) + SetFont(SubSpellFont, NORMAL, self.db.general.fontSize) + SetFont(DialogButtonNormalText, NORMAL, self.db.general.fontSize) + SetFont(ZoneTextFont, NORMAL, 32, MONOCHROME.."OUTLINE") + SetFont(SubZoneTextFont, NORMAL, 24, MONOCHROME.."OUTLINE") + SetFont(PVPInfoTextFont, NORMAL, 22, MONOCHROME.."OUTLINE") + SetFont(TextStatusBarText, NORMAL, self.db.general.fontSize) + SetFont(TextStatusBarTextSmall, NORMAL, self.db.general.fontSize) + SetFont(InvoiceTextFontNormal, NORMAL, self.db.general.fontSize) + SetFont(InvoiceTextFontSmall, NORMAL, self.db.general.fontSize) + SetFont(CombatTextFont, COMBAT, 25, MONOCHROME.."OUTLINE") end -end \ No newline at end of file +end diff --git a/ElvUI/Core/install.lua b/ElvUI/Core/install.lua index b1a5b63..aa06590 100644 --- a/ElvUI/Core/install.lua +++ b/ElvUI/Core/install.lua @@ -5,45 +5,44 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, Profi local _G = _G local format = string.format --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 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 GetScreenWidth = GetScreenWidth +local SetCVar = SetCVar local PlaySoundFile = PlaySoundFile local ReloadUI = ReloadUI -local SetCVar = SetCVar local UIFrameFadeOut = UIFrameFadeOut - -local RAID_CLASS_COLORS = RAID_CLASS_COLORS -local CUSTOM_CLASS_COLORS = CUSTOM_CLASS_COLORS - -local CHAT_LABEL, CLASS, CONTINUE, PREV = CHAT_LABEL, CLASS, CONTINUE, PREV -local GUILD_EVENT_LOG = GUILD_EVENT_LOG -local LOOT, GENERAL, TRADE = LOOT, GENERAL, TRADE +local ChatFrame_AddMessageGroup = ChatFrame_AddMessageGroup +local ChatFrame_RemoveAllMessageGroups = ChatFrame_RemoveAllMessageGroups +local ChatFrame_AddChannel = ChatFrame_AddChannel +local ChatFrame_RemoveChannel = ChatFrame_RemoveChannel +local ChangeChatColor = ChangeChatColor +local FCF_ResetChatWindows = FCF_ResetChatWindows +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 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 MAX_PAGE = 8 local function FCF_ResetChatWindows() ChatFrame1:ClearAllPoints() - E:Point(ChatFrame1, "BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 32, 95) - E:Size(ChatFrame1, 430, 120) + ChatFrame1:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 32, 95) + ChatFrame1:SetWidth(430) + ChatFrame1:SetHeight(120) ChatFrame1.isInitialized = 0 FCF_SetButtonSide(ChatFrame1, "left") FCF_SetChatWindowFontSize(ChatFrame1, 14) 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_UnDockFrame(ChatFrame1) FCF_ValidateChatFramePosition(ChatFrame1) @@ -169,9 +168,6 @@ local function SetupChat() ChatFrame_AddMessageGroup(ChatFrame1, "DND") ChatFrame_AddMessageGroup(ChatFrame1, "IGNORED") ChatFrame_AddMessageGroup(ChatFrame1, "CHANNEL") - - ChatFrame_ActivateCombatMessages(ChatFrame2) - ChatFrame_AddChannel(ChatFrame1, GENERAL) ChatFrame_RemoveMessageGroup(ChatFrame1, "SKILL") ChatFrame_RemoveMessageGroup(ChatFrame1, "LOOT") @@ -179,6 +175,8 @@ local function SetupChat() ChatFrame_RemoveMessageGroup(ChatFrame1, "COMBAT_FACTION_CHANGE") ChatFrame_RemoveChannel(ChatFrame1, TRADE) + ChatFrame_ActivateCombatMessages(ChatFrame2) + ChatFrame_RemoveAllMessageGroups(ChatFrame3) ChatFrame_AddMessageGroup(ChatFrame3, "SKILL") ChatFrame_AddMessageGroup(ChatFrame3, "LOOT") @@ -198,11 +196,11 @@ local function SetupChat() if E.Chat then E.Chat:PositionChat(true) - if E.db["RightChatPanelFaded"] then + if E.db.RightChatPanelFaded then RightChatToggleButton:Click() end - if E.db["LeftChatPanelFaded"] then + if E.db.LeftChatPanelFaded then LeftChatToggleButton:Click() 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.backdropcolor = E:GetColor(.1, .1, .1) 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.healthclass = false E.db.unitframe.colors.health = E:GetColor(.31, .31, .31) @@ -291,6 +288,8 @@ function E:SetupResolution(noDataReset) if not noDataReset then E.db.chat.panelWidth = 400 E.db.chat.panelHeight = 180 + E.db.chat.panelWidthRight = 400 + E.db.chat.panelHeightRight = 180 E.db.bags.bagWidth = 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.width = 200 E.db.unitframe.units.targettarget.height = 26 + + E.db.unitframe.units.arena.width = 200 + E.db.unitframe.units.arena.castbar.width = 200 end 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.yOffset = -7 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.yOffset = -6 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.useFilter = "TurtleBuffs" 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.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.yOffset = -7 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.yOffset = -6 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.useFilter = "TurtleBuffs" 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.roleIcon.position = "BOTTOMRIGHT" E.db.unitframe.units.party.health.text_format = "[healthcolor][health:deficit]" E.db.unitframe.units.party.health.position = "BOTTOM" 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.power.text_format = "" - -- E.db.unitframe.units.raid40.height = 30 - -- E.db.unitframe.units.raid40.growthDirection = "LEFT_UP" + E.db.unitframe.units.raid40.height = 30 + E.db.unitframe.units.raid40.growthDirection = "LEFT_UP" E.db.unitframe.units.party.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.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.actionbar.bar2.enabled = true @@ -476,6 +467,7 @@ function E:SetupLayout(layout, noDataReset) 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) 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.ElvUF_PartyMover = "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" 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.width = 200 E.db.unitframe.units.targettarget.height = 26 + + E.db.unitframe.units.arena.width = 200 + E.db.unitframe.units.arena.castbar.width = 200 end 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) end 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_TargetMover = "BOTTOM,ElvUIParent,BOTTOM,307,76" E.db.movers.ElvUF_TargetTargetMover = "BOTTOM,ElvUIParent,BOTTOM,0,76" @@ -644,7 +639,7 @@ end local function SetupAuras(style) 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.debuffs, P.unitframe.units.player.debuffs) 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) 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.debuffs, P.unitframe.units.target.debuffs) 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 UF:Configure_Auras(frame, "Buffs") @@ -667,18 +661,33 @@ local function SetupAuras(style) -- UF:Configure_AuraBars(frame) 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 + --PLAYER E.db.unitframe.units.player.buffs.enable = true 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.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.aurabar.enable = false - E:GetModule("UnitFrames"):CreateAndUpdateUF("target") + if E.private.unitframe.enable then + E:GetModule("UnitFrames"):CreateAndUpdateUF("target") + end end 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.Desc2:SetText(L["Please click the button below so you can setup variables and ReloadUI."]) InstallOption1Button:Show() - InstallOption1Button:SetScript("OnClick", InstallComplete) - InstallOption1Button:SetText(L["Finished"]) + InstallOption1Button:SetScript("OnClick", function() E:StaticPopup_Show("ELVUI_EDITBOX", nil, nil, "https://discord.gg/Uatdmm7") end) + InstallOption1Button:SetText("Discord") -- No need for a locale + InstallOption2Button:Show() + InstallOption2Button:SetScript("OnClick", InstallComplete) + InstallOption2Button:SetText(L["Finished"]) + E:Size(ElvUIInstallFrame, 550, 350) end end @@ -875,6 +888,27 @@ function E:Install() 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") E:FontTemplate(imsg.text, E["media"].normFont, 32, "OUTLINE") E:Point(imsg.text, "BOTTOM", 0, 16) @@ -882,6 +916,7 @@ function E:Install() imsg.text:SetJustifyH("CENTER") end + --Create Frame if not ElvUIInstallFrame then local f = CreateFrame("Button", "ElvUIInstallFrame", E.UIParent) f.SetPage = SetPage @@ -918,7 +953,7 @@ function E:Install() f.Status = CreateFrame("StatusBar", "InstallStatus", f) f.Status:SetFrameLevel(f.Status:GetFrameLevel() + 2) E:CreateBackdrop(f.Status, "Default") - f.Status:SetStatusBarTexture(E["media"].normTex) + f.Status:SetStatusBarTexture(E.media.normTex) E:RegisterStatusBar(f.Status) f.Status:SetMinMaxValues(0, MAX_PAGE) E:Point(f.Status, "TOPLEFT", f.Prev, "TOPRIGHT", 6, -2) @@ -1015,4 +1050,4 @@ function E:Install() ElvUIInstallFrame:Show() NextPage() -end \ No newline at end of file +end diff --git a/ElvUI/Core/modulecopy.lua b/ElvUI/Core/modulecopy.lua index 2d4aae8..0a63b5f 100644 --- a/ElvUI/Core/modulecopy.lua +++ b/ElvUI/Core/modulecopy.lua @@ -44,7 +44,7 @@ function CP:CreateModuleConfigGroup(Name, section, pluginSection) type = "execute", name = L["Import Now"], 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() CP:ImportFromProfile(section, pluginSection) end @@ -56,7 +56,7 @@ function CP:CreateModuleConfigGroup(Name, section, pluginSection) type = "execute", name = L["Export Now"], 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() CP:ExportToProfile(section, pluginSection) end @@ -94,7 +94,7 @@ function CP:CreateMoversConfigGroup() type = "execute", name = L["Import Now"], 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() CP:CopyMovers("import") end @@ -106,7 +106,7 @@ function CP:CreateMoversConfigGroup() type = "execute", name = L["Export Now"], 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() CP:CopyMovers("export") end @@ -154,7 +154,7 @@ function CP:CopyTable(CopyFrom, CopyTo, CopyDefault, module) E:CopyTable(CopyTo, CopyDefault) E:CopyTable(CopyTo, CopyFrom) 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]) --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 @@ -176,7 +176,7 @@ G["profileCopy"][YourOptionGroupName] = { ... } * For example -G["profileCopy"]["auras"] = { +G["profileCopy"].auras = { ["general"] = true, ["buffs"] = 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] 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 - 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 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) if type(module) == "table" and next(module) then --This module is not an empty table 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] 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 - 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 --Starting digging through the settings 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] if type(module) == "table" and next(module) then --This module is not an empty table CP:CopyTable(CopyFrom, CopyTo, CopyDefault, module) @@ -248,12 +248,12 @@ end function CP:CopyMovers(mode) 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 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 - 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 for moverName in pairs(E.CreatedMovers) do diff --git a/ElvUI/Core/pluginInstaller.lua b/ElvUI/Core/pluginInstaller.lua index 75af365..1184301 100644 --- a/ElvUI/Core/pluginInstaller.lua +++ b/ElvUI/Core/pluginInstaller.lua @@ -193,7 +193,7 @@ function PI:CreateStepComplete() imsg.lineBottom:SetTexCoord(0.00195313, 0.81835938, 0.01953125, 0.03320313) 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) imsg.text:SetTextColor(1, 0.82, 0) imsg.text:SetJustifyH("CENTER") @@ -234,8 +234,8 @@ function PI:CreateFrame() f.Status = CreateFrame("StatusBar", "PluginInstallStatus", f) f.Status:SetFrameLevel(f.Status:GetFrameLevel() + 2) E:CreateBackdrop(f.Status, "Default", true) - f.Status:SetStatusBarTexture(E["media"].normTex) - f.Status:SetStatusBarColor(unpack(E["media"].rgbvaluecolor)) + f.Status:SetStatusBarTexture(E.media.normTex) + f.Status:SetStatusBarColor(unpack(E.media.rgbvaluecolor)) E:Point(f.Status, "TOPLEFT", f.Prev, "TOPRIGHT", 6, -2) E:Point(f.Status, "BOTTOMRIGHT", f.Next, "BOTTOMLEFT", -6, 2) -- Setup StatusBar Animation @@ -355,7 +355,7 @@ function PI:CreateFrame() E:Width(f.side, 140) f.side.text = f.side:CreateFontString(nil, "OVERLAY") 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.Lines = {} --Table to keep shown lines f.side:Hide() @@ -370,7 +370,7 @@ function PI:CreateFrame() button.text = button:CreateFontString(nil, "OVERLAY") E:Point(button.text, "TOPLEFT", button, "TOPLEFT", 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.text:SetText("") f.side.Lines[i] = button diff --git a/ElvUI/Init.lua b/ElvUI/Init.lua index 80a2949..2c06a5b 100644 --- a/ElvUI/Init.lua +++ b/ElvUI/Init.lua @@ -26,10 +26,10 @@ AddOn.callbacks = AddOn.callbacks or LibStub("CallbackHandler-1.0"):New(AddOn) -- Defaults AddOn.DF = {} -AddOn.DF["profile"] = {} -AddOn.DF["global"] = {} +AddOn.DF.profile = {} +AddOn.DF.global = {} AddOn.privateVars = {} -AddOn.privateVars["profile"] = {} +AddOn.privateVars.profile = {} AddOn.Options = { type = "group", @@ -40,9 +40,9 @@ AddOn.Options = { local Locale = LibStub("AceLocale-3.0"):GetLocale(AddOnName, false) Engine[1] = AddOn Engine[2] = Locale -Engine[3] = AddOn.privateVars["profile"] -Engine[4] = AddOn.DF["profile"] -Engine[5] = AddOn.DF["global"] +Engine[3] = AddOn.privateVars.profile +Engine[4] = AddOn.DF.profile +Engine[5] = AddOn.DF.global _G[AddOnName] = Engine local tcopy = table.copy @@ -125,6 +125,9 @@ function AddOn:OnInitialize() GameMenuButtonLogout:SetPoint("TOPLEFT", GameMenuFrame[AddOnName], "BOTTOMLEFT", 0, -16) end end) + + if AddOn.private.skins.blizzard.enable ~= true or AddOn.private.skins.blizzard.misc ~= true then return end + local S = AddOn:GetModule("Skins") S:HandleButton(GameMenuButton) end @@ -147,7 +150,8 @@ function AddOn:OnProfileReset() self:StaticPopup_Show("RESET_PROFILE_PROMPT") end -function AddOn:ToggleConfig() +local pageNodes = {} +function AddOn:ToggleConfig(msg) if not IsAddOnLoaded("ElvUI_Config") then local _, _, _, _, _, reason = GetAddOnInfo("ElvUI_Config") if reason ~= "MISSING" and reason ~= "DISABLED" then @@ -227,7 +231,5 @@ function AddOn:ToggleConfig() PlaySound("igMainMenuClose") end - ACD[mode](ACD, AddOnName) - GameTooltip:Hide() --Just in case you're mouseovered something and it closes. end diff --git a/ElvUI/Layout/Layout.lua b/ElvUI/Layout/Layout.lua index b4a6a55..8fc15bd 100644 --- a/ElvUI/Layout/Layout.lua +++ b/ElvUI/Layout/Layout.lua @@ -379,12 +379,12 @@ function LO:CreateChatPanels() rchattb.text:SetText(">") --Load Settings - if E.db["LeftChatPanelFaded"] then + if E.db.LeftChatPanelFaded then LeftChatToggleButton:SetAlpha(0) LeftChatPanel:Hide() end - if E.db["RightChatPanelFaded"] then + if E.db.RightChatPanelFaded then RightChatToggleButton:SetAlpha(0) RightChatPanel:Hide() end diff --git a/ElvUI/Modules/Bags/Bags.lua b/ElvUI/Modules/Bags/Bags.lua index aa9a9ec..8b58710 100644 --- a/ElvUI/Modules/Bags/Bags.lua +++ b/ElvUI/Modules/Bags/Bags.lua @@ -821,7 +821,7 @@ function B:OnEvent() end 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 function B:FormatMoney(amount) @@ -1530,7 +1530,7 @@ function B:CreateSellFrame() B.SellFrame.statusbar = CreateFrame("StatusBar", "ElvUIVendorGraysFrameStatusbar", B.SellFrame) E:Size(B.SellFrame.statusbar, 180, 16) 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) E:CreateBackdrop(B.SellFrame.statusbar, "Transparent") diff --git a/ElvUI/Modules/Bags/Sort.lua b/ElvUI/Modules/Bags/Sort.lua index 3a055e5..dc57537 100644 --- a/ElvUI/Modules/Bags/Sort.lua +++ b/ElvUI/Modules/Bags/Sort.lua @@ -606,17 +606,17 @@ function B.SortBags(...) for bagType, sortedBags in pairs(bagCache) do if bagType ~= "Normal" then B.Stack(sortedBags, sortedBags, B.IsPartial) - B.Stack(bagCache["Normal"], sortedBags) - B.Fill(bagCache["Normal"], sortedBags, B.db.sortInverted) + B.Stack(bagCache.Normal, sortedBags) + B.Fill(bagCache.Normal, sortedBags, B.db.sortInverted) B.Sort(sortedBags, nil, B.db.sortInverted) twipe(sortedBags) end end - if bagCache["Normal"] then - B.Stack(bagCache["Normal"], bagCache["Normal"], B.IsPartial) - B.Sort(bagCache["Normal"], nil, B.db.sortInverted) - twipe(bagCache["Normal"]) + if bagCache.Normal then + B.Stack(bagCache.Normal, bagCache.Normal, B.IsPartial) + B.Sort(bagCache.Normal, nil, B.db.sortInverted) + twipe(bagCache.Normal) end twipe(bagCache) twipe(bagGroups) diff --git a/ElvUI/Modules/Chat/Chat.lua b/ElvUI/Modules/Chat/Chat.lua index 0edb9ee..d758ac6 100644 --- a/ElvUI/Modules/Chat/Chat.lua +++ b/ElvUI/Modules/Chat/Chat.lua @@ -204,9 +204,9 @@ function CH:StyleChat(frame) end) 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) - 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 self:SetTextColor(rR, gG, bB) end @@ -370,8 +370,8 @@ local function FindRightChatID() end function CH:UpdateChatTabs() - local fadeUndockedTabs = E.db["chat"].fadeUndockedTabs - local fadeTabsNoBackdrop = E.db["chat"].fadeTabsNoBackdrop + local fadeUndockedTabs = E.db.chat.fadeUndockedTabs + local fadeTabsNoBackdrop = E.db.chat.fadeTabsNoBackdrop for i = 1, CreatedFrames do 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 local chat, tab, id, isDocked - local fadeUndockedTabs = E.db["chat"].fadeUndockedTabs - local fadeTabsNoBackdrop = E.db["chat"].fadeTabsNoBackdrop + local fadeUndockedTabs = E.db.chat.fadeUndockedTabs + local fadeTabsNoBackdrop = E.db.chat.fadeTabsNoBackdrop for i = 1, CreatedFrames do 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) end end -E["valueColorUpdateFuncs"][UpdateChatTabColor] = true +E.valueColorUpdateFuncs[UpdateChatTabColor] = true function CH:ScrollToBottom(frame) frame:ScrollToBottom() @@ -1158,7 +1158,7 @@ local protectLinks = {} function CH:CheckKeyword(message) for itemLink in gmatch(message, "|%x+|Hitem:.-|h.-|h|r") do 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 self.db.keywordSound ~= "None" and not self.SoundPlayed then PlaySoundFile(LSM:Fetch("sound", self.db.keywordSound), "Master") @@ -1358,10 +1358,10 @@ function CH:DisplayChatHistory() CH.SoundPlayed = nil end -tremove(ChatTypeGroup["GUILD"], 3) +tremove(ChatTypeGroup.GUILD, 3) function CH:DelayGuildMOTD() local delay, delayFrame, chat = 0, CreateFrame("Frame") - tinsert(ChatTypeGroup["GUILD"], 3, "GUILD_MOTD") + tinsert(ChatTypeGroup.GUILD, 3, "GUILD_MOTD") delayFrame:SetScript("OnUpdate", function() delay = delay + arg1 if delay < 7 then return end diff --git a/ElvUI/Modules/DataTexts/Armor.lua b/ElvUI/Modules/DataTexts/Armor.lua index eec6418..c2751e2 100644 --- a/ElvUI/Modules/DataTexts/Armor.lua +++ b/ElvUI/Modules/DataTexts/Armor.lua @@ -65,6 +65,6 @@ local function ValueColorUpdate(hex) OnEvent(lastPanel) end end -E["valueColorUpdateFuncs"][ValueColorUpdate] = true +E.valueColorUpdateFuncs[ValueColorUpdate] = true DT:RegisterDatatext("Armor", {"UNIT_RESISTANCES"}, OnEvent, nil, nil, OnEnter, nil, ARMOR) \ No newline at end of file diff --git a/ElvUI/Modules/DataTexts/AttackPower.lua b/ElvUI/Modules/DataTexts/AttackPower.lua index b932e53..1b290a4 100644 --- a/ElvUI/Modules/DataTexts/AttackPower.lua +++ b/ElvUI/Modules/DataTexts/AttackPower.lua @@ -61,6 +61,6 @@ local function ValueColorUpdate(hex) OnEvent(lastPanel) 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) \ No newline at end of file diff --git a/ElvUI/Modules/DataTexts/Avoidance.lua b/ElvUI/Modules/DataTexts/Avoidance.lua index e6c98d1..852984c 100644 --- a/ElvUI/Modules/DataTexts/Avoidance.lua +++ b/ElvUI/Modules/DataTexts/Avoidance.lua @@ -122,6 +122,6 @@ local function ValueColorUpdate(hex) OnEvent(lastPanel) 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"]) \ No newline at end of file diff --git a/ElvUI/Modules/DataTexts/DataTexts.lua b/ElvUI/Modules/DataTexts/DataTexts.lua index e7357ae..ecd6f12 100644 --- a/ElvUI/Modules/DataTexts/DataTexts.lua +++ b/ElvUI/Modules/DataTexts/DataTexts.lua @@ -110,7 +110,7 @@ end local function ValueColorUpdate(newHex) hex = newHex end -E["valueColorUpdateFuncs"][ValueColorUpdate] = true +E.valueColorUpdateFuncs[ValueColorUpdate] = true function DT:GetDataPanelPoint(panel, i, numPoints) if(numPoints == 1) then @@ -119,9 +119,9 @@ function DT:GetDataPanelPoint(panel, i, numPoints) if(i == 1) then return "CENTER", panel, "CENTER" elseif(i == 2) then - return "RIGHT", panel.dataPanels["middle"], "LEFT", -4, 0 + return "RIGHT", panel.dataPanels.middle, "LEFT", -4, 0 elseif(i == 3) then - return "LEFT", panel.dataPanels["middle"], "RIGHT", 4, 0 + return "LEFT", panel.dataPanels.middle, "RIGHT", 4, 0 end end end @@ -180,12 +180,12 @@ end function DT:AssignPanelToDataText(panel, data) panel.name = "" - if data["name"] then - panel.name = data["name"] + if data.name then + panel.name = data.name end - if data["events"] then - for _, event in pairs(data["events"]) do + if data.events then + for _, event in pairs(data.events) do -- random error 132 if event == "PLAYER_ENTERING_WORLD" then event = "PLAYER_LOGIN" @@ -194,35 +194,35 @@ function DT:AssignPanelToDataText(panel, data) end end - if data["eventFunc"] then + if data.eventFunc then panel:SetScript("OnEvent", function() - data["eventFunc"](this, event) + data.eventFunc(this, event) end) - data["eventFunc"](panel, "ELVUI_FORCE_RUN") + data.eventFunc(panel, "ELVUI_FORCE_RUN") end - if data["onUpdate"] then + if data.onUpdate then panel:SetScript("OnUpdate", function() - data["onUpdate"](this, arg1) + data.onUpdate(this, arg1) end) - data["onUpdate"](panel, 20000) + data.onUpdate(panel, 20000) end - if data["onClick"] then + if data.onClick then panel:SetScript("OnClick", function() - data["onClick"](this) + data.onClick(this) end) end - if data["onEnter"] then + if data.onEnter then panel:SetScript("OnEnter", function() - data["onEnter"](this) + data.onEnter(this) end) end - if data["onLeave"] then + if data.onLeave then panel:SetScript("OnLeave", function() - data["onLeave"](this) + data.onLeave(this) end) else 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.") end - DT.RegisteredDataTexts[name]["name"] = name + DT.RegisteredDataTexts[name].name = name if type(events) ~= "table" and events ~= nil then error("Events must be registered as a table.") else - DT.RegisteredDataTexts[name]["events"] = events - DT.RegisteredDataTexts[name]["eventFunc"] = eventFunc + DT.RegisteredDataTexts[name].events = events + DT.RegisteredDataTexts[name].eventFunc = eventFunc end if updateFunc and type(updateFunc) == "function" then - DT.RegisteredDataTexts[name]["onUpdate"] = updateFunc + DT.RegisteredDataTexts[name].onUpdate = updateFunc end if clickFunc and type(clickFunc) == "function" then - DT.RegisteredDataTexts[name]["onClick"] = clickFunc + DT.RegisteredDataTexts[name].onClick = clickFunc end if onEnterFunc and type(onEnterFunc) == "function" then - DT.RegisteredDataTexts[name]["onEnter"] = onEnterFunc + DT.RegisteredDataTexts[name].onEnter = onEnterFunc end if onLeaveFunc and type(onLeaveFunc) == "function" then - DT.RegisteredDataTexts[name]["onLeave"] = onLeaveFunc + DT.RegisteredDataTexts[name].onLeave = onLeaveFunc end if localizedName and type(localizedName) == "string" then - DT.RegisteredDataTexts[name]["localizedName"] = localizedName + DT.RegisteredDataTexts[name].localizedName = localizedName end end diff --git a/ElvUI/Modules/DataTexts/Durability.lua b/ElvUI/Modules/DataTexts/Durability.lua index 5bd1e22..58807f1 100644 --- a/ElvUI/Modules/DataTexts/Durability.lua +++ b/ElvUI/Modules/DataTexts/Durability.lua @@ -73,6 +73,6 @@ local function ValueColorUpdate(hex) OnEvent(lastPanel, "ELVUI_COLOR_UPDATE") 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) \ No newline at end of file diff --git a/ElvUI/Modules/DataTexts/Friends.lua b/ElvUI/Modules/DataTexts/Friends.lua index c2a0c7f..430767b 100644 --- a/ElvUI/Modules/DataTexts/Friends.lua +++ b/ElvUI/Modules/DataTexts/Friends.lua @@ -172,6 +172,6 @@ local function ValueColorUpdate(hex) OnEvent(lastPanel, "ELVUI_COLOR_UPDATE") 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) \ No newline at end of file diff --git a/ElvUI/Modules/DataTexts/Gold.lua b/ElvUI/Modules/DataTexts/Gold.lua index 8db8b92..69de27d 100644 --- a/ElvUI/Modules/DataTexts/Gold.lua +++ b/ElvUI/Modules/DataTexts/Gold.lua @@ -16,11 +16,11 @@ local resetInfoFormatter = join("", "|cffaaaaaa", L["Reset Data: Hold Shift + Ri local function OnEvent(self) local NewMoney = GetMoney() ElvDB = ElvDB or {} - ElvDB["gold"] = ElvDB["gold"] 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 = ElvDB.gold or {} + ElvDB.gold[E.myrealm] = ElvDB.gold[E.myrealm] or {} + 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 if OldMoney > NewMoney then @@ -31,7 +31,7 @@ local function OnEvent(self) 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 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["Spent:"], E:FormatMoney(Spent, style), 1, 1, 1, 1, 1, 1) 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 - 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 DT.tooltip:AddLine(" ") local totalGold = 0; DT.tooltip:AddLine(L["Character: "]) - for k, _ in pairs(ElvDB["gold"][E.myrealm]) do - 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) - totalGold = totalGold + ElvDB["gold"][E.myrealm][k] + for k in pairs(ElvDB.gold[E.myrealm]) do + 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) + totalGold = totalGold + ElvDB.gold[E.myrealm][k] end end @@ -78,4 +78,4 @@ local function OnEnter(self) DT.tooltip:Show() 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"]) \ No newline at end of file +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) \ No newline at end of file diff --git a/ElvUI/Modules/DataTexts/Guild.lua b/ElvUI/Modules/DataTexts/Guild.lua index acd771e..6528c9c 100644 --- a/ElvUI/Modules/DataTexts/Guild.lua +++ b/ElvUI/Modules/DataTexts/Guild.lua @@ -229,6 +229,6 @@ local function ValueColorUpdate(hex) OnEvent(lastPanel, "ELVUI_COLOR_UPDATE") 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) \ No newline at end of file diff --git a/ElvUI/Modules/DataTexts/Time.lua b/ElvUI/Modules/DataTexts/Time.lua index 3d3a8e6..e9c0162 100644 --- a/ElvUI/Modules/DataTexts/Time.lua +++ b/ElvUI/Modules/DataTexts/Time.lua @@ -89,6 +89,6 @@ local function ValueColorUpdate(hex) OnUpdate(lastPanel, 20000) end end -E["valueColorUpdateFuncs"][ValueColorUpdate] = true +E.valueColorUpdateFuncs[ValueColorUpdate] = true DT:RegisterDatatext("Time", nil, nil, OnUpdate, OnClick, OnEnter, OnLeave) \ No newline at end of file diff --git a/ElvUI/Modules/Misc/ChatBubbles.lua b/ElvUI/Modules/Misc/ChatBubbles.lua index 4c60ecb..40d7ee2 100644 --- a/ElvUI/Modules/Misc/ChatBubbles.lua +++ b/ElvUI/Modules/Misc/ChatBubbles.lua @@ -112,8 +112,8 @@ function M:SkinBubble(frame) if E.private.general.chatBubbles == "backdrop" then if E.PixelMode then frame:SetBackdrop({ - bgFile = E["media"].blankTex, - edgeFile = E["media"].blankTex, + bgFile = E.media.blankTex, + edgeFile = E.media.blankTex, tile = false, tileSize = 0, edgeSize = mult, insets = {left = 0, right = 0, top = 0, bottom = 0} }) diff --git a/ElvUI/Modules/Misc/Loot.lua b/ElvUI/Modules/Misc/Loot.lua index 408d96f..cc9d4f6 100644 --- a/ElvUI/Modules/Misc/Loot.lua +++ b/ElvUI/Modules/Misc/Loot.lua @@ -107,7 +107,7 @@ local function createSlot(id) iconFrame:SetPoint("RIGHT", frame) E:SetTemplate(iconFrame, "Default") frame.iconFrame = iconFrame - E["frames"][iconFrame] = nil + E.frames[iconFrame] = nil local icon = iconFrame:CreateTexture(nil, "ARTWORK") icon:SetTexCoord(unpack(E.TexCoords)) @@ -290,7 +290,7 @@ function M:LoadLoot() StaticPopup_Hide("CONFIRM_LOOT_DISTRIBUTION") CloseLoot() end) - E["frames"][lootFrame] = nil + E.frames[lootFrame] = nil self:RegisterEvent("LOOT_OPENED") self:RegisterEvent("LOOT_SLOT_CLEARED") diff --git a/ElvUI/Modules/Misc/LootRoll.lua b/ElvUI/Modules/Misc/LootRoll.lua index 15e63f6..0cc15bc 100644 --- a/ElvUI/Modules/Misc/LootRoll.lua +++ b/ElvUI/Modules/Misc/LootRoll.lua @@ -189,7 +189,7 @@ function M:CreateRollFrame() E:SetInside(status) status:SetScript("OnUpdate", function() StatusUpdate(status) end) status:SetFrameLevel(status:GetFrameLevel() - 1) - status:SetStatusBarTexture(E["media"].normTex) + status:SetStatusBarTexture(E.media.normTex) E:RegisterStatusBar(status) status:SetStatusBarColor(.8, .8, .8, .9) status.parent = frame diff --git a/ElvUI/Modules/NamePlates/NamePlates.lua b/ElvUI/Modules/NamePlates/NamePlates.lua index 622f18c..dad33d6 100644 --- a/ElvUI/Modules/NamePlates/NamePlates.lua +++ b/ElvUI/Modules/NamePlates/NamePlates.lua @@ -200,7 +200,7 @@ function mod:StyleFrame(parent, noBackdrop, point) if not noBackdrop then point.backdrop = parent:CreateTexture(nil, "BACKGROUND") point.backdrop:SetAllPoints(point) - point.backdrop:SetTexture(unpack(E["media"].backdropfadecolor)) + point.backdrop:SetTexture(unpack(E.media.backdropfadecolor)) end 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("TOPRIGHT", point, "TOPRIGHT", noscalemult, 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:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", -noscalemult, -noscalemult) point.borderbottom:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", noscalemult, -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:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult) point.borderleft:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", noscalemult, -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:SetPoint("TOPRIGHT", point, "TOPRIGHT", noscalemult, noscalemult) point.borderright:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", -noscalemult, -noscalemult) point.borderright:SetWidth(noscalemult) - point.borderright:SetTexture(unpack(E["media"].bordercolor)) + point.borderright:SetTexture(unpack(E.media.bordercolor)) else point.bordertop = parent:CreateTexture(nil, "OVERLAY") point.bordertop:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult*2) @@ -521,7 +521,7 @@ function mod:AnimatedHide() num = num + 1 end if num < 1 then - + end end @@ -649,7 +649,7 @@ function mod:OnUpdate() end for frame in pairs(mod.VisiblePlates) do - if mod.hasTarget then + if mod.hasTarget then frame.alpha = frame:GetParent():GetAlpha() else frame.alpha = 1 @@ -801,8 +801,8 @@ function mod:ClassCache_ClassUpdated(_, name, class) end function mod:Initialize() - self.db = E.db["nameplates"] - if E.private["nameplates"].enable ~= true then return end + self.db = E.db.nameplates + if E.private.nameplates.enable ~= true then return end self.hasTarget = false diff --git a/ElvUI/Modules/Skins/Blizzard/AuctionHouse.lua b/ElvUI/Modules/Skins/Blizzard/AuctionHouse.lua index 587cafb..e754582 100644 --- a/ElvUI/Modules/Skins/Blizzard/AuctionHouse.lua +++ b/ElvUI/Modules/Skins/Blizzard/AuctionHouse.lua @@ -92,7 +92,7 @@ local function LoadSkin() E:StyleButton(AuctionsItemButton, false, true) 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 this:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) E:SetInside(this:GetNormalTexture()) @@ -104,11 +104,11 @@ local function LoadSkin() if quality then this:SetBackdropBorderColor(GetItemQualityColor(quality)) else - this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + this:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end else - this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + this:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end) @@ -221,7 +221,7 @@ local function LoadSkin() icon:SetBackdropBorderColor(r, g, b) end) hooksecurefunc(name, "Hide", function() - icon:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + icon:SetBackdropBorderColor(unpack(E.media.bordercolor)) end) end @@ -254,7 +254,7 @@ local function LoadSkin() icon:SetBackdropBorderColor(r, g, b) end) hooksecurefunc(name, "Hide", function(_, r, g, b) - icon:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + icon:SetBackdropBorderColor(unpack(E.media.bordercolor)) end) end @@ -287,7 +287,7 @@ local function LoadSkin() icon:SetBackdropBorderColor(r, g, b) end) hooksecurefunc(name, "Hide", function(_, r, g, b) - icon:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + icon:SetBackdropBorderColor(unpack(E.media.bordercolor)) end) end diff --git a/ElvUI/Modules/Skins/Blizzard/Character.lua b/ElvUI/Modules/Skins/Blizzard/Character.lua index 0c693aa..081fe22 100644 --- a/ElvUI/Modules/Skins/Blizzard/Character.lua +++ b/ElvUI/Modules/Skins/Blizzard/Character.lua @@ -100,7 +100,7 @@ local function LoadSkin() local rarity = GetInventoryItemQuality("player", this:GetID()) this:SetBackdropBorderColor(GetItemQualityColor(rarity)) else - this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + this:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end) @@ -133,7 +133,7 @@ local function LoadSkin() PetMagicResFrame5:GetRegions():SetTexCoord(0.21875, 0.78125, 0.4765625, 0.546875) E:StripTextures(PetPaperDollFrameExpBar) - PetPaperDollFrameExpBar:SetStatusBarTexture(E["media"].normTex) + PetPaperDollFrameExpBar:SetStatusBarTexture(E.media.normTex) E:RegisterStatusBar(PetPaperDollFrameExpBar) E:CreateBackdrop(PetPaperDollFrameExpBar, "Default") diff --git a/ElvUI/Modules/Skins/Blizzard/Craft.lua b/ElvUI/Modules/Skins/Blizzard/Craft.lua index 4cfcb36..1229c63 100644 --- a/ElvUI/Modules/Skins/Blizzard/Craft.lua +++ b/ElvUI/Modules/Skins/Blizzard/Craft.lua @@ -47,7 +47,7 @@ local function LoadSkin() E:Size(CraftRankFrame, 420, 18) CraftRankFrame:ClearAllPoints() CraftRankFrame:SetPoint("TOP", -10, -38) - CraftRankFrame:SetStatusBarTexture(E["media"].normTex) + CraftRankFrame:SetStatusBarTexture(E.media.normTex) E:RegisterStatusBar(CraftRankFrame) CraftRankFrameSkillName:Hide() @@ -204,7 +204,7 @@ local function LoadSkin() CraftIcon:SetBackdropBorderColor(GetItemQualityColor(quality)) CraftName:SetTextColor(GetItemQualityColor(quality)) else - CraftIcon:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + CraftIcon:SetBackdropBorderColor(unpack(E.media.bordercolor)) CraftName:SetTextColor(1, 1, 1) end end @@ -228,8 +228,8 @@ local function LoadSkin() name:SetTextColor(GetItemQualityColor(quality)) end else - reagent:SetBackdropBorderColor(unpack(E["media"].bordercolor)) - icon.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + reagent:SetBackdropBorderColor(unpack(E.media.bordercolor)) + icon.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end end diff --git a/ElvUI/Modules/Skins/Blizzard/Debug.lua b/ElvUI/Modules/Skins/Blizzard/Debug.lua index 44bbca3..e61bb49 100644 --- a/ElvUI/Modules/Skins/Blizzard/Debug.lua +++ b/ElvUI/Modules/Skins/Blizzard/Debug.lua @@ -65,8 +65,8 @@ local function LoadSkin() HookScript(FrameStackTooltip, "OnShow", function() E:SetTemplate(this, "Transparent") - this:SetBackdropColor(unpack(E["media"].backdropfadecolor)) - this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + this:SetBackdropColor(unpack(E.media.backdropfadecolor)) + this:SetBackdropBorderColor(unpack(E.media.bordercolor)) end) HookScript(EventTraceTooltip, "OnShow", function() diff --git a/ElvUI/Modules/Skins/Blizzard/DressingRoom.lua b/ElvUI/Modules/Skins/Blizzard/DressingRoom.lua index 04d743c..baaaf81 100644 --- a/ElvUI/Modules/Skins/Blizzard/DressingRoom.lua +++ b/ElvUI/Modules/Skins/Blizzard/DressingRoom.lua @@ -9,6 +9,7 @@ local SetDressUpBackground = SetDressUpBackground local function LoadSkin() 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:CreateBackdrop(DressUpFrame, "Transparent") E:Point(DressUpFrame.backdrop, "TOPLEFT", 10, -12) diff --git a/ElvUI/Modules/Skins/Blizzard/Help.lua b/ElvUI/Modules/Skins/Blizzard/Help.lua index 7776d43..6845614 100644 --- a/ElvUI/Modules/Skins/Blizzard/Help.lua +++ b/ElvUI/Modules/Skins/Blizzard/Help.lua @@ -27,6 +27,7 @@ local function LoadSkin() "VerbalHarassmentButton", } + local HelpFrame = _G["HelpFrame"] E:StripTextures(HelpFrame) E:CreateBackdrop(HelpFrame, "Transparent") E:Point(HelpFrame.backdrop, "TOPLEFT", 6, -2) diff --git a/ElvUI/Modules/Skins/Blizzard/Inspect.lua b/ElvUI/Modules/Skins/Blizzard/Inspect.lua index b5bfae1..3c23231 100644 --- a/ElvUI/Modules/Skins/Blizzard/Inspect.lua +++ b/ElvUI/Modules/Skins/Blizzard/Inspect.lua @@ -16,6 +16,7 @@ local hooksecurefunc = hooksecurefunc local function LoadSkin() 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:CreateBackdrop(InspectFrame, "Transparent") E:Point(InspectFrame.backdrop, "TOPLEFT", 10, -12) diff --git a/ElvUI/Modules/Skins/Blizzard/Loot.lua b/ElvUI/Modules/Skins/Blizzard/Loot.lua index d9fbeef..cd56fff 100644 --- a/ElvUI/Modules/Skins/Blizzard/Loot.lua +++ b/ElvUI/Modules/Skins/Blizzard/Loot.lua @@ -70,10 +70,10 @@ local function LoadSkin() if quality then lootButton.backdrop:SetBackdropBorderColor(GetItemQualityColor(quality)) else - lootButton.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + lootButton.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor)) end else - lootButton.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + lootButton.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end end @@ -121,7 +121,7 @@ local function LoadRollSkin() local statusBar = _G[frameName.."Timer"] E:StripTextures(statusBar) E:CreateBackdrop(statusBar, "Default") - statusBar:SetStatusBarTexture(E["media"].normTex) + statusBar:SetStatusBarTexture(E.media.normTex) E:RegisterStatusBar(statusBar) local decoration = _G[frameName.."Decoration"] diff --git a/ElvUI/Modules/Skins/Blizzard/Macro.lua b/ElvUI/Modules/Skins/Blizzard/Macro.lua index aa39b58..e79cdcc 100644 --- a/ElvUI/Modules/Skins/Blizzard/Macro.lua +++ b/ElvUI/Modules/Skins/Blizzard/Macro.lua @@ -11,6 +11,7 @@ local getn = table.getn local function LoadSkin() 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:CreateBackdrop(MacroFrame, "Transparent") E:Point(MacroFrame.backdrop, "TOPLEFT", 10, -11) diff --git a/ElvUI/Modules/Skins/Blizzard/Mail.lua b/ElvUI/Modules/Skins/Blizzard/Mail.lua index fb802d8..990b59d 100644 --- a/ElvUI/Modules/Skins/Blizzard/Mail.lua +++ b/ElvUI/Modules/Skins/Blizzard/Mail.lua @@ -73,13 +73,13 @@ local function LoadSkin() if quality then button:SetBackdropBorderColor(GetItemQualityColor(quality)) else - button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + button:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end elseif isGM then button:SetBackdropBorderColor(0, 0.56, 0.94) else - button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + button:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end @@ -123,12 +123,12 @@ local function LoadSkin() if quality then button:SetBackdropBorderColor(GetItemQualityColor(quality)) else - button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + button:SetBackdropBorderColor(unpack(E.media.bordercolor)) end texture:SetTexCoord(unpack(E.TexCoords)) E:SetInside(texture) else - button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + button:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end) @@ -189,12 +189,12 @@ local function LoadSkin() if quality then button:SetBackdropBorderColor(GetItemQualityColor(quality)) else - button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + button:SetBackdropBorderColor(unpack(E.media.bordercolor)) end texture:SetTexCoord(unpack(E.TexCoords)) E:SetInside(texture) else - button:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + button:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end end) diff --git a/ElvUI/Modules/Skins/Blizzard/Merchant.lua b/ElvUI/Modules/Skins/Blizzard/Merchant.lua index 06932b8..64063a6 100644 --- a/ElvUI/Modules/Skins/Blizzard/Merchant.lua +++ b/ElvUI/Modules/Skins/Blizzard/Merchant.lua @@ -30,7 +30,7 @@ local function LoadSkin() else if MerchantNextPageButton:IsShown() and MerchantNextPageButton:IsEnabled() == 1 then MerchantNextPageButton_OnClick() - end + end end end) @@ -112,15 +112,15 @@ local function LoadSkin() itemName:SetTextColor(GetItemQualityColor(quality)) itemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) else - itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + itemButton:SetBackdropBorderColor(unpack(E.media.bordercolor)) end else - itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + itemButton:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end HookScript(MerchantBuyBackItemItemButton, "OnEvent", function() - this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + this:SetBackdropBorderColor(unpack(E.media.bordercolor)) end) local buybackName = GetBuybackItemInfo(GetNumBuybackItems()) @@ -130,7 +130,7 @@ local function LoadSkin() MerchantBuyBackItemName:SetTextColor(GetItemQualityColor(quality)) MerchantBuyBackItemItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) else - MerchantBuyBackItemItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + MerchantBuyBackItemItemButton:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end end @@ -150,7 +150,7 @@ local function LoadSkin() itemName:SetTextColor(GetItemQualityColor(quality)) itemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) else - itemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + itemButton:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end end diff --git a/ElvUI/Modules/Skins/Blizzard/MirrorTimers.lua b/ElvUI/Modules/Skins/Blizzard/MirrorTimers.lua index a7fe174..b69e02a 100644 --- a/ElvUI/Modules/Skins/Blizzard/MirrorTimers.lua +++ b/ElvUI/Modules/Skins/Blizzard/MirrorTimers.lua @@ -40,7 +40,7 @@ local function LoadSkin() E:StripTextures(mirrorTimer) E:Size(mirrorTimer, 222, 18) mirrorTimer.label = text - statusBar:SetStatusBarTexture(E["media"].normTex) + statusBar:SetStatusBarTexture(E.media.normTex) E:RegisterStatusBar(statusBar) E:CreateBackdrop(statusBar) E:Size(statusBar, 222, 18) diff --git a/ElvUI/Modules/Skins/Blizzard/Petition.lua b/ElvUI/Modules/Skins/Blizzard/Petition.lua index 5de43c1..01bf67a 100644 --- a/ElvUI/Modules/Skins/Blizzard/Petition.lua +++ b/ElvUI/Modules/Skins/Blizzard/Petition.lua @@ -9,6 +9,7 @@ local _G = _G local function LoadSkin() 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:CreateBackdrop(PetitionFrame, "Transparent") E:Point(PetitionFrame.backdrop, "TOPLEFT", 12, -17) diff --git a/ElvUI/Modules/Skins/Blizzard/Quest.lua b/ElvUI/Modules/Skins/Blizzard/Quest.lua index b721291..6ebd724 100644 --- a/ElvUI/Modules/Skins/Blizzard/Quest.lua +++ b/ElvUI/Modules/Skins/Blizzard/Quest.lua @@ -126,8 +126,8 @@ local function LoadSkin() text:SetTextColor(GetItemQualityColor(quality)) else if frame then - frame:SetBackdropBorderColor(unpack(E["media"].bordercolor)) - frame.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + frame:SetBackdropBorderColor(unpack(E.media.bordercolor)) + frame.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor)) end text:SetTextColor(1, 1, 1) end @@ -140,7 +140,7 @@ local function LoadSkin() E:Size(QuestRewardItemHighlight, 142, 40) hooksecurefunc("QuestRewardItem_OnClick", function() - QuestRewardItemHighlight:ClearAllPoints(); + QuestRewardItemHighlight:ClearAllPoints() E:SetOutside(QuestRewardItemHighlight, this:GetName().."IconTexture") _G[this:GetName().."Name"]:SetTextColor(1, 1, 0) diff --git a/ElvUI/Modules/Skins/Blizzard/Raid.lua b/ElvUI/Modules/Skins/Blizzard/Raid.lua index 106c9e4..ca1d775 100644 --- a/ElvUI/Modules/Skins/Blizzard/Raid.lua +++ b/ElvUI/Modules/Skins/Blizzard/Raid.lua @@ -69,7 +69,7 @@ local function LoadSkin() for _, v in pairs{"HealthBar", "ManaBar", "Target", "TargetTarget"} do local sBar = pfBName..v E:StripTextures(_G[sBar]) - _G[sBar]:SetStatusBarTexture(E["media"].normTex) + _G[sBar]:SetStatusBarTexture(E.media.normTex) end E:Point(_G[pfBName.."ManaBar"], "TOP", "$parentHealthBar", "BOTTOM", 0, 0) diff --git a/ElvUI/Modules/Skins/Blizzard/SpellBook.lua b/ElvUI/Modules/Skins/Blizzard/SpellBook.lua index 68ffafd..994177f 100644 --- a/ElvUI/Modules/Skins/Blizzard/SpellBook.lua +++ b/ElvUI/Modules/Skins/Blizzard/SpellBook.lua @@ -6,10 +6,13 @@ local S = E:GetModule("Skins"); local _G = _G local unpack = unpack --WoW API / Variables +local CreateFrame = CreateFrame +local hooksecurefunc = hooksecurefunc local function LoadSkin() 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:CreateBackdrop(SpellBookFrame, "Transparent") E:Point(SpellBookFrame.backdrop, "TOPLEFT", 10, -12) @@ -28,7 +31,7 @@ local function LoadSkin() if currentPage > 1 then PrevPageButton_OnClick() end - else + else if currentPage < maxPages then NextPageButton_OnClick() end diff --git a/ElvUI/Modules/Skins/Blizzard/Stable.lua b/ElvUI/Modules/Skins/Blizzard/Stable.lua index 7d2730d..0f84de1 100644 --- a/ElvUI/Modules/Skins/Blizzard/Stable.lua +++ b/ElvUI/Modules/Skins/Blizzard/Stable.lua @@ -13,6 +13,7 @@ local UnitExists = UnitExists local function LoadSkin() 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:Kill(PetStableFramePortrait) E:CreateBackdrop(PetStableFrame, "Transparent") diff --git a/ElvUI/Modules/Skins/Blizzard/Tabard.lua b/ElvUI/Modules/Skins/Blizzard/Tabard.lua index 23bd693..04c8199 100644 --- a/ElvUI/Modules/Skins/Blizzard/Tabard.lua +++ b/ElvUI/Modules/Skins/Blizzard/Tabard.lua @@ -10,6 +10,7 @@ local hooksecurefunc = hooksecurefunc local function LoadSkin() 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:Kill(TabardFramePortrait) E:CreateBackdrop(TabardFrame, "Transparent") diff --git a/ElvUI/Modules/Skins/Blizzard/Talent.lua b/ElvUI/Modules/Skins/Blizzard/Talent.lua index fd919ce..0e9ff69 100644 --- a/ElvUI/Modules/Skins/Blizzard/Talent.lua +++ b/ElvUI/Modules/Skins/Blizzard/Talent.lua @@ -12,6 +12,7 @@ local function LoadSkin() UIPanelWindows["TalentFrame"] = {area = "left", pushable = 0, whileDead = 1} + local PlayerTalentFrame = _G["PlayerTalentFrame"] E:StripTextures(TalentFrame) E:CreateBackdrop(TalentFrame, "Transparent") E:Point(TalentFrame.backdrop, "TOPLEFT", 13, -12) diff --git a/ElvUI/Modules/Skins/Blizzard/Taxi.lua b/ElvUI/Modules/Skins/Blizzard/Taxi.lua index 0088d6c..ce97ad3 100644 --- a/ElvUI/Modules/Skins/Blizzard/Taxi.lua +++ b/ElvUI/Modules/Skins/Blizzard/Taxi.lua @@ -1,6 +1,10 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local S = E:GetModule("Skins"); +--Cache global variables +--Lua functions +local _G = _G + local function LoadSkin() if E.private.skins.blizzard.enable ~= true or E.private.skins.blizzard.taxi ~= true then return end diff --git a/ElvUI/Modules/Skins/Blizzard/Tooltip.lua b/ElvUI/Modules/Skins/Blizzard/Tooltip.lua index 331fbeb..600fa9e 100644 --- a/ElvUI/Modules/Skins/Blizzard/Tooltip.lua +++ b/ElvUI/Modules/Skins/Blizzard/Tooltip.lua @@ -14,7 +14,7 @@ local function LoadSkin() S:HandleCloseButton(ItemRefCloseButton) local GameTooltip = _G["GameTooltip"] - local GameTooltipStatusBar = _G["GameTooltipStatusBar"] + local GameTooltipStatusBar = _G["GameTooltipStatusBar"] local tooltips = { GameTooltip, ItemRefTooltip, @@ -37,7 +37,7 @@ local function LoadSkin() TT:SecureHookScript(tt, "OnShow", "CheckBackdropColor") end - GameTooltipStatusBar:SetStatusBarTexture(E["media"].normTex) + GameTooltipStatusBar:SetStatusBarTexture(E.media.normTex) E:RegisterStatusBar(GameTooltipStatusBar) E:CreateBackdrop(GameTooltipStatusBar, "Transparent") GameTooltipStatusBar:ClearAllPoints() diff --git a/ElvUI/Modules/Skins/Blizzard/Trade.lua b/ElvUI/Modules/Skins/Blizzard/Trade.lua index 611b2eb..bc63ab7 100644 --- a/ElvUI/Modules/Skins/Blizzard/Trade.lua +++ b/ElvUI/Modules/Skins/Blizzard/Trade.lua @@ -6,14 +6,16 @@ local S = E:GetModule("Skins"); local _G = _G local unpack = unpack --WoW API / Variables +local CreateFrame = CreateFrame +local hooksecurefunc = hooksecurefunc local GetItemQualityColor = GetItemQualityColor local GetTradePlayerItemInfo = GetTradePlayerItemInfo local GetTradeTargetItemInfo = GetTradeTargetItemInfo -local hooksecurefunc = hooksecurefunc local function LoadSkin() 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:Width(TradeFrame, 400) E:CreateBackdrop(TradeFrame, "Transparent") @@ -101,7 +103,7 @@ local function LoadSkin() tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) end else - tradeItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + tradeItemButton:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end) @@ -117,7 +119,7 @@ local function LoadSkin() tradeItemButton:SetBackdropBorderColor(GetItemQualityColor(quality)) end else - tradeItemButton:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + tradeItemButton:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end) end diff --git a/ElvUI/Modules/Skins/Blizzard/TradeSkill.lua b/ElvUI/Modules/Skins/Blizzard/TradeSkill.lua index 7e21d51..20132dd 100644 --- a/ElvUI/Modules/Skins/Blizzard/TradeSkill.lua +++ b/ElvUI/Modules/Skins/Blizzard/TradeSkill.lua @@ -22,6 +22,7 @@ local function LoadSkin() UIPanelWindows["TradeSkillFrame"] = {area = "doublewide", pushable = 0, whileDead = 1} + local TradeSkillFrame = _G["TradeSkillFrame"] E:StripTextures(TradeSkillFrame, true) E:CreateBackdrop(TradeSkillFrame, "Transparent") TradeSkillFrame.backdrop:SetPoint("TOPLEFT", 10, -12) @@ -47,7 +48,7 @@ local function LoadSkin() E:Size(TradeSkillRankFrame, 420, 18) TradeSkillRankFrame:ClearAllPoints() TradeSkillRankFrame:SetPoint("TOP", -10, -38) - TradeSkillRankFrame:SetStatusBarTexture(E["media"].normTex) + TradeSkillRankFrame:SetStatusBarTexture(E.media.normTex) E:RegisterStatusBar(TradeSkillRankFrame) TradeSkillRankFrameSkillName:Hide() @@ -224,7 +225,7 @@ local function LoadSkin() TradeSkillSkillIcon:SetBackdropBorderColor(GetItemQualityColor(quality)) TradeSkillSkillName:SetTextColor(GetItemQualityColor(quality)) else - TradeSkillSkillIcon:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + TradeSkillSkillIcon:SetBackdropBorderColor(unpack(E.media.bordercolor)) TradeSkillSkillName:SetTextColor(1, 1, 1) end end @@ -248,8 +249,8 @@ local function LoadSkin() name:SetTextColor(GetItemQualityColor(quality)) end else - reagent:SetBackdropBorderColor(unpack(E["media"].bordercolor)) - icon.backdrop:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + reagent:SetBackdropBorderColor(unpack(E.media.bordercolor)) + icon.backdrop:SetBackdropBorderColor(unpack(E.media.bordercolor)) end end end diff --git a/ElvUI/Modules/Skins/Blizzard/WorldMap.lua b/ElvUI/Modules/Skins/Blizzard/WorldMap.lua index 0db00ec..eafe6f0 100644 --- a/ElvUI/Modules/Skins/Blizzard/WorldMap.lua +++ b/ElvUI/Modules/Skins/Blizzard/WorldMap.lua @@ -1,9 +1,14 @@ local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local S = E:GetModule("Skins"); +--Cache global variables +--Lua functions +local _G = _G + local function LoadSkin() 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:CreateBackdrop(WorldMapPositioningGuide, "Transparent") diff --git a/ElvUI/Modules/Skins/Skins.lua b/ElvUI/Modules/Skins/Skins.lua index 5b6e49e..35a428a 100644 --- a/ElvUI/Modules/Skins/Skins.lua +++ b/ElvUI/Modules/Skins/Skins.lua @@ -38,12 +38,12 @@ end function S:SetModifiedBackdrop() if this.backdrop then this = this.backdrop end - this:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor)) + this:SetBackdropBorderColor(unpack(E.media.rgbvaluecolor)) end function S:SetOriginalBackdrop() if this.backdrop then this = this.backdrop end - this:SetBackdropBorderColor(unpack(E["media"].bordercolor)) + this:SetBackdropBorderColor(unpack(E.media.bordercolor)) end function S:HandleButton(f, strip) @@ -389,7 +389,7 @@ function S:HandleSliderFrame(frame) frame:SetBackdrop(nil) end end) - frame:SetThumbTexture(E["media"].blankTex) + frame:SetThumbTexture(E.media.blankTex) frame:GetThumbTexture():SetVertexColor(0.3, 0.3, 0.3) E:Size(frame:GetThumbTexture(), SIZE-2) if orientation == "VERTICAL" then @@ -460,9 +460,9 @@ function S:ADDON_LOADED() self.addonsToLoad[arg1] = nil elseif self.addonCallbacks[arg1] then --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]["CallPriority"][index] = nil + self.addonCallbacks[arg1].CallPriority[index] = nil E.callbacks:Fire(event) end end @@ -475,9 +475,9 @@ function S:ADDON_LOADED() self.addonsToLoad[arg1]() self.addonsToLoad[arg1] = nil 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]["CallPriority"][index] = nil + self.addonCallbacks[arg1].CallPriority[index] = nil E.callbacks:Fire(event) end end @@ -536,7 +536,7 @@ function S:AddCallbackForAddon(addonName, eventName, loadFunc, forceLoad, bypass else --Insert eventName in this addons' registry self.addonCallbacks[addonName][eventName] = true - tinsert(self.addonCallbacks[addonName]["CallPriority"], eventName) + tinsert(self.addonCallbacks[addonName].CallPriority, eventName) end end @@ -559,7 +559,7 @@ function S:AddCallback(eventName, loadFunc) --Add event name to registry self.nonAddonCallbacks[eventName] = true - tinsert(self.nonAddonCallbacks["CallPriority"], eventName) + tinsert(self.nonAddonCallbacks.CallPriority, eventName) --Register loadFunc to be called when event is fired E.RegisterCallback(E, eventName, loadFunc) @@ -571,17 +571,17 @@ function S:Initialize() --Fire events for Blizzard addons that are already loaded for addon in pairs(self.addonCallbacks) do 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]["CallPriority"][index] = nil + self.addonCallbacks[addon].CallPriority[index] = nil E.callbacks:Fire(event) end end end --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["CallPriority"][index] = nil + self.nonAddonCallbacks.CallPriority[index] = nil E.callbacks:Fire(event) end diff --git a/ElvUI/Modules/Tooltip/Tooltip.lua b/ElvUI/Modules/Tooltip/Tooltip.lua index b7b06c5..597766a 100644 --- a/ElvUI/Modules/Tooltip/Tooltip.lua +++ b/ElvUI/Modules/Tooltip/Tooltip.lua @@ -97,7 +97,7 @@ function TT:GameTooltip_SetDefaultAnchor(tt, parent) end if self.db.cursorAnchor then tt:SetOwner(parent, "ANCHOR_CURSOR") - return; + return else tt:SetOwner(parent, "ANCHOR_NONE") end @@ -207,10 +207,10 @@ function TT:UPDATE_MOUSEOVER_UNIT(_, unit) local unitTarget = unit.."target" if self.db.targetInfo and unit ~= "player" and UnitExists(unitTarget) then - local targetColor; + local targetColor if UnitIsPlayer(unitTarget) then - local _, class = UnitClass(unitTarget); - targetColor = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]; + local _, class = UnitClass(unitTarget) + targetColor = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class] else local reaction = UnitReaction(unitTarget, "player") or 4 targetColor = E.db.tooltip.useCustomFactionColors and E.db.tooltip.factionColors[reaction] or FACTION_BAR_COLORS[reaction] diff --git a/ElvUI/Modules/UnitFrames/Config_Enviroment.lua b/ElvUI/Modules/UnitFrames/Config_Enviroment.lua index 5c1233a..6e5e676 100644 --- a/ElvUI/Modules/UnitFrames/Config_Enviroment.lua +++ b/ElvUI/Modules/UnitFrames/Config_Enviroment.lua @@ -259,17 +259,17 @@ function UF:HeaderConfig(header, configMode) end end - UF["headerFunctions"][header.groupName]:AdjustVisibility(header) + UF.headerFunctions[header.groupName]:AdjustVisibility(header) end function UF:PLAYER_REGEN_DISABLED() - for _, header in pairs(UF["headers"]) do + for _, header in pairs(UF.headers) do if header.forceShow then self:HeaderConfig(header) end end - for _, unit in pairs(UF["units"]) do + for _, unit in pairs(UF.units) do local frame = self[unit] if frame and frame.forceShow then self:UnforceShow(frame) diff --git a/ElvUI/Modules/UnitFrames/Elements/AuraBars.lua b/ElvUI/Modules/UnitFrames/Elements/AuraBars.lua index d339f4e..8c1db99 100644 --- a/ElvUI/Modules/UnitFrames/Elements/AuraBars.lua +++ b/ElvUI/Modules/UnitFrames/Elements/AuraBars.lua @@ -24,7 +24,7 @@ function UF:Construct_AuraBars() E:SetTemplate(self, "Default", nil, nil, UF.thinBorders, true) local inset = UF.thinBorders and E.mult or nil E:SetInside(bar, self, inset, inset) - UF["statusbars"][bar] = true + UF.statusbars[bar] = true UF:Update_StatusBar(bar) UF:Configure_FontString(bar.spelltime) diff --git a/ElvUI/Modules/UnitFrames/Elements/Auras.lua b/ElvUI/Modules/UnitFrames/Elements/Auras.lua index c1778cf..206310b 100644 --- a/ElvUI/Modules/UnitFrames/Elements/Auras.lua +++ b/ElvUI/Modules/UnitFrames/Elements/Auras.lua @@ -79,7 +79,7 @@ function UF:Construct_AuraIcon(button) if auraName then 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, ["priority"] = 0, } @@ -319,8 +319,8 @@ function UF:UpdateAuraIconSettings(auras, noCycle) if not frame.db then return end local db = frame.db[type] - local unitframeFont = LSM:Fetch("font", E.db["unitframe"].font) - local unitframeFontOutline = E.db["unitframe"].fontOutline + local unitframeFont = LSM:Fetch("font", E.db.unitframe.font) + local unitframeFontOutline = E.db.unitframe.fontOutline local index = 1 auras.db = db if db then @@ -421,7 +421,7 @@ function UF:UpdateAuraTimer(elapsed) if self.text:GetFont() then self.text:SetText(format("%s%s|r", E.TimeColors[formatid], E.TimeFormats[formatid][2]), timervalue) 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) end end diff --git a/ElvUI/Modules/UnitFrames/Elements/Castbar.lua b/ElvUI/Modules/UnitFrames/Elements/Castbar.lua index 3d961b1..4499d9c 100644 --- a/ElvUI/Modules/UnitFrames/Elements/Castbar.lua +++ b/ElvUI/Modules/UnitFrames/Elements/Castbar.lua @@ -30,7 +30,7 @@ local INVERT_ANCHORPOINT = { function UF:Construct_Castbar(frame, moverName) local castbar = CreateFrame("StatusBar", nil, frame) 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.CustomTimeText = self.CustomTimeText castbar.PostCastStart = self.PostCastStart diff --git a/ElvUI/Modules/UnitFrames/Elements/Power.lua b/ElvUI/Modules/UnitFrames/Elements/Power.lua index 288e642..0424447 100644 --- a/ElvUI/Modules/UnitFrames/Elements/Power.lua +++ b/ElvUI/Modules/UnitFrames/Elements/Power.lua @@ -13,7 +13,7 @@ assert(ElvUF, "ElvUI was unable to locate oUF.") function UF:Construct_PowerBar(frame, bg, text, textPos) local power = CreateFrame("StatusBar", nil, frame) - UF["statusbars"][power] = true + UF.statusbars[power] = true power.PostUpdate = self.PostUpdatePower @@ -22,7 +22,7 @@ function UF:Construct_PowerBar(frame, bg, text, textPos) if bg then power.bg = power:CreateTexture(nil, "BORDER") power.bg:SetAllPoints() - power.bg:SetTexture(E["media"].blankTex) + power.bg:SetTexture(E.media.blankTex) power.bg.multiplier = 0.2 end diff --git a/ElvUI/Modules/UnitFrames/Groups/Party.lua b/ElvUI/Modules/UnitFrames/Groups/Party.lua index 8376da5..b20027b 100644 --- a/ElvUI/Modules/UnitFrames/Groups/Party.lua +++ b/ElvUI/Modules/UnitFrames/Groups/Party.lua @@ -35,7 +35,7 @@ function UF:Construct_PartyFrames() UF:Update_StatusBars() UF:Update_FontStrings() - UF:Update_PartyFrames(self, UF.db["units"]["party"]) + UF:Update_PartyFrames(self, UF.db.units.party) return self; end @@ -59,7 +59,7 @@ function UF:Update_PartyHeader(header) header:RegisterEvent("PARTY_MEMBERS_CHANGED") header:RegisterEvent("RAID_ROSTER_UPDATE") - header:SetScript("OnEvent", UF["PartySmartVisibility"]) + header:SetScript("OnEvent", UF.PartySmartVisibility) header.positioned = true end @@ -136,4 +136,4 @@ function UF:Update_PartyFrames(frame, db) frame:UpdateAllElements("ElvUI_UpdateAllElements") end -UF["headerstoload"]["party"] = true \ No newline at end of file +UF.headerstoload.party = true \ No newline at end of file diff --git a/ElvUI/Modules/UnitFrames/Groups/Raid.lua b/ElvUI/Modules/UnitFrames/Groups/Raid.lua index cbfd7f7..d856a49 100644 --- a/ElvUI/Modules/UnitFrames/Groups/Raid.lua +++ b/ElvUI/Modules/UnitFrames/Groups/Raid.lua @@ -37,7 +37,7 @@ function UF:Construct_RaidFrames() UF:Update_FontStrings() self.unitframeType = "raid" - UF:Update_RaidFrames(self, UF.db["units"]["raid"]) + UF:Update_RaidFrames(self, UF.db.units.raid) return self end @@ -61,7 +61,7 @@ function UF:Update_RaidHeader(header) header:RegisterEvent("PARTY_MEMBERS_CHANGED") header:RegisterEvent("RAID_ROSTER_UPDATE") - header:SetScript("OnEvent", UF["RaidSmartVisibility"]) + header:SetScript("OnEvent", UF.RaidSmartVisibility) header.positioned = true end @@ -140,4 +140,4 @@ function UF:Update_RaidFrames(frame, db) frame:UpdateAllElements("ElvUI_UpdateAllElements") end -UF["headerstoload"]["raid"] = true \ No newline at end of file +UF.headerstoload.raid = true \ No newline at end of file diff --git a/ElvUI/Modules/UnitFrames/Tags.lua b/ElvUI/Modules/UnitFrames/Tags.lua index 7116869..299b663 100644 --- a/ElvUI/Modules/UnitFrames/Tags.lua +++ b/ElvUI/Modules/UnitFrames/Tags.lua @@ -161,7 +161,7 @@ ElvUF.Tags.Methods["health:deficit-percent:name"] = function(unit) if (deficit > 0 and currentHealth > 0) then return _TAGS["health:percent-nostatus"](unit); else - return _TAGS["name"](unit); + return _TAGS.name(unit); 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.Methods["powercolor"] = function(unit) - local color = ElvUF["colors"].power[UnitPowerType(unit)] + local color = ElvUF.colors.power[UnitPowerType(unit)] if color then return Hex(color[1], color[2], color[3]) else - return Hex(unpack(ElvUF["colors"].power[0])) + return Hex(unpack(ElvUF.colors.power[0])) end end @@ -271,8 +271,8 @@ ElvUF.Tags.Methods["power:max"] = function(unit) end ElvUF.Tags.Methods["manacolor"] = function() - local altR, altG, altB = PowerBarColor["MANA"].r, PowerBarColor["MANA"].g, PowerBarColor["MANA"].b - local color = ElvUF["colors"].power["MANA"] + local altR, altG, altB = PowerBarColor.MANA.r, PowerBarColor.MANA.g, PowerBarColor.MANA.b + local color = ElvUF.colors.power[0] if color then return Hex(color[1], color[2], color[3]) else @@ -358,7 +358,7 @@ ElvUF.Tags.Methods["namecolor"] = function(unit) if not class then return "" end return Hex(class[1], class[2], class[3]) elseif (unitReaction) then - local reaction = ElvUF["colors"].reaction[unitReaction] + local reaction = ElvUF.colors.reaction[unitReaction] return Hex(reaction[1], reaction[2], reaction[3]) else return "|cFFC2C2C2" diff --git a/ElvUI/Modules/UnitFrames/UnitFrames.lua b/ElvUI/Modules/UnitFrames/UnitFrames.lua index 73ed7de..a7b1984 100644 --- a/ElvUI/Modules/UnitFrames/UnitFrames.lua +++ b/ElvUI/Modules/UnitFrames/UnitFrames.lua @@ -24,37 +24,37 @@ local ns = oUF ElvUF = ns.oUF assert(ElvUF, "ElvUI was unable to locate oUF.") -UF["headerstoload"] = {} -UF["unitstoload"] = {} +UF.headerstoload = {} +UF.unitstoload = {} -UF["groupPrototype"] = {} -UF["headerPrototype"] = {} -UF["headers"] = {} -UF["units"] = {} +UF.groupPrototype = {} +UF.headerPrototype = {} +UF.headers = {} +UF.units = {} -UF["statusbars"] = {} -UF["fontstrings"] = {} -UF["badHeaderPoints"] = { +UF.statusbars = {} +UF.fontstrings = {} +UF.badHeaderPoints = { ["TOP"] = "BOTTOM", ["LEFT"] = "RIGHT", ["BOTTOM"] = "TOP", ["RIGHT"] = "LEFT" } -UF["headerFunctions"] = {} +UF.headerFunctions = {} -UF["classMaxResourceBar"] = { +UF.classMaxResourceBar = { ["DRUID"] = 1 } -UF["mapIDs"] = { +UF.mapIDs = { [443] = 10, -- Warsong Gulch [461] = 15, -- Arathi Basin [401] = 40, -- Alterac Valley [566] = 15, -- Eye of the Storm } -UF["headerGroupBy"] = { +UF.headerGroupBy = { ["CLASS"] = function(header) header:SetAttribute("groupingOrder", "DRUID,HUNTER,MAGE,PALADIN,PRIEST,SHAMAN,WARLOCK,WARRIOR") header:SetAttribute("sortMethod", "NAME") @@ -325,7 +325,7 @@ end function UF:Update_StatusBars() 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 statusbar:SetStatusBarTexture(statusBarTexture) elseif statusbar and statusbar:GetObjectType() == "Texture" then @@ -344,24 +344,24 @@ end function UF:Update_FontStrings() 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) end end function UF:Configure_FontString(obj) - UF["fontstrings"][obj] = true + UF.fontstrings[obj] = true E:FontTemplate(obj) --This is temporary. end 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:Update_FontStrings() self:Update_StatusBars() - for unit in pairs(self["units"]) do - if self.db["units"][unit].enable then + for unit in pairs(self.units) do + if self.db.units[unit].enable then self[unit]:Enable() self[unit]:Update() E:EnableMover(self[unit].mover:GetName()) @@ -519,9 +519,9 @@ end function UF.groupPrototype:Update(self) 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 - self.groups[i].db = UF.db["units"][group] + self.groups[i].db = UF.db.units[group] self.groups[i]:Update() end end @@ -548,7 +548,7 @@ end function UF.groupPrototype:UpdateHeader(self) 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 function UF.headerPrototype:ClearChildPoints() @@ -560,7 +560,7 @@ end function UF.headerPrototype:Update(isForced) local group = self.groupName - local db = UF.db["units"][group] + local db = UF.db.units[group] local i = 1 local child = self:GetAttribute("child" .. i) @@ -609,7 +609,7 @@ end function UF:CreateHeader(parent, groupFilter, overrideName, template, groupName, headerTemplate) local group = parent.groupName or groupName - local db = UF.db["units"][group] + local db = UF.db.units[group] ElvUF:SetActiveStyle("ElvUF_"..E:StringTitle(group)) local header = ElvUF:SpawnHeader(overrideName, headerTemplate, nil, "groupFilter", groupFilter, @@ -630,7 +630,7 @@ function UF:CreateHeader(parent, groupFilter, overrideName, template, groupName, end function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdate, headerTemplate) - local db = self.db["units"][group] + local db = self.db.units[group] local numGroups = db.numGroups if not self[group] then @@ -645,16 +645,16 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat self[group].groupName = group self[group].template = self[group].template or template self[group].headerTemplate = self[group].headerTemplate or headerTemplate - if not UF["headerFunctions"][group] then UF["headerFunctions"][group] = {} end + if not UF.headerFunctions[group] then UF.headerFunctions[group] = {} end for k, v in pairs(self.groupPrototype) do - UF["headerFunctions"][group][k] = v + UF.headerFunctions[group][k] = v end else self[group] = self:CreateHeader(E.UIParent, groupFilter, "ElvUF_"..E:StringTitle(group), template, group, headerTemplate) end self[group].db = db - self["headers"][group] = self[group] + self.headers[group] = self[group] self[group]:Show() end @@ -671,17 +671,17 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat end end - UF["headerFunctions"][group]:AdjustVisibility(self[group]) + UF.headerFunctions[group]:AdjustVisibility(self[group]) 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 -- RegisterStateDriver(self[group], "visibility", db.visibility) end else - UF["headerFunctions"][group]:Configure_Groups(self[group]) - UF["headerFunctions"][group]:UpdateHeader(self[group]) - UF["headerFunctions"][group]:Update(self[group]) + UF.headerFunctions[group]:Configure_Groups(self[group]) + UF.headerFunctions[group]:UpdateHeader(self[group]) + UF.headerFunctions[group]:Update(self[group]) end if db.enable then @@ -700,9 +700,9 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat else self[group].db = db - if not UF["headerFunctions"][group] then UF["headerFunctions"][group] = {} end - UF["headerFunctions"][group]["Update"] = function() - local db = UF.db["units"][group] + if not UF.headerFunctions[group] then UF.headerFunctions[group] = {} end + UF.headerFunctions[group]["Update"] = function() + local db = UF.db.units[group] if db.enable ~= true then --UnregisterStateDriver(UF[group], "visibility") UF[group]:Hide() @@ -715,14 +715,14 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat for i = 1, UF[group]:GetNumChildren() do local child = select(i, UF[group]:GetChildren()) - UF["Update_"..E:StringTitle(group).."Frames"](UF, child, UF.db["units"][group]) + UF["Update_"..E:StringTitle(group).."Frames"](UF, child, UF.db.units[group]) if _G[child:GetName().."Target"] then - UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Target"], UF.db["units"][group]) + UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Target"], UF.db.units[group]) end if _G[child:GetName().."Pet"] then - UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Pet"], UF.db["units"][group]) + UF["Update_"..E:StringTitle(group).."Frames"](UF, _G[child:GetName().."Pet"], UF.db.units[group]) end end @@ -732,7 +732,7 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat if headerUpdate then UF["Update_"..E:StringTitle(group).."Header"](self, self[group], db) else - UF["headerFunctions"][group]:Update(self[group]) + UF.headerFunctions[group]:Update(self[group]) end end end @@ -749,14 +749,14 @@ function UF:CreateAndUpdateUF(unit) frameName = gsub(frameName, "t(arget)", "T%1") if not self[unit] then self[unit] = ElvUF:Spawn(unit, "ElvUF_"..frameName) - self["units"][unit] = unit + self.units[unit] = unit end 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 - if self.db["units"][unit].enable then + if self.db.units[unit].enable then self[unit]:Enable() self[unit].Update() E:EnableMover(self[unit].mover:GetName()) @@ -767,12 +767,12 @@ function UF:CreateAndUpdateUF(unit) end function UF:LoadUnits() - for _, unit in pairs(self["unitstoload"]) do + for _, unit in pairs(self.unitstoload) do self:CreateAndUpdateUF(unit) 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 if type(groupOptions) == "table" then groupFilter, template, headerTemplate = unpack(groupOptions) @@ -780,7 +780,7 @@ function UF:LoadUnits() self:CreateAndUpdateHeaderGroup(group, groupFilter, template, nil, headerTemplate) end - self["headerstoload"] = nil + self.headerstoload = nil end function UF:UpdateAllHeaders(event) @@ -796,15 +796,15 @@ function UF:UpdateAllHeaders(event) end end - if E.private["unitframe"]["disabledBlizzardFrames"].party then + if E.private.unitframe.disabledBlizzardFrames.party then ElvUF:DisableBlizzard("party") end - for group, header in pairs(self["headers"]) do + for group, header in pairs(self.headers) do if header.numGroups then - UF["headerFunctions"][group]:UpdateHeader(header) + UF.headerFunctions[group]:UpdateHeader(header) end - UF["headerFunctions"][group]:Update(header) + UF.headerFunctions[group]:Update(header) if group == "party" or group == "raid" then --Update BuffIndicators on profile change as they might be using profile specific data @@ -851,19 +851,19 @@ end function ElvUF:DisableBlizzard(unit) 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) - elseif(unit == "pet") and E.private["unitframe"]["disabledBlizzardFrames"].player then + elseif(unit == "pet") and E.private.unitframe.disabledBlizzardFrames.player then 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(ComboFrame) --- elseif(unit == "focus") and E.private["unitframe"]["disabledBlizzardFrames"].focus then +-- elseif(unit == "focus") and E.private.unitframe.disabledBlizzardFrames.focus then -- HandleFrame(FocusFrame) -- HandleFrame(FocusFrameToT) - elseif(unit == "targettarget") and E.private["unitframe"]["disabledBlizzardFrames"].target then + elseif(unit == "targettarget") and E.private.unitframe.disabledBlizzardFrames.target then HandleFrame(TargetofTargetFrame) - elseif string.match(unit, "(party)%d?$") == "party" and E.private["unitframe"]["disabledBlizzardFrames"].party then + elseif string.match(unit, "(party)%d?$") == "party" and E.private.unitframe.disabledBlizzardFrames.party then local id = string.match(unit, "party(%d)") if id then HandleFrame("PartyMemberFrame"..id) @@ -892,9 +892,9 @@ function UF:PLAYER_ENTERING_WORLD() end function UF:Initialize() - self.db = E.db["unitframe"] + self.db = E.db.unitframe 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 self:UpdateColors() @@ -915,14 +915,14 @@ function UF:Initialize() end 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 - self.db["units"][unit].buffs.sizeOverride = P.unitframe.units[unit].buffs.sizeOverride or 0 + if self.db.units[unit].buffs and self.db.units[unit].buffs.sizeOverride then + self.db.units[unit].buffs.sizeOverride = P.unitframe.units[unit].buffs.sizeOverride or 0 end - if self.db["units"][unit].debuffs and self.db["units"][unit].debuffs.sizeOverride then - self.db["units"][unit].debuffs.sizeOverride = P.unitframe.units[unit].debuffs.sizeOverride or 0 + if self.db.units[unit].debuffs and self.db.units[unit].debuffs.sizeOverride then + self.db.units[unit].debuffs.sizeOverride = P.unitframe.units[unit].debuffs.sizeOverride or 0 end self:Update_AllFrames() @@ -958,7 +958,7 @@ local allowPass = { } function UF:MergeUnitSettings(fromUnit, toUnit, isGroupUnit) - local db = self.db["units"] + local db = self.db.units local filter = ignoreSettings if isGroupUnit then filter = ignoreSettingsGroup diff --git a/ElvUI/Modules/UnitFrames/Units/Pet.lua b/ElvUI/Modules/UnitFrames/Units/Pet.lua index c43ddc5..c3eb5f5 100644 --- a/ElvUI/Modules/UnitFrames/Units/Pet.lua +++ b/ElvUI/Modules/UnitFrames/Units/Pet.lua @@ -86,4 +86,4 @@ function UF:Update_PetFrame(frame, db) frame:UpdateAllElements("ElvUI_UpdateAllElements") end -tinsert(UF["unitstoload"], "pet") \ No newline at end of file +tinsert(UF.unitstoload, "pet") \ No newline at end of file diff --git a/ElvUI/Modules/UnitFrames/Units/PetTarget.lua b/ElvUI/Modules/UnitFrames/Units/PetTarget.lua index 03c6f60..4a320ba 100644 --- a/ElvUI/Modules/UnitFrames/Units/PetTarget.lua +++ b/ElvUI/Modules/UnitFrames/Units/PetTarget.lua @@ -83,4 +83,4 @@ function UF:Update_PetTargetFrame(frame, db) frame:UpdateAllElements("ElvUI_UpdateAllElements") end -tinsert(UF["unitstoload"], "pettarget") \ No newline at end of file +tinsert(UF.unitstoload, "pettarget") \ No newline at end of file diff --git a/ElvUI/Modules/UnitFrames/Units/Player.lua b/ElvUI/Modules/UnitFrames/Units/Player.lua index a61c843..4320db7 100644 --- a/ElvUI/Modules/UnitFrames/Units/Player.lua +++ b/ElvUI/Modules/UnitFrames/Units/Player.lua @@ -113,4 +113,4 @@ function UF:Update_PlayerFrame(frame, db) frame:UpdateAllElements("ElvUI_UpdateAllElements") end -tinsert(UF["unitstoload"], "player") \ No newline at end of file +tinsert(UF.unitstoload, "player") \ No newline at end of file diff --git a/ElvUI/Modules/UnitFrames/Units/Target.lua b/ElvUI/Modules/UnitFrames/Units/Target.lua index 56d9f0a..1a00969 100644 --- a/ElvUI/Modules/UnitFrames/Units/Target.lua +++ b/ElvUI/Modules/UnitFrames/Units/Target.lua @@ -102,4 +102,4 @@ function UF:Update_TargetFrame(frame, db) frame:UpdateAllElements("ElvUI_UpdateAllElements") end -tinsert(UF["unitstoload"], "target") \ No newline at end of file +tinsert(UF.unitstoload, "target") \ No newline at end of file diff --git a/ElvUI/Modules/UnitFrames/Units/TargetTarget.lua b/ElvUI/Modules/UnitFrames/Units/TargetTarget.lua index 5932f56..087f039 100644 --- a/ElvUI/Modules/UnitFrames/Units/TargetTarget.lua +++ b/ElvUI/Modules/UnitFrames/Units/TargetTarget.lua @@ -82,4 +82,4 @@ function UF:Update_TargetTargetFrame(frame, db) frame:UpdateAllElements("ElvUI_UpdateAllElements") end -tinsert(UF["unitstoload"], "targettarget") \ No newline at end of file +tinsert(UF.unitstoload, "targettarget") \ No newline at end of file