@@ -565,11 +565,24 @@ function MySlot:RecoverData(msg, opt)
565
565
end
566
566
-- }}}
567
567
568
+ local slotBucket = {}
568
569
569
570
-- {{{ Macro
570
- -- cache macro
571
571
local macro = {}
572
- MySlot :Clear (" MACRO" , opt .clearOpt .ignoreMacros )
572
+
573
+ for _ , s in pairs (msg .slot or {}) do
574
+ local slotId = s .id
575
+ local slotType = _MySlot .Slot .SlotType [s .type ]
576
+ local index = s .index
577
+
578
+ if slotType == MYSLOT_MACRO then
579
+ if macro [index ] then
580
+ table.insert (macro [index ], slotId )
581
+ else
582
+ macro [index ] = {slotId }
583
+ end
584
+ end
585
+ end
573
586
574
587
for _ , m in pairs (msg .macro or {}) do
575
588
local macroId = m .id
@@ -585,22 +598,29 @@ function MySlot:RecoverData(msg, opt)
585
598
[" body" ] = body ,
586
599
}
587
600
588
- if not opt .actionOpt .ignoreMacros [" ACCOUNT" ] and macroId <= MAX_ACCOUNT_MACROS then
589
- macro [macroId ] = self :FindOrCreateMacro (info )
601
+ local newid = nil
602
+
603
+ if (not opt .actionOpt .ignoreMacros [" ACCOUNT" ] and macroId <= MAX_ACCOUNT_MACROS )
604
+ or (not opt .actionOpt .ignoreMacros [" CHARACTOR" ] and macroId > MAX_ACCOUNT_MACROS )
605
+ then
606
+ newid = self :FindOrCreateMacro (info )
590
607
end
591
608
592
- if not opt . actionOpt . ignoreMacros [ " CHARACTOR " ] and macroId > MAX_ACCOUNT_MACROS then
593
- macro [ macroId ] = self :FindOrCreateMacro (info )
609
+ if not newid then
610
+ newid = self :FindMacro (info )
594
611
end
595
612
596
- if not macro [macroId ] then
597
- macro [macroId ] = self :FindMacro (info )
613
+ if newid then
614
+ for _ , slotId in pairs (macro [macroId ] or {}) do
615
+ PickupMacro (newid )
616
+ PlaceAction (slotId )
617
+ end
618
+ else
619
+ MySlot :Print (L [" Ignore unknown macro [id=%s]" ]:format (macroId ))
598
620
end
599
621
end
600
622
-- }}} Macro
601
623
602
- MySlot :Clear (" ACTION" , opt .clearOpt .ignoreActionBars )
603
- local slotBucket = {}
604
624
605
625
for _ , s in pairs (msg .slot or {}) do
606
626
local slotId = s .id
@@ -644,16 +664,16 @@ function MySlot:RecoverData(msg, opt)
644
664
end
645
665
elseif slotType == MYSLOT_ITEM then
646
666
PickupItem (index )
647
- elseif slotType == MYSLOT_MACRO then
648
- local macroid = macro [index ]
667
+ -- elseif slotType == MYSLOT_MACRO then
668
+ -- local macroid = macro[index]
649
669
650
- if not macroid then
651
- MySlot :Print (L [" Ignore unknown macro [id=%s]" ]:format (index ))
652
- end
670
+ -- if not macroid then
671
+ -- MySlot:Print(L["Ignore unknown macro [id=%s]"]:format(index))
672
+ -- end
653
673
654
- if curType ~= MYSLOT_MACRO or curIndex ~= macroid then
655
- PickupMacro (macroid )
656
- end
674
+ -- if curType ~= MYSLOT_MACRO or curIndex ~= macroid then
675
+ -- PickupMacro(macroid)
676
+ -- end
657
677
elseif slotType == MYSLOT_SUMMONPET and strindex and strindex ~= curIndex then
658
678
C_PetJournal .PickupPet (strindex , false )
659
679
if not GetCursorInfo () then
@@ -695,10 +715,6 @@ function MySlot:RecoverData(msg, opt)
695
715
end
696
716
end
697
717
698
- if opt .clearOpt .ignoreBinding then
699
- MySlot :Clear (" BINDING" )
700
- end
701
-
702
718
if not opt .actionOpt .ignoreBinding then
703
719
704
720
for _ , b in pairs (msg .bind or {}) do
0 commit comments