mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Merge remote-tracking branch 'remotes/MetalStormGhost/dcs_liberation/f16i-mod-support-v2.2' into f16i-mod-support-v2.2
Added a pydcs extension for the IDF Mods Project F-16I mod version 2.2, utilizing the pylon_injector written for the CJS Superbug mod support. Includes banner by Schmokedpancake. The mod alters the stock F-16C aircraft, which requires a different approach when injecting the mod information to pydcs. The extension changes the F-16C parameters by setattr(F_16C_50, "fuel_max", 2585.48), adds new weapons to the existing pylons and adds five new ones (for example, the mod allows internal ECM equipment in the dorsal spine, freeing the central hardpoint for a fuel tank). The mod also adds additional Vipers: F-16D (both with and without the dorsal spine, GE and P&W engines) and the stock F-16C Block 50 under a different DCS unit ID. Also added a separate mod_payloads directory under resources which can be used when aircraft added by mods use the same "unitType" in the loadout lua files. The loadouts are only loaded if the mod is enabled (uses the existing inject_custom_payloads function). The mod settings are now saved in the Liberation save inside the Faction, so loading the aircraft icons, banners, loadouts etc and the pydcs injection can be re-applied on game load.
This commit is contained in:
@@ -56,6 +56,18 @@ def inject_custom_payloads(user_path: Path) -> None:
|
||||
PayloadDirectories.set_preferred(user_path / "MissionEditor" / "UnitPayloads")
|
||||
|
||||
|
||||
def inject_mod_payloads(mod_path: Path) -> None:
|
||||
if mod_path.exists():
|
||||
payloads = mod_path
|
||||
else:
|
||||
raise RuntimeError(
|
||||
f"Could not find mod payloads at {mod_path}."
|
||||
f"Aircraft will have no payloads."
|
||||
)
|
||||
# We configure these as preferred so the mod's loadouts override the stock ones.
|
||||
PayloadDirectories.set_preferred(payloads)
|
||||
|
||||
|
||||
def on_game_load(game: Game | None) -> None:
|
||||
EventStream.drain()
|
||||
EventStream.put_nowait(GameUpdateEvents().game_loaded(game))
|
||||
|
||||
@@ -161,6 +161,7 @@ class NewGameWizard(QtWidgets.QWizard):
|
||||
a4_skyhawk=self.field("a4_skyhawk"),
|
||||
f4b_phantom=self.field("f4b_phantom"),
|
||||
f15d_baz=self.field("f15d_baz"),
|
||||
f_16_idf=self.field("f_16_idf"),
|
||||
f22_raptor=self.field("f22_raptor"),
|
||||
f100_supersabre=self.field("f100_supersabre"),
|
||||
f104_starfighter=self.field("f104_starfighter"),
|
||||
@@ -664,6 +665,8 @@ class GeneratorOptions(QtWidgets.QWizardPage):
|
||||
self.registerField("f4b_phantom", f4b_phantom)
|
||||
f15d_baz = QtWidgets.QCheckBox()
|
||||
self.registerField("f15d_baz", f15d_baz)
|
||||
f_16_idf = QtWidgets.QCheckBox()
|
||||
self.registerField("f_16_idf", f_16_idf)
|
||||
f22_raptor = QtWidgets.QCheckBox()
|
||||
self.registerField("f22_raptor", f22_raptor)
|
||||
f100_supersabre = QtWidgets.QCheckBox()
|
||||
@@ -705,9 +708,19 @@ class GeneratorOptions(QtWidgets.QWizardPage):
|
||||
modLayout.addWidget(QtWidgets.QLabel("F-15D Baz (v1.0)"), modLayout_row, 0)
|
||||
modLayout.addWidget(f15d_baz, modLayout_row, 1)
|
||||
modLayout_row += 1
|
||||
modLayout.addWidget(
|
||||
QtWidgets.QLabel("F-16I Sufa & F-16D (version 2.2 by IDF Mods Project)"),
|
||||
modLayout_row,
|
||||
0,
|
||||
)
|
||||
modLayout.addWidget(f_16_idf, modLayout_row, 1)
|
||||
modLayout_row += 1
|
||||
modLayout.addWidget(QtWidgets.QLabel("F-22A Raptor"), modLayout_row, 0)
|
||||
modLayout.addWidget(f22_raptor, modLayout_row, 1)
|
||||
modLayout_row += 1
|
||||
# Section break here for readability
|
||||
modLayout.addWidget(QtWidgets.QWidget(), modLayout_row, 0)
|
||||
modLayout_row += 1
|
||||
modLayout.addWidget(
|
||||
QtWidgets.QLabel("F-100 Super Sabre (version 2.7.18.30765 patch 09.10.22)"),
|
||||
modLayout_row,
|
||||
@@ -715,9 +728,6 @@ class GeneratorOptions(QtWidgets.QWizardPage):
|
||||
)
|
||||
modLayout.addWidget(f100_supersabre, modLayout_row, 1)
|
||||
modLayout_row += 1
|
||||
# Section break here for readability
|
||||
modLayout.addWidget(QtWidgets.QWidget(), modLayout_row, 0)
|
||||
modLayout_row += 1
|
||||
modLayout.addWidget(
|
||||
QtWidgets.QLabel("F-104 Starfighter (version 2.7.11.222.01)"),
|
||||
modLayout_row,
|
||||
@@ -742,14 +752,14 @@ class GeneratorOptions(QtWidgets.QWizardPage):
|
||||
)
|
||||
modLayout.addWidget(uh_60l, modLayout_row, 1)
|
||||
modLayout_row += 1
|
||||
# Section break here for readability
|
||||
modLayout.addWidget(QtWidgets.QWidget(), modLayout_row, 0)
|
||||
modLayout_row += 1
|
||||
modLayout.addWidget(
|
||||
QtWidgets.QLabel("JAS 39 Gripen (version v1.8.0-beta)"), modLayout_row, 0
|
||||
)
|
||||
modLayout.addWidget(jas39_gripen, modLayout_row, 1)
|
||||
modLayout_row += 1
|
||||
# Section break here for readability
|
||||
modLayout.addWidget(QtWidgets.QWidget(), modLayout_row, 0)
|
||||
modLayout_row += 1
|
||||
modLayout.addWidget(
|
||||
QtWidgets.QLabel("Su-30 Flanker-H (V2.01B)"), modLayout_row, 0
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user