Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions sc2reader/events/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,17 +521,21 @@ def __str__(self):

def create_control_group_event(frame, pid, data):
update_type = data["control_group_update"]
if update_type == 0:
if update_type in [0, 4]:
# 0 is the normal set command.
# 4 is used when you steal and set. If required, type 4 will be followed by autogenerated
# selection and control group events that remove the units from their other groups.
return SetControlGroupEvent(frame, pid, data)
elif update_type == 1:
elif update_type in [1, 5]:
# 1 is the normal add command.
# 5 is used when you steal and add. If required, type 5 will be followed by autogenerated
# selection and control group events that remove the units from their other groups.
return AddToControlGroupEvent(frame, pid, data)
elif update_type == 2:
return GetControlGroupEvent(frame, pid, data)
elif update_type == 3:
# TODO: What could this be?!?
return ControlGroupEvent(frame, pid, data)
return DeleteControlGroupEvent(frame, pid, data)
else:
# No idea what this is but we're seeing update_types of 4 and 5 in 3.0
return ControlGroupEvent(frame, pid, data)


Expand Down Expand Up @@ -589,6 +593,15 @@ class AddToControlGroupEvent(SetControlGroupEvent):
"""


class DeleteControlGroupEvent(ControlGroupEvent):
"""
Extends :class:`ControlGroupEvent`

This event deletes the control group (all units are removed). This happens when all
units are stolen from the event group (alt, alt+shift modifiers by default).
"""


class GetControlGroupEvent(ControlGroupEvent):
"""
Extends :class:`ControlGroupEvent`
Expand Down