當前位置: 首頁>>代碼示例>>Python>>正文


Python DIALOGS.all方法代碼示例

本文整理匯總了Python中gui.Scaleform.locale.DIALOGS.DIALOGS.all方法的典型用法代碼示例。如果您正苦於以下問題:Python DIALOGS.all方法的具體用法?Python DIALOGS.all怎麽用?Python DIALOGS.all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gui.Scaleform.locale.DIALOGS.DIALOGS的用法示例。


在下文中一共展示了DIALOGS.all方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _showAward

# 需要導入模塊: from gui.Scaleform.locale.DIALOGS import DIALOGS [as 別名]
# 或者: from gui.Scaleform.locale.DIALOGS.DIALOGS import all [as 別名]
    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,代碼行數:28,代碼來源:awardcontroller.py

示例2: _showAward

# 需要導入模塊: from gui.Scaleform.locale.DIALOGS import DIALOGS [as 別名]
# 或者: from gui.Scaleform.locale.DIALOGS.DIALOGS import all [as 別名]
    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,代碼行數:38,代碼來源:awardcontroller.py

示例3: getLabels

# 需要導入模塊: from gui.Scaleform.locale.DIALOGS import DIALOGS [as 別名]
# 或者: from gui.Scaleform.locale.DIALOGS.DIALOGS import all [as 別名]
 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,代碼行數:4,代碼來源:__init__.py

示例4: _makeString

# 需要導入模塊: from gui.Scaleform.locale.DIALOGS import DIALOGS [as 別名]
# 或者: from gui.Scaleform.locale.DIALOGS.DIALOGS import all [as 別名]
 def _makeString(self, key, ctx):
     return i18n.makeString(DIALOGS.all(key), **ctx)
開發者ID:webiumsk,項目名稱:WoT,代碼行數:4,代碼來源:__init__.py


注:本文中的gui.Scaleform.locale.DIALOGS.DIALOGS.all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。