当前位置: 首页>>代码示例>>Python>>正文


Python DIALOGS.DIALOGS类代码示例

本文整理汇总了Python中gui.Scaleform.locale.DIALOGS.DIALOGS的典型用法代码示例。如果您正苦于以下问题:Python DIALOGS类的具体用法?Python DIALOGS怎么用?Python DIALOGS使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DIALOGS类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: updateAllDropdowns

    def updateAllDropdowns(self, nationID, tankType, typeID, roleType):
        nationsDP = [{'id': None,
          'label': DIALOGS.RECRUITWINDOW_MENUEMPTYROW}, {'id': nationID,
          'label': MENU.nations(nations.NAMES[int(nationID)])}]
        classesDP = [{'id': None,
          'label': DIALOGS.RECRUITWINDOW_MENUEMPTYROW}, {'id': tankType,
          'label': DIALOGS.recruitwindow_vehicleclassdropdown(tankType)}]
        typesDP = [{'id': None,
          'label': DIALOGS.RECRUITWINDOW_MENUEMPTYROW}]
        rolesDP = [{'id': None,
          'label': DIALOGS.RECRUITWINDOW_MENUEMPTYROW}]
        unlocks = yield StatsRequester().getUnlocks()
        modulesAll = yield Requester('vehicle').getFromShop()
        for module in modulesAll:
            compdecs = module.descriptor.type.compactDescr
            if compdecs in unlocks and module.descriptor.type.id[0] == nationID and module.descriptor.type.id[1] == typeID:
                typesDP.append({'id': module.descriptor.type.id[1],
                 'label': module.descriptor.type.shortUserString})
                for role in module.descriptor.type.crewRoles:
                    if role[0] == roleType:
                        rolesDP.append({'id': role[0],
                         'label': convert(getSkillsConfig()[role[0]]['userString'])})

                break

        self.flashObject.as_setAllDropdowns(nationsDP, classesDP, typesDP, rolesDP)
        return
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:27,代码来源:recruitwindow.py

示例2: _showAward

    def _showAward(self, ctx):
        _, message = ctx
        for dataForVehicle in message.data.values():
            arenaTypeID = dataForVehicle.get('arenaTypeID', 0)
            if arenaTypeID > 0 and arenaTypeID in ArenaType.g_cache:
                arenaType = ArenaType.g_cache[arenaTypeID]
            else:
                arenaType = None
            arenaCreateTime = dataForVehicle.get('arenaCreateTime', None)
            fairplayViolations = dataForVehicle.get('fairplayViolations', None)
            if arenaCreateTime and arenaType and fairplayViolations is not None and fairplayViolations[:2] != (0, 0):
                penaltyType = None
                violation = None
                if fairplayViolations[1] != 0:
                    penaltyType = 'penalty'
                    violation = fairplayViolations[1]
                elif fairplayViolations[0] != 0:
                    penaltyType = 'warning'
                    violation = fairplayViolations[0]
                from gui.DialogsInterface import showDialog
                showDialog(I18PunishmentDialogMeta('punishmentWindow', None, {'penaltyType': penaltyType,
                 'arenaName': i18n.makeString(arenaType.name),
                 'time': TimeFormatter.getActualMsgTimeStr(arenaCreateTime),
                 'reason': i18n.makeString(DIALOGS.all('punishmentWindow/reason/%s' % getFairPlayViolationName(violation)))}), lambda *args: None)

        return
开发者ID:webiumsk,项目名称:WOT-0.9.12-CT,代码行数:26,代码来源:awardcontroller.py

