From 92c9472cfe7ab2744222ff692da3ec8f38e5c2ef Mon Sep 17 00:00:00 2001 From: Eltreum <30246110+eltreum0@users.noreply.github.com> Date: Tue, 14 Nov 2023 16:29:23 -0300 Subject: [PATCH] more C_CVar references --- ElvUI_EltreumUI/Core/AddonSetup.lua | 2 +- ElvUI_EltreumUI/Core/Commands.lua | 1 + ElvUI_EltreumUI/Core/Core.lua | 8 ++--- ElvUI_EltreumUI/Core/Options.lua | 30 +++++++++---------- ElvUI_EltreumUI/Core/Tags.lua | 1 + ElvUI_EltreumUI/Layouts/LayoutGeneral.lua | 2 +- ElvUI_EltreumUI/Layouts/SetupNameplates.lua | 2 +- ElvUI_EltreumUI/Modules/Cursor/Cursor.lua | 2 +- ElvUI_EltreumUI/Modules/Misc/AFK.lua | 8 ++--- ElvUI_EltreumUI/Modules/Misc/CombatEvents.lua | 10 +++---- ElvUI_EltreumUI/Modules/Misc/InstantLoot.lua | 8 ++--- ElvUI_EltreumUI/Modules/Misc/Maps.lua | 1 + ElvUI_EltreumUI/Modules/Misc/PartyRaid.lua | 1 + .../Skins/Character/CharacterPanelSkin.lua | 2 +- .../Modules/Skins/Nameplate/NamePlates.lua | 14 ++++----- 15 files changed, 48 insertions(+), 44 deletions(-) diff --git a/ElvUI_EltreumUI/Core/AddonSetup.lua b/ElvUI_EltreumUI/Core/AddonSetup.lua index cdfa7915b..d3aac928d 100644 --- a/ElvUI_EltreumUI/Core/AddonSetup.lua +++ b/ElvUI_EltreumUI/Core/AddonSetup.lua @@ -1,7 +1,7 @@ local E, L = unpack(ElvUI) local _G = _G local IsAddOnLoaded = _G.C_AddOns and _G.C_AddOns.IsAddOnLoaded or _G.IsAddOnLoaded -local SetCVar = _G.SetCVar +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar -- AddOnSkins Profile function ElvUI_EltreumUI:AddonSetupAS() diff --git a/ElvUI_EltreumUI/Core/Commands.lua b/ElvUI_EltreumUI/Core/Commands.lua index 09e296dea..e4dac8fd5 100644 --- a/ElvUI_EltreumUI/Core/Commands.lua +++ b/ElvUI_EltreumUI/Core/Commands.lua @@ -16,6 +16,7 @@ local GetContainerItemInfo = E.Retail and C_Container.GetContainerItemInfo or _G local UseContainerItem = E.Retail and C_Container.UseContainerItem or _G.UseContainerItem local next = _G.next local SendChatMessage = _G.SendChatMessage +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar -- Register on init diff --git a/ElvUI_EltreumUI/Core/Core.lua b/ElvUI_EltreumUI/Core/Core.lua index 34d706095..41b98f61a 100644 --- a/ElvUI_EltreumUI/Core/Core.lua +++ b/ElvUI_EltreumUI/Core/Core.lua @@ -1,6 +1,5 @@ local E, L = unpack(ElvUI) local _G = _G -local C_CVar = _G.C_CVar local S = E:GetModule('Skins') local CreateFrame = _G.CreateFrame local UIParent = _G.UIParent @@ -11,7 +10,6 @@ local IsAddOnLoaded = _G.C_AddOns and _G.C_AddOns.IsAddOnLoaded or _G.IsAddOnLoa local DisableAddOn = _G.C_AddOns and _G.C_AddOns.DisableAddOn or _G.DisableAddOn local LoadAddOn = _G.C_AddOns and _G.C_AddOns.LoadAddOn or _G.LoadAddOn local GetPhysicalScreenSize = _G.GetPhysicalScreenSize -local SetCVar = _G.SetCVar local UIParentLoadAddOn = _G.UIParentLoadAddOn local GetCursorInfo = _G.GetCursorInfo local GetItemInfo = _G.GetItemInfo @@ -26,6 +24,8 @@ local tostring = _G.tostring local math = _G.math local PlaySound = _G.PlaySound local W +local GetCVar = _G.C_CVar and _G.C_CVar.GetCVar or _G.GetCVar +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar -- Eltreum UI print function ElvUI_EltreumUI:Print(msg) @@ -149,7 +149,7 @@ function ElvUI_EltreumUI:BlizzCombatText() return end if not InCombatLockdown() then - if tostring(C_CVar.GetCVar("enableFloatingCombatText")) == "1" then + if tostring(GetCVar("enableFloatingCombatText")) == "1" then if E.db.ElvUI_EltreumUI.otherstuff.blizzcombattext and not E.db.ElvUI_EltreumUI.otherstuff.blizzcombatmana then if IsAddOnLoaded('ElvUI_FCT') or IsAddOnLoaded('NameplateSCT') then SetCVar("enableFloatingCombatText", 0) @@ -160,7 +160,7 @@ function ElvUI_EltreumUI:BlizzCombatText() end end end - if tostring(C_CVar.GetCVar("floatingCombatTextEnergyGains")) == "0" or tostring(C_CVar.GetCVar("enableFloatingCombatText")) == "0" then + if tostring(GetCVar("floatingCombatTextEnergyGains")) == "0" or tostring(GetCVar("enableFloatingCombatText")) == "0" then if E.db.ElvUI_EltreumUI.otherstuff.blizzcombatmana then SetCVar("floatingCombatTextEnergyGains", 1) SetCVar("enableFloatingCombatText", 1) ----this is damage taken without this the floating resource will not work diff --git a/ElvUI_EltreumUI/Core/Options.lua b/ElvUI_EltreumUI/Core/Options.lua index 1a25158cf..f95ae2c48 100644 --- a/ElvUI_EltreumUI/Core/Options.lua +++ b/ElvUI_EltreumUI/Core/Options.lua @@ -15,8 +15,8 @@ local CURRENCY = _G.CURRENCY local tostring = _G.tostring local PlaySoundFile = _G.PlaySoundFile local tonumber = _G.tonumber -local SetCVar = _G.SetCVar -local C_CVar = _G.C_CVar +local GetCVar = _G.C_CVar and _G.C_CVar.GetCVar or _G.GetCVar +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar local OKAY = _G.OKAY local Item = _G.Item local tremove = _G.tremove @@ -661,9 +661,9 @@ function ElvUI_EltreumUI:Configtable() ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.nameplates.args.description1 = ACH:Description(" ", 1, nil, 'Interface\\AddOns\\ElvUI_EltreumUI\\Media\\Textures\\EltreumHeader', nil, 3240, 1, "full") ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.nameplates.args.SoftTargetInteract = ACH:Toggle(L["Soft Target Interact"], L["Enable Soft Target Interactions"], 2, nil, false,'full', function() - if C_CVar.GetCVar('SoftTargetInteract') == '0' then + if GetCVar('SoftTargetInteract') == '0' then return false - elseif C_CVar.GetCVar('SoftTargetInteract') == '3' then + elseif GetCVar('SoftTargetInteract') == '3' then return true end end, function(_, value) @@ -683,20 +683,20 @@ function ElvUI_EltreumUI:Configtable() ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.nameplates.args.nameplateTargetRadialPosition = ACH:Select(L["Nameplate Target Radial Position"], L["When target is off screen, position its nameplate radially around sides and bottom."], 4, { ["1"] = L["Target Only"], ["2"] = L["All in Combat"], - }, false, nil, function() return C_CVar.GetCVar('nameplateTargetRadialPosition') end, function(_, value) E.db.ElvUI_EltreumUI.cvars.nameplateTargetRadialPosition = value SetCVar('nameplateTargetRadialPosition', value) end) + }, false, nil, function() return GetCVar('nameplateTargetRadialPosition') end, function(_, value) E.db.ElvUI_EltreumUI.cvars.nameplateTargetRadialPosition = value SetCVar('nameplateTargetRadialPosition', value) end) ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.nameplates.args.nameplateTargetRadialPosition.style = "radio" ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.nameplates.args.description3 = ACH:Description(" ", 5, nil, 'Interface\\AddOns\\ElvUI_EltreumUI\\Media\\Textures\\EltreumHeader', nil, 3240, 1, "full") ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.nameplates.args.nameplateOtherBottomInset = ACH:Range(L["Nameplate Other Bottom Inset"], L["In screen % the inset from the Bottom"], 6, { min = 0.01, max = 1, step = 0.01 }, 'full', function() return E.db.ElvUI_EltreumUI.cvars.nameplateOtherBottomInset end, function(_, value) E.db.ElvUI_EltreumUI.cvars.nameplateOtherBottomInset = value SetCVar('nameplateOtherBottomInset', value) SetCVar('nameplateLargeBottomInset', value) end) ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.nameplates.args.nameplateOtherTopInset = ACH:Range(L["Nameplate Other Top Inset"], L["In screen % the inset from the Top"], 6, { min = 0.01, max = 1, step = 0.01 }, 'full', function() return E.db.ElvUI_EltreumUI.cvars.nameplateOtherTopInset end, function(_, value) E.db.ElvUI_EltreumUI.cvars.nameplateOtherTopInset = value SetCVar('nameplateOtherTopInset', value) SetCVar('nameplateLargeTopInset', value) end) ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.nameplates.args.nameplateOccludedAlphaMult = ACH:Range(L["Nameplate Occluded Alpha"], L["Alpha of Nameplates out of Sight"], 7, { min = 0, max = 1, step = 0.01 }, 'full', function() return E.db.ElvUI_EltreumUI.cvars.nameplateOccludedAlphaMult end, function(_, value) E.db.ElvUI_EltreumUI.cvars.nameplateOccludedAlphaMult = value SetCVar('nameplateOccludedAlphaMult', value) end) - ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.nameplates.args.nameplateGlobalScale = ACH:Range(L["Nameplate Global Scale"], L["Global Scaling of nameplates after selected, min, and max scale"], 7, { min = 0.1, max = 10, step = 0.01 }, 'full', function() return tonumber(C_CVar.GetCVar('nameplateGlobalScale')) end, function(_, value) SetCVar('nameplateGlobalScale', value) end) + ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.nameplates.args.nameplateGlobalScale = ACH:Range(L["Nameplate Global Scale"], L["Global Scaling of nameplates after selected, min, and max scale"], 7, { min = 0.1, max = 10, step = 0.01 }, 'full', function() return tonumber(GetCVar('nameplateGlobalScale')) end, function(_, value) SetCVar('nameplateGlobalScale', value) end) ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics = ACH:Group(L["Graphics"], nil, 2, "tab") ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.description1 = ACH:Description(L["AMD FSR"], 1, nil, 'Interface\\AddOns\\ElvUI_EltreumUI\\Media\\Textures\\EltreumHeader', nil, 3240, 1, "full", not E.Retail) ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.forceFSRon = ACH:Toggle(L["Enable AMD FSR even if not scaling"], L["Forces AMD's FSR to sharpen image even if you aren't running a lower resolution"], 2, nil, false,'full', function() - if C_CVar.GetCVar('ResampleAlwaysSharpen') == '0' then + if GetCVar('ResampleAlwaysSharpen') == '0' then return false - elseif C_CVar.GetCVar('ResampleAlwaysSharpen') == '1' then + elseif GetCVar('ResampleAlwaysSharpen') == '1' then return true end end, function(_, value) @@ -706,21 +706,21 @@ function ElvUI_EltreumUI:Configtable() SetCVar('ResampleAlwaysSharpen', 0) end end) - ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.forceFSRsharpness = ACH:Range(RESAMPLE_QUALITY_FSR, nil, 3, { min = 0, max = 2, step = 0.1 }, 'full', function() return tonumber(C_CVar.GetCVar('ResampleSharpness')) end, function(_, value) SetCVar('ResampleSharpness', value) end, function() if C_CVar.GetCVar('ResampleAlwaysSharpen') == '1' then return false elseif C_CVar.GetCVar('ResampleAlwaysSharpen') == '0' then return true end end) + ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.forceFSRsharpness = ACH:Range(RESAMPLE_QUALITY_FSR, nil, 3, { min = 0, max = 2, step = 0.1 }, 'full', function() return tonumber(GetCVar('ResampleSharpness')) end, function(_, value) SetCVar('ResampleSharpness', value) end, function() if GetCVar('ResampleAlwaysSharpen') == '1' then return false elseif GetCVar('ResampleAlwaysSharpen') == '0' then return true end end) ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.description2 = ACH:Description(LOW_LATENCY_MODE or "Low Latency Mode", 4, nil, 'Interface\\AddOns\\ElvUI_EltreumUI\\Media\\Textures\\EltreumHeader', nil, 3240, 1, "full") ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.lowlatencycvar = ACH:Select(" ",OPTION_TOOLTIP_LOW_LATENCY_MODE or "Allows the game to use various techniques to reduce input latency", 5, { ["0"] = VIDEO_OPTIONS_DISABLED or "Disabled", ["1"] = VIDEO_OPTIONS_BUILTIN or "Built-in", ["2"] = VIDEO_OPTIONS_NVIDIA_REFLEX or "NVIDIA Reflex", --["3"] = VIDEO_OPTIONS_NVIDIA_REFLEX_BOOST, - }, false, nil, function() return C_CVar.GetCVar('LowLatencyMode') end, function(_, value) local number = tonumber(value) SetCVar('LowLatencyMode', number) end, nil) + }, false, nil, function() return GetCVar('LowLatencyMode') end, function(_, value) local number = tonumber(value) SetCVar('LowLatencyMode', number) end, nil) ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.lowlatencycvar.style = "radio" ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.description3 = ACH:Description(L["Dynamic Render Scale"], 6, nil, 'Interface\\AddOns\\ElvUI_EltreumUI\\Media\\Textures\\EltreumHeader', nil, 3240, 1, "full") ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.dynamicrenderscaleenable = ACH:Toggle(L["Lowers render scale if GPU bound to hit Target FPS."], L["Note this feature is in BETA.\nKnown issues:\n - May cause hitching.\n - May behave poorly with vsync on."], 7, nil, false,'full', function() - if C_CVar.GetCVar('DynamicRenderScale') == '0' then + if GetCVar('DynamicRenderScale') == '0' then return false - elseif C_CVar.GetCVar('DynamicRenderScale') == '1' then + elseif GetCVar('DynamicRenderScale') == '1' then return true end end, function(_, value) @@ -731,7 +731,7 @@ function ElvUI_EltreumUI:Configtable() end end) ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.dynamicrenderscaleenable.descStyle = "inline" - ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.dynamicrenderscalepercentage = ACH:Range(L["Dynamic Render Scale Minimum"], L["Lowest Render Scale used"], 8, { min = 0.1, max = 1, step = 0.01 }, 'full', function() return tonumber(C_CVar.GetCVar('DynamicRenderScaleMin')) end, function(_, value) SetCVar('DynamicRenderScaleMin', tonumber(value)) E.db.ElvUI_EltreumUI.cvars.dynamicrenderscalemin = tonumber(value) end, function() if C_CVar.GetCVar('DynamicRenderScale') == '1' then return false elseif C_CVar.GetCVar('DynamicRenderScale') == '0' then return true end end) + ElvUI_EltreumUI.Options.args.cvars.args.othercvars.args.graphics.args.dynamicrenderscalepercentage = ACH:Range(L["Dynamic Render Scale Minimum"], L["Lowest Render Scale used"], 8, { min = 0.1, max = 1, step = 0.01 }, 'full', function() return tonumber(GetCVar('DynamicRenderScaleMin')) end, function(_, value) SetCVar('DynamicRenderScaleMin', tonumber(value)) E.db.ElvUI_EltreumUI.cvars.dynamicrenderscalemin = tonumber(value) end, function() if GetCVar('DynamicRenderScale') == '1' then return false elseif GetCVar('DynamicRenderScale') == '0' then return true end end) --custom glow ElvUI_EltreumUI.Options.args.customglow = ACH:Group(E:TextGradient(L["Custom Glow"], 0.50, 0.70, 1, 0.67, 0.95, 1), L["Fully customize how action bars glow and add glows to debuffs on unitframes"], 85, 'tab') @@ -974,7 +974,7 @@ function ElvUI_EltreumUI:Configtable() ElvUI_EltreumUI.Options.args.map.args.cardinal.args.enable = ACH:Toggle(L["Enable Cardinal Directions"], L["Add North, East, South, West to Minimap"], 2, nil, false,'full',function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable end,function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable = value ElvUI_EltreumUI:MinimapCardinalDirections() end) ElvUI_EltreumUI.Options.args.map.args.cardinal.args.cardinaloffset = ACH:Range(L["Cardinal Text Offset"], nil, 3, { min = -100, max = 100, step = 1 }, 'full', function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.offset end, function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.offset = value ElvUI_EltreumUI:MinimapCardinalDirections() end, function() return not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable end) ElvUI_EltreumUI.Options.args.map.args.cardinal.args.description2 = ACH:Description(" ", 4, nil, nil, nil, nil, nil, "full") - ElvUI_EltreumUI.Options.args.map.args.cardinal.args.fontsize = ACH:Range(L["Font Size"], nil, 5, { min = 4, max = 64, step = 1 }, 'full', function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize end, function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize = value ElvUI_EltreumUI:MinimapCardinalDirections() end, function() return C_CVar.GetCVar("rotateMinimap") == "1" or not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable end, function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.rotate end) + ElvUI_EltreumUI.Options.args.map.args.cardinal.args.fontsize = ACH:Range(L["Font Size"], nil, 5, { min = 4, max = 64, step = 1 }, 'full', function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize end, function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.fontsize = value ElvUI_EltreumUI:MinimapCardinalDirections() end, function() return GetCVar("rotateMinimap") == "1" or not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable end, function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.rotate end) ElvUI_EltreumUI.Options.args.map.args.cardinal.args.description3 = ACH:Description(" ", 6, nil, nil, nil, nil, nil, "full") ElvUI_EltreumUI.Options.args.map.args.cardinal.args.classcolor = ACH:Toggle(L["Use Class Colors"], nil, 7, nil, false,nil,function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.classcolor end,function(_, value) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.classcolor = value ElvUI_EltreumUI:MinimapCardinalDirections() end, function() return not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable end) ElvUI_EltreumUI.Options.args.map.args.cardinal.args.customcolor = ACH:Color(L["Custom Color"], nil, 8, false, nil, function() return E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.r, E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.g, E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.b, 1 end, function(_, r, g, b) E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.r, E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.g, E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.b = r, g, b ElvUI_EltreumUI:MinimapCardinalDirections() end, function() return not E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.enable or E.db.ElvUI_EltreumUI.otherstuff.minimapcardinaldirections.colors.classcolor end) @@ -1278,7 +1278,7 @@ function ElvUI_EltreumUI:Configtable() ElvUI_EltreumUI.Options.args.cursor.args.general.args.fixlag = ACH:Select(" ", L["Software cursor is how the cursor was before Battle for Azeroth, Hardware cursor is faster but will cause problems with addons that attach to it"], 12, { ["0"] = L["Software Cursor"], ["1"] = L["Hardware Cursor"], - }, false, nil, function() return C_CVar.GetCVar('HardwareCursor') end, function(_, value) E.db.ElvUI_EltreumUI.cursors.cursor.fixlag = value SetCVar('HardwareCursor', value) end) + }, false, nil, function() return GetCVar('HardwareCursor') end, function(_, value) E.db.ElvUI_EltreumUI.cursors.cursor.fixlag = value SetCVar('HardwareCursor', value) end) ElvUI_EltreumUI.Options.args.cursor.args.general.args.fixlag.style = "radio" ElvUI_EltreumUI.Options.args.cursor.args.size = ACH:Group(L["Cursor Sizes"], nil, 2, "tab", nil, nil, function() return not E.db.ElvUI_EltreumUI.cursors.cursor.enable end) ElvUI_EltreumUI.Options.args.cursor.args.size.args.description1 = ACH:Description(L["Cursor Sizes "], 1, nil, 'Interface\\AddOns\\ElvUI_EltreumUI\\Media\\Textures\\EltreumHeader', nil, 3240, 1, "full") diff --git a/ElvUI_EltreumUI/Core/Tags.lua b/ElvUI_EltreumUI/Core/Tags.lua index ba4e89f66..ef6ba7add 100644 --- a/ElvUI_EltreumUI/Core/Tags.lua +++ b/ElvUI_EltreumUI/Core/Tags.lua @@ -38,6 +38,7 @@ local GetShapeshiftFormInfo = _G.GetShapeshiftFormInfo local select = _G.select local ElvUI_EltreumUI = _G.ElvUI_EltreumUI local IsAddOnLoaded = _G.C_AddOns and _G.C_AddOns.IsAddOnLoaded or _G.IsAddOnLoaded +local GetCVarBool = _G.C_AddOns and _G.C_AddOns.GetCVarBool or _G.GetCVarBool --level difference table based on blizzard's local eltruismdif = { diff --git a/ElvUI_EltreumUI/Layouts/LayoutGeneral.lua b/ElvUI_EltreumUI/Layouts/LayoutGeneral.lua index dfad7e8ed..c3e09899b 100644 --- a/ElvUI_EltreumUI/Layouts/LayoutGeneral.lua +++ b/ElvUI_EltreumUI/Layouts/LayoutGeneral.lua @@ -3,7 +3,7 @@ local valuecolors = E:ClassColor(E.myclass, true) local _G = _G local IsAddOnLoaded = _G.C_AddOns and _G.C_AddOns.IsAddOnLoaded or _G.IsAddOnLoaded local tostring = _G.tostring -local SetCVar = _G.SetCVar +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar local math = _G.math local GetPhysicalScreenSize = _G.GetPhysicalScreenSize diff --git a/ElvUI_EltreumUI/Layouts/SetupNameplates.lua b/ElvUI_EltreumUI/Layouts/SetupNameplates.lua index 950444dda..f43de598b 100644 --- a/ElvUI_EltreumUI/Layouts/SetupNameplates.lua +++ b/ElvUI_EltreumUI/Layouts/SetupNameplates.lua @@ -1,7 +1,7 @@ local E, L = unpack(ElvUI) local _G = _G local pairs = _G.pairs -local SetCVar = _G.SetCVar +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar local GetPhysicalScreenSize = _G.GetPhysicalScreenSize -- for rare nameplates diff --git a/ElvUI_EltreumUI/Modules/Cursor/Cursor.lua b/ElvUI_EltreumUI/Modules/Cursor/Cursor.lua index c2709aea4..248af9167 100644 --- a/ElvUI_EltreumUI/Modules/Cursor/Cursor.lua +++ b/ElvUI_EltreumUI/Modules/Cursor/Cursor.lua @@ -5,7 +5,7 @@ local UnitChannelInfo = _G.UnitChannelInfo or _G.ChannelInfo local isRetail = _G.select(4, _G.GetBuildInfo())>=90000 local CreateFrame = _G.CreateFrame local UIParent = _G.UIParent -local SetCVar = _G.SetCVar +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar local next = _G.next local min = _G.min local floor = _G.floor diff --git a/ElvUI_EltreumUI/Modules/Misc/AFK.lua b/ElvUI_EltreumUI/Modules/Misc/AFK.lua index ab795bfa6..74a219fb1 100644 --- a/ElvUI_EltreumUI/Modules/Misc/AFK.lua +++ b/ElvUI_EltreumUI/Modules/Misc/AFK.lua @@ -1,10 +1,10 @@ local E = unpack(ElvUI) local _G = _G -local C_CVar = _G.C_CVar +local GetCVar = _G.C_CVar and _G.C_CVar.GetCVar or _G.GetCVar local CreateFrame = _G.CreateFrame local UIParent = _G.UIParent local UnitIsAFK = _G.UnitIsAFK -local SetCVar = _G.SetCVar +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar local PlayMusic = _G.PlayMusic local PlaySound = _G.PlaySound local StopMusic = _G.StopMusic @@ -83,14 +83,14 @@ local classicMusic = { } -- with the help of Repooc, Simpy and Acidweb (not in order :D) -local musicSettingLoadingIn = C_CVar.GetCVar('Sound_EnableMusic') +local musicSettingLoadingIn = GetCVar('Sound_EnableMusic') local musicSetting = musicSettingLoadingIn local classicmusicstopper = nil local willplay = nil function ElvUI_EltreumUI:AFKmusic() if E.db.ElvUI_EltreumUI.otherstuff.afkmusic.enable then if UnitIsAFK("player") then - musicSetting = tonumber(C_CVar.GetCVar('Sound_EnableMusic')) + musicSetting = tonumber(GetCVar('Sound_EnableMusic')) SetCVar("Sound_EnableMusic", 1) if E.Retail then if E.db.ElvUI_EltreumUI.otherstuff.afkmusic.racial then diff --git a/ElvUI_EltreumUI/Modules/Misc/CombatEvents.lua b/ElvUI_EltreumUI/Modules/Misc/CombatEvents.lua index 31d908a60..bf4564d95 100644 --- a/ElvUI_EltreumUI/Modules/Misc/CombatEvents.lua +++ b/ElvUI_EltreumUI/Modules/Misc/CombatEvents.lua @@ -1,6 +1,6 @@ local E = unpack(ElvUI) local _G = _G -local C_CVar = _G.C_CVar +local GetCVar = _G.C_CVar and _G.C_CVar.GetCVar or _G.GetCVar local IsInInstance = _G.IsInInstance local PlayMusic = _G.PlayMusic local tostring = _G.tostring @@ -18,7 +18,7 @@ local list = {} --play music during combat function ElvUI_EltreumUI:CombatMusic(event, event2) - if E.private.ElvUI_EltreumUI.combatmusic.enable and tostring(C_CVar.GetCVar('Sound_EnableMusic')) == '1' then + if E.private.ElvUI_EltreumUI.combatmusic.enable and tostring(GetCVar('Sound_EnableMusic')) == '1' then _, instanceType = IsInInstance() soundfile = [[Interface\AddOns\]]..E.private.ElvUI_EltreumUI.combatmusic.musicfile if E.db.ElvUI_EltreumUI.otherstuff.musicshuffle then @@ -45,7 +45,7 @@ function ElvUI_EltreumUI:CombatMusic(event, event2) end function ElvUI_EltreumUI:StopCombatMusic(event, event2) - if E.private.ElvUI_EltreumUI.combatmusic.enable and tostring(C_CVar.GetCVar('Sound_EnableMusic')) == '1' then + if E.private.ElvUI_EltreumUI.combatmusic.enable and tostring(GetCVar('Sound_EnableMusic')) == '1' then if dontstop == 1 then if event == 'PLAYER_REGEN_ENABLED' and event2 == nil and dontstopboss == 0 then StopMusic() @@ -57,7 +57,7 @@ end --play music during boss fights function ElvUI_EltreumUI:BossMusic(event) - if E.private.ElvUI_EltreumUI.combatmusic.bossmusic and tostring(C_CVar.GetCVar('Sound_EnableMusic')) == '1' then + if E.private.ElvUI_EltreumUI.combatmusic.bossmusic and tostring(GetCVar('Sound_EnableMusic')) == '1' then soundfileboss = [[Interface\AddOns\]]..E.private.ElvUI_EltreumUI.combatmusic.bossfile if event == 'ENCOUNTER_START' then if dontstop == 1 then @@ -70,7 +70,7 @@ function ElvUI_EltreumUI:BossMusic(event) end function ElvUI_EltreumUI:StopBossMusic(event) - if E.private.ElvUI_EltreumUI.combatmusic.bossmusic and tostring(C_CVar.GetCVar('Sound_EnableMusic')) == '1' then + if E.private.ElvUI_EltreumUI.combatmusic.bossmusic and tostring(GetCVar('Sound_EnableMusic')) == '1' then if dontstopboss == 1 then if event == 'ENCOUNTER_END' then StopMusic() diff --git a/ElvUI_EltreumUI/Modules/Misc/InstantLoot.lua b/ElvUI_EltreumUI/Modules/Misc/InstantLoot.lua index be2f82531..2c299195d 100644 --- a/ElvUI_EltreumUI/Modules/Misc/InstantLoot.lua +++ b/ElvUI_EltreumUI/Modules/Misc/InstantLoot.lua @@ -11,10 +11,10 @@ local GetItemIcon = _G.GetItemIcon local GetItemQualityColor = _G.GetItemQualityColor local tonumber = _G.tonumber local UIFrameFadeIn = _G.UIFrameFadeIn -local GetCVarBool = _G.GetCVarBool +local GetCVarBool = _G.C_CVar and _G.C_CVar.GetCVarBool or _G.GetCVarBool +local GetCVar = _G.C_CVar and _G.C_CVar.GetCVar or _G.GetCVar local IsModifiedClick = _G.IsModifiedClick local LootSlot = _G.LootSlot -local C_CVar = _G.C_CVar local GetLootSlotInfo = _G.GetLootSlotInfo local GetLootSlotType = _G.GetLootSlotType local CloseLoot = _G.CloseLoot @@ -141,7 +141,7 @@ local function InstantLoot(_, event,_, arg2) return else --print("fastlootfilter") - if C_CVar.GetCVar('autoLootDefault') == 1 then + if GetCVar('autoLootDefault') == 1 then ElvUI_EltreumUI:Print("Autoloot is enabled, please disable it to use Loot Filtering") end for i = GetNumLootItems(), 1, -1 do @@ -161,7 +161,7 @@ local function InstantLoot(_, event,_, arg2) end end if E.db.ElvUI_EltreumUI.loot.lootwishlistfilter then - if C_CVar.GetCVar('autoLootDefault') == 1 then + if GetCVar('autoLootDefault') == 1 then ElvUI_EltreumUI:Print("Autoloot is enabled, please disable it to use Wishlist Loot Filtering") end if event == 'LOOT_BIND_CONFIRM' then diff --git a/ElvUI_EltreumUI/Modules/Misc/Maps.lua b/ElvUI_EltreumUI/Modules/Misc/Maps.lua index 629e48212..65d79940b 100644 --- a/ElvUI_EltreumUI/Modules/Misc/Maps.lua +++ b/ElvUI_EltreumUI/Modules/Misc/Maps.lua @@ -5,6 +5,7 @@ local UIParent = _G.UIParent local IsInInstance = _G.IsInInstance local S = E:GetModule('Skins') local valuecolors = E:ClassColor(E.myclass, true) +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar --Conversion of Time to Arrive weakaura (new version) if E.Retail then diff --git a/ElvUI_EltreumUI/Modules/Misc/PartyRaid.lua b/ElvUI_EltreumUI/Modules/Misc/PartyRaid.lua index 99431b33e..27bf5de1a 100644 --- a/ElvUI_EltreumUI/Modules/Misc/PartyRaid.lua +++ b/ElvUI_EltreumUI/Modules/Misc/PartyRaid.lua @@ -19,6 +19,7 @@ local instanceok local currentCharges, cooldownStart, cooldownDuration local cooldown local GetPartyAssignment = _G.GetPartyAssignment +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar --PlaySound(61850) --PlaySound(61851) diff --git a/ElvUI_EltreumUI/Modules/Skins/Character/CharacterPanelSkin.lua b/ElvUI_EltreumUI/Modules/Skins/Character/CharacterPanelSkin.lua index b48a1d266..86bc14edd 100644 --- a/ElvUI_EltreumUI/Modules/Skins/Character/CharacterPanelSkin.lua +++ b/ElvUI_EltreumUI/Modules/Skins/Character/CharacterPanelSkin.lua @@ -13,7 +13,7 @@ local GetItemQualityColor = _G.GetItemQualityColor local PaperDollFrame = _G.PaperDollFrame local SkillFrame = _G.SkillFrame local CharacterModelFrame = _G.CharacterModelFrame -local SetCVar = _G.SetCVar +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar local PaperDollItemsFrame = _G.PaperDollItemsFrame local CharacterNameText = _G.CharacterNameText local CharacterTitleText = _G.CharacterTitleText diff --git a/ElvUI_EltreumUI/Modules/Skins/Nameplate/NamePlates.lua b/ElvUI_EltreumUI/Modules/Skins/Nameplate/NamePlates.lua index 34ab84140..8c588159a 100644 --- a/ElvUI_EltreumUI/Modules/Skins/Nameplate/NamePlates.lua +++ b/ElvUI_EltreumUI/Modules/Skins/Nameplate/NamePlates.lua @@ -21,9 +21,9 @@ local GetShapeshiftForm = _G.GetShapeshiftForm local IsInInstance = _G.IsInInstance local WorldMapFrame = _G.WorldMapFrame local tostring = _G.tostring -local C_CVar = _G.C_CVar +local GetCVar = _G.C_CVar and _G.C_CVar.GetCVar or _G.GetCVar local InCombatLockdown = _G.InCombatLockdown -local SetCVar = _G.SetCVar +local SetCVar = _G.C_CVar and _G.C_CVar.SetCVar or _G.SetCVar local TimeSinceLastUpdate local debufftime local _, targetclass @@ -728,14 +728,14 @@ end function ElvUI_EltreumUI:FriendlyNameplates() _, instanceType = IsInInstance() mapID = WorldMapFrame:GetMapID() - nameplateShowOnlyNames = tostring(C_CVar.GetCVar('nameplateShowOnlyNames')) - nameplateShowFriends = tostring(C_CVar.GetCVar('nameplateShowFriends')) + nameplateShowOnlyNames = tostring(GetCVar('nameplateShowOnlyNames')) + nameplateShowFriends = tostring(GetCVar('nameplateShowFriends')) --print(mapID, instanceType) if not InCombatLockdown() then if E.Retail then - local UnitNameHostleNPC = C_CVar.GetCVar('UnitNameHostleNPC') - local UnitNameInteractiveNPC =C_CVar.GetCVar('UnitNameInteractiveNPC') - local UnitNameNPC = C_CVar.GetCVar('UnitNameNPC') + local UnitNameHostleNPC = GetCVar('UnitNameHostleNPC') + local UnitNameInteractiveNPC = GetCVar('UnitNameInteractiveNPC') + local UnitNameNPC = GetCVar('UnitNameNPC') if E.db.ElvUI_EltreumUI.cvars.autohidenpcname then if instanceType == "none" then if UnitNameHostleNPC == "1" then