@@ -113,6 +113,12 @@ local FlipBooks = {
113
113
},
114
114
}
115
115
116
+ local FlipBook_List = {
117
+ [0 ] = " None" ,
118
+ [" Classic" ] = " Classic" ,
119
+ [" Thin" ] = " Thin" ,
120
+ }
121
+
116
122
---- ------------------------------------
117
123
-- Utility
118
124
---
@@ -417,6 +423,7 @@ hooksecurefunc("ActionButton_ShowOverlayGlow", UpdateSpellAlert)
417
423
-- Core
418
424
---
419
425
426
+ Core .FlipBook_List = FlipBook_List
420
427
Core .UpdateSpellAlert = UpdateSpellAlert
421
428
422
429
---- ------------------------------------
486
493
---
487
494
488
495
-- Adds a custom FlipBook style.
489
- function API :AddSpellAlertFlipBook (Shape , Data )
490
- if type (Shape ) ~= " string" or FlipBooks [Shape ] then
496
+ function API :AddSpellAlertFlipBook (Style , Shape , Data )
497
+ if type (Style ) ~= " string" then
498
+ if Core .Debug then
499
+ error (" Bad argument to API method 'AddSpellAlertFlipBook'. 'Shape' must be a unique string." , 2 )
500
+ end
501
+ return
502
+ elseif type (Shape ) ~= " string" then
491
503
if Core .Debug then
492
504
error (" Bad argument to API method 'AddSpellAlertFlipBook'. 'Shape' must be a unique string." , 2 )
493
505
end
@@ -499,17 +511,34 @@ function API:AddSpellAlertFlipBook(Shape, Data)
499
511
return
500
512
end
501
513
502
- FlipBooks [Shape ] = Data
514
+ local Style_Data = FlipBooks [Style ] or {}
515
+
516
+ if Style_Data [Shape ] then
517
+ if Core .Debug then
518
+ error (" Bad argument to API method 'AddSpellAlertFlipBook'. A style for this shape already exists." , 2 )
519
+ end
520
+ return
521
+ end
522
+
523
+ FlipBooks [Style ][Shape ] = Data
524
+ FlipBook_List [Style ] = FlipBook_List [Style ] or Style
503
525
end
504
526
505
527
-- Returns a FlipBook style table.
506
- function API :GetSpellAlertFlipBook (Shape )
507
- if type (Shape ) ~= " string" then
528
+ function API :GetSpellAlertFlipBook (Style , Shape )
529
+ if type (Style ) ~= " string" then
530
+ if Core .Debug then
531
+ error (" Bad argument to API method 'GetSpellAlertFlipBook'. 'Style' must be a string." , 2 )
532
+ end
533
+ return
534
+ elseif type (Shape ) ~= " string" then
508
535
if Core .Debug then
509
536
error (" Bad argument to API method 'GetSpellAlertFlipBook'. 'Shape' must be a string." , 2 )
510
537
end
511
538
return
512
539
end
513
540
514
- return FlipBooks [Shape ]
541
+ local Style_Data = FlipBooks [Style ]
542
+
543
+ return Style_Data and Style_Data [Shape ]
515
544
end
0 commit comments