示例3: updateAllDropdowns

    def updateAllDropdowns(self, nationID, tankType, typeID, roleType):
        nationsDP = [{'id': None,
          'label': DIALOGS.RECRUITWINDOW_MENUEMPTYROW}, {'id': nationID,
          'label': MENU.nations(nations.NAMES[int(nationID)])}]
        classesDP = [{'id': None,
          'label': DIALOGS.RECRUITWINDOW_MENUEMPTYROW}, {'id': tankType,
          'label': DIALOGS.recruitwindow_vehicleclassdropdown(tankType)}]
        typesDP = [{'id': None,
          'label': DIALOGS.RECRUITWINDOW_MENUEMPTYROW}]
        rolesDP = [{'id': None,
          'label': DIALOGS.RECRUITWINDOW_MENUEMPTYROW}]
        modulesAll = g_itemsCache.items.getVehicles(self.__getRoleCriteria(nationID, tankType, typeID)).values()
        modulesAll.sort()
        for module in modulesAll:
            typesDP.append({'id': module.innationID,
             'label': module.shortUserName})
            for role in module.descriptor.type.crewRoles:
                if role[0] == roleType:
                    rolesDP.append({'id': role[0],
                     'label': convert(getSkillsConfig()[role[0]]['userString'])})

            break

        self.flashObject.as_setAllDropdowns(nationsDP, classesDP, typesDP, rolesDP)
        return
开发者ID:webiumsk,项目名称:WOT-0.9.15-CT,代码行数:25,代码来源:recruitwindow.py

示例4: updateVehicleClassDropdown

    def updateVehicleClassDropdown(self, nationID):
        Waiting.show("updating")
        modulesAll = g_itemsCache.items.getVehicles(self.__getClassesCriteria(nationID)).values()
        classes = []
        data = [{"id": None, "label": DIALOGS.RECRUITWINDOW_MENUEMPTYROW}]
        modulesAll.sort()
        for module in modulesAll:
            if module.type in classes:
                continue
            classes.append(module.type)
            data.append({"id": module.type, "label": DIALOGS.recruitwindow_vehicleclassdropdown(module.type)})

        self.flashObject.as_setVehicleClassDropdown(data)
        Waiting.hide("updating")
        return
开发者ID:webiumsk,项目名称:WOT0.10.0,代码行数:15,代码来源:recruitwindow.py

示例5: updateVehicleClassDropdown

    def updateVehicleClassDropdown(self, nationID):
        Waiting.show('updating')
        unlocks = yield StatsRequester().getUnlocks()
        modulesAll = yield Requester('vehicle').getFromShop()
        classes = []
        data = [{'id': None,
          'label': DIALOGS.RECRUITWINDOW_MENUEMPTYROW}]
        modulesAll.sort()
        for module in modulesAll:
            compdecs = module.descriptor.type.compactDescr
            if compdecs in unlocks and module.descriptor.type.id[0] == nationID and module.type not in classes:
                classes.append(module.type)
                data.append({'id': module.type,
                 'label': DIALOGS.recruitwindow_vehicleclassdropdown(module.type)})

        self.flashObject.as_setVehicleClassDropdown(data)
        Waiting.hide('updating')
        return
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:18,代码来源:recruitwindow.py

示例6: changeNation

    def changeNation(self, nationID):
        Waiting.show('updating')
        self.__selectedNation = nationID
        modulesAll = g_itemsCache.items.getVehicles(self.__getClassesCriteria(nationID)).values()
        classes = []
        data = [self.__getVehicleClassEmptyRow()]
        modulesAll.sort()
        for module in modulesAll:
            if module.type in classes:
                continue
            classes.append(module.type)
            data.append({'id': module.type,
             'label': DIALOGS.recruitwindow_vehicleclassdropdown(module.type)})

        self.as_setVehicleClassDataS(self.__getSendingData(data, len(data) > 1, 0))
        self.as_setVehicleDataS(self.__getSendingData([self.__getVehicleEmptyRow()], False, 0))
        self.as_setTankmanRoleDataS(self.__getSendingData([self.__getTankmanRoleEmptyRow()], False, 0))
        Waiting.hide('updating')
        self.onDataChange(self.__selectedNation, self.__selectedVehClass, self.__selectedVehicle, self.__selectedTmanRole)
