Fine-tune TGO-purchasability logic

This commit is contained in:
Raffson
2024-07-16 21:40:07 +02:00
parent 2c270306a1
commit f9e7772e09
3 changed files with 15 additions and 7 deletions

View File

@@ -104,14 +104,14 @@ class QGroundObjectMenu(QDialog):
self.buy_replace.clicked.connect(self.buy_group)
self.buy_replace.setProperty("style", "btn-success")
if self.ground_object.purchasable or self.game.turn == 0:
if self.ground_object.purchasable:
# if not purchasable but is_iads => naval unit
if self.total_value > 0:
self.actionLayout.addWidget(self.sell_all_button)
self.actionLayout.addWidget(self.buy_replace)
if self.show_buy_sell_actions and (
self.ground_object.purchasable or self.game.turn == 0
):
if self.show_buy_sell_actions and self.ground_object.purchasable:
# if not purchasable but is_iads => naval unit
self.mainLayout.addLayout(self.actionLayout)
self.setLayout(self.mainLayout)