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) ]
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
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] 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
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
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)]
def getLabels(self): return [{'id': DIALOG_BUTTON_ID.CLOSE, 'label': DIALOGS.all(I18N_CANCEL_KEY.format(self._i18nKey)), 'focused': True}]
def _makeString(self, key, ctx): return i18n.makeString(DIALOGS.all(key), **ctx)
def getLabels(self): return [{ 'id': DIALOG_BUTTON_ID.CLOSE, 'label': DIALOGS.all(I18N_CANCEL_KEY.format(self._i18nKey)), 'focused': True }]
def _makeString(self, key, ctx): return i18n.makeString(DIALOGS.all(key), **ctx)