开发者ID:aevitas,项目名称:wotsdk,代码行数:19,代码来源:recruitwindowrecruitparamscomponent.py

示例7: _getBattleChartsStatistics

def _getBattleChartsStatistics(battlesStats, levelDisabledTooltip):
    outcome = []
    tDict = battlesStats[0]
    typesRes = []
    for vehType in VEHICLE_TYPES_ORDER:
        typesRes.append({'xField': i18n.makeString(DIALOGS.vehicleselldialog_vehicletype(vehType)),
         'icon': '../maps/icons/filters/tanks/{0}.png'.format(vehType),
         'yField': tDict[vehType],
         'tooltip': PROFILE.SECTION_STATISTICS_CHART_TYPE_TOOLTIP})

    _setChartDataPercentages(typesRes)
    outcome.append(typesRes)
    tDict = battlesStats[1]
    nationRes = []
    for guiNationIdx, _ in enumerate(GUI_NATIONS):
        nationIdx = getNationIndex(guiNationIdx)
        nationName = nations.NAMES[nationIdx]
        nationRes.append({'xField': i18n.makeString(MENU.nations(nationName)),
         'icon': '../maps/icons/filters/nations/{0}.png'.format(nationName),
         'yField': tDict[nationIdx],
         'tooltip': PROFILE.SECTION_STATISTICS_CHART_NATION_TOOLTIP})

    _setChartDataPercentages(nationRes)
    outcome.append(nationRes)
    tDict = battlesStats[2]
    lvlRes = len(tDict) * [None]
    for level, value in tDict.iteritems():
        tooltip = PROFILE.SECTION_STATISTICS_CHART_LEVEL_TOOLTIP
        if value is None:
            value = -1
            if levelDisabledTooltip != None:
                tooltip = levelDisabledTooltip
        lvlRes[level - 1] = {'xField': str(level),
         'icon': '../maps/icons/levels/tank_level_{0}.png'.format(level),
         'yField': value,
         'tooltip': tooltip}

    _setChartDataPercentages(lvlRes)
    outcome.append(lvlRes)
    return {'data': outcome}
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:40,代码来源:profile_statistics_vos.py

示例8: _showAward

    def _showAward(self, ctx):
        _, message = ctx
        arenaTypeID = message.data.get("arenaTypeID", 0)
        if arenaTypeID > 0 and arenaTypeID in ArenaType.g_cache:
            arenaType = ArenaType.g_cache[arenaTypeID]
        else:
            arenaType = None
        arenaCreateTime = message.data.get("arenaCreateTime", None)
        fairplayViolations = message.data.get("fairplayViolations", None)
        if arenaCreateTime and arenaType and fairplayViolations is not None and fairplayViolations[:2] != (0, 0):
            penaltyType = None
            violation = None
            if fairplayViolations[1] != 0:
                penaltyType = "penalty"
                violation = fairplayViolations[1]
            elif fairplayViolations[0] != 0:
                penaltyType = "warning"
                violation = fairplayViolations[0]
            from gui.DialogsInterface import showDialog

            showDialog(
                I18PunishmentDialogMeta(
                    "punishmentWindow",
                    None,
                    {
                        "penaltyType": penaltyType,
                        "arenaName": i18n.makeString(arenaType.name),
                        "time": TimeFormatter.getActualMsgTimeStr(arenaCreateTime),
                        "reason": i18n.makeString(
                            DIALOGS.all("punishmentWindow/reason/%s" % getFairPlayViolationName(violation))
                        ),
                    },
                ),
                lambda *args: None,
            )
        return
开发者ID:webiumsk,项目名称:WOT-0.9.12,代码行数:36,代码来源:awardcontroller.py

