mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Removed /MissionEditor/UnitPayloads/ from mod_payloads paths. Implemented a separate inject_mod_payloads method to support it.
This commit is contained in:
@@ -278,7 +278,7 @@ inject_weapons(WeaponsF16I)
|
|||||||
|
|
||||||
|
|
||||||
def inject_F16I() -> None:
|
def inject_F16I() -> None:
|
||||||
from qt_ui.main import inject_custom_payloads, THIS_DIR
|
from qt_ui.main import inject_mod_payloads, THIS_DIR
|
||||||
|
|
||||||
AIRCRAFT_ICONS["F-16C_50"] = QPixmap(
|
AIRCRAFT_ICONS["F-16C_50"] = QPixmap(
|
||||||
os.path.join("./resources/ui/units/aircrafts/icons/", "F-16I_24.jpg")
|
os.path.join("./resources/ui/units/aircrafts/icons/", "F-16I_24.jpg")
|
||||||
@@ -312,7 +312,7 @@ def inject_F16I() -> None:
|
|||||||
F_16C_50.Pylon15 = Pylon15
|
F_16C_50.Pylon15 = Pylon15
|
||||||
F_16C_50.Pylon16 = Pylon16
|
F_16C_50.Pylon16 = Pylon16
|
||||||
|
|
||||||
inject_custom_payloads(Path(THIS_DIR.parent / "resources/mod_payloads/f16i_idf"))
|
inject_mod_payloads(Path(THIS_DIR.parent / "resources/mod_payloads/f16i_idf"))
|
||||||
|
|
||||||
|
|
||||||
@planemod
|
@planemod
|
||||||
|
|||||||
@@ -58,6 +58,18 @@ def inject_custom_payloads(user_path: Path) -> None:
|
|||||||
PayloadDirectories.set_preferred(user_path / "MissionEditor" / "UnitPayloads")
|
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:
|
def on_game_load(game: Game | None) -> None:
|
||||||
EventStream.drain()
|
EventStream.drain()
|
||||||
EventStream.put_nowait(GameUpdateEvents().game_loaded(game))
|
EventStream.put_nowait(GameUpdateEvents().game_loaded(game))
|
||||||
|
|||||||
Reference in New Issue
Block a user