Add date-based loadout restriction.

Follow up work:

* Data entry. I plan to do the air-to-air missiles in the near term. I
  covered some variants of the AIM-120, AIM-7, and AIM-9 here, but there
  are variants of those weapons for each mounting rack that need to be
  done still, as well as all the non-US weapons.
* Arbitrary start dates.

https://github.com/Khopa/dcs_liberation/issues/490
This commit is contained in:
Dan Albert
2021-01-02 14:38:07 -08:00
parent 507b217065
commit 34945e7eba
7 changed files with 132 additions and 10 deletions

View File

@@ -248,6 +248,30 @@ class QSettingsWindow(QDialog):
campaign_layout.setAlignment(Qt.AlignTop)
self.campaign_management_page.setLayout(campaign_layout)
general = QGroupBox("General")
campaign_layout.addWidget(general)
general_layout = QGridLayout()
general.setLayout(general_layout)
def set_restict_weapons_by_date(value: bool) -> None:
self.game.settings.restrict_weapons_by_date = value
restrict_weapons = QCheckBox()
restrict_weapons.setChecked(self.game.settings.restrict_weapons_by_date)
restrict_weapons.toggled.connect(set_restict_weapons_by_date)
tooltip_text = (
"Restricts weapon availability based on the campaign date. Data is "
"extremely incomplete so does not affect all weapons."
)
restrict_weapons.setToolTip(tooltip_text)
restrict_weapons_label = QLabel("Restrict weapons by date (WIP)")
restrict_weapons_label.setToolTip(tooltip_text)
general_layout.addWidget(restrict_weapons_label, 0, 0)
general_layout.addWidget(restrict_weapons, 0, 1, Qt.AlignRight)
automation = QGroupBox("HQ Automation")
campaign_layout.addWidget(automation)