wuira 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +102 -1
  2. package/README.md +347 -0
  3. package/lib/Spells.d.ts +21 -0
  4. package/lib/Spells.lua +41 -0
  5. package/lib/datasources/AuraTimer.d.ts +21 -0
  6. package/lib/datasources/AuraTimer.lua +322 -0
  7. package/lib/datasources/CastTimer.d.ts +9 -0
  8. package/lib/datasources/CastTimer.lua +240 -0
  9. package/lib/datasources/DataSource.d.ts +4 -0
  10. package/lib/datasources/DataSource.lua +24 -0
  11. package/lib/datasources/KnownSpells.d.ts +21 -0
  12. package/lib/datasources/KnownSpells.lua +794 -0
  13. package/lib/datasources/ManaRegenTimer.d.ts +29 -0
  14. package/lib/datasources/ManaRegenTimer.lua +674 -0
  15. package/lib/datasources/ProgressSource.d.ts +6 -2
  16. package/lib/datasources/ProgressSource.lua +34 -3
  17. package/lib/datasources/Resources.d.ts +33 -2
  18. package/lib/datasources/Resources.lua +562 -10
  19. package/lib/datasources/SpellCooldown.d.ts +12 -0
  20. package/lib/datasources/SpellCooldown.lua +218 -0
  21. package/lib/datasources/SpellSource.d.ts +14 -0
  22. package/lib/datasources/SpellSource.lua +224 -0
  23. package/lib/datasources/SwingTimer.d.ts +31 -0
  24. package/lib/datasources/SwingTimer.lua +641 -0
  25. package/lib/datasources/TextureSource.d.ts +10 -0
  26. package/lib/datasources/TextureSource.lua +83 -0
  27. package/lib/datasources/TimerSource.d.ts +20 -0
  28. package/lib/datasources/TimerSource.lua +338 -0
  29. package/lib/datasources/TotemTimer.d.ts +10 -0
  30. package/lib/datasources/TotemTimer.lua +260 -0
  31. package/lib/datasources/index.d.ts +16 -1
  32. package/lib/datasources/index.lua +43 -0
  33. package/lib/index.d.ts +11 -0
  34. package/lib/index.lua +24 -0
  35. package/lib/platform/ActionBars.d.ts +27 -0
  36. package/lib/platform/ActionBars.lua +726 -0
  37. package/lib/platform/AddonSettings.d.ts +9 -0
  38. package/lib/platform/AddonSettings.lua +36 -0
  39. package/lib/platform/BlizzardUI.d.ts +17 -0
  40. package/lib/platform/BlizzardUI.lua +689 -0
  41. package/lib/platform/MicroMenu.d.ts +15 -0
  42. package/lib/platform/MicroMenu.lua +219 -0
  43. package/lib/platform/SecureButton.d.ts +5 -0
  44. package/lib/platform/SecureButton.lua +196 -0
  45. package/lib/platform/SlashCommands.d.ts +3 -0
  46. package/lib/platform/SlashCommands.lua +309 -0
  47. package/lib/platform/forever.d.ts +115 -2
  48. package/lib/skins/MicroBar.d.ts +8 -0
  49. package/lib/skins/MicroBar.lua +65 -0
  50. package/lib/skins/NativeSkin.d.ts +26 -0
  51. package/lib/skins/NativeSkin.lua +601 -0
  52. package/lib/skins/index.d.ts +3 -0
  53. package/lib/skins/index.lua +11 -0
  54. package/lib/store/index.lua +13 -0
  55. package/lib/ui/Button.d.ts +10 -0
  56. package/lib/ui/Button.lua +9 -0
  57. package/lib/ui/Cell.d.ts +7 -1
  58. package/lib/ui/FrameMover.d.ts +21 -0
  59. package/lib/ui/FrameMover.lua +123 -0
  60. package/lib/ui/HoverTracker.d.ts +20 -0
  61. package/lib/ui/HoverTracker.lua +88 -0
  62. package/lib/ui/Icon.d.ts +8 -0
  63. package/lib/ui/Icon.lua +8 -0
  64. package/lib/ui/KeybindCapture.d.ts +20 -0
  65. package/lib/ui/KeybindCapture.lua +488 -0
  66. package/lib/ui/Label.d.ts +10 -0
  67. package/lib/ui/Label.lua +8 -0
  68. package/lib/ui/ProgressBar.d.ts +5 -1
  69. package/lib/ui/SecureButton.d.ts +44 -0
  70. package/lib/ui/SecureButton.lua +9 -0
  71. package/lib/ui/index.d.ts +13 -0
  72. package/lib/ui/index.lua +28 -0
  73. package/lib/ui/layout/measureLayout.lua +11 -2
  74. package/lib/ui/mount.lua +679 -74
  75. package/lib/ui/primitives/jsx.d.ts +15 -2
  76. package/lib/wuira.d.ts +3 -0
  77. package/lib/wuira.lua +5 -0
  78. package/package.json +8 -1
  79. package/tools/build-library.mjs +1 -1
