Commit f060f6a6 authored by Simpy's avatar Simpy 🐹

Merge branch 'development'

parents a2b4e0c4 6075cbbe
This diff is collapsed.
...@@ -200,7 +200,7 @@ end ...@@ -200,7 +200,7 @@ end
function E:ToggleBlizzardCooldownText(cd, timer, request) function E:ToggleBlizzardCooldownText(cd, timer, request)
-- we should hide the blizzard cooldown text when ours are enabled -- we should hide the blizzard cooldown text when ours are enabled
if timer and cd and cd.SetHideCountdownNumbers then if timer and cd and cd.SetHideCountdownNumbers then
local forceHide = (timer.timerOptions and timer.timerOptions.hideBlizzard) or (E.db and E.db.cooldown and E.db.cooldown.hideBlizzard) local forceHide = cd.hideText or (timer.timerOptions and timer.timerOptions.hideBlizzard) or (E.db and E.db.cooldown and E.db.cooldown.hideBlizzard)
if request then if request then
return forceHide or E:Cooldown_IsEnabled(timer) return forceHide or E:Cooldown_IsEnabled(timer)
else else
......
local ElvUI = select(2, ...) local ElvUI = select(2, ...)
ElvUI[2] = ElvUI[1].Libs.ACL:GetLocale('ElvUI', false) -- Locale doesn't exist yet, make it exist.
local gameLocale
do -- Locale doesn't exist yet, make it exist.
local convert = {['enGB'] = 'enUS', ['esES'] = 'esMX', ['itIT'] = 'enUS'}
local lang = GetLocale()
gameLocale = convert[lang] or lang or 'enUS'
ElvUI[2] = ElvUI[1].Libs.ACL:GetLocale('ElvUI', gameLocale)
end
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local ActionBars = E:GetModule('ActionBars') local ActionBars = E:GetModule('ActionBars')
...@@ -26,17 +35,15 @@ local _G = _G ...@@ -26,17 +35,15 @@ local _G = _G
local tonumber, pairs, ipairs, error, unpack, select, tostring = tonumber, pairs, ipairs, error, unpack, select, tostring local tonumber, pairs, ipairs, error, unpack, select, tostring = tonumber, pairs, ipairs, error, unpack, select, tostring
local assert, type, pcall, date, print = assert, type, pcall, date, print local assert, type, pcall, date, print = assert, type, pcall, date, print
local twipe, tinsert, tremove, next = wipe, tinsert, tremove, next local twipe, tinsert, tremove, next = wipe, tinsert, tremove, next
local gsub, strmatch, strjoin = gsub, match, strjoin local gsub, strmatch, strjoin = gsub, strmatch, strjoin
local format, find, strrep, len, sub = format, strfind, strrep, strlen, strsub local format, find, strrep, len, sub = format, strfind, strrep, strlen, strsub
--WoW API / Variables --WoW API / Variables
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local GetCVar, SetCVar, GetCVarBool = GetCVar, SetCVar, GetCVarBool local GetCVar, SetCVar, GetCVarBool = GetCVar, SetCVar, GetCVarBool
local GetChannelName = GetChannelName local GetChannelName = GetChannelName
local GetCombatRatingBonus = GetCombatRatingBonus
local GetDodgeChance, GetParryChance = GetDodgeChance, GetParryChance
local GetFunctionCPUUsage = GetFunctionCPUUsage local GetFunctionCPUUsage = GetFunctionCPUUsage
local GetNumGroupMembers = GetNumGroupMembers local GetNumGroupMembers = GetNumGroupMembers
local GetSpecialization, GetActiveSpecGroup = GetSpecialization, GetActiveSpecGroup local GetSpecialization = GetSpecialization
local GetSpecializationRole = GetSpecializationRole local GetSpecializationRole = GetSpecializationRole
local InCombatLockdown = InCombatLockdown local InCombatLockdown = InCombatLockdown
local IsAddOnLoaded = IsAddOnLoaded local IsAddOnLoaded = IsAddOnLoaded
...@@ -51,12 +58,10 @@ local UIParentLoadAddOn = UIParentLoadAddOn ...@@ -51,12 +58,10 @@ local UIParentLoadAddOn = UIParentLoadAddOn
local UnitGroupRolesAssigned = UnitGroupRolesAssigned local UnitGroupRolesAssigned = UnitGroupRolesAssigned
local UnitHasVehicleUI = UnitHasVehicleUI local UnitHasVehicleUI = UnitHasVehicleUI
local WrapTextInColorCode = WrapTextInColorCode local WrapTextInColorCode = WrapTextInColorCode
local UnitLevel, UnitStat, UnitAttackPower = UnitLevel, UnitStat, UnitAttackPower local UnitStat, UnitAttackPower = UnitStat, UnitAttackPower
local hooksecurefunc = hooksecurefunc local hooksecurefunc = hooksecurefunc
local COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN = COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN
local LE_PARTY_CATEGORY_HOME = LE_PARTY_CATEGORY_HOME local LE_PARTY_CATEGORY_HOME = LE_PARTY_CATEGORY_HOME
local LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_INSTANCE local LE_PARTY_CATEGORY_INSTANCE = LE_PARTY_CATEGORY_INSTANCE
local MAX_PLAYER_LEVEL = MAX_PLAYER_LEVEL
local MAX_WOW_CHAT_CHANNELS = MAX_WOW_CHAT_CHANNELS local MAX_WOW_CHAT_CHANNELS = MAX_WOW_CHAT_CHANNELS
local ERR_NOT_IN_COMBAT = ERR_NOT_IN_COMBAT local ERR_NOT_IN_COMBAT = ERR_NOT_IN_COMBAT
local C_ChatInfo_GetNumActiveChannels = C_ChatInfo.GetNumActiveChannels local C_ChatInfo_GetNumActiveChannels = C_ChatInfo.GetNumActiveChannels
...@@ -141,14 +146,6 @@ E.DispelClasses = { ...@@ -141,14 +146,6 @@ E.DispelClasses = {
} }
} }
E.HealingClasses = {
PALADIN = 1,
SHAMAN = 3,
DRUID = 4,
MONK = 2,
PRIEST = {1, 2}
}
E.ClassRole = { E.ClassRole = {
PALADIN = { PALADIN = {
[1] = 'Caster', [1] = 'Caster',
...@@ -607,23 +604,6 @@ E.snapBars[#E.snapBars + 1] = E.UIParent ...@@ -607,23 +604,6 @@ E.snapBars[#E.snapBars + 1] = E.UIParent
E.HiddenFrame = CreateFrame('Frame') E.HiddenFrame = CreateFrame('Frame')
E.HiddenFrame:Hide() E.HiddenFrame:Hide()
function E:CheckTalentTree(tree)
local activeSpec = GetActiveSpecGroup()
local currentSpec = activeSpec and GetSpecialization(false, false, activeSpec)
if currentSpec and type(tree) == 'number' then
return tree == currentSpec
elseif currentSpec and type(tree) == 'table' then
for _, index in pairs(tree) do
if index == currentSpec then
return true
end
end
end
return false
end
function E:IsDispellableByMe(debuffType) function E:IsDispellableByMe(debuffType)
if not self.DispelClasses[self.myclass] then return end if not self.DispelClasses[self.myclass] then return end
...@@ -633,25 +613,17 @@ function E:IsDispellableByMe(debuffType) ...@@ -633,25 +613,17 @@ function E:IsDispellableByMe(debuffType)
end end
function E:CheckRole() function E:CheckRole()
local talentTree = GetSpecialization() self.myspec = GetSpecialization()
self.myspec = talentTree self.myrole = E:GetPlayerRole()
local IsInPvPGear, role = false -- myrole = group role; TANK, HEALER, DAMAGER
-- role = class role; Tank, Melee, Caster
local resilperc = GetCombatRatingBonus(COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN)
if resilperc > GetDodgeChance() and resilperc > GetParryChance() and UnitLevel('player') == MAX_PLAYER_LEVEL then
IsInPvPGear = true
end
local role
if type(self.ClassRole[self.myclass]) == 'string' then if type(self.ClassRole[self.myclass]) == 'string' then
role = self.ClassRole[self.myclass] role = self.ClassRole[self.myclass]
elseif talentTree then elseif self.myspec then
role = self.ClassRole[self.myclass][talentTree] role = self.ClassRole[self.myclass][self.myspec]
end
--Check for PvP gear
if role == 'Tank' and IsInPvPGear then
role = 'Melee'
end end
if not role then if not role then
...@@ -672,12 +644,8 @@ function E:CheckRole() ...@@ -672,12 +644,8 @@ function E:CheckRole()
self.callbacks:Fire('RoleChanged') self.callbacks:Fire('RoleChanged')
end end
if self.HealingClasses[self.myclass] ~= nil and self.myclass ~= 'PRIEST' then if self.myrole and self.DispelClasses[self.myclass] ~= nil then
if self:CheckTalentTree(self.HealingClasses[self.myclass]) then self.DispelClasses[self.myclass].Magic = (self.myrole == 'HEALER')
self.DispelClasses[self.myclass].Magic = true
else
self.DispelClasses[self.myclass].Magic = false
end
end end
end end
...@@ -1672,6 +1640,18 @@ function E:InitializeModules() ...@@ -1672,6 +1640,18 @@ function E:InitializeModules()
end end
function E:DBConversions() function E:DBConversions()
--Fix issue where UIScale was incorrectly stored as string
E.global.general.UIScale = tonumber(E.global.general.UIScale)
--Not sure how this one happens, but prevent it in any case
if E.global.general.UIScale <= 0 then
E.global.general.UIScale = G.general.UIScale
end
if gameLocale and E.global.general.locale == 'auto' then
E.global.general.locale = gameLocale
end
--Combat & Resting Icon options update --Combat & Resting Icon options update
if E.db.unitframe.units.player.combatIcon ~= nil then if E.db.unitframe.units.player.combatIcon ~= nil then
E.db.unitframe.units.player.CombatIcon.enable = E.db.unitframe.units.player.combatIcon E.db.unitframe.units.player.CombatIcon.enable = E.db.unitframe.units.player.combatIcon
...@@ -1739,6 +1719,20 @@ function E:DBConversions() ...@@ -1739,6 +1719,20 @@ function E:DBConversions()
E.db.nameplates.durationFontOutline = nil E.db.nameplates.durationFontOutline = nil
end end
if E.db.nameplates.lowHealthThreshold > 0.8 then
E.db.nameplates.lowHealthThreshold = 0.8
end
if E.db.nameplates.units.TARGET.nonTargetTransparency ~= nil then
E.global.nameplate.filters.ElvUI_NonTarget.actions.alpha = E.db.nameplates.units.TARGET.nonTargetTransparency * 100
E.db.nameplates.units.TARGET.nonTargetTransparency = nil
end
if E.db.nameplates.units.TARGET.scale ~= nil then
E.global.nameplate.filters.ElvUI_Target.actions.scale = E.db.nameplates.units.TARGET.scale
E.db.nameplates.units.TARGET.scale = nil
end
if not E.db.chat.panelColorConverted then if not E.db.chat.panelColorConverted then
local color = E.db.general.backdropfadecolor local color = E.db.general.backdropfadecolor
E.db.chat.panelColor = {r = color.r, g = color.g, b = color.b, a = color.a} E.db.chat.panelColor = {r = color.r, g = color.g, b = color.b, a = color.a}
...@@ -1762,6 +1756,17 @@ function E:DBConversions() ...@@ -1762,6 +1756,17 @@ function E:DBConversions()
end end
end end
--Health Backdrop Multiplier
if E.db.unitframe.colors.healthmultiplier ~= nil then
if E.db.unitframe.colors.healthmultiplier > 0.75 then
E.db.unitframe.colors.healthMultiplier = 0.75
else
E.db.unitframe.colors.healthMultiplier = E.db.unitframe.colors.healthmultiplier
end
E.db.unitframe.colors.healthmultiplier = nil
end
--Tooltip FactionColors Setting --Tooltip FactionColors Setting
for i=1, 8 do for i=1, 8 do
local oldTable = E.db.tooltip.factionColors[''..i] local oldTable = E.db.tooltip.factionColors[''..i]
...@@ -1772,14 +1777,6 @@ function E:DBConversions() ...@@ -1772,14 +1777,6 @@ function E:DBConversions()
end end
end end
--Fix issue where UIScale was incorrectly stored as string
E.global.general.UIScale = tonumber(E.global.general.UIScale)
--Not sure how this one happens, but prevent it in any case
if E.global.general.UIScale <= 0 then
E.global.general.UIScale = G.general.UIScale
end
--v11 Nameplates Reset --v11 Nameplates Reset
if not E.db.v11NamePlateReset and E.private.nameplates.enable then if not E.db.v11NamePlateReset and E.private.nameplates.enable then
local styleFilters = E:CopyTable({}, E.db.nameplates.filters) local styleFilters = E:CopyTable({}, E.db.nameplates.filters)
...@@ -1793,7 +1790,7 @@ end ...@@ -1793,7 +1790,7 @@ end
local CPU_USAGE = {} local CPU_USAGE = {}
local function CompareCPUDiff(showall, minCalls) local function CompareCPUDiff(showall, minCalls)
local greatestUsage, greatestCalls, greatestName, newName, newFunc local greatestUsage, greatestCalls, greatestName, newName, newFunc
local greatestDiff, lastModule, mod, newUsage, calls, differance = 0 local greatestDiff, lastModule, mod, usage, calls, diff = 0
for name, oldUsage in pairs(CPU_USAGE) do for name, oldUsage in pairs(CPU_USAGE) do
newName, newFunc = strmatch(name, '^([^:]+):(.+)$') newName, newFunc = strmatch(name, '^([^:]+):(.+)$')
...@@ -1804,19 +1801,19 @@ local function CompareCPUDiff(showall, minCalls) ...@@ -1804,19 +1801,19 @@ local function CompareCPUDiff(showall, minCalls)
mod = E:GetModule(newName, true) or E mod = E:GetModule(newName, true) or E
lastModule = newName lastModule = newName
end end
newUsage, calls = GetFunctionCPUUsage(mod[newFunc], true) usage, calls = GetFunctionCPUUsage(mod[newFunc], true)
differance = newUsage - oldUsage diff = usage - oldUsage
if showall and (calls > minCalls) then if showall and (calls > minCalls) then
E:Print('Name('..name..') Calls('..calls..') Diff('..(differance > 0 and format('%.3f', differance) or 0)..')') E:Print('Name('..name..') Calls('..calls..') MS('..(usage or 0)..') Diff('..(diff > 0 and format('%.3f', diff) or 0)..')')
end end
if (differance > greatestDiff) and calls > minCalls then if (diff > greatestDiff) and calls > minCalls then
greatestName, greatestUsage, greatestCalls, greatestDiff = name, newUsage, calls, differance greatestName, greatestUsage, greatestCalls, greatestDiff = name, usage, calls, diff
end end
end end
end end
if greatestName then if greatestName then
E:Print(greatestName.. ' had the CPU usage difference of: '..(greatestUsage > 0 and format('%.3f', greatestUsage) or 0)..'ms. And has been called '.. greatestCalls..' times.') E:Print(greatestName.. ' had the CPU usage of: '..(greatestUsage > 0 and format('%.3f', greatestUsage) or 0)..'ms. And has been called '.. greatestCalls..' times.')
else else
E:Print('CPU Usage: No CPU Usage differences found.') E:Print('CPU Usage: No CPU Usage differences found.')
end end
...@@ -1940,9 +1937,8 @@ function E:Initialize() ...@@ -1940,9 +1937,8 @@ function E:Initialize()
self:DBConversions() self:DBConversions()
self:UIScale() self:UIScale()
if not E.db.general.cropIcon then if not E.db.general.cropIcon then E.TexCoords = {0, 1, 0, 1} end
E.TexCoords = {0, 1, 0, 1} self:BuildPrefixValues()
end
self:LoadCommands() --Load Commands self:LoadCommands() --Load Commands
self:InitializeModules() --Load Modules self:InitializeModules() --Load Modules
......
...@@ -253,6 +253,7 @@ local blacklistedKeys = { ...@@ -253,6 +253,7 @@ local blacklistedKeys = {
userInformedNewChanges1 = true, userInformedNewChanges1 = true,
general = { general = {
UIScale = true, UIScale = true,
locale = true,
version = true, version = true,
eyefinity = true, eyefinity = true,
ignoreScalePopup = true, ignoreScalePopup = true,
......
...@@ -41,12 +41,12 @@ function E:UpdateBlizzardFonts() ...@@ -41,12 +41,12 @@ function E:UpdateBlizzardFonts()
COMBAT = E.Media.Fonts.Invisible COMBAT = E.Media.Fonts.Invisible
end end
--_G.NAMEPLATE_FONT = NAMEFONT if E.private.general.replaceBlizzFonts then
_G.UNIT_NAME_FONT = NAMEFONT --_G.NAMEPLATE_FONT = NAMEFONT
_G.DAMAGE_TEXT_FONT = COMBAT _G.UNIT_NAME_FONT = NAMEFONT
_G.STANDARD_TEXT_FONT = NORMAL _G.DAMAGE_TEXT_FONT = COMBAT
_G.STANDARD_TEXT_FONT = NORMAL
if self.private.general.replaceBlizzFonts then
--SetFont(_G.NumberFontNormal, LSM:Fetch('font', 'Homespun'), 10, 'MONOCHROMEOUTLINE', 1, 1, 1, 0, 0, 0) --SetFont(_G.NumberFontNormal, LSM:Fetch('font', 'Homespun'), 10, 'MONOCHROMEOUTLINE', 1, 1, 1, 0, 0, 0)
--SetFont(_G.GameFontNormalSmall, NORMAL, 12, nil, nil, nil, nil, nil, nil, nil, unpack(E.media.rgbvaluecolor)) --SetFont(_G.GameFontNormalSmall, NORMAL, 12, nil, nil, nil, nil, nil, nil, nil, unpack(E.media.rgbvaluecolor))
SetFont(_G.AchievementFont_Small, NORMAL, self.db.general.fontSize) -- Achiev dates SetFont(_G.AchievementFont_Small, NORMAL, self.db.general.fontSize) -- Achiev dates
......
...@@ -6,6 +6,7 @@ local format = format ...@@ -6,6 +6,7 @@ local format = format
local tinsert = tinsert local tinsert = tinsert
local select, tonumber = select, tonumber local select, tonumber = select, tonumber
local next, max, wipe = next, max, wipe local next, max, wipe = next, max, wipe
local utf8sub = string.utf8sub
--WoW API / Variables --WoW API / Variables
local UnitIsUnit = UnitIsUnit local UnitIsUnit = UnitIsUnit
local GetCVarBool = GetCVarBool local GetCVarBool = GetCVarBool
...@@ -33,7 +34,7 @@ function E:InspectGearSlot(line, lineText, enchantText, enchantColors, iLvl, ite ...@@ -33,7 +34,7 @@ function E:InspectGearSlot(line, lineText, enchantText, enchantColors, iLvl, ite
local itemLevel = lineText and lineText:match(MATCH_ITEM_LEVEL) local itemLevel = lineText and lineText:match(MATCH_ITEM_LEVEL)
local enchant = lineText:match(MATCH_ENCHANT) local enchant = lineText:match(MATCH_ENCHANT)
if enchant then if enchant then
enchantText = enchant:sub(1, 18) enchantText = utf8sub(enchant, 1, 18)
enchantColors = {lr, lg, lb} enchantColors = {lr, lg, lb}
end end
if itemLevel then if itemLevel then
......
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
--Lua functions --Lua functions
local tinsert, tremove, next = tinsert, tremove, next local tinsert, tremove, next, wipe, ipairs = tinsert, tremove, next, wipe, ipairs
local select, tonumber, assert, type, unpack = select, tonumber, assert, type, unpack local select, tonumber, type, unpack = select, tonumber, type, unpack
local atan2, modf, ceil, floor, abs, sqrt, mod = math.atan2, math.modf, math.ceil, math.floor, math.abs, math.sqrt, mod local atan2, modf, ceil, floor, abs, sqrt, mod = math.atan2, math.modf, math.ceil, math.floor, math.abs, math.sqrt, mod
local format, strfind, strsub, strupper, gsub, gmatch, utf8sub = format, strfind, strsub, strupper, gsub, gmatch, string.utf8sub local format, strfind, strsub, strupper, gsub, gmatch, utf8sub = format, strfind, strsub, strupper, gsub, gmatch, string.utf8sub
--WoW API / Variables --WoW API / Variables
...@@ -13,65 +13,36 @@ local BreakUpLargeNumbers = BreakUpLargeNumbers ...@@ -13,65 +13,36 @@ local BreakUpLargeNumbers = BreakUpLargeNumbers
local GetScreenWidth, GetScreenHeight = GetScreenWidth, GetScreenHeight local GetScreenWidth, GetScreenHeight = GetScreenWidth, GetScreenHeight
local C_Timer_After = C_Timer.After local C_Timer_After = C_Timer.After
E.ShortPrefixValues = {}
E.ShortPrefixStyles = {
["CHINESE"] = {{1e8,"Y"}, {1e4,"W"}},
["ENGLISH"] = {{1e12,"T"}, {1e9,"B"}, {1e6,"M"}, {1e3,"K"}},
["GERMAN"] = {{1e12,"Bio"}, {1e9,"Mrd"}, {1e6,"Mio"}, {1e3,"Tsd"}},
["KOREAN"] = {{1e8,"억"}, {1e4,"만"}, {1e3,"천"}},
["METRIC"] = {{1e12,"T"}, {1e9,"G"}, {1e6,"M"}, {1e3,"k"}}
}
function E:BuildPrefixValues()
if next(E.ShortPrefixValues) then wipe(E.ShortPrefixValues) end
E.ShortPrefixValues = E:CopyTable(E.ShortPrefixValues, E.ShortPrefixStyles[E.db.general.numberPrefixStyle])
E.ShortValueDec = format("%%.%df", E.db.general.decimalLength or 1)
for _, style in ipairs(E.ShortPrefixValues) do
style[2] = E.ShortValueDec..style[2]
end
end
--Return short value of a number --Return short value of a number
function E:ShortValue(v) function E:ShortValue(v)
local shortValueDec = format("%%.%df", E.db.general.decimalLength or 1) local abs_v = v<0 and -v or v
local shortValue = abs(v) for i=1, #E.ShortPrefixValues do
if E.db.general.numberPrefixStyle == "METRIC" then if abs_v >= E.ShortPrefixValues[i][1] then
if shortValue >= 1e12 then return format(E.ShortPrefixValues[i][2], v / E.ShortPrefixValues[i][1])
return format(shortValueDec.."T", v / 1e12)
elseif shortValue >= 1e9 then
return format(shortValueDec.."G", v / 1e9)
elseif shortValue >= 1e6 then
return format(shortValueDec.."M", v / 1e6)
elseif shortValue >= 1e3 then
return format(shortValueDec.."k", v / 1e3)
else
return format("%.0f", v)
end
elseif E.db.general.numberPrefixStyle == "CHINESE" then
if shortValue >= 1e8 then
return format(shortValueDec.."Y", v / 1e8)
elseif shortValue >= 1e4 then
return format(shortValueDec.."W", v / 1e4)
else
return format("%.0f", v)
end
elseif E.db.general.numberPrefixStyle == "KOREAN" then
if shortValue >= 1e8 then
return format(shortValueDec.."억", v / 1e8)
elseif shortValue >= 1e4 then
return format(shortValueDec.."만", v / 1e4)
elseif shortValue >= 1e3 then
return format(shortValueDec.."천", v / 1e3)
else
return format("%.0f", v)
end
elseif E.db.general.numberPrefixStyle == "GERMAN" then
if shortValue >= 1e12 then
return format(shortValueDec.."Bio", v / 1e12)
elseif shortValue >= 1e9 then
return format(shortValueDec.."Mrd", v / 1e9)
elseif shortValue >= 1e6 then
return format(shortValueDec.."Mio", v / 1e6)
elseif shortValue >= 1e3 then
return format(shortValueDec.."Tsd", v / 1e3)
else
return format("%.0f", v)
end
else
if shortValue >= 1e12 then
return format(shortValueDec.."T", v / 1e12)
elseif shortValue >= 1e9 then
return format(shortValueDec.."B", v / 1e9)
elseif shortValue >= 1e6 then
return format(shortValueDec.."M", v / 1e6)
elseif shortValue >= 1e3 then
return format(shortValueDec.."K", v / 1e3)
else
return format("%.0f", v)
end end
end end
return format("%.0f", v)
end end
function E:IsEvenNumber(num) function E:IsEvenNumber(num)
...@@ -206,10 +177,6 @@ local gftStyles = { ...@@ -206,10 +177,6 @@ local gftStyles = {
} }
function E:GetFormattedText(style, min, max) function E:GetFormattedText(style, min, max)
assert(gftStyles[style], 'Invalid format style: '..style)
assert(min, 'You need to provide a current value. Usage: E:GetFormattedText(style, min, max)')
assert(max, 'You need to provide a maximum value. Usage: E:GetFormattedText(style, min, max)')
if max == 0 then max = 1 end if max == 0 then max = 1 end
local gftUseStyle local gftUseStyle
......
...@@ -50,7 +50,6 @@ E.PopupDialogs.ELVUI_UPDATED_WHILE_RUNNING = { ...@@ -50,7 +50,6 @@ E.PopupDialogs.ELVUI_UPDATED_WHILE_RUNNING = {
self.button1:Hide() self.button1:Hide()
end, end,
timeout = 0,
whileDead = 1, whileDead = 1,
} }
...@@ -127,7 +126,6 @@ E.PopupDialogs.ELVUI_EDITBOX = { ...@@ -127,7 +126,6 @@ E.PopupDialogs.ELVUI_EDITBOX = {
self:ClearFocus() self:ClearFocus()
end, end,
OnAccept = E.noop, OnAccept = E.noop,
timeout = 0,
whileDead = 1, whileDead = 1,
preferredIndex = 3, preferredIndex = 3,
hideOnEscape = 1, hideOnEscape = 1,
...@@ -159,7 +157,6 @@ E.PopupDialogs.CONFIRM_LOSE_BINDING_CHANGES = { ...@@ -159,7 +157,6 @@ E.PopupDialogs.CONFIRM_LOSE_BINDING_CHANGES = {
local isChecked = ElvUIBindPopupWindowCheckButton:GetChecked() local isChecked = ElvUIBindPopupWindowCheckButton:GetChecked()
ElvUIBindPopupWindowCheckButton:SetChecked(not isChecked) ElvUIBindPopupWindowCheckButton:SetChecked(not isChecked)
end, end,
timeout = 0,
whileDead = 1, whileDead = 1,
showAlert = 1, showAlert = 1,
}; };
...@@ -170,7 +167,6 @@ E.PopupDialogs.TUKUI_ELVUI_INCOMPATIBLE = { ...@@ -170,7 +167,6 @@ E.PopupDialogs.TUKUI_ELVUI_INCOMPATIBLE = {
OnCancel = function() DisableAddOn("Tukui"); ReloadUI() end, OnCancel = function() DisableAddOn("Tukui"); ReloadUI() end,
button1 = 'ElvUI', button1 = 'ElvUI',
button2 = 'Tukui', button2 = 'Tukui',
timeout = 0,
whileDead = 1, whileDead = 1,
hideOnEscape = false, hideOnEscape = false,
} }
...@@ -181,7 +177,6 @@ E.PopupDialogs.DISABLE_INCOMPATIBLE_ADDON = { ...@@ -181,7 +177,6 @@ E.PopupDialogs.DISABLE_INCOMPATIBLE_ADDON = {
OnCancel = function() E:StaticPopup_Hide('DISABLE_INCOMPATIBLE_ADDON'); E:StaticPopup_Show('INCOMPATIBLE_ADDON', E.PopupDialogs.INCOMPATIBLE_ADDON.addon, E.PopupDialogs.INCOMPATIBLE_ADDON.module) end, OnCancel = function() E:StaticPopup_Hide('DISABLE_INCOMPATIBLE_ADDON'); E:StaticPopup_Show('INCOMPATIBLE_ADDON', E.PopupDialogs.INCOMPATIBLE_ADDON.addon, E.PopupDialogs.INCOMPATIBLE_ADDON.module) end,
button1 = L["I Swear"], button1 = L["I Swear"],
button2 = DECLINE, button2 = DECLINE,
timeout = 0,
whileDead = 1, whileDead = 1,
hideOnEscape = false, hideOnEscape = false,
} }
...@@ -195,7 +190,6 @@ E.PopupDialogs.INCOMPATIBLE_ADDON = { ...@@ -195,7 +190,6 @@ E.PopupDialogs.INCOMPATIBLE_ADDON = {
E:StaticPopup_Hide('INCOMPATIBLE_ADDON') E:StaticPopup_Hide('INCOMPATIBLE_ADDON')
E:StaticPopup_Show('DISABLE_INCOMPATIBLE_ADDON'); E:StaticPopup_Show('DISABLE_INCOMPATIBLE_ADDON');
end, end,
timeout = 0,
whileDead = 1, whileDead = 1,
hideOnEscape = false, hideOnEscape = false,
} }
...@@ -208,7 +202,6 @@ E.PopupDialogs.UISCALE_CHANGE = { ...@@ -208,7 +202,6 @@ E.PopupDialogs.UISCALE_CHANGE = {
button2 = CANCEL, button2 = CANCEL,
button3 = L["Preview Changes"], button3 = L["Preview Changes"],
OnAlt = function() E:PixelScaleChanged('UISCALE_CHANGE') end, OnAlt = function() E:PixelScaleChanged('UISCALE_CHANGE') end,
timeout = 0,
whileDead = 1, whileDead = 1,
hideOnEscape = false hideOnEscape = false
} }
...@@ -217,7 +210,6 @@ E.PopupDialogs.PIXELPERFECT_CHANGED = { ...@@ -217,7 +210,6 @@ E.PopupDialogs.PIXELPERFECT_CHANGED = {
text = L["You have changed the Thin Border Theme option. You will have to complete the installation process to remove any graphical bugs."], text = L["You have changed the Thin Border Theme option. You will have to complete the installation process to remove any graphical bugs."],
button1 = ACCEPT, button1 = ACCEPT,
OnAccept = E.noop, OnAccept = E.noop,
timeout = 0,
whileDead = 1, whileDead = 1,
hideOnEscape = false, hideOnEscape = false,
} }
...@@ -226,7 +218,6 @@ E.PopupDialogs.CONFIGAURA_SET = { ...@@ -226,7 +218,6 @@ E.PopupDialogs.CONFIGAURA_SET = {
text = L["Because of the mass confusion caused by the new aura system I've implemented a new step to the installation process. This is optional. If you like how your auras are setup go to the last step and click finished to not be prompted again. If for some reason you are prompted repeatedly please restart your game."], text = L["Because of the mass confusion caused by the new aura system I've implemented a new step to the installation process. This is optional. If you like how your auras are setup go to the last step and click finished to not be prompted again. If for some reason you are prompted repeatedly please restart your game."],
button1 = ACCEPT, button1 = ACCEPT,
OnAccept = E.noop, OnAccept = E.noop,
timeout = 0,
whileDead = 1, whileDead = 1,
hideOnEscape = false, hideOnEscape = false,
} }
...@@ -236,7 +227,6 @@ E.PopupDialogs.FAILED_UISCALE = { ...@@ -236,7 +227,6 @@ E.PopupDialogs.FAILED_UISCALE = {
button1 = ACCEPT, button1 = ACCEPT,
button2 = CANCEL, button2 = CANCEL,
OnAccept = function() E.global.general.autoScale = false; ReloadUI(); end, OnAccept = function() E.global.general.autoScale = false; ReloadUI(); end,
timeout = 0,
whileDead = 1, whileDead = 1,
hideOnEscape = false, hideOnEscape = false,
} }
...@@ -246,7 +236,6 @@ E.PopupDialogs.CONFIG_RL = { ...@@ -246,7 +236,6 @@ E.PopupDialogs.CONFIG_RL = {
button1 = ACCEPT, button1 = ACCEPT,
button2 = CANCEL, button2 = CANCEL,
OnAccept = ReloadUI, OnAccept = ReloadUI,
timeout = 0,
whileDead = 1,