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

@@ -70,9 +70,13 @@ class Squadron:
untasked_aircraft: int = field(init=False, hash=False, compare=False, default=0)
pending_deliveries: int = field(init=False, hash=False, compare=False, default=0)
use_livery_set: bool = False # if livery-set should be used when present
def __setstate__(self, state: dict[str, Any]) -> None:
if "id" not in state:
state["id"] = uuid4()
if "use_livery_set" not in state:
state["use_livery_set"] = len(state["livery_set"]) > 0
self.__dict__.update(state)
def __str__(self) -> str: