@@ -521,17 +521,21 @@ def __str__(self):
521521
522522def create_control_group_event (frame , pid , data ):
523523 update_type = data ["control_group_update" ]
524- if update_type == 0 :
524+ if update_type in [0 , 4 ]:
525+ # 0 is the normal set command.
526+ # 4 is used when you steal and set. If required, type 4 will be followed by autogenerated
527+ # selection and control group events that remove the units from their other groups.
525528 return SetControlGroupEvent (frame , pid , data )
526- elif update_type == 1 :
529+ elif update_type in [1 , 5 ]:
530+ # 1 is the normal add command.
531+ # 5 is used when you steal and add. If required, type 5 will be followed by autogenerated
532+ # selection and control group events that remove the units from their other groups.
527533 return AddToControlGroupEvent (frame , pid , data )
528534 elif update_type == 2 :
529535 return GetControlGroupEvent (frame , pid , data )
530536 elif update_type == 3 :
531- # TODO: What could this be?!?
532- return ControlGroupEvent (frame , pid , data )
537+ return DeleteControlGroupEvent (frame , pid , data )
533538 else :
534- # No idea what this is but we're seeing update_types of 4 and 5 in 3.0
535539 return ControlGroupEvent (frame , pid , data )
536540
537541
@@ -589,6 +593,15 @@ class AddToControlGroupEvent(SetControlGroupEvent):
589593 """
590594
591595
596+ class DeleteControlGroupEvent (ControlGroupEvent ):
597+ """
598+ Extends :class:`ControlGroupEvent`
599+
600+ This event deletes the control group (all units are removed). This happens when all
601+ units are stolen from the event group (alt, alt+shift modifiers by default).
602+ """
603+
604+
592605class GetControlGroupEvent (ControlGroupEvent ):
593606 """
594607 Extends :class:`ControlGroupEvent`
0 commit comments