Commit cc539f2a authored by Simpy's avatar Simpy 🐹

no reason to pass these tbh

parent ee2dacb1
......@@ -1938,7 +1938,7 @@ function E:Initialize()
self:UIScale()
if not E.db.general.cropIcon then E.TexCoords = {0, 1, 0, 1} end
self:BuildPrefixValues(E.db.general.decimalLength, E.db.general.numberPrefixStyle)
self:BuildPrefixValues()
self:LoadCommands() --Load Commands
self:InitializeModules() --Load Modules
......
......@@ -22,23 +22,23 @@ E.ShortPrefixStyles = {
["METRIC"] = {{1e12,"T"}, {1e9,"G"}, {1e6,"M"}, {1e3,"k"}}
}
function E:BuildPrefixValues(decimalLength, prefixStyle)
function E:BuildPrefixValues()
if next(E.ShortPrefixValues) then wipe(E.ShortPrefixValues) end
E.ShortPrefixValues = E:CopyTable(E.ShortPrefixValues, E.ShortPrefixStyles[prefixStyle])
E.ShortValueDec = format("%%.%df", decimalLength or 1)
E.ShortPrefixValues = E:CopyTable(E.ShortPrefixValues, E.ShortPrefixStyles[E.db.general.numberPrefixStyle])
E.ShortValueDec = format("%%.%df", E.db.general.decimalLength or 1)
for _, prefix in ipairs(E.ShortPrefixValues) do
prefix[2] = E.ShortValueDec..prefix[2]
for _, style in ipairs(E.ShortPrefixValues) do
style[2] = E.ShortValueDec..style[2]
end
end
--Return short value of a number
function E:ShortValue(v)
local abs_v = (v < 0 and v * -1) or v
for _, prefix in ipairs(E.ShortPrefixValues) do
if abs_v >= prefix[1] then
return format(prefix[2], v / prefix[1])
for _, style in ipairs(E.ShortPrefixValues) do
if abs_v >= style[1] then
return format(style[2], v / style[1])
end
end
......
......@@ -129,7 +129,7 @@ E.Options.args.general = {
min = 0, max = 4, step = 1,
set = function(info, value)
E.db.general.decimalLength = value
E:BuildPrefixValues(E.db.general.decimalLength, E.db.general.numberPrefixStyle)
E:BuildPrefixValues()
E:StaticPopup_Show("CONFIG_RL")
end,
},
......@@ -140,7 +140,7 @@ E.Options.args.general = {
desc = L["The unit prefixes you want to use when values are shortened in ElvUI. This is mostly used on UnitFrames."],
set = function(info, value)
E.db.general.numberPrefixStyle = value
E:BuildPrefixValues(E.db.general.decimalLength, E.db.general.numberPrefixStyle)
E:BuildPrefixValues()
E:StaticPopup_Show("CONFIG_RL")
end,
values = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment