New cheat option: manage REDFOR's TGOs

This commit is contained in:
Raffson
2024-03-01 23:06:46 +01:00
parent 9f7c9eec14
commit 32f8d8d0b7
5 changed files with 37 additions and 8 deletions

View File

@@ -188,7 +188,8 @@ class QGroundObjectTemplateLayout(QGroupBox):
@property
def affordable(self) -> bool:
return self.cost <= self.game.blue.budget
coalition = self.ground_object.coalition
return self.cost <= coalition.budget
def add_theater_group(
self, group_name: str, force_group: ForceGroup, groups: list[TgoLayoutUnitGroup]
@@ -226,7 +227,8 @@ class QGroundObjectTemplateLayout(QGroupBox):
self.game.theater.heading_to_conflict_from(self.ground_object.position)
or self.ground_object.heading
)
self.game.blue.budget -= self.cost
coalition = self.ground_object.coalition
coalition.budget -= self.cost
self.ground_object.groups = []
for group_name, groups in self.layout_model.groups.items():
for group in groups:
@@ -282,7 +284,8 @@ class QGroundObjectBuyMenu(QDialog):
if not tasks:
tasks = role.tasks
for group in game.blue.armed_forces.groups_for_tasks(tasks):
coalition = ground_object.coalition
for group in coalition.armed_forces.groups_for_tasks(tasks):
self.force_group_selector.addItem(group.name, userData=group)
self.force_group_selector.setEnabled(self.force_group_selector.count() > 1)
self.force_group_selector.adjustSize()