-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathRangeSection.lua
More file actions
executable file
·218 lines (215 loc) · 10.8 KB
/
RangeSection.lua
File metadata and controls
executable file
·218 lines (215 loc) · 10.8 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
local ECSLoader = ECSLoader
local IsClassic = ECS.IsClassic
local IsWotlk = ECS.IsWotlk
local UnitHasRelicSlot = UnitHasRelicSlot
---@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:LoadRangeSection()
return {
type = "group",
order = 3,
inline = false,
width = 2,
name = function() return i18n("Ranged") end,
hidden = function() return UnitHasRelicSlot("player") end,
args = {
showRangeStats = {
type = "toggle",
order = 0,
name = function() return i18n("Show Ranged Stats") end,
desc = function() return i18n("Shows/Hides all ranged stats.") end,
width = 1.5,
get = function () return ExtendedCharacterStats.profile.ranged.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.display = value
Stats.RebuildStatInfos()
end,
},
rangedAttackPower = {
type = "toggle",
order = 1,
name = function() return i18n("Ranged Attack Power") end,
desc = function() return i18n("Shows/Hides the ranged attack power value.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.ranged.display); end,
get = function () return ExtendedCharacterStats.profile.ranged.attackPower.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.attackPower.display = value
Stats.RebuildStatInfos()
end,
},
rangeCrit = {
type = "toggle",
order = 2,
name = function() return i18n("Ranged Crit") end,
desc = function() return i18n("Shows/Hides the ranged crit chance.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.ranged.display); end,
get = function () return ExtendedCharacterStats.profile.ranged.crit.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.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,
disabled = function() return (not ExtendedCharacterStats.profile.ranged.display); end,
get = function () return ExtendedCharacterStats.profile.ranged.penetration.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.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.ranged.display); end,
get = function () return ExtendedCharacterStats.profile.ranged.penetrationRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.penetrationRating.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 ranged haste rating.") end,
width = 1.5,
hidden = function() return IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.ranged.display); end,
get = function () return ExtendedCharacterStats.profile.ranged.hasteRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.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 ranged haste bonus value.") end,
width = 1.5,
hidden = function() return IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.ranged.display); end,
get = function () return ExtendedCharacterStats.profile.ranged.hasteBonus.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.hasteBonus.display = value
Stats.RebuildStatInfos()
end,
},
rangedAttackSpeed = {
type = "toggle",
order = 3,
name = function() return i18n("Attack Speed") end,
desc = function() return i18n("Shows/Hides the ranged attack speed.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.ranged.display); end,
get = function () return ExtendedCharacterStats.profile.ranged.attackSpeed.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.attackSpeed.display = value
Stats.RebuildStatInfos()
end,
},
rangeHit = {
type = "toggle",
order = 4,
name = function() return i18n("Ranged Hit") end,
desc = function() return i18n("Shows/Hides all ranged hit chance.") end,
width = 1.5,
disabled = function() return (not ExtendedCharacterStats.profile.ranged.display); end,
get = function () return ExtendedCharacterStats.profile.ranged.hit.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.hit.display = value
Stats.RebuildStatInfos()
end,
},
rangeHitGroup = {
type = "group",
order = 5,
inline = true,
name = function() return i18n("Ranged Hit Values") end,
args = {
rangeHitRating = {
type = "toggle",
order = 1,
name = function() return i18n("Hit Rating") end,
desc = function() return i18n("Shows/Hides the ranged hit rating.") end,
width = 1.5,
hidden = function() return IsClassic end,
disabled = function()
return ((not ExtendedCharacterStats.profile.ranged.display) or
(not ExtendedCharacterStats.profile.ranged.hit.display))
end,
get = function () return ExtendedCharacterStats.profile.ranged.hit.rating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.hit.rating.display = value
Stats.RebuildStatInfos()
end,
},
rangeHitBonus = {
type = "toggle",
order = 2,
name = function() return i18n("Hit Bonus") end,
desc = function() return i18n("Shows/Hides the ranged hit bonus.") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.ranged.display) or
(not ExtendedCharacterStats.profile.ranged.hit.display))
end,
get = function () return ExtendedCharacterStats.profile.ranged.hit.bonus.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.hit.bonus.display = value
Stats.RebuildStatInfos()
end,
},
rangeMiss = {
type = "toggle",
order = 3,
name = function() return i18n("Miss Chance") end,
desc = function() return i18n("Shows/Hides the ranged miss chance against enemies on the same level.") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.ranged.display) or
(not ExtendedCharacterStats.profile.ranged.hit.display))
end,
get = function () return ExtendedCharacterStats.profile.ranged.hit.sameLevel.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.hit.sameLevel.display = value
Stats.RebuildStatInfos()
end,
},
rangeMissBoss = {
type = "toggle",
order = 4,
name = function() return i18n("Miss Chance Boss") end,
desc = function() return i18n("Shows/Hides the ranged miss chance against boss enemies (+3 Level).") end,
width = 1.5,
disabled = function()
return ((not ExtendedCharacterStats.profile.ranged.display) or
(not ExtendedCharacterStats.profile.ranged.hit.display))
end,
get = function () return ExtendedCharacterStats.profile.ranged.hit.bossLevel.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.hit.bossLevel.display = value
Stats.RebuildStatInfos()
end,
},
}
},
},
}
end