Fix incorrect handling of disabled groups in buy menu

Disabled groups would still be bought free of charge. this is now fixed
This commit is contained in:
RndName 2022-05-04 21:26:49 +02:00
parent 321bd4e874
commit 015103f613
No known key found for this signature in database
GPG Key ID: 5EF516FD9537F7C0

View File

@ -222,14 +222,15 @@ class QGroundObjectTemplateLayout(QGroupBox):
self.ground_object.groups = [] self.ground_object.groups = []
for group_name, groups in self.layout_model.groups.items(): for group_name, groups in self.layout_model.groups.items():
for group in groups: for group in groups:
self.layout_model.force_group.create_theater_group_for_tgo( if group.enabled:
self.ground_object, self.layout_model.force_group.create_theater_group_for_tgo(
group.layout, self.ground_object,
f"{self.ground_object.name} ({group_name})", group.layout,
self.game, f"{self.ground_object.name} ({group_name})",
group.dcs_unit_type, # Forced Type self.game,
group.amount, # Forced Amount group.dcs_unit_type, # Forced Type
) group.amount, # Forced Amount
)
self.close_dialog_signal.emit() self.close_dialog_signal.emit()