Skip to content

Commit 157e556

Browse files
remove isTbcOnly from profile (#394)
1 parent 4a0de89 commit 157e556

7 files changed

Lines changed: 32 additions & 85 deletions

File tree

Modules/Config/MeleeSection.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,4 +365,4 @@ function _Config:LoadMeleeSection()
365365
},
366366
},
367367
}
368-
end
368+
end

Modules/Config/RangeSection.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ function _Config:LoadRangeSection()
6060
name = function() return i18n("Armor Pen.") end,
6161
desc = function() return i18n("Shows/Hides the armor penetration value.") end,
6262
width = 1.5,
63-
hidden = function() return (not ECS.IsWotlk) end,
6463
disabled = function() return (not ExtendedCharacterStats.profile.ranged.display); end,
6564
get = function () return ExtendedCharacterStats.profile.ranged.penetration.display; end,
6665
set = function (_, value)

Modules/Data/Data.lua

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,9 @@ dataFunctionRefs = {
2222
-- Melee
2323
["MeleeAttackPower"] = function() return Data:GetMeleeAttackPower() end,
2424
["MeleeCritChance"] = function() return Data:MeleeCrit() end,
25-
["Expertise"] = function()
26-
if ECS.IsWotlk then
27-
return Data:GetExpertise()
28-
else
29-
return 0
30-
end
31-
end,
25+
["Expertise"] = function() return ECS.IsClassic and 0 or Data:GetExpertise() end,
3226
["ExpertiseRating"] = function() return ECS.IsClassic and 0 or Data:GetExpertiseRating() end,
33-
["MeleeArmorPenetration"] = function()
34-
if ECS.IsWotlk then
35-
return Data:GetArmorPenetration()
36-
else
37-
return 0
38-
end
39-
end,
27+
["MeleeArmorPenetration"] = function() return Data:GetArmorPenetration() end,
4028
["MeleeArmorPenetrationRating"] = function() return ECS.IsWotlk and Data:GetArmorPenetrationRating() or 0 end,
4129
["MeleeHitRating"] = function() return ECS.IsClassic and 0 or Data:MeleeHitRating() end,
4230
["MeleeHitBonus"] = function() return Data:MeleeHitBonus() end,
@@ -50,13 +38,7 @@ dataFunctionRefs = {
5038
["GlanceDamageBossLevel"] = function() return Data:GlanceDamageBossLevel() end,
5139

5240
["MeleeHasteRating"] = function() return ECS.IsClassic and 0 or Data:GetMeleeHasteRating() end,
53-
["MeleeHasteBonus"] = function()
54-
if ECS.IsWotlk then
55-
return Data:GetMeleeHasteBonus()
56-
else
57-
return 0
58-
end
59-
end,
41+
["MeleeHasteBonus"] = function() return Data:GetMeleeHasteBonus() end,
6042
["MeleeAttackSpeedMainHand"] = function() return Data:GetMeleeAttackSpeedMainHand() end,
6143
["MeleeAttackSpeedOffHand"] = function() return Data:GetMeleeAttackSpeedOffHand() end,
6244
-- Ranged
@@ -65,23 +47,11 @@ dataFunctionRefs = {
6547
["RangedHitRating"] = function() return ECS.IsClassic and 0 or Data:RangeHitRating() end,
6648
["RangedHitBonus"] = function() return Data:RangeHitBonus() end,
6749
["RangedHitSameLevel"] = function() return Data:RangeMissChanceSameLevel() end,
68-
["RangedArmorPenetration"] = function()
69-
if ECS.IsWotlk then
70-
return Data:GetArmorPenetration()
71-
else
72-
return 0
73-
end
74-
end,
50+
["RangedArmorPenetration"] = function() return Data:GetArmorPenetration() end,
7551
["RangedArmorPenetrationRating"] = function() return ECS.IsWotlk and Data:GetArmorPenetrationRating() or 0 end,
7652
["RangedHitBossLevel"] = function() return Data.RangeMissChanceBossLevel() end,
7753
["RangedHasteRating"] = function() return ECS.IsClassic and 0 or Data:GetRangedHasteRating() end,
78-
["RangedHasteBonus"] = function()
79-
if ECS.IsWotlk then
80-
return Data:GetRangedHasteBonus()
81-
else
82-
return 0
83-
end
84-
end,
54+
["RangedHasteBonus"] = function() return Data:GetRangedHasteBonus() end,
8555
["RangedAttackSpeed"] = function() return Data:GetRangedAttackSpeed() end,
8656
-- Defense
8757
["Armor"] = function() return Data:GetArmorValue() end,
@@ -104,13 +74,7 @@ dataFunctionRefs = {
10474
["SpellHitBossLevel"] = function() return Data:SpellMissChanceBossLevel(Data.HOLY_SCHOOL) end,
10575
["SpellCritChance"] = function() return Data:GetSpellCrit(Data.HOLY_SCHOOL) end,
10676
["SpellHasteRating"] = function() return ECS.IsClassic and 0 or Data:GetSpellHasteRating() end,
107-
["SpellHasteBonus"] = function()
108-
if ECS.IsWotlk then
109-
return Data:GetSpellHasteBonus()
110-
else
111-
return "0 %"
112-
end
113-
end,
77+
["SpellHasteBonus"] = function() return Data:GetSpellHasteBonus() end,
11478
["SpellPenetration"] = function() return Data:GetSpellPenetration() end,
11579
-- MP5
11680
["MP5Items"] = function() return Data:GetMP5FromItems() end,

Modules/Migration.lua

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,10 @@ local i18n = ECSLoader:ImportModule("i18n")
88

99
---@param profileVersion number
1010
function Migration:ToLatestProfileVersion(profileVersion)
11-
if profileVersion < 20 then
11+
if profileVersion < 23 then
1212
---@class ECSProfile
1313
Profile:Reset()
14-
ECS:Print(i18n("Profile has been reset due to a major update.")) -- v4.0.0 because of major spell restructuring
14+
ECS:Print(i18n("Profile has been reset due to a major update.")) -- because of TBC anniversary
1515
return
1616
end
17-
18-
local defaultProfile = Profile:GetDefaultProfile()
19-
if profileVersion < 21 then
20-
ExtendedCharacterStats.general.qualityColorsIntensity = defaultProfile.general.qualityColorsIntensity
21-
end
22-
if profileVersion < 22 then
23-
ExtendedCharacterStats.profile.defense.meleeCritReduction = defaultProfile.profile.defense.meleeCritReduction
24-
ExtendedCharacterStats.profile.defense.rangedCritReduction = defaultProfile.profile.defense.rangedCritReduction
25-
ExtendedCharacterStats.profile.defense.spellCritReduction = defaultProfile.profile.defense.spellCritReduction
26-
ExtendedCharacterStats.profile.defense.avoidanceBoss = defaultProfile.profile.defense.avoidanceBoss
27-
28-
ExtendedCharacterStats.profile.defense.critImmunity = nil
29-
ExtendedCharacterStats.profile.defense.critReduction = nil
30-
end
3117
end

Modules/Profile.lua

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ local Utils = ECSLoader:ImportModule("Utils")
66

77
---@return number
88
function Profile.GetProfileVersion()
9-
return 22
9+
return 23
1010
end
1111

1212
---@return ECSProfile
@@ -35,7 +35,6 @@ local function GetDefaultStatsProfile()
3535

3636
rating = {
3737
display = true,
38-
isTbcOnly = true,
3938
refName = "MeleeHitRating",
4039
text = "Rating",
4140
textColor = colors.HIT_SECONDARY,
@@ -113,33 +112,37 @@ local function GetDefaultStatsProfile()
113112
},
114113
penetration = {
115114
display = true,
116-
isTbcOnly = true,
117115
refName = "MeleeArmorPenetration",
118116
text = "Armor Pen.",
119117
textColor = colors.ATTACK_SPEED_SECONDARY,
120118
statColor = colors.ATTACK_SPEED_PRIMARY,
121119
},
122120
penetrationRating = {
123121
display = true,
124-
isTbcOnly = true,
125122
refName = "MeleeArmorPenetrationRating",
126123
text = "Armor Pen. Rating",
127124
textColor = colors.ATTACK_SPEED_SECONDARY,
128125
statColor = colors.ATTACK_SPEED_PRIMARY,
129126
},
130-
expertise = {display = true, isTbcOnly = true, refName = "Expertise", text = "Expertise"},
131-
expertiseRating = {display = true, isTbcOnly = true, refName = "ExpertiseRating", text = "Expertise Rating"},
127+
expertise = {
128+
display = true,
129+
refName = "Expertise",
130+
text = "Expertise"
131+
},
132+
expertiseRating = {
133+
display = true,
134+
refName = "ExpertiseRating",
135+
text = "Expertise Rating"
136+
},
132137
hasteRating = {
133138
display = true,
134-
isTbcOnly = true,
135139
refName = "MeleeHasteRating",
136140
text = "Haste Rating",
137141
textColor = colors.HASTE_RATING_SECONDARY,
138142
statColor = colors.HASTE_RATING_PRIMARY
139143
},
140144
hasteBonus = {
141145
display = true,
142-
isTbcOnly = true,
143146
refName = "MeleeHasteBonus",
144147
text = "Haste Bonus",
145148
textColor = colors.HASTE_RATING_SECONDARY,
@@ -182,7 +185,6 @@ local function GetDefaultStatsProfile()
182185

183186
rating = {
184187
display = true,
185-
isTbcOnly = true,
186188
refName = "RangedHitRating",
187189
text = "Rating",
188190
textColor = colors.HIT_SECONDARY,
@@ -226,31 +228,27 @@ local function GetDefaultStatsProfile()
226228
},
227229
penetration = {
228230
display = true,
229-
isTbcOnly = true,
230231
refName = "RangedArmorPenetration",
231232
text = "Armor Pen.",
232233
textColor = colors.ATTACK_SPEED_SECONDARY,
233234
statColor = colors.ATTACK_SPEED_PRIMARY,
234235
},
235236
penetrationRating = {
236237
display = true,
237-
isTbcOnly = true,
238238
refName = "RangedArmorPenetrationRating",
239239
text = "Armor Pen. Rating",
240240
textColor = colors.ATTACK_SPEED_SECONDARY,
241241
statColor = colors.ATTACK_SPEED_PRIMARY,
242242
},
243243
hasteRating = {
244244
display = true,
245-
isTbcOnly = true,
246245
refName = "RangedHasteRating",
247246
text = "Haste Rating",
248247
textColor = colors.HASTE_RATING_SECONDARY,
249248
statColor = colors.HASTE_RATING_PRIMARY
250249
},
251250
hasteBonus = {
252251
display = true,
253-
isTbcOnly = true,
254252
refName = "RangedHasteBonus",
255253
text = "Haste Bonus",
256254
textColor = colors.HASTE_RATING_SECONDARY,
@@ -276,13 +274,21 @@ local function GetDefaultStatsProfile()
276274
spellCritReduction = {display = true, refName = "SpellCritReduction", text = "Spell Crit Reduction"},
277275
avoidance = {display = true, refName = "Avoidance", text = "Avoidance"},
278276
avoidanceBoss = {display = true, refName = "AvoidanceBoss", text = "Avoidance (Lvl +3)"},
279-
defenseRating = {display = true, isTbcOnly = true, refName = "DefenseRating", text = "Defense Rating"},
277+
defenseRating = {
278+
display = true,
279+
refName = "DefenseRating",
280+
text = "Defense Rating"
281+
},
280282
defense = {display = true, refName = "DefenseValue", text = "Defense"},
281283
blockChance = {display = true, refName = "BlockChance", text = "Block Chance"},
282284
blockValue = {display = true, refName = "BlockValue", text = "Block Value"},
283285
parry = {display = true, refName = "ParryChance", text = "Parry Chance"},
284286
dodge = {display = true, refName = "DodgeChance", text = "Dodge Chance"},
285-
resilience = {display = true, isTbcOnly = true, refName = "ResilienceValue", text = "Resilience"},
287+
resilience = {
288+
display = true,
289+
refName = "ResilienceValue",
290+
text = "Resilience"
291+
},
286292
},
287293

288294
regen = {
@@ -363,7 +369,6 @@ local function GetDefaultStatsProfile()
363369

364370
rating = {
365371
display = true,
366-
isTbcOnly = true,
367372
refName = "SpellHitRating",
368373
text = "Hit Rating",
369374
textColor = colors.HIT_SECONDARY,
@@ -372,7 +377,7 @@ local function GetDefaultStatsProfile()
372377
bonus = {
373378
display = true,
374379
refName = "SpellHitBonus",
375-
text = "Bonus",
380+
text = "Hit Bonus",
376381
textColor = colors.HIT_SECONDARY,
377382
statColor = colors.HIT_PRIMARY
378383
},
@@ -540,15 +545,13 @@ local function GetDefaultStatsProfile()
540545
},
541546
hasteRating = {
542547
display = true,
543-
isTbcOnly = true,
544548
refName = "SpellHasteRating",
545549
text = "Haste Rating",
546550
textColor = colors.HASTE_RATING_SECONDARY,
547551
statColor = colors.HASTE_RATING_PRIMARY
548552
},
549553
hasteBonus = {
550554
display = true,
551-
isTbcOnly = true,
552555
refName = "SpellHasteBonus",
553556
text = "Haste Bonus",
554557
textColor = colors.HASTE_RATING_SECONDARY,

Modules/Stats.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,6 @@ end
176176
--- Helper function to iterate all field of a given category and create them if they should be displayed
177177
---@param category Category|SubCategory
178178
_CreateStatInfo = function(category, ...)
179-
if ECS.IsClassic and category.isTbcOnly then
180-
return
181-
end
182-
183179
if category.display then
184180
_CreateHeader(category.refName, i18n(category.text), category.isSubGroup)
185181
local stats = {...}
@@ -232,7 +228,7 @@ _CreateStatInfos = function()
232228

233229
if (not ECS.IsWotlk) then
234230
category = profile.melee.glance
235-
_CreateStatInfo(category, category.sameLevel, category.damageSameLevel, category.bossLevel, category.damageBossLevel)
231+
_CreateStatInfo(category, category.sameLevel, category.damageSameLevel, category.bossLevel, category.damageBossLevel)
236232
end
237233

238234
category = profile.melee.attackSpeed

types/types.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
---@field display boolean
1616
---@field refName string
1717
---@field text string
18-
---@field isTbcOnly? true
1918
---@field textColor Color
2019
---@field statColor Color
2120

0 commit comments

Comments
 (0)