示例9: _populate

    def _populate(self):
        super(VehicleSellDialog, self)._populate()
        g_clientUpdateManager.addCallbacks({'stats.gold': self.onSetGoldHndlr})
        g_itemsCache.onSyncCompleted += self.__shopResyncHandler
        items = g_itemsCache.items
        vehicle = items.getVehicle(self.vehInvID)
        sellPrice = vehicle.sellPrice
        sellForGold = sellPrice.gold > 0
        priceTextColor = CURRENCIES_CONSTANTS.GOLD_COLOR if sellForGold else CURRENCIES_CONSTANTS.CREDITS_COLOR
        priceTextValue = _ms(DIALOGS.VEHICLESELLDIALOG_PRICE_SIGN_ADD) + _ms(BigWorld.wg_getIntegralFormat(sellPrice.gold if sellForGold else sellPrice.credits))
        currencyIcon = CURRENCIES_CONSTANTS.GOLD if sellForGold else CURRENCIES_CONSTANTS.CREDITS
        invVehs = items.getVehicles(REQ_CRITERIA.INVENTORY)
        if vehicle.isPremium or vehicle.level >= 3:
            self.as_visibleControlBlockS(True)
            self.__initCtrlQuestion()
        else:
            self.as_visibleControlBlockS(False)
        modules = items.getItems(criteria=REQ_CRITERIA.VEHICLE.SUITABLE([vehicle]) | REQ_CRITERIA.INVENTORY).values()
        shells = items.getItems(criteria=REQ_CRITERIA.VEHICLE.SUITABLE([vehicle], [GUI_ITEM_TYPE.SHELL]) | REQ_CRITERIA.INVENTORY).values()
        otherVehsShells = set()
        for invVeh in invVehs.itervalues():
            if invVeh.invID != self.vehInvID:
                for shot in invVeh.descriptor.gun['shots']:
                    otherVehsShells.add(shot['shell']['compactDescr'])

        vehicleAction = None
        if sellPrice != vehicle.defaultSellPrice:
            vehicleAction = packItemActionTooltipData(vehicle, False)
        if vehicle.isElite:
            description = TOOLTIPS.tankcaruseltooltip_vehicletype_elite(vehicle.type)
        else:
            description = DIALOGS.vehicleselldialog_vehicletype(vehicle.type)
        levelStr = text_styles.concatStylesWithSpace(text_styles.stats(int2roman(vehicle.level)), text_styles.main(_ms(DIALOGS.VEHICLESELLDIALOG_VEHICLE_LEVEL)))
        restoreController = getRestoreController()
        tankmenGoingToBuffer, deletedTankmen = restoreController.getTankmenDeletedBySelling(vehicle)
        deletedCount = len(deletedTankmen)
        if deletedCount > 0:
            recoveryBufferFull = True
            deletedStr = formatDeletedTankmanStr(deletedTankmen[0])
            maxCount = restoreController.getMaxTankmenBufferLength()
            currCount = len(restoreController.getDismissedTankmen())
            if deletedCount == 1:
                crewTooltip = text_styles.concatStylesToMultiLine(text_styles.middleTitle(_ms(TOOLTIPS.VEHICLESELLDIALOG_CREW_ALERTICON_RECOVERY_HEADER)), text_styles.main(_ms(TOOLTIPS.VEHICLESELLDIALOG_CREW_ALERTICON_RECOVERY_BODY, maxVal=maxCount, curVal=currCount, sourceName=tankmenGoingToBuffer[-1].fullUserName, targetInfo=deletedStr)))
            else:
                crewTooltip = text_styles.concatStylesToMultiLine(text_styles.middleTitle(_ms(TOOLTIPS.VEHICLESELLDIALOG_CREW_ALERTICON_RECOVERY_HEADER)), text_styles.main(_ms(TOOLTIPS.DISMISSTANKMANDIALOG_BUFFERISFULLMULTIPLE_BODY, deletedStr=deletedStr, extraCount=deletedCount - 1, maxCount=maxCount, currCount=currCount)))
        else:
            crewTooltip = None
            recoveryBufferFull = False
        barracksDropDownData = [{'label': _ms(MENU.BARRACKS_BTNUNLOAD)}, {'label': _ms(MENU.BARRACKS_BTNDISSMISS)}]
        sellVehicleData = {'intCD': vehicle.intCD,
         'userName': vehicle.userName,
         'icon': vehicle.icon,
         'level': vehicle.level,
         'isElite': vehicle.isElite,
         'isPremium': vehicle.isPremium,
         'type': vehicle.type,
         'nationID': vehicle.nationID,
         'sellPrice': sellPrice,
         'priceTextValue': priceTextValue,
         'priceTextColor': priceTextColor,
         'currencyIcon': currencyIcon,
         'action': vehicleAction,
         'hasCrew': vehicle.hasCrew,
         'isRented': vehicle.isRented,
         'description': description,
         'levelStr': levelStr,
         'priceLabel': _ms(DIALOGS.VEHICLESELLDIALOG_VEHICLE_EMPTYSELLPRICE),
         'crewLabel': _ms(DIALOGS.VEHICLESELLDIALOG_CREW_LABEL),
         'crewTooltip': crewTooltip,
         'barracksDropDownData': barracksDropDownData,
         'crewRecoveryBufferFull': recoveryBufferFull}
        onVehicleOptionalDevices = []
        for o in vehicle.optDevices:
            if o is not None:
                action = None
                if o.sellPrice != o.defaultSellPrice:
                    action = packItemActionTooltipData(o, False)
                data = {'intCD': o.intCD,
                 'isRemovable': o.isRemovable,
                 'userName': o.userName,
                 'sellPrice': o.sellPrice,
                 'toInventory': True,
                 'action': action}
                onVehicleOptionalDevices.append(data)

        onVehicleoShells = []
        for shell in vehicle.shells:
            if shell is not None:
                action = None
                if shell.sellPrice != shell.defaultSellPrice:
                    action = packItemActionTooltipData(shell, False)
                data = {'intCD': shell.intCD,
                 'count': shell.count,
                 'sellPrice': shell.sellPrice,
                 'userName': shell.userName,
                 'kind': shell.type,
                 'toInventory': shell in otherVehsShells or shell.isPremium,
                 'action': action}
                onVehicleoShells.append(data)

