Exemplo n.º 1
0
 def _onLoading(self, *args, **kwargs):
     isFirstOpen = not AccountSettings.getSettings(CRYSTALS_INFO_SHOWN)
     if isFirstOpen:
         AccountSettings.setSettings(CRYSTALS_INFO_SHOWN, True)
     with self.getViewModel().transaction() as model:
         model.setSelectedTab(1 if isFirstOpen else 0)
         model.setEquipmentPrice(getIntegralFormat(3000))
         model.setInstructionPrice(getIntegralFormat(6))
         model.setVehiclePrice(getIntegralFormat(3000))
         model.setIsChina(IS_CHINA)
         self.__updateCondition(model)
         model.goToShop += self.__goToShopHandler
Exemplo n.º 2
0
 def _onLoading(self, *args, **kwargs):
     super(CrystalsPromoView, self)._onLoading(*args, **kwargs)
     self.__destroyViewObject.init(self.getParentWindow())
     isFirstOpen = not AccountSettings.getSettings(CRYSTALS_INFO_SHOWN)
     if isFirstOpen:
         AccountSettings.setSettings(CRYSTALS_INFO_SHOWN, True)
     with self.getViewModel().transaction() as model:
         model.setSelectedTab(1 if isFirstOpen else 0)
         model.setEquipmentPrice(
             getIntegralFormat(_DEFAULT_EQUIPMENT_PRICE))
         model.setInstructionPrice(
             getIntegralFormat(_DEFAULT_INSTRUCTION_PRICE))
         model.setVehiclePrice(getIntegralFormat(_DEFAULT_VEHICLE_PRICE))
         model.setIsChina(IS_CHINA)
         self.__updateCondition(model)
Exemplo n.º 3
0
 def __getModelForUniversalFragment(self, value):
     item = FragmentItemModel()
     item.setFragmentCD(BlueprintTypes.INTELLIGENCE_DATA)
     item.setValue(backport_system_locale.getIntegralFormat(value))
     item.setIcon(
         R.images.gui.maps.icons.blueprints.fragment.small.intelligence())
     item.setSpecialIcon(
         R.images.gui.maps.icons.blueprints.fragment.big.intelligence())
     return item
Exemplo n.º 4
0
 def __getModelForNationalFragment(self, nationName, value):
     item = FragmentItemModel()
     item.setFragmentCD(getNationalFragmentCD(nations.INDICES[nationName]))
     item.setValue(backport_system_locale.getIntegralFormat(value))
     item.setIcon(
         R.images.gui.maps.icons.blueprints.fragment.small.dyn(nationName)
         ())
     item.setSpecialIcon(
         R.images.gui.maps.icons.blueprints.fragment.big.dyn(nationName)())
     return item
 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