def METHOD_NAME(self) -> None:
    payload_name_input = self._create_input_dialog()
    if not payload_name_input.exec_():
        return
    payload_name = payload_name_input.textValue()
    ac_type = self.flight.unit_type.dcs_unit_type
    ac_id = ac_type.id
    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()
    if payload_file.exists():
        self._create_backup_if_needed(ac_id)
        with payload_file.open("r", encoding="utf-8") as f:
            payloads = lua.loads(f.read())
        if payloads:
            pdict = payloads["unitPayloads"]["payloads"]
            next_key = len(pdict) + 1
            for p in pdict:
                if pdict[p]["name"] == payload_name:
                    next_key = p
            pdict[next_key] = DcsPayload.from_flight(
                self.flight, payload_name
            ).to_dict()
            with payload_file.open("w", encoding="utf-8") as f:
                f.write("local unitPayloads = ")
                f.write(lua.dumps(payloads["unitPayloads"], indent=1))
                f.write("\nreturn unitPayloads")
    else:
        with payload_file.open("w", encoding="utf-8") as f:
            payloads = {
                "name": f"{self.flight.unit_type.dcs_unit_type.id}",
                "payloads": {
                    1: DcsPayload.from_flight(self.flight, payload_name).to_dict(),
                },
                "unitType": f"{self.flight.unit_type.dcs_unit_type.id}",
            }
            f.write("local unitPayloads = ")
            f.write(lua.dumps(payloads, indent=1))
            f.write("\nreturn unitPayloads")
        self.flight.unit_type.dcs_unit_type.add_to_payload_cache(payload_file)
    self.saved.emit(payload_name)
    QMessageBox.information(
        QWidget(),
        "Payload Saved",
        f"Payload for {self.flight.unit_type.dcs_unit_type.id} was successfully saved.\n"
        f"Location: {payload_file}",
    )