mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fixed bug when buying armor at base
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import logging
|
||||
|
||||
from PySide2 import QtCore
|
||||
from PySide2.QtGui import QCloseEvent, Qt
|
||||
from PySide2.QtGui import Qt
|
||||
from PySide2.QtWidgets import QHBoxLayout, QDialog, QGridLayout, QLabel, QGroupBox, QVBoxLayout, QPushButton, \
|
||||
QComboBox, QSpinBox, QMessageBox
|
||||
from dcs import Point
|
||||
@@ -9,7 +9,7 @@ from dcs import Point
|
||||
from game import Game, db
|
||||
from game.data.building_data import FORTIFICATION_BUILDINGS
|
||||
from game.db import PRICES, unit_type_of, PinpointStrike
|
||||
from gen.defenses.armor_group_generator import generate_armor_group
|
||||
from gen.defenses.armor_group_generator import generate_armor_group_of_type_and_size
|
||||
from gen.sam.sam_group_generator import get_faction_possible_sams_generator
|
||||
from qt_ui.uiconstants import EVENT_ICONS
|
||||
from qt_ui.widgets.QBudgetBox import QBudgetBox
|
||||
@@ -288,7 +288,9 @@ class QBuyGroupForGroundObjectDialog(QDialog):
|
||||
self.buyArmorButton.setText("Buy [$" + str(db.PRICES[self.buyArmorCombo.itemData(self.buyArmorCombo.currentIndex())] * self.amount.value()) + "M][-$" + str(self.current_group_value) + "M]")
|
||||
|
||||
def buyArmor(self):
|
||||
print("Buy Armor ")
|
||||
utype = self.buyArmorCombo.itemData(self.buyArmorCombo.currentIndex())
|
||||
print(utype)
|
||||
price = db.PRICES[utype] * self.amount.value() - self.current_group_value
|
||||
if price > self.game.budget:
|
||||
self.error_money()
|
||||
@@ -298,7 +300,7 @@ class QBuyGroupForGroundObjectDialog(QDialog):
|
||||
self.game.budget -= price
|
||||
|
||||
# Generate Armor
|
||||
group = generate_armor_group(self.game.player_name, self.game, self.ground_object)
|
||||
group = generate_armor_group_of_type_and_size(self.game, self.ground_object, utype, int(self.amount.value()))
|
||||
self.ground_object.groups = [group]
|
||||
|
||||
GameUpdateSignal.get_instance().updateBudget(self.game)
|
||||
|
||||
Reference in New Issue
Block a user