mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Move the tgo value calculation from UI to the tgo
This commit is contained in:
@@ -217,11 +217,7 @@ class QGroundObjectMenu(QDialog):
|
||||
def update_total_value(self):
|
||||
if not self.ground_object.purchasable:
|
||||
return
|
||||
self.total_value = sum(
|
||||
u.unit_type.price
|
||||
for u in self.ground_object.units
|
||||
if u.unit_type and u.alive
|
||||
)
|
||||
self.total_value = self.ground_object.value
|
||||
if self.sell_all_button is not None:
|
||||
self.sell_all_button.setText("Disband (+$" + str(self.total_value) + "M)")
|
||||
|
||||
@@ -248,7 +244,7 @@ class QGroundObjectMenu(QDialog):
|
||||
|
||||
def sell_all(self):
|
||||
self.update_total_value()
|
||||
self.game.blue.budget = self.game.blue.budget + self.total_value
|
||||
self.game.blue.budget += self.total_value
|
||||
self.ground_object.groups = []
|
||||
self.update_game()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user