diff --git a/Modded-Aircraft-Support.md b/Modded-Aircraft-Support.md index f31ca62..d0cad76 100644 --- a/Modded-Aircraft-Support.md +++ b/Modded-Aircraft-Support.md @@ -74,21 +74,74 @@ plane_map["MB-339PAN"] = MB_339PAN If this is a vehicle, add it to vehicle_map instead. -## Step 2 : DB stuff +## Step 2 : Campaign start setup -Still in [db.py](https://github.com/dcs-liberation/dcs_liberation/blob/develop/game/db.py) - -Add your plane to the price map: +For campaign start setup and mod settings support, add your plane to the files [start_generator.py](https://github.com/dcs-liberation/dcs_liberation/blob/develop/game/theater/start_generator.py), [faction.py](https://github.com/dcs-liberation/dcs_liberation/blob/develop/game/factions/faction.py) and [QNewGameWizard.py](https://github.com/dcs-liberation/dcs_liberation/blob/develop/qt_ui/windows/newgame/QNewGameWizard.py) ```python -PRICES = { - # ... - A_4E_C: 8, - MB_339PAN: 6, - # ... + a4_skyhawk: bool = False + f22_raptor: bool = False + hercules: bool = False + jas39_gripen: bool = False + su57_felon: bool = False + frenchpack: bool = False ``` -Also add it to the list and maps: ```UNIT_BY_TASK```, ```PLANE_PAYLOAD_OVERRIDES```, and if relevant in the lists : ```CARRIER_CAPABLE```, ```LHA_CAPABLE``` +```python + # aircraft + if not mod_settings.a4_skyhawk: + self.remove_aircraft("A-4E-C") + if not mod_settings.hercules: + self.remove_aircraft("Hercules") + if not mod_settings.f22_raptor: + self.remove_aircraft("F-22A") + if not mod_settings.jas39_gripen: + self.remove_aircraft("JAS39Gripen") + self.remove_aircraft("JAS39Gripen_AG") + if not mod_settings.su57_felon: + self.remove_aircraft("Su-57") +``` + +```python + mod_settings = ModSettings( + a4_skyhawk=self.field("a4_skyhawk"), + f22_raptor=self.field("f22_raptor"), + f104_starfighter=self.field("f104_starfighter"), + hercules=self.field("hercules"), + jas39_gripen=self.field("jas39_gripen"), + su57_felon=self.field("su57_felon"), + frenchpack=self.field("frenchpack"), +``` + +```python + modSettingsGroup = QtWidgets.QGroupBox("Mod Settings") + a4_skyhawk = QtWidgets.QCheckBox() + self.registerField("a4_skyhawk", a4_skyhawk) + hercules = QtWidgets.QCheckBox() + self.registerField("hercules", hercules) + f22_raptor = QtWidgets.QCheckBox() + self.registerField("f22_raptor", f22_raptor) + jas39_gripen = QtWidgets.QCheckBox() + self.registerField("jas39_gripen", jas39_gripen) + su57_felon = QtWidgets.QCheckBox() + self.registerField("su57_felon", su57_felon) +``` + +```python + modLayout = QtWidgets.QGridLayout() + modLayout.addWidget(QtWidgets.QLabel("A-4E Skyhawk"), 1, 0) + modLayout.addWidget(a4_skyhawk, 1, 1) + modLayout.addWidget(QtWidgets.QLabel("F-22A Raptor"), 2, 0) + modLayout.addWidget(f22_raptor, 2, 1) + modLayout.addWidget(QtWidgets.QLabel("C-130J-30 Super Hercules"), 3, 0) + modLayout.addWidget(hercules, 3, 1) + modLayout.addWidget(QtWidgets.QLabel("JAS 39 Gripen"), 4, 0) + modLayout.addWidget(jas39_gripen, 4, 1) + modLayout.addWidget(QtWidgets.QLabel("Su-57 Felon"), 5, 0) + modLayout.addWidget(su57_felon, 5, 1) + modLayout.addWidget(QtWidgets.QLabel("Frenchpack"), 6, 0) + modLayout.addWidget(frenchpack, 6, 1) +``` ## Step 3 : Liberation flight planner database setup : @@ -122,19 +175,25 @@ and the following line after the weapons definition class: See [Custom Factions](Custom-Factions) and create a faction that support the mods so it can be used -## Step 6 : Add icons for the UI [Optional] +## Step 6 : Resource files for aircraft + +Add new yaml files for your aircraft in resources/units/aircraft/ + +See [A-4E-C.yaml](https://github.com/dcs-liberation/dcs_liberation/blob/develop/resources/units/aircraft/A-4E-C.yaml) for reference. + +## Step 7 : Add icons for the UI [Optional] Add icons for the new plane there: https://github.com/dcs-liberation/dcs_liberation/tree/develop/resources/ui/units/aircrafts/icons And a banner, there: https://github.com/dcs-liberation/dcs_liberation/tree/develop/resources/ui/units/aircrafts/banners -## Step 7 : Playtest ! +## Step 8 : Playtest ! Play a few missions with the plane, test as much cases as you can. -## Step 8 : Release ! +## Step 9 : Release ! -## Step 9 : Maintenance ! +## Step 10 : Maintenance ! Redo the data export thing (Step 1), every time said mod is updated, if needed create new loadouts and account for new capabilities in db.