def __updateModel(self): vehicle = g_currentVehicle.item if isIncorrectVehicle(vehicle): return self.__setAmmo(vehicle) self.__setAbilities(vehicle) self.__updateRentPrice() self.__updateRentState() self.__updateVehicleInfo()
def __updateModel(self): vehicle = g_currentVehicle.item if isIncorrectVehicle(vehicle): return self.__setAmmo(vehicle) self.__setAbilities(vehicle) self.__setRepairPrice() self.__updateRepairPrice() self.__updateVehicleStatus() self.__updateModuleButtonBubble()
def __updateModel(self): vehicle = g_currentVehicle.item if br_helpers.isIncorrectVehicle(vehicle): return nationName = vehicle.nationName props = getVehicleProperties(nationName) with self.viewModel.transaction() as model: self.__createPropsGroup(props.strengths, model.getVehicleGoodSpec(), _Properties.GOOD) self.__createPropsGroup(props.weaknesses, model.getVehicleBadSpec(), _Properties.BAD)
def __updateModel(self): vehicle = g_currentVehicle.item if br_helpers.isIncorrectVehicle(vehicle): return nationName = vehicle.nationName props = getVehicleProperties(nationName) with self.viewModel.transaction() as model: model.setVehicleDescription( R.strings.battle_royale.vehicleDescription.dyn(nationName)()) self.__createPropsGroup(props.strengths, model.vehicleGoodSpec.getItems(), _Properties.GOOD) self.__createPropsGroup(props.weaknesses, model.vehicleBadSpec.getItems(), _Properties.BAD)
def __setRepairPrice(self): vehicle = g_currentVehicle.item if isIncorrectVehicle(vehicle): return items = self.viewModel.repairPrice.getItems() items.clear() repairCost = vehicle.repairCost itemPrice = ItemPrice(price=Money(credits=repairCost), defPrice=Money(credits=repairCost)) actionPriceModels = getItemPricesViewModel( self.__itemsCache.items.stats.money, itemPrice)[0] for model in actionPriceModels: items.addViewModel(model) items.invalidate()
def __updateModel(self): vehicle = g_currentVehicle.item if isIncorrectVehicle(vehicle): return with self.viewModel.transaction() as model: model.setNation(vehicle.nationName) perkList = model.getPerkList() perkList.clear() commanderSkills = self.__brControl.getBrCommanderSkills() for skill in commanderSkills: skillName = skill.name perkModel = CommanderCmpPerkModel() perkModel.setIcon(_R_SKILLS_ICONS.dyn(skillName)()) perkModel.setTooltipID(skillName) perkList.addViewModel(perkModel) perkList.invalidate()
def __updateRentPrice(self): vehicle = g_currentVehicle.item if isIncorrectVehicle(vehicle): return else: items = self.viewModel.rentPrice.getItems() items.clear() price = self.__rentVehiclesController.getRentPrice() itemPrice = ItemPrice(price=price, defPrice=price) actionPriceModels = getItemPricesViewModel( self.__itemsCache.items.stats.getDynamicMoney(), itemPrice)[0] isEnoughMoney = self.__rentVehiclesController.isEnoughMoneyToPurchase( ) if actionPriceModels is not None: for model in actionPriceModels: items.addViewModel(model) items.invalidate() self.viewModel.setIsEnoughMoney(isEnoughMoney) return
def __updateRepairPrice(self): vehicle = g_currentVehicle.item if isIncorrectVehicle(vehicle): return repairCost = vehicle.repairCost if repairCost <= 0: self.viewModel.setIsRepairBtnVisible(False) return with self.viewModel.transaction() as vm: vm.setIsRepairBtnVisible(True) for priceModel in vm.repairPrice.getItems(): currencyType = priceModel.getType() if currencyType == Currency.CREDITS: isEnough = repairCost <= self.__itemsCache.items.stats.money.get( currencyType) with priceModel.transaction() as pm: pm.setPrice(getIntegralFormat(repairCost)) pm.setIsEnough(isEnough) vm.setIsRepairBtnDisabled(not isEnough) break
def __subscribeRentTimeUpdate(self): vehicle = g_currentVehicle.item if not isIncorrectVehicle(vehicle): self.__rentVehiclesController.setRentUpdateCurrentVehicleCallback( self.__rentLiveUpdate)