Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for a_out_text_delay_u action #362

Merged
merged 2 commits into from
May 20, 2024
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
31 changes: 31 additions & 0 deletions dcs/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,36 @@ def dict(self):
return d


class MessageToUnit(TextAction):
predicate = "a_out_text_delay_u"

def __init__(self, unit_id: int = 0, text: String = String(),
rp- marked this conversation as resolved.
Show resolved Hide resolved
seconds: int = 10, clearview: bool = False, start_delay: int = 0) -> None:
super().__init__(self.predicate, text)
self.unit_id = unit_id
self.params.append(self.unit_id)
self.params.append(self.text)
self.seconds = seconds
self.params.append(self.seconds)
self.clearview = clearview
self.params.append(self.clearview)
self.start_delay = start_delay
self.params.append(self.start_delay)

@classmethod
def create_from_dict(cls, d: Dict[Any, Any], mission) -> MessageToUnit:
return cls(d["unit"], mission.translation.get_string(d["text"]),
d["seconds"], d["clearview"], d["start_delay"])

def dict(self):
d = super().dict()
d["unit"] = self.unit_id
d["seconds"] = self.seconds
d["clearview"] = self.clearview
d["start_delay"] = self.start_delay
return d


class PlayArgument(Action):
predicate = "a_play_argument"

Expand Down Expand Up @@ -2027,6 +2057,7 @@ def dict(self) -> Dict[str, Any]:
"a_out_text_delay_s": MessageToCoalition,
"a_out_text_delay_c": MessageToCountry,
"a_out_text_delay_g": MessageToGroup,
"a_out_text_delay_u": MessageToUnit,
"a_play_argument": PlayArgument,
"a_prevent_controls_synchronization": PreventControlsSynchronization,
"a_radio_transmission": RadioTransmission,
Expand Down
Loading