Custom kneeboard injection

Drop custom kneeboards in SavedGames/DCS/Retribution/Kneeboards as you would normally do, i.e. using the necessary folders if kneeboards are aircraft-specific
This commit is contained in:
Raffson 2024-04-27 22:10:25 +02:00
parent 71965e7183
commit 4043e2452f
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
3 changed files with 12 additions and 0 deletions

View File

@ -9,6 +9,7 @@
* **[Modding]** Updated support for F/A-18E/F/G mod version 2.2.5
* **[Campaign Setup]** Allow adjustments to naval TGOs (except carriers) on turn 0
* **[Campaign Design]** Ability to configure specific carrier names & types in campaign's yaml file
* **[Mission Generation]** Ability to inject custom kneeboards
## Fixes
* **[UI/UX]** A-10A flights can be edited again.

View File

@ -50,6 +50,7 @@ from game.weather.weather import Weather
from .aircraft.flightdata import FlightData
from .briefinggenerator import CommInfo, JtacInfo, MissionInfoGenerator
from .missiondata import AwacsInfo, TankerInfo
from ..persistency import kneeboards_dir
if TYPE_CHECKING:
from game import Game
@ -821,6 +822,12 @@ class KneeboardGenerator(MissionInfoGenerator):
page_path = aircraft_dir / f"page{idx:02}.png"
page.write(page_path)
self.mission.add_aircraft_kneeboard(aircraft.dcs_unit_type, page_path)
for type in Path(kneeboards_dir()).iterdir():
if type.is_dir():
for kneeboard in type.iterdir():
self.mission.custom_kneeboards[type.name].append(kneeboard)
else:
self.mission.custom_kneeboards[""].append(type)
def pages_by_airframe(self) -> Dict[AircraftType, List[KneeboardPage]]:
"""Returns a list of kneeboard pages per airframe in the mission.

View File

@ -111,6 +111,10 @@ def airwing_dir() -> Path:
return base_path() / "Retribution" / "AirWing"
def kneeboards_dir() -> Path:
return base_path() / "Retribution" / "Kneeboards"
def payloads_dir(backup: bool = False) -> Path:
payloads = base_path() / "MissionEditor" / "UnitPayloads"
if backup: