Skip to content

Commit

Permalink
Change some variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed Feb 8, 2024
1 parent 20872c0 commit 4012bb0
Show file tree
Hide file tree
Showing 16 changed files with 134 additions and 147 deletions.
2 changes: 1 addition & 1 deletion Config/OptionsTables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ local function CreateStatOption(opts, i, stat)
local self = Addon
local GUI = self.GUI

local percent = Addon.isClassic and percentStats[stat] and "%" or ""
local percent = Addon.isEra and percentStats[stat] and "%" or ""

local defaultText = GetDefaultStatText(sampleNumber .. percent, stat)
local formattedText = GetFormattedStatText(sampleNumber .. percent, stat)
Expand Down
6 changes: 3 additions & 3 deletions Config/Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ function Addon:MakeDefaultOptions()
},

order = {
[self.expansions.wrath] = tblConcat(self.statList[self.expansions.wrath] , ","),
[self.expansions.tbc] = tblConcat(self.statList[self.expansions.tbc] , ","),
[self.expansions.classic] = tblConcat(self.statList[self.expansions.classic], ","),
[self.expansions.wrath] = tblConcat(self.statList[self.expansions.wrath] , ","),
[self.expansions.tbc] = tblConcat(self.statList[self.expansions.tbc] , ","),
[self.expansions.era] = tblConcat(self.statList[self.expansions.era], ","),
},
hide = {
["*"] = false,
Expand Down
45 changes: 16 additions & 29 deletions Init/Init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -239,38 +239,25 @@ end

do
Addon.expansions = {
retail = 10,
cataclysm = 4,
cata = 4,
wrath = 3,
wotlk = 3,
tbc = 2,
bcc = 2,
classic = 1,
era = 1,
retail = 10,
cata = 4,
wrath = 3,
tbc = 2,
era = 1,
}

Addon.season = ((C_Seasons or {}).GetActiveSeason or nop)() or 0
Addon.expansionLevel = tonumber(GetBuildInfo():match"^(%d+)%.")
if Addon.expansionLevel >= Addon.expansions.retail then
Addon.expansionName = "retail"
elseif Addon.expansionLevel >= Addon.expansions.wrath then
Addon.expansionName = "wrath"
elseif Addon.expansionLevel == Addon.expansions.tbc then
Addon.expansionName = "tbc"
elseif Addon.expansionLevel == Addon.expansions.classic then
Addon.expansionName = "classic"
end
Addon.isRetail = Addon.expansionName == "retail"
Addon.isWrath = Addon.expansionName == "wrath"
Addon.isTBC = Addon.expansionName == "tbc"
Addon.isClassic = Addon.expansionName == "classic"

Addon.isSeasonOfMastery = Addon.season == Enum.SeasonID.SeasonOfMastery
Addon.isSeasonOfDiscovery = Addon.season == (Enum.SeasonID.SeasonOfDiscovery or Enum.SeasonID.Placeholder)

Addon.isSoM = Addon.isSeasonOfMastery
Addon.isSoD = Addon.isSeasonOfDiscovery

Addon.isRetail = Addon.expansionLevel >= Addon.expansions.retail
Addon.isClassic = not Addon.isRetail
Addon.isCata = Addon.expansionLevel == Addon.expansions.cata
Addon.isWrath = Addon.expansionLevel == Addon.expansions.wrath
Addon.isTBC = Addon.expansionLevel == Addon.expansions.tbc
Addon.isEra = Addon.expansionLevel == Addon.expansions.era

local season = ((C_Seasons or {}).GetActiveSeason or nop)() or 0
Addon.isSoM = season == Enum.SeasonID.SeasonOfMastery
Addon.isSoD = season == (Enum.SeasonID.SeasonOfDiscovery or Enum.SeasonID.Placeholder)
end


Expand Down
14 changes: 7 additions & 7 deletions Init/InitAddon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ do


Addon.statList = {
[Addon.expansions.classic] = {},
[Addon.expansions.tbc] = {},
[Addon.expansions.wrath] = {},
[Addon.expansions.era] = {},
[Addon.expansions.tbc] = {},
[Addon.expansions.wrath] = {},
}
Addon.statsInfo = setmetatable({}, {__index = function() return {} end})
Addon.statOrder = {}
Expand Down Expand Up @@ -348,9 +348,9 @@ do

-- Races: Human, Orc, Dwarf, Night Elf, Undead, Tauren, Gnome, Troll, Blood Elf, Draenei
local raceIDs = {}
raceIDs[Addon.expansions.classic] = {1, 2, 3, 4, 5, 6, 7, 8}
raceIDs[Addon.expansions.tbc] = {1, 2, 3, 4, 5, 6, 7, 8, 10, 11}
raceIDs[Addon.expansions.wrath] = raceIDs[Addon.expansions.tbc]
raceIDs[Addon.expansions.era] = {1, 2, 3, 4, 5, 6, 7, 8}
raceIDs[Addon.expansions.tbc] = {1, 2, 3, 4, 5, 6, 7, 8, 10, 11}
raceIDs[Addon.expansions.wrath] = raceIDs[Addon.expansions.tbc]

Addon.raceNames = {}

Expand Down Expand Up @@ -1164,7 +1164,7 @@ do
33633,
},
} or nil,
[Addon.expansions.wotlk] = Addon.expansionLevel >= Addon.expansions.wotlk and {
[Addon.expansions.wrath] = Addon.expansionLevel >= Addon.expansions.wrath and {
Socket_red = {
39998,
39996,
Expand Down
2 changes: 1 addition & 1 deletion LocaleExtra/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Addon:AddExtraStatCapture("Holy Damage",
{INPUT = "^%+(%d+) Heiligzauberschaden$"})


if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraStatCapture("Defense Rating",
{INPUT = "^Verteidigung %+(%d+)%.$"})

Expand Down
4 changes: 2 additions & 2 deletions LocaleExtra/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Addon:AddExtraStatCapture("Health Regeneration",



if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraStatCapture("Defense Rating",
{INPUT = "^Increased Defense %+(%d+)%.$"})

Expand Down Expand Up @@ -249,7 +249,7 @@ if Addon.isTBC then
}
)
end
if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraReplacement("Mount Speed",
{
INPUT = "^Mithril Spurs", -- Mithril Spurs Enchantment (Mithril Spurs (464))
Expand Down
2 changes: 1 addition & 1 deletion LocaleExtra/esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end



if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraStatCapture("Stamina",
{INPUT = "^(%+)(%d+) de aguante$"})

Expand Down
2 changes: 1 addition & 1 deletion LocaleExtra/esMX.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Addon:AddExtraStatCapture("Health Regeneration",
{INPUT = "^%+(%d+) salud cada 5 s$"})


if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraStatCapture("Defense Rating",
{INPUT = "^Aumenta (%d+) p%. el índice de defensa%.$"})

Expand Down
2 changes: 1 addition & 1 deletion LocaleExtra/frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Addon:AddExtraStatCapture("Health Regeneration",
{INPUT = "^%+(%d+) points? de vie toutes les 5 sec%.$"})


if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraStatCapture("Defense Rating",
{INPUT = "^Défense augmentée de (%d+)%.$"})

Expand Down
2 changes: 1 addition & 1 deletion LocaleExtra/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Addon:AddExtraStatCapture("Health Regeneration",
{INPUT = "^5초당 생명력 회복 %+(%d+)$"})


if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraStatCapture("Defense Rating",
{INPUT = "^방어 숙련도 %+(%d+)%.?$"})

Expand Down
2 changes: 1 addition & 1 deletion LocaleExtra/ptBR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Addon:AddExtraStatCapture("Health Regeneration",
Addon:AddExtraStatCapture("Mana Regeneration",
{INPUT = "^Restaura (%d+) de mana a cada 5 s%.$"})

if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraStatCapture("Defense Rating",
{INPUT = "^Defesa aumentada em (%d+)%.$"})

Expand Down
2 changes: 1 addition & 1 deletion LocaleExtra/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Addon:AddExtraStatCapture("Health Regeneration",
{INPUT = "^%+(%d+) ед%. здоровья каждые 5 секунд$"})


if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraStatCapture("Defense Rating",
{INPUT = "^Увеличение рейтинга защиты на (%d+) ед%.$"})

Expand Down
2 changes: 1 addition & 1 deletion LocaleExtra/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Addon:AddExtraStatCapture("Holy Damage",
{INPUT = "^%+(%d+) 神圣法术伤害$"})


if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraStatCapture("Defense Rating",
{INPUT = "^防御技能提高(%d+)点。$"})

Expand Down
2 changes: 1 addition & 1 deletion LocaleExtra/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Addon:AddExtraStatCapture("Holy Damage",
{INPUT = "^%+(%d+)神聖法術傷害$"},
{INPUT = "^%+(%d+) 神聖法術傷害$"})

if Addon.isClassic then
if Addon.isEra then
Addon:AddExtraStatCapture("Defense Rating",
{INPUT = "^防禦技能提高(%d+)點。$"})

Expand Down
Loading

0 comments on commit 4012bb0

Please sign in to comment.