Add UI for selecting weapon laser codes.

This makes it possible to have the right laser code set for hot start
aircraft that (typically) do not allow changing laser codes when the
engine is on.
This commit is contained in:
Dan Albert
2023-07-22 16:32:11 -07:00
committed by Raffson
parent 2a8f34ea25
commit 51f578b9e3
5 changed files with 82 additions and 1 deletions

View File

@@ -258,7 +258,11 @@ class FlightGroupConfigurator:
def setup_props(self) -> None:
for unit, member in zip(self.group.units, self.flight.iter_members()):
for prop_id, value in member.properties.items():
props = dict(member.properties)
if (code := member.weapon_laser_code) is not None:
for laser_code_config in self.flight.unit_type.laser_code_configs:
props.update(laser_code_config.property_dict_for_code(code.code))
for prop_id, value in props.items():
unit.set_property(prop_id, value)
def setup_payloads(self) -> None: