mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Remove fallback for old non-convoy behavior.
This commit is contained in:
parent
ae57e4da83
commit
f4b64370bb
@ -258,13 +258,7 @@ class ProcurementAi:
|
|||||||
if not cp.has_ground_unit_source(self.game):
|
if not cp.has_ground_unit_source(self.game):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Buy to a higher limit when using the new recruitment mechanic since it
|
if self.total_ground_units_allocated_to(cp) >= 50:
|
||||||
# will take longer to reinforce losses.
|
|
||||||
if self.game.settings.enable_new_ground_unit_recruitment:
|
|
||||||
limit = 50
|
|
||||||
else:
|
|
||||||
limit = 30
|
|
||||||
if self.total_ground_units_allocated_to(cp) >= limit:
|
|
||||||
# Control point is already sufficiently defended.
|
# Control point is already sufficiently defended.
|
||||||
continue
|
continue
|
||||||
for connected in cp.connected_points:
|
for connected in cp.connected_points:
|
||||||
|
|||||||
@ -37,11 +37,6 @@ class Settings:
|
|||||||
disable_legacy_aewc: bool = False
|
disable_legacy_aewc: bool = False
|
||||||
generate_dark_kneeboard: bool = False
|
generate_dark_kneeboard: bool = False
|
||||||
|
|
||||||
#: Feature flag for new ground unit behavior. Old campaigns are will not work with
|
|
||||||
#: this so the old behavior remains an option until it breaks, at which point we'll
|
|
||||||
#: remove it.
|
|
||||||
enable_new_ground_unit_recruitment: bool = True
|
|
||||||
|
|
||||||
# Performance oriented
|
# Performance oriented
|
||||||
perf_red_alert_state: bool = True
|
perf_red_alert_state: bool = True
|
||||||
perf_smoke_gen: bool = True
|
perf_smoke_gen: bool = True
|
||||||
|
|||||||
@ -382,9 +382,6 @@ class ControlPoint(MissionTarget, ABC):
|
|||||||
if not self.can_deploy_ground_units:
|
if not self.can_deploy_ground_units:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not game.settings.enable_new_ground_unit_recruitment:
|
|
||||||
return True
|
|
||||||
|
|
||||||
if game.turn == 0:
|
if game.turn == 0:
|
||||||
# Allow units to be recruited anywhere on turn 0 to avoid long delays to get
|
# Allow units to be recruited anywhere on turn 0 to avoid long delays to get
|
||||||
# everyone to the front line.
|
# everyone to the front line.
|
||||||
@ -397,9 +394,6 @@ class ControlPoint(MissionTarget, ABC):
|
|||||||
if not self.can_deploy_ground_units:
|
if not self.can_deploy_ground_units:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not game.settings.enable_new_ground_unit_recruitment:
|
|
||||||
return True
|
|
||||||
|
|
||||||
for cp in game.theater.controlpoints:
|
for cp in game.theater.controlpoints:
|
||||||
if cp.is_friendly(self.captured) and cp.can_recruit_ground_units(game):
|
if cp.is_friendly(self.captured) and cp.can_recruit_ground_units(game):
|
||||||
return True
|
return True
|
||||||
|
|||||||
@ -199,7 +199,6 @@ def create_game(
|
|||||||
automate_runway_repair=auto_procurement,
|
automate_runway_repair=auto_procurement,
|
||||||
automate_front_line_reinforcements=auto_procurement,
|
automate_front_line_reinforcements=auto_procurement,
|
||||||
automate_aircraft_reinforcements=auto_procurement,
|
automate_aircraft_reinforcements=auto_procurement,
|
||||||
enable_new_ground_unit_recruitment=True,
|
|
||||||
enable_frontline_cheats=cheats,
|
enable_frontline_cheats=cheats,
|
||||||
enable_base_capture_cheat=cheats,
|
enable_base_capture_cheat=cheats,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import List, Optional
|
from datetime import timedelta
|
||||||
|
from typing import List
|
||||||
|
|
||||||
from PySide2 import QtGui, QtWidgets
|
from PySide2 import QtGui, QtWidgets
|
||||||
from PySide2.QtCore import QItemSelectionModel, QPoint, Qt, QDate
|
from PySide2.QtCore import QItemSelectionModel, QPoint, Qt, QDate
|
||||||
from PySide2.QtWidgets import QVBoxLayout, QTextEdit, QLabel
|
from PySide2.QtWidgets import QVBoxLayout, QTextEdit, QLabel
|
||||||
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
||||||
from datetime import timedelta
|
|
||||||
|
|
||||||
from game import db
|
from game import db
|
||||||
from game.settings import Settings
|
from game.settings import Settings
|
||||||
@ -19,9 +19,6 @@ from qt_ui.windows.newgame.QCampaignList import (
|
|||||||
QCampaignList,
|
QCampaignList,
|
||||||
load_campaigns,
|
load_campaigns,
|
||||||
)
|
)
|
||||||
from qt_ui.windows.settings.QSettingsWindow import (
|
|
||||||
NEW_GROUND_UNIT_RECRUITMENT_BEHAVIOR_LABEL,
|
|
||||||
)
|
|
||||||
|
|
||||||
jinja_env = Environment(
|
jinja_env = Environment(
|
||||||
loader=FileSystemLoader("resources/ui/templates"),
|
loader=FileSystemLoader("resources/ui/templates"),
|
||||||
@ -91,9 +88,6 @@ class NewGameWizard(QtWidgets.QWizard):
|
|||||||
),
|
),
|
||||||
automate_aircraft_reinforcements=self.field("automate_aircraft_purchases"),
|
automate_aircraft_reinforcements=self.field("automate_aircraft_purchases"),
|
||||||
supercarrier=self.field("supercarrier"),
|
supercarrier=self.field("supercarrier"),
|
||||||
enable_new_ground_unit_recruitment=self.field(
|
|
||||||
"new_ground_unit_recruitment"
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
generator_settings = GeneratorSettings(
|
generator_settings = GeneratorSettings(
|
||||||
start_date=start_date,
|
start_date=start_date,
|
||||||
@ -509,21 +503,6 @@ class DifficultyAndAutomationOptions(QtWidgets.QWizardPage):
|
|||||||
self.registerField("automate_aircraft_purchases", aircraft)
|
self.registerField("automate_aircraft_purchases", aircraft)
|
||||||
assist_layout.addWidget(aircraft, 2, 1, Qt.AlignRight)
|
assist_layout.addWidget(aircraft, 2, 1, Qt.AlignRight)
|
||||||
|
|
||||||
flags_group = QtWidgets.QGroupBox("Feature flags")
|
|
||||||
layout.addWidget(flags_group)
|
|
||||||
flags_layout = QtWidgets.QGridLayout()
|
|
||||||
flags_group.setLayout(flags_layout)
|
|
||||||
|
|
||||||
new_ground_unit_recruitment_label = QtWidgets.QLabel(
|
|
||||||
NEW_GROUND_UNIT_RECRUITMENT_BEHAVIOR_LABEL
|
|
||||||
)
|
|
||||||
new_ground_unit_recruitment_label.setOpenExternalLinks(True)
|
|
||||||
flags_layout.addWidget(new_ground_unit_recruitment_label, 0, 0)
|
|
||||||
new_ground_unit_recruitment = QtWidgets.QCheckBox()
|
|
||||||
new_ground_unit_recruitment.setChecked(True)
|
|
||||||
self.registerField("new_ground_unit_recruitment", new_ground_unit_recruitment)
|
|
||||||
flags_layout.addWidget(new_ground_unit_recruitment, 0, 1, Qt.AlignRight)
|
|
||||||
|
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,6 @@ from PySide2.QtWidgets import (
|
|||||||
QStackedLayout,
|
QStackedLayout,
|
||||||
QVBoxLayout,
|
QVBoxLayout,
|
||||||
QWidget,
|
QWidget,
|
||||||
QSlider,
|
|
||||||
)
|
)
|
||||||
from dcs.forcedoptions import ForcedOptions
|
from dcs.forcedoptions import ForcedOptions
|
||||||
|
|
||||||
@ -78,17 +77,6 @@ class CheatSettingsBox(QGroupBox):
|
|||||||
|
|
||||||
START_TYPE_TOOLTIP = "Selects the start type used for AI aircraft."
|
START_TYPE_TOOLTIP = "Selects the start type used for AI aircraft."
|
||||||
|
|
||||||
NEW_GROUND_UNIT_RECRUITMENT_TOOLTIP = (
|
|
||||||
"If checked, the new ground unit recruitment behavior will be used. Ground "
|
|
||||||
"units may only be purchased at factories or off-map spawns and must "
|
|
||||||
"travel to the front line."
|
|
||||||
)
|
|
||||||
NEW_GROUND_UNIT_RECRUITMENT_BEHAVIOR_LABEL = (
|
|
||||||
"Enable new ground unit recruitment behavior<br />"
|
|
||||||
'<a href="https://github.com/dcs-liberation/dcs_liberation/issues/986">'
|
|
||||||
'<span style="color:#FFFFFF;">More information.</span></a>'
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class StartTypeComboBox(QComboBox):
|
class StartTypeComboBox(QComboBox):
|
||||||
def __init__(self, settings: Settings) -> None:
|
def __init__(self, settings: Settings) -> None:
|
||||||
@ -379,27 +367,6 @@ class QSettingsWindow(QDialog):
|
|||||||
general_layout.addWidget(old_awac_label, 1, 0)
|
general_layout.addWidget(old_awac_label, 1, 0)
|
||||||
general_layout.addWidget(old_awac, 1, 1, Qt.AlignRight)
|
general_layout.addWidget(old_awac, 1, 1, Qt.AlignRight)
|
||||||
|
|
||||||
def set_new_ground_unit_recruitment(value: bool) -> None:
|
|
||||||
self.game.settings.enable_new_ground_unit_recruitment = value
|
|
||||||
|
|
||||||
new_ground_unit_recruitment_behavior_label = QLabel(
|
|
||||||
NEW_GROUND_UNIT_RECRUITMENT_BEHAVIOR_LABEL
|
|
||||||
)
|
|
||||||
new_ground_unit_recruitment_behavior_label.setToolTip(
|
|
||||||
NEW_GROUND_UNIT_RECRUITMENT_TOOLTIP
|
|
||||||
)
|
|
||||||
new_ground_unit_recruitment_behavior_label.setOpenExternalLinks(True)
|
|
||||||
|
|
||||||
new_ground_unit_recruitment = QCheckBox()
|
|
||||||
new_ground_unit_recruitment.setToolTip(NEW_GROUND_UNIT_RECRUITMENT_TOOLTIP)
|
|
||||||
new_ground_unit_recruitment.setChecked(
|
|
||||||
self.game.settings.enable_new_ground_unit_recruitment
|
|
||||||
)
|
|
||||||
new_ground_unit_recruitment.toggled.connect(set_new_ground_unit_recruitment)
|
|
||||||
|
|
||||||
general_layout.addWidget(new_ground_unit_recruitment_behavior_label, 2, 0)
|
|
||||||
general_layout.addWidget(new_ground_unit_recruitment, 2, 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