This repository has been archived by the owner on Jan 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Neuron-States.lua
329 lines (303 loc) · 9.49 KB
/
Neuron-States.lua
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
-- Neuron is a World of Warcraft® user interface addon.
-- Copyright (c) 2017-2023 Britt W. Yazel
-- Copyright (c) 2006-2014 Connor H. Chenoweth
-- This code is licensed under the MIT license (see LICENSE for details)
local _, addonTable = ...
local Neuron = addonTable.Neuron
local L = LibStub("AceLocale-3.0"):GetLocale("Neuron")
function Neuron.UpdateStanceStrings()
-- these are the results of the visibility macro conditional in the MANAGED_SECONDARY_STATES table
Neuron.VISIBILITY_STATES = {
paged1 = L["Page 1"],
paged2 = L["Page 2"],
paged3 = L["Page 3"],
paged4 = L["Page 4"],
paged5 = L["Page 5"],
paged6 = L["Page 6"],
pet0 = L["No Pet"],
pet1 = L["Pet Exists"],
alt0 = L["Alt Up"],
alt1 = L["Alt Down"],
ctrl0 = L["Control Up"],
ctrl1 = L["Control Down"],
shift0 = L["Shift Up"],
shift1 = L["Shift Down"],
stance0 = L["Default"],
stealth0 = L["No Stealth"],
stealth1 = L["Stealth"],
reaction0 = L["Friendly"],
reaction1 = L["Hostile"],
combat0 = L["Out of Combat"],
combat1 = L["In Combat"],
group0 = L["No Group"],
group1 = L["Group: Raid"],
group2 = L["Group: Party"],
dragonriding0 = L["No Dragon Riding"],
dragonriding1 = L["Dragon Riding"],
fishing0 = L["No Fishing Pole"],
fishing1 = L["Fishing Pole"],
vehicle0 = L["No Vehicle"],
vehicle1 = L["Vehicle"],
possess0 = L["No Possess"],
possess1 = L["Possess"],
override0 = L["No Override Bar"],
override1 = L["Override Bar"],
extrabar0 = L["No Extra Bar"],
extrabar1 = L["Extra Bar"],
target0 = L["Has Target"],
target1 = L["No Target"],
}
Neuron.STATES = {
homestate = L["Home State"],
laststate = L["Last State"],
custom0 = L["Custom States"],
}
MergeTable(Neuron.STATES, Neuron.VISIBILITY_STATES)
--- this is actually a lot of classes. rogues stealth, paladins have
--- devo aura, priests have shadowform, etc
for i=1,GetNumShapeshiftForms() do
local _, _, _, spellID = GetShapeshiftFormInfo(i)
Neuron.STATES["stance"..i] = GetSpellInfo(spellID) --Get the string name of the shapeshift form (now that shapeshifts are considered spells)
end
-- Caster Form is special cased just because that's the way it's been historically
if Neuron.class == "DRUID" then
Neuron.STATES["stance0"] = L["Caster Form"]
end
-- stealth shows up with the GetShapeshiftFormInfo, but not the others
-- Melee is special cased just because that's the way it's been historically
if Neuron.class == "ROGUE" then
Neuron.STATES["stance0"] = L["Melee"]
Neuron.STATES["stance2"] = L["Vanish"]
Neuron.STATES["stance3"] = L["Shadow Dance"] --for Subelty Rogues
end
-- the "states" and "visibility" fields are macro conditionals. they will
-- pass the result of the conditional as "message" into the attribute driver
-- See "RegisterAttributeDriver" and "SetAttribute"
-- example: if a priest is in shadowform (stance1) then
-- "[stance0] noshadow; [stance1] shadow" will make message="shadow"
Neuron.MANAGED_HOME_STATES = {
paged = {
modifier = "paged",
homestate = "paged1",
states = "[bar:1] paged1; [bar:2] paged2; [bar:3] paged3; [bar:4] paged4; [bar:5] paged5; [bar:6] paged6",
visibility = "[bar:1] paged1; [bar:2] paged2; [bar:3] paged3; [bar:4] paged4; [bar:5] paged5; [bar:6] paged6",
rangeStart = 2,
rangeStop = 6,
localizedName = L["Paged"],
},
stance = {
modifier = "stance",
homestate = "stance0",
-- the class with the maximum "stances" is the druid with 6. no need for more than this
states = "[stance:0] stance0; [stance:1] stance1; [stance:2] stance2; [stance:3] stance3; [stance:4] stance4; [stance:5] stance5; [stance:6] stance6;",
visibility = "[stance:0] stance0; [stance:1] stance1; [stance:2] stance2; [stance:3] stance3; [stance:4] stance4; [stance:5] stance5; [stance:6] stance6;",
rangeStart = 1,
rangeStop = 8,
localizedName =
(Neuron.class == "ROGUE" and L["Stealth"]) or
(Neuron.class == "DRUID" and L["Shapeshift"]) or
(Neuron.class == "SHAMAN" and L["Shapeshift"]) or
L["Stance"],
},
pet = {
modifier = "pet",
homestate = "pet1",
states = "[nopet] pet1; [@pet,exists,nodead] pet2",
visibility = "[vehicleui] pet0; [possessbar] pet0; [overridebar] pet0; [nopet] pet0; [pet] pet1",
rangeStart = 2,
rangeStop = 3,
localizedName = L["Pet"],
},
}
Neuron.MANAGED_SECONDARY_STATES = {
alt = {
modifier = "alt",
states = "[mod:alt] alt1; laststate",
visibility = "[nomod:alt] alt0; [mod:alt] alt1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Alt"],
},
ctrl = {
modifier = "ctrl",
states = "[mod:ctrl] ctrl1; laststate",
visibility = "[nomod:ctrl] ctrl0; [mod:ctrl] ctrl1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Ctrl"],
},
shift = {
modifier = "shift",
states = "[mod:shift] shift1; laststate",
visibility = "[nomod:shift] shift0; [mod:shift] shift1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Shift"],
},
stealth = {
modifier = "stealth",
states = "[stealth] stealth1; laststate",
visibility = "[nostealth] stealth0; [stealth] stealth1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Stealth"],
},
reaction = {
modifier = "reaction",
states = "[@target,harm] reaction1; laststate",
visibility = "[@target,help] reaction0; [@target,harm] reaction1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Reaction"],
},
dragonriding = {
modifier = "dragonriding",
states = "[bonusbar:5,nopossessbar] dragonriding1; laststate",
visibility = "[possessbar] dragonriding0; [nobonusbar:5] dragonriding0; [bonusbar:5] dragonriding1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Dragon Riding"],
},
vehicle = {
modifier = "vehicle",
states = "[vehicleui] vehicle1; laststate",
visibility = "[novehicleui] vehicle0; [vehicleui] vehicle1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Vehicle"],
},
group = {
modifier = "group",
states = "[group:raid] group1; [group:party] group2; laststate",
visibility = "[nogroup] group0; [group:raid] group1; [group:party] group2",
rangeStart = 1,
rangeStop = 2,
localizedName = L["Group"],
},
fishing = {
modifier = "fishing",
states = "[worn:fishing poles] fishing1; laststate",
visibility = "[noworn:fishing poles] fishing0; [worn:fishing poles] fishing1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Fishing"],
},
combat = {
modifier = "combat",
states = "[combat] combat1; laststate",
visibility = "[nocombat] combat0; [combat] combat1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Combat"],
},
possess = {
modifier = "possess",
states = "[possessbar] possess1; laststate",
visibility = "[nopossessbar] possess0; [possessbar] possess1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Possess"],
},
override = {
modifier = "override",
states = "[overridebar] override1; laststate",
visibility = "[nooverridebar] override0; [overridebar] override1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Override"],
},
target = {
modifier = "target",
states = "[exists] target1; laststate",
visibility = "[noexists] target0; [exists] target1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Target"],
},
indoors = {
modifier = "indoors",
states = "[indoors] indoors1; laststate",
visibility = "[noindoors] indoors0; [indoors] indoors1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Indoors"],
},
outdoors = {
modifier = "outdoors",
states = "[outdoors] outdoors1; laststate",
visibility = "[nooutdoors] outdoors0; [outdoors] outdoors1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Outdoors"],
},
mounted = {
modifier = "mounted",
states = "[mounted] mounted1; laststate",
visibility = "[nomounted] mounted0; [mounted] mounted1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Mounted"],
},
flying = {
modifier = "flying",
states = "[flying] flying1; laststate",
visibility = "[noflying] flying0; [flying] flying1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Flying"],
},
help = {
modifier = "help",
states = "[help] help1; laststate",
visibility = "[nohelp] help0; [help] help1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Help"],
},
harm = {
modifier = "harm",
states = "[harm] harm1; laststate",
visibility = "[noharm] harm0; [harm] harm1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Harm"],
},
resting = {
modifier = "resting",
states = "[resting] resting1; laststate",
visibility = "[noresting] resting0; [resting] resting1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Resting"],
},
swimming = {
modifier = "swimming",
states = "[swimming] swimming1; laststate",
visibility = "[noswimming] swimming0; [swimming] swimming1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Swimming"],
},
}
Neuron.MANAGED_OTHER_STATES = {
custom = {
modifier = "custom",
states = "",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Custom"],
},
extrabar = {
modifier = "extrabar",
states = "[extrabar] extrabar1; laststate",
visibility = "[noextrabar] extrabar0; [extrabar] extrabar1",
rangeStart = 1,
rangeStop = 1,
localizedName = L["Extrabar"],
},
}
Neuron.MANAGED_BAR_STATES = {}
MergeTable(Neuron.MANAGED_BAR_STATES, Neuron.MANAGED_HOME_STATES)
MergeTable(Neuron.MANAGED_BAR_STATES, Neuron.MANAGED_SECONDARY_STATES)
MergeTable(Neuron.MANAGED_BAR_STATES, Neuron.MANAGED_OTHER_STATES)
end