mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix purchase groups.
The new class PurchaseGroup coming in with commit 9bb986c was not
initiallized correctly.
This causes the bug that the update function is not working when you
for example open the AircraftRecruitmentMenu press "+" or "-", close
the dialog and then open ArmorRecruitmentMenu. If you then want to buy
or sell the update function will raise an error "Internal C++ Object
Already Deleted".
This commit is contained in:
@@ -76,13 +76,14 @@ class PurchaseGroup(QGroupBox):
|
||||
class QRecruitBehaviour:
|
||||
game_model: GameModel
|
||||
cp: ControlPoint
|
||||
purchase_groups: dict[UnitType, PurchaseGroup] = {}
|
||||
purchase_groups: dict[UnitType, PurchaseGroup]
|
||||
existing_units_labels = None
|
||||
maximum_units = -1
|
||||
BUDGET_FORMAT = "Available Budget: <b>${:.2f}M</b>"
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.existing_units_labels = {}
|
||||
self.purchase_groups = {}
|
||||
self.update_available_budget()
|
||||
|
||||
@property
|
||||
|
||||
@@ -26,7 +26,7 @@ class QAircraftRecruitmentMenu(QFrame, QRecruitBehaviour):
|
||||
QFrame.__init__(self)
|
||||
self.cp = cp
|
||||
self.game_model = game_model
|
||||
|
||||
self.purchase_groups = {}
|
||||
self.bought_amount_labels = {}
|
||||
self.existing_units_labels = {}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class QArmorRecruitmentMenu(QFrame, QRecruitBehaviour):
|
||||
QFrame.__init__(self)
|
||||
self.cp = cp
|
||||
self.game_model = game_model
|
||||
|
||||
self.purchase_groups = {}
|
||||
self.bought_amount_labels = {}
|
||||
self.existing_units_labels = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user