예제 #1
0
 def _setResult(self, result):
     if result == DialogButtons.SUBMIT:
         shortage = self._itemsCache.items.stats.money.getShortage(
             self.itemPrice.price)
         if shortage and shortage.getCurrency() == Currency.GOLD:
             showBuyGoldForEquipment(self.itemPrice.price.gold)
             result = DialogButtons.CANCEL
     super(DemountOptionalDeviceSinglePriceDialog, self)._setResult(result)
 def _onAcceptClicked(self):
     goldEnought = self._isGoldEnought()
     dk = self._goodiesCache.getDemountKit()
     dkEnought = dk.inventoryCount > 0
     if not goldEnought and not dkEnought:
         showBuyGoldForEquipment(self.removalPrice.price.gold)
     else:
         super(DemountOpDevDialog, self)._onAcceptClicked()
예제 #3
0
 def _setResult(self, result):
     goldEnough = self._isGoldEnough()
     dk, _ = getDemountKitForOptDevice(self.__item)
     dkEnough = dk.inventoryCount > 0
     if result == DialogButtons.SUBMIT:
         if not goldEnough and not dkEnough:
             showBuyGoldForEquipment(self.removalPrice.price.gold)
             result = DialogButtons.CANCEL
     super(DemountOptionalDeviceDialog, self)._setResult(result)
예제 #4
0
 def __doSellVehicle(self, vehicle, shells, eqs, optDevicesToSell,
                     inventory, customizationItems, isDismissCrew,
                     itemsForDemountKit, boosters):
     vehicleSeller = VehicleSeller(vehicle, shells, eqs, optDevicesToSell,
                                   inventory, customizationItems, boosters,
                                   isDismissCrew, itemsForDemountKit)
     currentMoneyGold = self.__itemsCache.items.stats.money.get(
         Currency.GOLD, 0)
     spendMoneyGold = vehicleSeller.spendMoney.get(Currency.GOLD, 0)
     if currentMoneyGold < spendMoneyGold:
         showBuyGoldForEquipment(spendMoneyGold)
     else:
         result = yield vehicleSeller.request()
         SystemMessages.pushMessages(result)
         self.destroy()
 def _onAcceptClicked(self):
     if self.isPriceInGold() and self._shortage:
         showBuyGoldForEquipment(self._price.price.get(self._currency))
     else:
         super(ItemPriceDialog, self)._onAcceptClicked()