-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMeleeSection.lua
More file actions
executable file
·374 lines (371 loc) · 19.4 KB
/
MeleeSection.lua
File metadata and controls
executable file
·374 lines (371 loc) · 19.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
local CanDualWield = CanDualWield
local ECSLoader = ECSLoader
local IsClassic = ECS.IsClassic
local IsWotlk = ECS.IsWotlk
---@class Config
local Config = ECSLoader:ImportModule("Config")
local _Config = Config.private
---@type Stats
local Stats = ECSLoader:ImportModule("Stats")
---@type i18n
local i18n = ECSLoader:ImportModule("i18n")
function _Config:LoadMeleeSection()
return {
type = "group",
order = 2,
inline = false,
width = 2,
name = function() return i18n("Melee") end,
args = {
showMeleeStats = {
type = "toggle",
order = 0,
name = function() return i18n("Show Melee Stats") end,
desc = function() return i18n("Shows/Hides all melee stats.") end,
width = 1.5,
get = function () return ExtendedCharacterStats.profile.melee.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.display = value
Stats.RebuildStatInfos()
end,
},
meleeAttackPower = {
type = "toggle",
order = 1,
name = function() return i18n("Melee Attack Power") end,
desc = function() return i18n("Shows/Hides the melee attack power value.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.attackPower.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.attackPower.display = value
Stats.RebuildStatInfos()
end,
},
meleeCrit = {
type = "toggle",
order = 2,
name = function() return i18n("Melee Crit") end,
desc = function() return i18n("Shows/Hides the melee crit chance.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.crit.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.crit.display = value
Stats.RebuildStatInfos()
end,
},
penetration = {
type = "toggle",
order = 2.3,
name = function() return i18n("Armor Pen.") end,
desc = function() return i18n("Shows/Hides the armor penetration value.") end,
width = 1.5,
hidden = function() return IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.penetration.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.penetration.display = value
Stats.RebuildStatInfos()
end,
},
penetrationRating = {
type = "toggle",
order = 2.4,
name = function() return i18n("Armor Pen. Rating") end,
desc = function() return i18n("Shows/Hides the armor penetration rating value.") end,
width = 1.5,
hidden = function() return not IsWotlk end,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.penetrationRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.penetrationRating.display = value
Stats.RebuildStatInfos()
end,
},
expertise = {
type = "toggle",
order = 2.5,
name = function() return i18n("Expertise") end,
desc = function() return i18n("Shows/Hides the expertise value.") end,
width = 1.5,
hidden = function() return IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.expertise.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.expertise.display = value
Stats.RebuildStatInfos()
end,
},
expertiseRating = {
type = "toggle",
order = 2.6,
name = function() return i18n("Expertise Rating") end,
desc = function() return i18n("Shows/Hides the expertise rating.") end,
width = 1.5,
hidden = function() return IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.expertiseRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.expertiseRating.display = value
Stats.RebuildStatInfos()
end,
},
hasteRating = {
type = "toggle",
order = 2.6,
name = function() return i18n("Haste Rating") end,
desc = function() return i18n("Shows/Hides the melee haste rating.") end,
width = 1.5,
hidden = function() return IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.hasteRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.hasteRating.display = value
Stats.RebuildStatInfos()
end,
},
hasteBonus = {
type = "toggle",
order = 2.7,
name = function() return i18n("Haste Bonus") end,
desc = function() return i18n("Shows/Hides the melee haste bonus value.") end,
width = 1.5,
hidden = function() return IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.hasteBonus.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.hasteBonus.display = value
Stats.RebuildStatInfos()
end,
},
meleeHit = {
type = "toggle",
order = 3,
name = function() return i18n("Melee Hit") end,
desc = function() return i18n("Shows/Hides all melee hit chance.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.hit.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.hit.display = value
Stats.RebuildStatInfos()
end,
},
meleeHitGroup = {
type = "group",
order = 4,
inline = true,
name = function() return i18n("Melee Hit Values") end,
args = {
meleeHitRating = {
type = "toggle",
order = 1,
name = function() return i18n("Hit Rating") end,
desc = function() return i18n("Shows/Hides the melee hit rating.") end,
width = 1.5,
hidden = function() return IsClassic end,
disabled = function()
return ((not ExtendedCharacterStats.profile.melee.display) or
(not ExtendedCharacterStats.profile.melee.hit.display))
end,
get = function () return ExtendedCharacterStats.profile.melee.hit.rating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.hit.rating.display = value
Stats.RebuildStatInfos()
end,
},
meleeHitBonus = {
type = "toggle",
order = 2,
name = function() return i18n("Hit Bonus") end,
desc = function() return i18n("Shows/Hides the melee hit bonus.") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.melee.display) or
(not ExtendedCharacterStats.profile.melee.hit.display))
end,
get = function () return ExtendedCharacterStats.profile.melee.hit.bonus.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.hit.bonus.display = value
Stats.RebuildStatInfos()
end,
},
meleeMiss = {
type = "toggle",
order = 3,
name = function() return i18n("Miss Chance") end,
desc = function() return i18n("Shows/Hides the melee miss chance against enemies on the same level.") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.melee.display) or
(not ExtendedCharacterStats.profile.melee.hit.display))
end,
get = function () return ExtendedCharacterStats.profile.melee.hit.sameLevel.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.hit.sameLevel.display = value
Stats.RebuildStatInfos()
end,
},
meleeMissBoss = {
type = "toggle",
order = 4,
name = function() return i18n("Miss Chance Boss") end,
desc = function() return i18n("Shows/Hides the melee miss chance against boss enemies (+3 Level).") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.melee.display) or
(not ExtendedCharacterStats.profile.melee.hit.display))
end,
get = function () return ExtendedCharacterStats.profile.melee.hit.bossLevel.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.hit.bossLevel.display = value
Stats.RebuildStatInfos()
end,
},
},
},
glancingBlow = {
type = "toggle",
order = 5,
name = function() return i18n("Glancing Blow") end,
desc = function() return i18n("Shows/Hides all glancing blow stats") end,
width = 1.5,
hidden = function() return IsWotlk end,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.glance.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.glance.display = value
Stats.RebuildStatInfos()
end,
},
meleeGlanceGroup = {
type = "group",
order = 6,
inline = true,
name = function() return i18n("Melee Glance Values") end,
hidden = function() return IsWotlk end,
args = {
meleeGlance = {
type = "toggle",
order = 1,
name = function() return i18n("Glancing Blow Chance") end,
desc = function() return i18n("Shows/Hides the glancing chance against enemies on same level.") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.melee.display) or
(not ExtendedCharacterStats.profile.melee.glance.display))
end,
get = function () return ExtendedCharacterStats.profile.melee.glance.sameLevel.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.glance.sameLevel.display = value
Stats.RebuildStatInfos()
end,
},
meleeGlanceBoss = {
type = "toggle",
order = 2,
name = function() return i18n("Glancing Blow Chance Boss") end,
desc = function() return i18n("Shows/Hides the glancing chance against boss enemies (+3 Level).") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.melee.display) or
(not ExtendedCharacterStats.profile.melee.glance.display))
end,
get = function () return ExtendedCharacterStats.profile.melee.glance.bossLevel.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.glance.bossLevel.display = value
Stats.RebuildStatInfos()
end,
},
meleeGlanceDamage = {
type = "toggle",
order = 3,
name = function() return i18n("Glancing Blow Damage") end,
desc = function() return i18n("Shows/Hides the damage reduction against enemies on the same level.") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.melee.display) or
(not ExtendedCharacterStats.profile.melee.glance.display))
end,
get = function () return ExtendedCharacterStats.profile.melee.glance.damageSameLevel.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.glance.damageSameLevel.display = value
Stats.RebuildStatInfos()
end,
},
meleeGlanceDamageBoss = {
type = "toggle",
order = 4,
name = function() return i18n("Glancing Blow Damage Boss") end,
desc = function() return i18n("Shows/Hides the damage reduction against boss enemies (+3 Level).") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.melee.display) or
(not ExtendedCharacterStats.profile.melee.glance.display))
end,
get = function () return ExtendedCharacterStats.profile.melee.glance.damageBossLevel.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.glance.damageBossLevel.display = value
Stats.RebuildStatInfos()
end,
},
}
},
meleeAttackSpeed = {
type = "toggle",
order = 7,
name = function() return i18n("Attack Speed") end,
desc = function() return i18n("Shows/Hides the melee attack speed.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.attackSpeed.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.attackSpeed.display = value
Stats.RebuildStatInfos()
end,
},
meleeAttackSpeedGroup = {
type = "group",
order = 8,
inline = true,
name = function() return i18n("Attack Speed") end,
args = {
mainHand = {
type = "toggle",
order = 1,
name = function() return i18n("Main Hand") end,
desc = function() return i18n("Shows/Hides the attack speed of the main hand.") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.melee.display) or
(not ExtendedCharacterStats.profile.melee.attackSpeed.display))
end,
get = function () return ExtendedCharacterStats.profile.melee.attackSpeed.mainHand.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.attackSpeed.mainHand.display = value
Stats.RebuildStatInfos()
end,
},
offHand = {
type = "toggle",
order = 2,
name = function() return i18n("Off Hand") end,
hidden = function() return not CanDualWield() end,
desc = function() return i18n("Shows/Hides the attack speed of the off hand.") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.melee.display) or
(not ExtendedCharacterStats.profile.melee.attackSpeed.display))
end,
get = function () return ExtendedCharacterStats.profile.melee.attackSpeed.offHand.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.attackSpeed.offHand.display = value
Stats.RebuildStatInfos()
end,
},
}
},
},
}
end