mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Create payloads folder in ME folder if needed (#200)
Added a check for the existence of a payloads folder. Also made the _save_payloads lookup and path generation the same as _backup_payloads method to have consistency.
This commit is contained in:
parent
19b9b8b0ea
commit
16b7ff2bb4
@ -87,7 +87,10 @@ class QLoadoutEditor(QGroupBox):
|
||||
payload_name = payload_name_input.textValue()
|
||||
ac_type = self.flight.unit_type.dcs_unit_type
|
||||
ac_id = ac_type.id
|
||||
payload_file = payloads_dir() / f"{ac_id}.lua"
|
||||
payloads_folder = payloads_dir()
|
||||
payload_file = payloads_folder / f"{ac_id}.lua"
|
||||
if not payloads_folder.exists():
|
||||
payloads_folder.mkdir()
|
||||
ac_type.payloads[payload_name] = DcsPayload.from_flight(
|
||||
self.flight, payload_name
|
||||
).to_dict()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user