#.........这里部分代码省略.........
开发者ID:aevitas,项目名称:wotsdk,代码行数:101,代码来源:lobbyvehicleselldialog.py

示例10: getConfirmDialogMeta

 def getConfirmDialogMeta(self):
     message = DIALOGS.exitcurrentprebattle_custommessage(PREBATTLE_TYPE_NAMES[self.getPrbType()])
     return I18nConfirmDialogMeta('exitCurrentPrebattle', meta=SimpleDialogMeta(message=message))
开发者ID:19colt87,项目名称:WOTDecompiled,代码行数:3,代码来源:default.py

示例11: getLabels

 def getLabels(self):
     return [self.__getButtonInfoObject(DIALOG_BUTTON_ID.SUBMIT, DIALOGS.all(I18N_SUBMIT_KEY.format(self._i18nKey)), self._focusedIndex == DIALOG_BUTTON_ID.SUBMIT if self._focusedIndex is not None else True), self.__getButtonInfoObject(DIALOG_BUTTON_ID.CLOSE, DIALOGS.all(I18N_CANCEL_KEY.format(self._i18nKey)), self._focusedIndex == DIALOG_BUTTON_ID.CLOSE if self._focusedIndex is not None else False)]
开发者ID:webiumsk,项目名称:WoT,代码行数:2,代码来源:__init__.py

示例12: _makeString

 def _makeString(self, key, ctx):
     return i18n.makeString(DIALOGS.all(key), **ctx)
开发者ID:webiumsk,项目名称:WoT,代码行数:2,代码来源:__init__.py


注:本文中的gui.Scaleform.locale.DIALOGS.DIALOGS类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。