@@ -0,0 +1,689 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ -- Lua Library inline imports
3
+ local function __TS__Class(self)
4
+ local c = {prototype = {}}
5
+ c.prototype.__index = c.prototype
6
+ c.prototype.constructor = c
7
+ return c
8
+ end
9
+
10
+ local __TS__Symbol, Symbol
11
+ do
12
+ local symbolMetatable = {__tostring = function(self)
13
+ return ("Symbol(" .. (self.description or "")) .. ")"
14
+ end}
15
+ function __TS__Symbol(description)
16
+ return setmetatable({description = description}, symbolMetatable)
17
+ end
18
+ Symbol = {
19
+ asyncDispose = __TS__Symbol("Symbol.asyncDispose"),
20
+ dispose = __TS__Symbol("Symbol.dispose"),
21
+ iterator = __TS__Symbol("Symbol.iterator"),
22
+ hasInstance = __TS__Symbol("Symbol.hasInstance"),
23
+ species = __TS__Symbol("Symbol.species"),
24
+ toStringTag = __TS__Symbol("Symbol.toStringTag")
25
+ }
26
+ end
27
+
28
+ local __TS__Iterator
29
+ do
30
+ local function iteratorGeneratorStep(self)
31
+ local co = self.____coroutine
32
+ local status, value = coroutine.resume(co)
33
+ if not status then
34
+ error(value, 0)
35
+ end
36
+ if coroutine.status(co) == "dead" then
37
+ return
38
+ end
39
+ return true, value
40
+ end
41
+ local function iteratorIteratorStep(self)
42
+ local result = self:next()
43
+ if result.done then
44
+ return
45
+ end
46
+ return true, result.value
47
+ end
48
+ local function iteratorStringStep(self, index)
49
+ index = index + 1
50
+ if index > #self then
51
+ return
52
+ end
53
+ return index, string.sub(self, index, index)
54
+ end
55
+ function __TS__Iterator(iterable)
56
+ if type(iterable) == "string" then
57
+ return iteratorStringStep, iterable, 0
58
+ elseif iterable.____coroutine ~= nil then
59
+ return iteratorGeneratorStep, iterable
60
+ elseif iterable[Symbol.iterator] then
61
+ local iterator = iterable[Symbol.iterator](iterable)
62
+ return iteratorIteratorStep, iterator
63
+ else
64
+ return ipairs(iterable)
65
+ end
66
+ end
67
+ end
68
+
69
+ local function __TS__New(target, ...)
70
+ local instance = setmetatable({}, target.prototype)
71
+ instance:____constructor(...)
72
+ return instance
73
+ end
74
+
75
+ local Set
76
+ do
77
+ Set = __TS__Class()
78
+ Set.name = "Set"
79
+ function Set.prototype.____constructor(self, values)
80
+ self[Symbol.toStringTag] = "Set"
81
+ self.size = 0
82
+ self.nextKey = {}
83
+ self.previousKey = {}
84
+ if values == nil then
85
+ return
86
+ end
87
+ local iterable = values
88
+ if iterable[Symbol.iterator] then
89
+ local iterator = iterable[Symbol.iterator](iterable)
90
+ while true do
91
+ local result = iterator:next()
92
+ if result.done then
93
+ break
94
+ end
95
+ self:add(result.value)
96
+ end
97
+ else
98
+ local array = values
99
+ for ____, value in ipairs(array) do
100
+ self:add(value)
101
+ end
102
+ end
103
+ end
104
+ function Set.prototype.add(self, value)
105
+ local isNewValue = not self:has(value)
106
+ if isNewValue then
107
+ self.size = self.size + 1
108
+ end
109
+ if self.firstKey == nil then
110
+ self.firstKey = value
111
+ self.lastKey = value
112
+ elseif isNewValue then
113
+ self.nextKey[self.lastKey] = value
114
+ self.previousKey[value] = self.lastKey
115
+ self.lastKey = value
116
+ end
117
+ return self
118
+ end
119
+ function Set.prototype.clear(self)
120
+ self.nextKey = {}
121
+ self.previousKey = {}
122
+ self.firstKey = nil
123
+ self.lastKey = nil
124
+ self.size = 0
125
+ end
126
+ function Set.prototype.delete(self, value)
127
+ local contains = self:has(value)
128
+ if contains then
129
+ self.size = self.size - 1
130
+ local next = self.nextKey[value]
131
+ local previous = self.previousKey[value]
132
+ if next ~= nil and previous ~= nil then
133
+ self.nextKey[previous] = next
134
+ self.previousKey[next] = previous
135
+ elseif next ~= nil then
136
+ self.firstKey = next
137
+ self.previousKey[next] = nil
138
+ elseif previous ~= nil then
139
+ self.lastKey = previous
140
+ self.nextKey[previous] = nil
141
+ else
142
+ self.firstKey = nil
143
+ self.lastKey = nil
144
+ end
145
+ self.nextKey[value] = nil
146
+ self.previousKey[value] = nil
147
+ end
148
+ return contains
149
+ end
150
+ function Set.prototype.forEach(self, callback)
151
+ for ____, key in __TS__Iterator(self:keys()) do
152
+ callback(nil, key, key, self)
153
+ end
154
+ end
155
+ function Set.prototype.has(self, value)
156
+ return self.nextKey[value] ~= nil or self.lastKey == value
157
+ end
158
+ Set.prototype[Symbol.iterator] = function(self)
159
+ return self:values()
160
+ end
161
+ function Set.prototype.entries(self)
162
+ local function getFirstKey()
163
+ return self.firstKey
164
+ end
165
+ local nextKey = self.nextKey
166
+ local key
167
+ local started = false
168
+ return {
169
+ [Symbol.iterator] = function(self)
170
+ return self
171
+ end,
172
+ next = function(self)
173
+ if not started then
174
+ started = true
175
+ key = getFirstKey(nil)
176
+ else
177
+ key = nextKey[key]
178
+ end
179
+ return {done = not key, value = {key, key}}
180
+ end
181
+ }
182
+ end
183
+ function Set.prototype.keys(self)
184
+ local function getFirstKey()
185
+ return self.firstKey
186
+ end
187
+ local nextKey = self.nextKey
188
+ local key
189
+ local started = false
190
+ return {
191
+ [Symbol.iterator] = function(self)
192
+ return self
193
+ end,
194
+ next = function(self)
195
+ if not started then
196
+ started = true
197
+ key = getFirstKey(nil)
198
+ else
199
+ key = nextKey[key]
200
+ end
201
+ return {done = not key, value = key}
202
+ end
203
+ }
204
+ end
205
+ function Set.prototype.values(self)
206
+ local function getFirstKey()
207
+ return self.firstKey
208
+ end
209
+ local nextKey = self.nextKey
210
+ local key
211
+ local started = false
212
+ return {
213
+ [Symbol.iterator] = function(self)
214
+ return self
215
+ end,
216
+ next = function(self)
217
+ if not started then
218
+ started = true
219
+ key = getFirstKey(nil)
220
+ else
221
+ key = nextKey[key]
222
+ end
223
+ return {done = not key, value = key}
224
+ end
225
+ }
226
+ end
227
+ function Set.prototype.union(self, other)
228
+ local result = __TS__New(Set, self)
229
+ for ____, item in __TS__Iterator(other) do
230
+ result:add(item)
231
+ end
232
+ return result
233
+ end
234
+ function Set.prototype.intersection(self, other)
235
+ local result = __TS__New(Set)
236
+ for ____, item in __TS__Iterator(self) do
237
+ if other:has(item) then
238
+ result:add(item)
239
+ end
240
+ end
241
+ return result
242
+ end
243
+ function Set.prototype.difference(self, other)
244
+ local result = __TS__New(Set, self)
245
+ for ____, item in __TS__Iterator(other) do
246
+ result:delete(item)
247
+ end
248
+ return result
249
+ end
250
+ function Set.prototype.symmetricDifference(self, other)
251
+ local result = __TS__New(Set, self)
252
+ for ____, item in __TS__Iterator(other) do
253
+ if self:has(item) then
254
+ result:delete(item)
255
+ else
256
+ result:add(item)
257
+ end
258
+ end
259
+ return result
260
+ end
261
+ function Set.prototype.isSubsetOf(self, other)
262
+ for ____, item in __TS__Iterator(self) do
263
+ if not other:has(item) then
264
+ return false
265
+ end
266
+ end
267
+ return true
268
+ end
269
+ function Set.prototype.isSupersetOf(self, other)
270
+ for ____, item in __TS__Iterator(other) do
271
+ if not self:has(item) then
272
+ return false
273
+ end
274
+ end
275
+ return true
276
+ end
277
+ function Set.prototype.isDisjointFrom(self, other)
278
+ for ____, item in __TS__Iterator(self) do
279
+ if other:has(item) then
280
+ return false
281
+ end
282
+ end
283
+ return true
284
+ end
285
+ Set[Symbol.species] = Set
286
+ end
287
+
288
+ local __TS__Unpack = table.unpack or unpack
289
+
290
+ local function __TS__CountVarargs(...)
291
+ return select("#", ...)
292
+ end
293
+
294
+ local function __TS__SparseArrayNew(...)
295
+ local sparseArray = {...}
296
+ sparseArray.sparseLength = __TS__CountVarargs(...)
297
+ return sparseArray
298
+ end
299
+
300
+ local function __TS__SparseArrayPush(sparseArray, ...)
301
+ local args = {...}
302
+ local argsLen = __TS__CountVarargs(...)
303
+ local listLen = sparseArray.sparseLength
304
+ for i = 1, argsLen do
305
+ sparseArray[listLen + i] = args[i]
306
+ end
307
+ sparseArray.sparseLength = listLen + argsLen
308
+ end
309
+
310
+ local function __TS__SparseArraySpread(sparseArray)
311
+ local _unpack = unpack or table.unpack
312
+ return _unpack(sparseArray, 1, sparseArray.sparseLength)
313
+ end
314
+
315
+ local function __TS__ArrayPush(self, ...)
316
+ local items = {...}
317
+ local len = #self
318
+ for i = 1, #items do
319
+ len = len + 1
320
+ self[len] = items[i]
321
+ end
322
+ return len
323
+ end
324
+
325
+ local Map
326
+ do
327
+ Map = __TS__Class()
328
+ Map.name = "Map"
329
+ function Map.prototype.____constructor(self, entries)
330
+ self[Symbol.toStringTag] = "Map"
331
+ self.items = {}
332
+ self.size = 0
333
+ self.nextKey = {}
334
+ self.previousKey = {}
335
+ if entries == nil then
336
+ return
337
+ end
338
+ local iterable = entries
339
+ if iterable[Symbol.iterator] then
340
+ local iterator = iterable[Symbol.iterator](iterable)
341
+ while true do
342
+ local result = iterator:next()
343
+ if result.done then
344
+ break
345
+ end
346
+ local value = result.value
347
+ self:set(value[1], value[2])
348
+ end
349
+ else
350
+ local array = entries
351
+ for ____, kvp in ipairs(array) do
352
+ self:set(kvp[1], kvp[2])
353
+ end
354
+ end
355
+ end
356
+ function Map.prototype.clear(self)
357
+ self.items = {}
358
+ self.nextKey = {}
359
+ self.previousKey = {}
360
+ self.firstKey = nil
361
+ self.lastKey = nil
362
+ self.size = 0
363
+ end
364
+ function Map.prototype.delete(self, key)
365
+ local contains = self:has(key)
366
+ if contains then
367
+ self.size = self.size - 1
368
+ local next = self.nextKey[key]
369
+ local previous = self.previousKey[key]
370
+ if next ~= nil and previous ~= nil then
371
+ self.nextKey[previous] = next
372
+ self.previousKey[next] = previous
373
+ elseif next ~= nil then
374
+ self.firstKey = next
375
+ self.previousKey[next] = nil
376
+ elseif previous ~= nil then
377
+ self.lastKey = previous
378
+ self.nextKey[previous] = nil
379
+ else
380
+ self.firstKey = nil
381
+ self.lastKey = nil
382
+ end
383
+ self.nextKey[key] = nil
384
+ self.previousKey[key] = nil
385
+ end
386
+ self.items[key] = nil
387
+ return contains
388
+ end
389
+ function Map.prototype.forEach(self, callback)
390
+ for ____, key in __TS__Iterator(self:keys()) do
391
+ callback(nil, self.items[key], key, self)
392
+ end
393
+ end
394
+ function Map.prototype.get(self, key)
395
+ return self.items[key]
396
+ end
397
+ function Map.prototype.has(self, key)
398
+ return self.nextKey[key] ~= nil or self.lastKey == key
399
+ end
400
+ function Map.prototype.set(self, key, value)
401
+ local isNewValue = not self:has(key)
402
+ if isNewValue then
403
+ self.size = self.size + 1
404
+ end
405
+ self.items[key] = value
406
+ if self.firstKey == nil then
407
+ self.firstKey = key
408
+ self.lastKey = key
409
+ elseif isNewValue then
410
+ self.nextKey[self.lastKey] = key
411
+ self.previousKey[key] = self.lastKey
412
+ self.lastKey = key
413
+ end
414
+ return self
415
+ end
416
+ Map.prototype[Symbol.iterator] = function(self)
417
+ return self:entries()
418
+ end
419
+ function Map.prototype.entries(self)
420
+ local function getFirstKey()
421
+ return self.firstKey
422
+ end
423
+ local items = self.items
424
+ local nextKey = self.nextKey
425
+ local key
426
+ local started = false
427
+ return {
428
+ [Symbol.iterator] = function(self)
429
+ return self
430
+ end,
431
+ next = function(self)
432
+ if not started then
433
+ started = true
434
+ key = getFirstKey(nil)
435
+ else
436
+ key = nextKey[key]
437
+ end
438
+ return {done = not key, value = {key, items[key]}}
439
+ end
440
+ }
441
+ end
442
+ function Map.prototype.keys(self)
443
+ local function getFirstKey()
444
+ return self.firstKey
445
+ end
446
+ local nextKey = self.nextKey
447
+ local key
448
+ local started = false
449
+ return {
450
+ [Symbol.iterator] = function(self)
451
+ return self
452
+ end,
453
+ next = function(self)
454
+ if not started then
455
+ started = true
456
+ key = getFirstKey(nil)
457
+ else
458
+ key = nextKey[key]
459
+ end
460
+ return {done = not key, value = key}
461
+ end
462
+ }
463
+ end
464
+ function Map.prototype.values(self)
465
+ local function getFirstKey()
466
+ return self.firstKey
467
+ end
468
+ local items = self.items
469
+ local nextKey = self.nextKey
470
+ local key
471
+ local started = false
472
+ return {
473
+ [Symbol.iterator] = function(self)
474
+ return self
475
+ end,
476
+ next = function(self)
477
+ if not started then
478
+ started = true
479
+ key = getFirstKey(nil)
480
+ else
481
+ key = nextKey[key]
482
+ end
483
+ return {done = not key, value = items[key]}
484
+ end
485
+ }
486
+ end
487
+ Map[Symbol.species] = Map
488
+ end
489
+ -- End of Lua Library inline imports
490
+ local ____exports = {}
491
+ local ____MicroMenu = require("platform.MicroMenu")
492
+ local skinMicroMenu = ____MicroMenu.skinMicroMenu
493
+ --- Opt-in stock UI visibility. Native buttons, bindings and event handlers remain intact.
494
+ ____exports.BlizzardUI = __TS__Class()
495
+ local BlizzardUI = ____exports.BlizzardUI
496
+ BlizzardUI.name = "BlizzardUI"
497
+ function BlizzardUI.prototype.____constructor(self)
498
+ end
499
+ function BlizzardUI.SkinMicroMenu(self, options)
500
+ if options == nil then
501
+ options = {}
502
+ end
503
+ return skinMicroMenu(nil, options)
504
+ end
505
+ function BlizzardUI.DisableActionBars(self)
506
+ local unhide = self:Hide({actionBars = true})
507
+ local listener = CreateFrame("Frame", nil, UIParent)
508
+ local roots = {
509
+ "MainActionBar",
510
+ "MainMenuBar",
511
+ "MultiBarBottomLeft",
512
+ "MultiBarBottomRight",
513
+ "MultiBarRight",
514
+ "MultiBarLeft",
515
+ "MultiBar5",
516
+ "MultiBar6",
517
+ "MultiBar7",
518
+ "StanceBar",
519
+ "PetActionBar"
520
+ }
521
+ local managers = {
522
+ "ActionBarController",
523
+ "ActionBarButtonEventsFrame",
524
+ "ActionBarActionEventsFrame",
525
+ "ActionBarButtonUpdateFrame",
526
+ "ActionBarButtonRangeCheckFrame",
527
+ "ActionBarButtonUsableWatcherFrame"
528
+ }
529
+ local function apply()
530
+ if InCombatLockdown() then
531
+ return
532
+ end
533
+ local seen = __TS__New(Set)
534
+ local quiet
535
+ quiet = function(____, frame)
536
+ if frame == nil or frame.UnregisterAllEvents == nil or seen:has(frame) then
537
+ return
538
+ end
539
+ seen:add(frame)
540
+ frame:UnregisterAllEvents()
541
+ frame:SetScript("OnEvent", nil)
542
+ frame:SetScript("OnUpdate", nil)
543
+ if frame.GetChildren ~= nil then
544
+ local children = {frame:GetChildren()}
545
+ for ____, child in ipairs(children) do
546
+ quiet(nil, child)
547
+ end
548
+ end
549
+ end
550
+ local ____array_0 = __TS__SparseArrayNew(__TS__Unpack(roots))
551
+ __TS__SparseArrayPush(
552
+ ____array_0,
553
+ __TS__Unpack(managers)
554
+ )
555
+ for ____, name in ipairs({__TS__SparseArraySpread(____array_0)}) do
556
+ quiet(nil, _G[name])
557
+ end
558
+ for ____, prefix in ipairs({
559
+ "ActionButton",
560
+ "MultiBarBottomLeftButton",
561
+ "MultiBarBottomRightButton",
562
+ "MultiBarRightButton",
563
+ "MultiBarLeftButton",
564
+ "MultiBar5Button",
565
+ "MultiBar6Button",
566
+ "MultiBar7Button"
567
+ }) do
568
+ do
569
+ local index = 1
570
+ while index <= 12 do
571
+ local button = _G[prefix .. tostring(index)]
572
+ if button ~= nil then
573
+ local ____opt_1 = C_ActionBar and C_ActionBar.UnregisterActionUIButton
574
+ if ____opt_1 ~= nil then
575
+ ____opt_1(button)
576
+ end
577
+ end
578
+ index = index + 1
579
+ end
580
+ end
581
+ end
582
+ end
583
+ listener:RegisterEvent("ADDON_LOADED")
584
+ listener:RegisterEvent("PLAYER_ENTERING_WORLD")
585
+ listener:RegisterEvent("PLAYER_REGEN_ENABLED")
586
+ listener:SetScript("OnEvent", apply)
587
+ apply(nil)
588
+ return function()
589
+ listener:UnregisterAllEvents()
590
+ listener:SetScript("OnEvent", nil)
591
+ unhide(nil)
592
+ end
593
+ end
594
+ function BlizzardUI.Hide(self, options)
595
+ local names = {}
596
+ if options.actionBars then
597
+ __TS__ArrayPush(
598
+ names,
599
+ "MainActionBar",
600
+ "MainMenuBar",
601
+ "MultiBarBottomLeft",
602
+ "MultiBarBottomRight",
603
+ "MultiBarRight",
604
+ "MultiBarLeft",
605
+ "MultiBar5",
606
+ "MultiBar6",
607
+ "MultiBar7",
608
+ "StanceBar",
609
+ "PetActionBar"
610
+ )
611
+ end
612
+ if options.player then
613
+ names[#names + 1] = "PlayerFrame"
614
+ end
615
+ if options.target then
616
+ names[#names + 1] = "TargetFrame"
617
+ end
618
+ if options.focus then
619
+ names[#names + 1] = "FocusFrame"
620
+ end
621
+ local hidden = CreateFrame("Frame", nil, UIParent)
622
+ hidden:SetAllPoints(UIParent)
623
+ hidden:Hide()
624
+ local listener = CreateFrame("Frame", nil, UIParent)
625
+ local parents = __TS__New(Map)
626
+ local enabled = true
627
+ local function apply()
628
+ if InCombatLockdown() then
629
+ return
630
+ end
631
+ if not enabled then
632
+ for ____, ____value in __TS__Iterator(parents) do
633
+ local frame = ____value[1]
634
+ local parent = ____value[2]
635
+ if frame:GetParent() == hidden then
636
+ frame:SetParent(parent)
637
+ end
638
+ end
639
+ parents:clear()
640
+ listener:UnregisterAllEvents()
641
+ listener:SetScript("OnEvent", nil)
642
+ listener:Hide()
643
+ return
644
+ end
645
+ for ____, name in ipairs(names) do
646
+ do
647
+ local __continue31
648
+ repeat
649
+ local frame = _G[name]
650
+ if frame == nil then
651
+ __continue31 = true
652
+ break
653
+ end
654
+ if not parents:has(frame) then
655
+ parents:set(
656
+ frame,
657
+ frame:GetParent()
658
+ )
659
+ frame:HookScript(
660
+ "OnShow",
661
+ function()
662
+ if enabled and not InCombatLockdown() and frame:GetParent() ~= hidden then
663
+ frame:SetParent(hidden)
664
+ end
665
+ end
666
+ )
667
+ end
668
+ if frame:GetParent() ~= hidden then
669
+ frame:SetParent(hidden)
670
+ end
671
+ __continue31 = true
672
+ until true
673
+ if not __continue31 then
674
+ break
675
+ end
676
+ end
677
+ end
678
+ end
679
+ listener:RegisterEvent("PLAYER_REGEN_ENABLED")
680
+ listener:RegisterEvent("PLAYER_ENTERING_WORLD")
681
+ listener:RegisterEvent("ADDON_LOADED")
682
+ listener:SetScript("OnEvent", apply)
683
+ apply(nil)
684
+ return function()
685
+ enabled = false
686
+ apply(nil)
687
+ end
688
+ end
689
+ return ____exports
@@ -0,0 +1,15 @@
1
+ import type { Color } from "../types/Color";
2
+ export interface MicroMenuSkinOptions {
3
+ background?: Color;
4
+ border?: Color;
5
+ buttonBackground?: Color;
6
+ icon?: Color;
7
+ accent?: Color;
8
+ disabledIcon?: Color;
9
+ padding?: number;
10
+ panel?: boolean;
11
+ }
12
+ /** Style Forever's existing micro buttons without replacing their scripts or layout.
13
+ * Disposing stops maintenance; reload restores the native textures.
14
+ */
15
+ export declare function skinMicroMenu(options?: MicroMenuSkinOptions): () => void;