Set units on the frontline to Hidden On MFD. (#2669)

All groups (friendly and enemy) that are part of the front line are set
to `Hidden On MFD`. This is a group level filter, and can not be applied
on a per unit basis.
This commit is contained in:
SnappyComebacks 2022-12-28 14:19:33 -07:00 committed by Raffson
parent 33ee4b1d1a
commit 8363a7e8fa
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 7 additions and 2 deletions

View File

@ -156,6 +156,7 @@ Saves from 6.x are not compatible with 7.0.
* **[Squadrons]** Squadron-specific mission capability lists no longer restrict players from assigning missions outside the squadron's preferences.
* **[New Game Wizard]** Squadrons can be directly replaced with a preset during air wing configuration rather than needing to remove and create a new squadron.
* **[UI]** The orientation of objects like SAMs, EWRs, garrisons, and ships can now be manually adjusted.
* **[Mission Generation]** Units on the front line are now hidden on MFDs.
## Fixes

View File

@ -234,6 +234,7 @@ class FlotGenerator:
)
vehicle = vg.units[0]
GroundForcePainter(faction, vehicle).apply_livery()
vg.hidden_on_mfd = True
return
possible_infantry_units = set(faction.infantry_with_class(UnitClass.INFANTRY))
@ -261,6 +262,7 @@ class FlotGenerator:
)
vehicle = vg.units[0]
GroundForcePainter(faction, vehicle).apply_livery()
vg.hidden_on_mfd = True
for unit in units[1:]:
position = infantry_position.random_point_within(55, 5)
@ -275,6 +277,7 @@ class FlotGenerator:
)
vehicle = vg.units[0]
GroundForcePainter(faction, vehicle).apply_livery()
vg.hidden_on_mfd = True
def _earliest_tot_on_flot(self, player: bool) -> timedelta:
tots = [
@ -645,7 +648,7 @@ class FlotGenerator:
) -> List[VehicleGroup]:
"""
Return the nearest enemy group for the player group
@param group Group for which we should find the nearest ennemies
@param player_group Group for which we should find the nearest ennemies
@param enemy_groups Potential enemy groups
@param n number of nearby groups to take
"""
@ -670,7 +673,7 @@ class FlotGenerator:
) -> Optional[VehicleGroup]:
"""
Search the enemy groups for a potential target suitable to armored assault
@param group Group for which we should find the nearest ennemy
@param player_group Group for which we should find the nearest ennemy
@param enemy_groups Potential enemy groups
"""
min_distance = math.inf
@ -813,6 +816,7 @@ class FlotGenerator:
group_size=count,
heading=heading.degrees,
)
group.hidden_on_mfd = True
self.unit_map.add_front_line_units(group, cp, unit_type)