Ejemplo n.º 1
0
 def getPurchaseItems(self):
     import inspect
     if not self.isBuy and inspect.stack()[1][0].f_code.co_name == 'buildList':
         return self.getModdedPurchaseItems()
     if self._lastTab[CSMode.BUY] != C11nTabs.STYLE:
         currentSeason = self.currentSeason
         order = [currentSeason] + [s for s in SEASONS_ORDER if s != currentSeason]
         return getCustomPurchaseItems(self.getOutfitsInfo(), order)
     return getStylePurchaseItems(OutfitInfo(self.__originalStyle, self.__modifiedStyle), buyMore=self.__prolongStyleRent)
Ejemplo n.º 2
0
 def onActionBtnClick(self, actionType, actionData):
     if (self.__ctx.isBuy
             or self._attachedAnchor.slotType != GUI_ITEM_TYPE.STYLE
             or actionType != CA.CUSTOMIZATION_SHEET_ACTION_EDIT):
         return super(CustomizationPropertiesSheet,
                      self).onActionBtnClick(actionType, actionData)
     nat, veh = g_currentVehicle.item.descriptor.name.split(':')
     if not (getCustomPurchaseItems(self.__ctx.getModdedOutfitsInfo(),
                                    (self.__ctx.currentSeason, ))
             or g_config.outfitCache.get(nat, {}).get(veh, {}).get(
                 SEASON_TYPE_TO_NAME[self.__ctx.currentSeason])):
         self.__ctx.installStyleItemsToModifiedOutfits(True)
         return
     message = makeHtmlString(
         'html_templates:lobby/customization/dialog', 'decal',
         {'value': g_config.i18n['flashCol_propertySheet_edit_message']})
     DialogsInterface.showDialog(
         PMConfirmationDialogMeta(
             _APPLY_TO_OTHER_SEASONS_DIALOG,
             messageCtx={
                 'message': message,
                 'icon': RES_ICONS.MAPS_ICONS_LIBRARY_ICON_ALERT_90X84
             }), self.__ctx.installStyleItemsToModifiedOutfits)
Ejemplo n.º 3
0
 def __makeEditRendererVO(self):
     nation, vehicle = g_currentVehicle.item.descriptor.name.split(':')
     enabled = not bool(self._currentStyle.modelsSet)
     return {
         'iconSrc':
         RES_ICONS.
         MAPS_ICONS_CUSTOMIZATION_PROPERTY_SHEET_IDLE_ICON_OFFSET_02_NORMAL,
         'iconHoverSrc':
         RES_ICONS.
         MAPS_ICONS_CUSTOMIZATION_PROPERTY_SHEET_IDLE_ICON_OFFSET_02_HOVER,
         'iconDisableSrc':
         RES_ICONS.
         MAPS_ICONS_CUSTOMIZATION_PROPERTY_SHEET_DISABLE_ICON_OFFSET_02_DISABLED,
         'actionBtnLabel':
         g_config.i18n['flash_propertySheet_edit_action'],
         'actionType':
         CA.CUSTOMIZATION_SHEET_ACTION_EDIT,
         'rendererLnk':
         CA.CUSTOMIZATION_SHEET_BTN_RENDERER_UI,
         'animatedTransition':
         True,
         'disableTooltip':
         g_config.i18n['flashCol_propertySheet_edit_disabled'],
         'notifyText':
         makeHtmlString(
             'html_templates:lobby/customization/notify', 'decal',
             {'value': g_config.i18n['flashCol_propertySheet_edit_notify']
              }),
         'needNotify':
         enabled and bool(
             getCustomPurchaseItems(self.__ctx.getModdedOutfitsInfo(),
                                    (self.__ctx.currentSeason, ))
             or g_config.outfitCache.get(nation, {}).get(vehicle, {}).get(
                 SEASON_TYPE_TO_NAME[self.__ctx.currentSeason])),
         'enabled':
         enabled
     }
Ejemplo n.º 4
0
 def getPurchaseItems(self):
     return getCustomPurchaseItems(self.getOutfitsInfo(
     )) if self._mode == C11nMode.CUSTOM else getStylePurchaseItems(
         self.getStyleInfo())
Ejemplo n.º 5
0
 def getPurchaseItems(self):
     return getCustomPurchaseItems(self._ctx.season, self.getModifiedOutfits())
Ejemplo n.º 6
0
 def getModdedPurchaseItems(self):
     if self._lastTab[CSMode.INSTALL] != C11nTabs.STYLE:
         currentSeason = self.currentSeason
         order = [currentSeason] + [s for s in SEASONS_ORDER if s != currentSeason]
         return getCustomPurchaseItems(self.getModdedOutfitsInfo(), order)
     return getStylePurchaseItems(OutfitInfo(self._originalModdedStyle, self._modifiedModdedStyle))
Ejemplo n.º 7
0
 def getPurchaseItems(self):
     return getCustomPurchaseItems(self.getOutfitsInfo())