mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add an option for disabling the legacy AEW&C aircraft.
Using the legacy AEW&C aircraft is still the default until https://github.com/Khopa/dcs_liberation/issues/844 is fixed.
This commit is contained in:
parent
5792eb354c
commit
65c185ebd2
@ -30,6 +30,7 @@ class Settings:
|
|||||||
automate_front_line_reinforcements: bool = False
|
automate_front_line_reinforcements: bool = False
|
||||||
automate_aircraft_reinforcements: bool = False
|
automate_aircraft_reinforcements: bool = False
|
||||||
restrict_weapons_by_date: bool = False
|
restrict_weapons_by_date: bool = False
|
||||||
|
disable_legacy_aewc: bool = False
|
||||||
|
|
||||||
# Performance oriented
|
# Performance oriented
|
||||||
perf_red_alert_state: bool = True
|
perf_red_alert_state: bool = True
|
||||||
|
|||||||
@ -21,6 +21,9 @@ from .conflictgen import Conflict
|
|||||||
from .radios import RadioFrequency, RadioRegistry
|
from .radios import RadioFrequency, RadioRegistry
|
||||||
from .tacan import TacanBand, TacanChannel, TacanRegistry
|
from .tacan import TacanBand, TacanChannel, TacanRegistry
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TANKER_DISTANCE = 15000
|
TANKER_DISTANCE = 15000
|
||||||
TANKER_ALT = 4572
|
TANKER_ALT = 4572
|
||||||
TANKER_HEADING_OFFSET = 45
|
TANKER_HEADING_OFFSET = 45
|
||||||
@ -133,28 +136,29 @@ class AirSupportConflictGenerator:
|
|||||||
|
|
||||||
self.air_support.tankers.append(TankerInfo(str(tanker_group.name), callsign, variant, freq, tacan))
|
self.air_support.tankers.append(TankerInfo(str(tanker_group.name), callsign, variant, freq, tacan))
|
||||||
|
|
||||||
possible_awacs = db.find_unittype(AWACS, self.conflict.attackers_side)
|
if not self.game.settings.disable_legacy_aewc:
|
||||||
|
possible_awacs = db.find_unittype(AWACS, self.conflict.attackers_side)
|
||||||
|
|
||||||
if len(possible_awacs) > 0:
|
if len(possible_awacs) > 0:
|
||||||
awacs_unit = possible_awacs[0]
|
awacs_unit = possible_awacs[0]
|
||||||
freq = self.radio_registry.alloc_uhf()
|
freq = self.radio_registry.alloc_uhf()
|
||||||
|
|
||||||
awacs_flight = self.mission.awacs_flight(
|
|
||||||
country=self.mission.country(self.game.player_country),
|
|
||||||
name=namegen.next_awacs_name(self.mission.country(self.game.player_country)),
|
|
||||||
plane_type=awacs_unit,
|
|
||||||
altitude=AWACS_ALT,
|
|
||||||
airport=None,
|
|
||||||
position=self.conflict.position.random_point_within(AWACS_DISTANCE, AWACS_DISTANCE),
|
|
||||||
frequency=freq.mhz,
|
|
||||||
start_type=StartType.Warm,
|
|
||||||
)
|
|
||||||
awacs_flight.set_frequency(freq.mhz)
|
|
||||||
|
|
||||||
awacs_flight.points[0].tasks.append(SetInvisibleCommand(True))
|
awacs_flight = self.mission.awacs_flight(
|
||||||
awacs_flight.points[0].tasks.append(SetImmortalCommand(True))
|
country=self.mission.country(self.game.player_country),
|
||||||
|
name=namegen.next_awacs_name(self.mission.country(self.game.player_country)),
|
||||||
|
plane_type=awacs_unit,
|
||||||
|
altitude=AWACS_ALT,
|
||||||
|
airport=None,
|
||||||
|
position=self.conflict.position.random_point_within(AWACS_DISTANCE, AWACS_DISTANCE),
|
||||||
|
frequency=freq.mhz,
|
||||||
|
start_type=StartType.Warm,
|
||||||
|
)
|
||||||
|
awacs_flight.set_frequency(freq.mhz)
|
||||||
|
|
||||||
self.air_support.awacs.append(AwacsInfo(
|
awacs_flight.points[0].tasks.append(SetInvisibleCommand(True))
|
||||||
str(awacs_flight.name), callsign_for_support_unit(awacs_flight), freq))
|
awacs_flight.points[0].tasks.append(SetImmortalCommand(True))
|
||||||
else:
|
|
||||||
logging.warning("No AWACS for faction")
|
self.air_support.awacs.append(AwacsInfo(
|
||||||
|
str(awacs_flight.name), callsign_for_support_unit(awacs_flight), freq))
|
||||||
|
else:
|
||||||
|
logging.warning("No AWACS for faction")
|
||||||
@ -309,6 +309,28 @@ class QSettingsWindow(QDialog):
|
|||||||
general_layout.addWidget(restrict_weapons_label, 0, 0)
|
general_layout.addWidget(restrict_weapons_label, 0, 0)
|
||||||
general_layout.addWidget(restrict_weapons, 0, 1, Qt.AlignRight)
|
general_layout.addWidget(restrict_weapons, 0, 1, Qt.AlignRight)
|
||||||
|
|
||||||
|
def set_old_awec(value: bool) -> None:
|
||||||
|
self.game.settings.disable_legacy_aewc = value
|
||||||
|
|
||||||
|
old_awac = QCheckBox()
|
||||||
|
old_awac.setChecked(self.game.settings.disable_legacy_aewc)
|
||||||
|
old_awac.toggled.connect(set_old_awec)
|
||||||
|
|
||||||
|
old_awec_info = (
|
||||||
|
"If checked, the invulnerable friendly AEW&C aircraft that begins "
|
||||||
|
"the mission in the air will not be spawned. AEW&C missions must "
|
||||||
|
"be planned in the ATO and will take time to arrive on-station."
|
||||||
|
)
|
||||||
|
|
||||||
|
old_awac.setToolTip(old_awec_info)
|
||||||
|
old_awac_label = QLabel(
|
||||||
|
"Disable invulnerable, always-available AEW&C (WIP)"
|
||||||
|
)
|
||||||
|
old_awac_label.setToolTip(old_awec_info)
|
||||||
|
|
||||||
|
general_layout.addWidget(old_awac_label, 1, 0)
|
||||||
|
general_layout.addWidget(old_awac, 1, 1, Qt.AlignRight)
|
||||||
|
|
||||||
automation = QGroupBox("HQ Automation")
|
automation = QGroupBox("HQ Automation")
|
||||||
campaign_layout.addWidget(automation)
|
campaign_layout.addWidget(automation)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user