Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 26 additions & 1 deletion dcs/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -1408,6 +1408,28 @@ def dict(self):
return d


class SoundToUnit(Action):
predicate = "a_out_sound_u"

def __init__(self, unit="", file_res_key: Optional[ResourceKey] = None):
super(SoundToUnit, self).__init__(SoundToGroup.predicate)
self.unit = unit
if file_res_key:
self.params.append(self.unit)
self.file_res_key = file_res_key
self.params.append(self.file_res_key)

@classmethod
def create_from_dict(cls, d, mission):
return cls(d["unit"], ResourceKey(d["file"]))

def dict(self):
d = super(SoundToUnit, self).dict()
d["unit"] = self.unit
d["file"] = self.file_res_key.key
return d


class StartListenCockpitEvent(Action):
predicate = "a_start_listen_event"

Expand Down Expand Up @@ -1614,7 +1636,9 @@ def __init__(self, groupid, task_index):

@classmethod
def create_from_dict(cls, d, mission):
return cls(d["set_ai_task"][0], d["ai_task"][1])
# Not sure if this used to be 0/1 in older missions, if
# so this needs a conditional.
return cls(d["set_ai_task"][1], d["set_ai_task"][2])

def dict(self):
d = super(AITaskSet, self).dict()
Expand Down Expand Up @@ -1823,6 +1847,7 @@ def dict(self):
"a_out_sound_s": SoundToCoalition,
"a_out_sound_c": SoundToCountry,
"a_out_sound_g": SoundToGroup,
"a_out_sound_u": SoundToUnit,
"a_start_listen_event": StartListenCockpitEvent,
"a_start_listen_command": StartListenCommand,
"a_cockpit_lock_player_seat": StartPlayerSeatLock,
Expand Down
8 changes: 8 additions & 0 deletions dcs/drawing/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ class LineStyle(Enum):
Wirefence = "wirefence"
Dot2 = "dot2"
Solid2 = "solid2"
DotDash = "dotdash"
StrongPoint = "strongpoint"
WireFence = "wirefence"
Boundry1 = "boundry1"
Boundry2 = "boundry2"
Boundry3 = "boundry3"
Boundry4 = "boundry4"
Boundry5 = "boundry5"


@dataclass
Expand Down
16 changes: 16 additions & 0 deletions tools/actions_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,22 @@
]
},

"SoundToUnit": {
"name": "a_out_sound_u",
"fields": [
{
"id": "unit",
"type": "combo",
"default": "",
},
{
"id": "file",
"type": "file_edit",
"default": "",
},
]
},

"SoundToCountry": {
"name": "a_out_sound_c",
"fields": [
Expand Down