Skip to content

Commit

Permalink
more C_CVar references
Browse files Browse the repository at this point in the history
  • Loading branch information
eltreum0 committed Nov 14, 2023
1 parent de500f6 commit 92c9472
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 44 deletions.
2 changes: 1 addition & 1 deletion ElvUI_EltreumUI/Core/AddonSetup.lua
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
1 change: 1 addition & 0 deletions ElvUI_EltreumUI/Core/Commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions ElvUI_EltreumUI/Core/Core.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
30 changes: 15 additions & 15 deletions ElvUI_EltreumUI/Core/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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')
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions ElvUI_EltreumUI/Core/Tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion ElvUI_EltreumUI/Layouts/LayoutGeneral.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ElvUI_EltreumUI/Layouts/SetupNameplates.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion ElvUI_EltreumUI/Modules/Cursor/Cursor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions ElvUI_EltreumUI/Modules/Misc/AFK.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 92c9472

Please sign in to comment.