Further improvements to livery-selector

Unlocking the full potential, i.e. allowing users to switch back & forth between livery-sets, livery-overrides and normal liveries, including support for overriding flight/flight-member specific liveries.
This commit is contained in:
Raffson
2024-08-03 19:09:56 +02:00
parent 5aca992140
commit f79e96a474
7 changed files with 48 additions and 33 deletions

View File

@@ -18,13 +18,12 @@ class FlightMember:
self.weapon_laser_code: LaserCode | None = None
self.properties: dict[str, bool | float | int] = {}
self.livery: Optional[str] = None
self.use_livery_set: bool = True
def __setstate__(self, state: dict[str, Any]) -> None:
if "tgp_laser_code" not in state:
state["tgp_laser_code"] = None
if "weapon_laser_code" not in state:
state["weapon_laser_code"] = None
self.__dict__.update(state)
new_state = FlightMember(state["pilot"], state["loadout"])
new_state.__dict__.update(state)
self.__dict__.update(new_state.__dict__)
def assign_tgp_laser_code(self, code: LaserCode) -> None:
if self.tgp_laser_code is not None: