Allow hiding IADS TGOs on MFD

This commit is contained in:
Raffson
2023-10-22 00:21:46 +02:00
parent e3dcf8e547
commit bc861380f0
6 changed files with 33 additions and 2 deletions

View File

@@ -223,3 +223,4 @@ class Migrator:
def _update_tgos(self) -> None:
for go in self.game.theater.ground_objects:
try_set_attr(go, "task", None)
try_set_attr(go, "hide_on_mfd", False)

View File

@@ -290,9 +290,11 @@ class GroundObjectGenerator:
# All alive Ships
ship_units.append(unit)
if vehicle_units:
self.create_vehicle_group(group.group_name, vehicle_units)
vg = self.create_vehicle_group(group.group_name, vehicle_units)
vg.hidden_on_mfd = self.ground_object.hide_on_mfd
if ship_units:
self.create_ship_group(group.group_name, ship_units)
sg = self.create_ship_group(group.group_name, ship_units)
sg.hidden_on_mfd = self.ground_object.hide_on_mfd
def create_vehicle_group(
self, group_name: str, units: list[TheaterUnit]

View File

@@ -64,6 +64,7 @@ class TheaterGroundObject(MissionTarget, SidcDescribable, ABC):
control_point: ControlPoint,
sea_object: bool,
task: Optional[GroupTask],
hide_on_mfd: bool = False,
) -> None:
super().__init__(name, location)
self.id = uuid.uuid4()
@@ -75,6 +76,7 @@ class TheaterGroundObject(MissionTarget, SidcDescribable, ABC):
self.original_name = location.original_name
self._threat_poly: ThreatPoly | None = None
self.task = task
self.hide_on_mfd = hide_on_mfd
def __getstate__(self) -> dict[str, Any]:
state = self.__dict__.copy()