예제 #1
0
    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
예제 #2
0
    def atCall(self, cd):
        vehicleItem = g_itemsCache.items.getItem(GUI_ITEM_TYPE.VEHICLE,
                                                 cd.self.nationID,
                                                 cd.self.inNationID)
        if self.__vehicle_is_available(vehicleItem):
            return None
        else:
            cd.avoid()

            def dialogButtonClickHandler(confirm):
                if confirm:
                    BigWorld.callback(
                        0.1, lambda: cd.self._VehicleBuyWindow__requestForBuy(
                            cd.args[0]))
                else:
                    cd.self.as_setEnabledSubmitBtnS(True)

            showDialog(
                SimpleDialogMeta(title=_ms('#miniclient:buy_vehicle/title'),
                                 message=icons.alert() +
                                 _ms('#miniclient:buy_vehicle/message'),
                                 buttons=I18nConfirmDialogButtons(
                                     i18nKey='questsConfirmDialog',
                                     focusedIndex=DIALOG_BUTTON_ID.SUBMIT)),
                dialogButtonClickHandler)
            return None
예제 #3
0
 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
예제 #4
0
def confirmReserveVehicle(self):
    try:
        showDialog(
            SimpleDialogMeta(l10n('reserve_confirm_title'),
                             l10n('reserve_confirm_message'),
                             I18nConfirmDialogButtons()),
            partial(checkReserveVehicle, self.vehCD))
    except Exception as ex:
        err(traceback.format_exc())
예제 #5
0
def _SquadActionsHandler_confirmCallback(base, self, result):
    if not result:
        return
    try:
        if battle_tiers_difference >= WARN_SQUAD_BATTLETIER_DIFFERENCE:
            showDialog(SimpleDialogMeta(l10n('Warning'), l10n('Squad tanks battle tiers difference') + ': %s.' % battle_tiers_difference, I18nConfirmDialogButtons()), partial(base, self))
            return True
    except Exception, ex:
        err(traceback.format_exc())
예제 #6
0
def _SquadActionsHandler_confirmCallback(base, self, result):
    if not result:
        return
    try:
        if battle_tiers_difference >= WARN_SQUAD_BATTLETIER_DIFFERENCE:
            showDialog(SimpleDialogMeta(l10n('Warning'), l10n('Squad tanks battle tiers difference') + ': %s.' % battle_tiers_difference, I18nConfirmDialogButtons()), partial(base, self))
            return True
    except Exception, ex:
        err(traceback.format_exc())
예제 #7
0
def _show_continue_client_download_dialog():
    showDialog(
        SimpleDialogMeta(
            title=_ms('#miniclient:continue_download_dialog/title'),
            message=_ms('#miniclient:continue_download_dialog/message'),
            buttons=I18nConfirmDialogButtons(
                focusedIndex=DIALOG_BUTTON_ID.SUBMIT,
                i18nKey='questsConfirmDialog')), lambda proceed:
        (BigWorld.wg_quitAndStartLauncher() if proceed else None))
예제 #8
0
파일: aspects.py 프로젝트: kblw/wot_client
    def atCall(self, cd):
        vehicleItem = g_itemsCache.items.getItem(GUI_ITEM_TYPE.VEHICLE, cd.self.nationID, cd.self.inNationID)
        if self.__vehicle_is_available(vehicleItem):
            return None
        cd.avoid()

        def dialogButtonClickHandler(confirm):
            if confirm:
                BigWorld.callback(0.1, lambda : cd.self._VehicleBuyWindow__requestForBuy(cd.args[0]))
            else:
                cd.self.as_setEnabledSubmitBtnS(True)

        showDialog(SimpleDialogMeta(title=_ms('#miniclient:buy_vehicle/title'), message=icons.alert() + _ms('#miniclient:buy_vehicle/message'), buttons=I18nConfirmDialogButtons(i18nKey='questsConfirmDialog', focusedIndex=DIALOG_BUTTON_ID.SUBMIT)), dialogButtonClickHandler)
예제 #9
0
 def _submit(self,
             title=None,
             message=None,
             submit=None,
             close=None,
             url=None):
     return showDialog(
         SimpleDialogMeta(title=title,
                          message=message,
                          buttons=DialogButtons(submit=submit,
                                                close=close)),
         lambda proceed: self.openUrlUp(url) if proceed else None)
예제 #10
0
    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
예제 #11
0
def _show_continue_client_download_dialog():
    showDialog(SimpleDialogMeta(title=_ms('#miniclient:continue_download_dialog/title'), message=_ms('#miniclient:continue_download_dialog/message'), buttons=I18nConfirmDialogButtons(focusedIndex=DIALOG_BUTTON_ID.SUBMIT, i18nKey='questsConfirmDialog')), lambda proceed: (BigWorld.wg_quitAndStartLauncher() if proceed else None))
예제 #12
0
def confirmReserveVehicle(self):
    try:
        showDialog(SimpleDialogMeta(l10n('reserve_confirm_title'), l10n('reserve_confirm_message'), I18nConfirmDialogButtons()), partial(checkReserveVehicle, self.vehCD))
    except Exception as ex:
        err(traceback.format_exc())
예제 #13
0
 def _close(self, title=None, message=None, close=None):
     return showDialog(
         SimpleDialogMeta(title=title,
                          message=message,
                          buttons=DialogButtons(close=close)), None)
예제 #14
0
def confirmReserveVehicle(self):
    showDialog(SimpleDialogMeta(l10n('reserve_confirm_title'), l10n('reserve_confirm_message'), I18nConfirmDialogButtons()), partial(checkReserveVehicle, self.vehCD))