def onSearchComplete(self, result): if not len(result): SystemMessages.pushI18nMessage( MESSENGER.CLIENT_INFORMATION_EMPTYSEARCHRESULT_MESSAGE, type=SystemMessages.SM_TYPE.Warning ) self.buildList(result) self.refresh()
def _showMessage4Item(self, scope, msg, itemCD, msgType = SystemMessages.SM_TYPE.Error, **kwargs): itemTypeID, nationID, itemID = vehicles.parseIntCompactDescr(itemCD) raise itemTypeID != _VEHICLE or AssertionError key = scope('item', msg) kwargs.update({'typeString': getTypeInfoByIndex(itemTypeID)['userString'], 'userString': vehicles.getDictDescr(itemCD)['userString']}) SystemMessages.pushMessage(i18n.makeString(key, **kwargs), type=msgType)
def _setTeamReady(self, ctx, callback=None): if prb_getters.isParentControlActivated(): g_eventDispatcher.showParentControlNotification() if callback: callback(False) return isValid, notValidReason = self._limits.isTeamValid() def _requestResponse(code, errStr): msg = messages.getInvalidTeamServerMessage(errStr, functional=self) if msg is not None: SystemMessages.pushMessage(msg, type=SystemMessages.SM_TYPE.Error) ctx.onResponseReceived(code) return if isValid: ctx.startProcessing(callback) BigWorld.player().prb_teamReady(ctx.getTeam(), ctx.isForced(), ctx.getGamePlayMask(), _requestResponse) else: LOG_ERROR("Team is invalid", notValidReason) if callback: callback(False) SystemMessages.pushMessage( messages.getInvalidTeamMessage(notValidReason, functional=self), type=SystemMessages.SM_TYPE.Error )
def xfw_cmd(self, cmd, *args): try: if IS_DEVELOPMENT and cmd in _LOG_COMMANDS: debug('[XFW] xfw_cmd: {} {}'.format(cmd, args)) if cmd == COMMAND.XFW_COMMAND_LOG: if swf.g_xvmlogger is None: swf.g_xvmlogger = Logger(PATH.XVM_LOG_FILE_NAME) swf.g_xvmlogger.add(*args) elif cmd == COMMAND.XFW_COMMAND_INITIALIZED: swf.xfwInitialized = True elif cmd == COMMAND.XFW_COMMAND_SWF_LOADED: xfw_mods_info.swf_loaded(args[0]) g_eventBus.handleEvent(HasCtxEvent(XFWEVENT.SWF_LOADED, args[0])) elif cmd == COMMAND.XFW_COMMAND_GETMODS: return self.getMods() elif cmd == COMMAND.XFW_COMMAND_LOADFILE: return load_file(args[0]) elif cmd == XFWCOMMAND.XFW_COMMAND_GETGAMEREGION: return GAME_REGION elif cmd == XFWCOMMAND.XFW_COMMAND_GETGAMELANGUAGE: return GAME_LANGUAGE elif cmd == XFWCOMMAND.XFW_COMMAND_CALLBACK: e = swf._events.get(args[0], None) if e: e.fire({ "name": args[0], "type": args[1], "x": int(args[2]), "y": int(args[3]), "stageX": int(args[4]), "stageY": int(args[5]), "buttonIdx": int(args[6]), "delta": int(args[7]) }) elif cmd == XFWCOMMAND.XFW_COMMAND_MESSAGEBOX: # title, message DialogsInterface.showDialog(dialogs.SimpleDialogMeta( args[0], args[1], dialogs.I18nInfoDialogButtons('common/error')), (lambda x: None)) elif cmd == XFWCOMMAND.XFW_COMMAND_SYSMESSAGE: # message, type # Types: gui.SystemMessages.SM_TYPE: # 'Error', 'Warning', 'Information', 'GameGreeting', ... SystemMessages.pushMessage( args[0], type=SystemMessages.SM_TYPE.of(args[1])) else: handlers = g_eventBus._EventBus__scopes[EVENT_BUS_SCOPE.DEFAULT][XFWCOMMAND.XFW_CMD] for handler in handlers.copy(): try: (result, status) = handler(cmd, *args) if status: return result except TypeError: err(traceback.format_exc()) log('WARNING: unknown command: {}'.format(cmd)) except: err(traceback.format_exc())
def leave(self, ctx, callback=None): if ctx.getRequestType() != _RQ_TYPE.LEAVE: LOG_ERROR("Invalid context to leave prebattle/unit", ctx) if callback is not None: callback(False) return elif self.__requestCtx.isProcessing(): LOG_ERROR("Request is processing", self.__requestCtx) if callback is not None: callback(False) return else: ctrlType = ctx.getCtrlType() formation = self.__collection.getItem(ctx.getCtrlType()) if formation is not None: if formation.hasLockedState(): entityType = formation.getEntityType() SystemMessages.pushI18nMessage( messages.getLeaveDisabledMessage(ctrlType, entityType), type=SystemMessages.SM_TYPE.Warning ) if callback is not None: callback(False) return LOG_DEBUG("Request to leave formation", ctx) self.__requestCtx = ctx formation.leave(ctx, callback=callback) else: LOG_ERROR("Functional not found", ctx) if callback is not None: callback(False) return
def sendPassword(self, value): pwdRange = xrange(CHANNEL_PWD_MIN_LENGTH, CHANNEL_PWD_MAX_LENGTH + 1) if value is None or len(unicode_from_utf8(value)[0]) not in pwdRange: SystemMessages.pushI18nMessage(MESSENGER.DIALOGS_CREATECHANNEL_ERRORS_INVALIDPASSWORD_MESSAGE, CHANNEL_PWD_MIN_LENGTH, CHANNEL_PWD_MAX_LENGTH, type=SystemMessages.SM_TYPE.Error) else: self.proto.channels.joinToChannel(self._channel.getID(), password=value) self.destroy()
def __onIgrTypeChanged(self, roomType, xpFactor): icon = gui.makeHtmlString('html_templates:igr/iconSmall', 'premium') if roomType == constants.IGR_TYPE.PREMIUM: SystemMessages.pushMessage(i18n.makeString(SYSTEM_MESSAGES.IGR_CUSTOMIZATION_BEGIN, igrIcon=icon), type=SystemMessages.SM_TYPE.Information) elif roomType in [constants.IGR_TYPE.BASE, constants.IGR_TYPE.NONE] and self.__currIgrType == constants.IGR_TYPE.PREMIUM: SystemMessages.pushMessage(i18n.makeString(SYSTEM_MESSAGES.IGR_CUSTOMIZATION_END, igrIcon=icon), type=SystemMessages.SM_TYPE.Information) self.__currIgrType = roomType
def onKickedFromArena(self, *args): super(HistoricalQueueFunctional, self).onKickedFromQueue(*args) self.__requestCtx.stopProcessing(True) g_eventDispatcher.loadHangar() g_eventDispatcher.updateUI() SystemMessages.pushMessage(messages.getKickReasonMessage('timeout'), type=SystemMessages.SM_TYPE.Warning) self.__checkAvailability()
def assignPrivate(self): databaseID = self.databaseID result = yield self.clubsCtrl.sendRequest( AssignPrivateCtx(self.__clubDbID, databaseID, waitingID="clubs/assignPrivate") ) if result.isSuccess(): SystemMessages.pushMessage(club_fmts.getAssignPrivateSysMsg(self.getUserFullName(databaseID)))
def doAction(self, action): if not g_currentVehicle.isPresent(): SystemMessages.pushMessage(messages.getInvalidVehicleMessage(PREBATTLE_RESTRICTION.VEHICLE_NOT_PRESENT), type=SystemMessages.SM_TYPE.Error) return False LOG_DEBUG('Do prebattle action', action) actionName = action.actionName if actionName == PREBATTLE_ACTION_NAME.LEAVE_RANDOM_QUEUE: self.exitFromRandomQueue() result = True elif actionName == PREBATTLE_ACTION_NAME.PREBATTLE_LEAVE: self.__prbFunctional.doLeaveAction(self) result = True elif actionName == PREBATTLE_ACTION_NAME.UNIT_LEAVE: self.__unitFunctional.doLeaveAction(self) result = True elif actionName in self.OPEN_PRB_LIST_BY_ACTION: entry = functional.createPrbEntry(self.OPEN_PRB_LIST_BY_ACTION[actionName]) entry.doAction(action, dispatcher=self) result = True else: result = False for func in (self.__unitFunctional, self.__prbFunctional, self.__queueFunctional): if func.doAction(action=action, dispatcher=self): result = True break return result
def leave(self, ctx, callback = None): if ctx.getRequestType() is not REQUEST_TYPE.LEAVE: LOG_ERROR('Invalid context to leave prebattle/unit', ctx) if callback: callback(False) return elif self.__requestCtx.isProcessing(): LOG_ERROR('Request is processing', self.__requestCtx) if callback: callback(False) return else: ctrlType = ctx.getCtrlType() formation = self.__collection.getItem(ctx.getCtrlType()) if formation is not None: if formation.hasLockedState(): if ctrlType == CTRL_ENTITY_TYPE.PREQUEUE: entityType = formation.getQueueType() else: entityType = formation.getPrbType() SystemMessages.pushI18nMessage('#system_messages:{0}'.format(rally_dialog_meta.makeI18nKey(ctrlType, entityType, 'leaveDisabled')), type=SystemMessages.SM_TYPE.Warning) if callback: callback(False) return LOG_DEBUG('Request to leave formation', ctx) self.__requestCtx = ctx formation.leave(ctx, callback=callback) else: LOG_ERROR('Functional not found', ctx) if callback: callback(False) return
def setXvmContactData(self, uid, value): try: if self.cached_data is None or 'players' not in self.cached_data: raise Exception('[INTERNAL_ERROR]') if (value['nick'] is None or value['nick'] == '') and (value['comment'] is None or value['comment'] == ''): self.cached_data['players'].pop(str(uid), None) else: self.cached_data['players'][str(uid)] = value json_data = simplejson.dumps(self.cached_data) #log(json_data) self._doRequest('addComments', json_data) return True except Exception as ex: self.contacts_disabled = True self.is_available = False self.cached_token = None self.cached_data = None errstr = _SYSTEM_MESSAGE_TPL.replace('%VALUE%', '<b>{0}</b>\n\n{1}\n\n{2}'.format( l10n('Error saving comments'), str(ex), l10n('Comments disabled'))) SystemMessages.pushMessage(errstr, type=SystemMessages.SM_TYPE.Error) err(traceback.format_exc()) return False
def onKickedFromQueue(self): super(RandomQueueFunctional, self).onKickedFromQueue() self.__requestCtx.stopProcessing(True) g_prbCtrlEvents.onPreQueueFunctionalDestroyed() g_eventDispatcher.loadHangar() g_eventDispatcher.updateUI() SystemMessages.pushMessage(messages.getKickReasonMessage('timeout'), type=SystemMessages.SM_TYPE.Warning)
def start(self, clanCache): if self.isStarted(): LOG_WARNING('Fort provider already is ready') return else: self.__initial |= FORT_PROVIDER_INITIAL_FLAGS.STARTED self.__clan = weakref.proxy(clanCache) self.__listeners = _ClientFortListeners() self.__keeper = FortSubscriptionKeeper() self.__keeper.onAutoUnsubscribed += self.__onAutoUnsubscribed fortMgr = getClientFortMgr() if fortMgr: fortMgr.onFortResponseReceived += self.__onFortResponseReceived fortMgr.onFortUpdateReceived += self.__onFortUpdateReceived fortMgr.onFortStateChanged += self.__onFortStateChanged else: LOG_ERROR('Fort manager is not found') g_lobbyContext.getServerSettings().onServerSettingsChange += self.__onServerSettingChanged g_playerEvents.onCenterIsLongDisconnected += self.__onCenterIsLongDisconnected self.__controller = controls.createInitial() self.__controller.init(self.__clan, self.__listeners) states.create(self) if not g_lobbyContext.getServerSettings().isFortsEnabled() and self.__cachedState is not None: if self.__cachedState.getStateID() not in (CLIENT_FORT_STATE.UNSUBSCRIBED, CLIENT_FORT_STATE.DISABLED): SystemMessages.pushI18nMessage(I18N_SM.FORTIFICATION_NOTIFICATION_TURNEDOFF, type=SystemMessages.SM_TYPE.Warning) showFortDisabledDialog() return
def showMessage(self, text, lookupType = None): guiType = None if type is not None: guiType = SystemMessages.SM_TYPE.lookup(lookupType) if guiType is None: guiType = SystemMessages.SM_TYPE.Information SystemMessages.pushMessage(text, type=guiType)
def __ci_onCustomizationDropSuccess(self, message): self.as_onDropSuccessS() Waiting.hide('customizationDrop') self.__lockUpdate = False BigWorld.player().resyncDossiers() self.__refreshData() SystemMessages.pushMessage(message, type=SystemMessages.SM_TYPE.Information)
def removeMember(self, memberDbID, userName): member = self.clubsCtrl.getClub(self._clubDbID).getMember(memberDbID) if member.isOwner(): i18nId = 'staticFormation/staffView/discontinuingFormationConfirmation' elif self.__viewerDbID == memberDbID: i18nId = 'staticFormation/staffView/leaveClubConfirmation' else: i18nId = 'staticFormation/staffView/removeMemberConfirmation' isOk = yield DialogsInterface.showDialog(I18nConfirmDialogMeta(i18nId, messageCtx={'userName': userName})) if isOk: if member.isOwner(): ctx = DestroyClubCtx(self._clubDbID) waitingID = WAITING.CLUBS_DESTROYCLUB successSysMsg = club_fmts.getDestroyClubSysMsg(self.clubsCtrl.getClub(self._clubDbID)) elif self.__viewerDbID == memberDbID: ctx = LeaveClubCtx(self._clubDbID) waitingID = WAITING.CLUBS_LEAVECLUB successSysMsg = club_fmts.getLeaveClubSysMsg(self.clubsCtrl.getClub(self._clubDbID)) else: ctx = KickMemberCtx(self._clubDbID, memberDbID) waitingID = WAITING.CLUBS_CLUBKICKMEMBER successSysMsg = club_fmts.getKickMemberSysMsg(self.getUserFullName(memberDbID)) self.showWaiting(waitingID) result = yield self.clubsCtrl.sendRequest(ctx) if result.isSuccess(): SystemMessages.pushMessage(successSysMsg) self.hideWaiting()
def changeDivision(self, ctx, callback = None): if ctx.getRequestType() != REQUEST_TYPE.CHANGE_DIVISION: LOG_ERROR('Invalid context for request changeDivision', ctx) if callback: callback(False) return if not ctx.isDivisionChanged(self._settings): if callback: callback(False) return if isRequestInCoolDown(REQUEST_TYPE.CHANGE_SETTINGS): SystemMessages.pushMessage(messages.getRequestInCoolDownMessage(REQUEST_TYPE.CHANGE_SETTINGS), type=SystemMessages.SM_TYPE.Error) if callback: callback(False) return if ctx.getDivision() not in PREBATTLE_COMPANY_DIVISION.RANGE: LOG_ERROR('Division is invalid', ctx) if callback: callback(False) return if self.getTeamState().isInQueue(): LOG_ERROR('Team is ready or locked', ctx) if callback: callback(False) return pPermissions = self.getPermissions() if not pPermissions.canChangeDivision(): LOG_ERROR('Player can not change division', pPermissions) if callback: callback(False) return ctx.startProcessing(callback) BigWorld.player().prb_changeDivision(ctx.getDivision(), ctx.onResponseReceived) setRequestCoolDown(REQUEST_TYPE.CHANGE_SETTINGS)
def __handleCreateOrJoinFortBattle(self, peripheryID, battleID, slotIndex = -1): if g_lobbyContext.isAnotherPeriphery(peripheryID): if g_lobbyContext.isPeripheryAvailable(peripheryID): self.__requestToReloginAndCreateOrJoinFortBattle(peripheryID, battleID, slotIndex) else: SystemMessages.pushI18nMessage('#system_messages:periphery/errors/isNotAvailable', type=SystemMessages.SM_TYPE.Error) else: self.__requestToCreateOrJoinFortBattle(battleID, slotIndex)
def request4Buy(self, itemCD): itemCD = int(itemCD) if getTypeOfCompactDescr(itemCD) == GUI_ITEM_TYPE.VEHICLE: self.buyVehicle(itemCD) else: if RequestState.inProcess('buyAndInstall'): SystemMessages.pushI18nMessage('#system_messages:shop/item/buy_and_equip_in_processing', type=SystemMessages.SM_TYPE.Warning) self.buyAndInstallItem(itemCD, 'buyAndInstall')
def appeal(self, uid, userName, topic): topicID = self.DENUNCIATIONS.get(topic) if topicID is not None: BigWorld.player().makeDenunciation(uid, topicID, constants.VIOLATOR_KIND.UNKNOWN) topicStr = i18n.makeString(MENU.denunciation(topicID)) sysMsg = i18n.makeString(SYSTEM_MESSAGES.DENUNCIATION_SUCCESS) % {'name': userName, 'topic': topicStr} SystemMessages.pushMessage(sysMsg, type=SystemMessages.SM_TYPE.Information)
def _doExitAction(self, ctx, dialogMeta, waiting, sysMsg): isOk = yield DialogsInterface.showDialog(dialogMeta) if isOk: self.showWaiting(waiting) result = yield self.clubsCtrl.sendRequest(ctx) if result.isSuccess(): SystemMessages.pushMessage(sysMsg) self.hideWaiting()
def assignPrivate(self, memberDbID, userName): isOk = yield DialogsInterface.showDialog(I18nConfirmDialogMeta('staticFormation/staffView/demoteConfirmation', messageCtx={'userName': userName})) if isOk: self.showWaiting(WAITING.CLUBS_ASSIGNPRIVATE) results = yield self.clubsCtrl.sendRequest(AssignPrivateCtx(self._clubDbID, int(memberDbID))) if results.isSuccess(): SystemMessages.pushMessage(club_fmts.getAssignPrivateSysMsg(self.getUserFullName(int(memberDbID)))) self.hideWaiting()
def unitMgr_onUnitErrorReceived(self, requestID, unitMgrID, unitIdx, errorCode, errorString): if errorCode not in IGNORED_UNIT_MGR_ERRORS: msgType, msgBody = messages.getUnitMessage(errorCode, errorString) SystemMessages.pushMessage(msgBody, type=msgType) if errorCode in RETURN_INTRO_UNIT_MGR_ERRORS: self.__unitFunctional.setExit(FUNCTIONAL_EXIT.INTRO_UNIT) self.__requestCtx.stopProcessing(result=False) events_dispatcher.updateUI()
def new_onPlayerStateChanged(self, functional, roster, playerInfo): self._updateRallyData() self._setActionButtonState() filt = messenger.proto.bw.find_criteria.BWPrbChannelFindCriteria(1) chan = messenger.MessengerEntry.g_instance.storage.channels.getChannelByCriteria(filt) battle_controllers.SquadChannelController(chan.getID())._broadcast('test') from gui import SystemMessages SystemMessages.pushMessage("test")
def selectTask(self, questID): quest = g_eventsCache.potapov.getQuests()[questID] if quest.needToGetReward(): result = yield self.__getAward(quest) else: result = yield quests_proc.PotapovQuestSelect(quest).request() if result and len(result.userMsg): SystemMessages.pushMessage(result.userMsg, type=result.sysMsgType)
def userAddToClan(self): self.as_showWaitingS(WAITING.CLANS_INVITES_SEND, {}) profile = g_clanCtrl.getAccountProfile() context = CreateInviteCtx(profile.getClanDbID(), [self.__databaseID]) result = yield g_clanCtrl.sendRequest(context, allowDelay=True) if result.isSuccess(): SystemMessages.pushMessage(clans_fmts.getAppSentSysMsg(profile.getClanName(), profile.getClanAbbrev())) self.as_hideWaitingS()
def giveLeadership(self): clubDbID = self.__clubDbID databaseID = self.databaseID isOk = yield DialogsInterface.showDialog(I18nConfirmDialogMeta('staticFormation/staffView/transferOwnership')) if isOk: result = yield self.clubsCtrl.sendRequest(TransferOwnershipCtx(clubDbID, databaseID, waitingID='clubs/transferOwnership')) if result.isSuccess(): SystemMessages.pushMessage(club_fmts.getTransferOwnershipSysMsg(self.getUserFullName(databaseID)))
def sendRequest(self): self.as_setWaitingVisibleS(True) context = CreateApplicationCtx([self.__selectedClan.getClanDbID()]) result = yield g_clanCtrl.sendRequest(context, allowDelay=True) if result.isSuccess(): SystemMessages.pushMessage(clans_fmts.getAppSentSysMsg(self.__selectedClan.getClanName(), self.__selectedClan.getClanAbbrev())) self._updateSetaledState() self.as_setWaitingVisibleS(False)
def selectTask(self, questID): quest = events_helpers.getPotapovQuestsCache().getQuests()[questID] if quest.needToGetReward(): result = yield events_helpers.getPotapovQuestAward(quest) else: result = yield events_helpers.getPotapovQuestsSelectProcessor()(quest, events_helpers.getPotapovQuestsCache()).request() if result and len(result.userMsg): SystemMessages.pushMessage(result.userMsg, type=result.sysMsgType)
def pe_onPrebattleJoinFailure(self, errorCode): SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error) self.__setDefault() g_eventDispatcher.loadHangar()
def __me_onUserActionReceived(self, action, user, shadowMode): message = getUserActionReceivedMessage(action, user) if message and not shadowMode: SystemMessages.pushMessage(message)
def __processReturnCrew(self): result = yield TankmanReturn(g_currentVehicle.item).request() if result.userMsg: SystemMessages.pushI18nMessage(result.userMsg, type=result.sysMsgType)
def equipCrewSkin(self, crewSkinID): unloader = CrewSkinEquip(self.tmanInvID, crewSkinID) result = yield unloader.request() SystemMessages.pushMessages(result)
def __repair(self): vehicle = g_currentVehicle.item result = yield VehicleRepairer(vehicle).request() if result and result.userMsg: SystemMessages.pushI18nMessage(result.userMsg, type=result.sysMsgType)
def pe_onArenaJoinFailure(self, errorCode, errorStr): SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
def submit(self, count, currency): result = yield BoosterBuyer(self.__booster, count, currency).request() if result.userMsg: SystemMessages.pushI18nMessage(result.userMsg, type=result.sysMsgType)
def buySlots(): result = yield VehicleSlotBuyer().request() if result.userMsg: SystemMessages.pushI18nMessage(result.userMsg, type=result.sysMsgType)
def sellItem(self, item, count, vehicle=None): result = yield CustomizationsSeller(vehicle, item, count).request() if result.userMsg: SystemMessages.pushI18nMessage(result.userMsg, type=result.sysMsgType)
def addTankmanSkill(self, invengoryID, skillName): tankman = self.__getTankmanByInvID(int(invengoryID)) processor = TankmanAddSkill(tankman, skillName) result = yield processor.request() if result.userMsg: SystemMessages.pushI18nMessage(result.userMsg, type=result.sysMsgType)
def pe_onArenaJoinFailure(self, errorCode, _): self.__collection.reset() SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
def unequipCrewSkin(self): unloader = CrewSkinUnequip(self.tmanInvID) result = yield unloader.request() SystemMessages.pushMessages(result)
def pe_onKickedFromArena(self, reasonCode): self.__entity.resetPlayerState() SystemMessages.pushMessage(messages.getKickReasonMessage(reasonCode), type=SystemMessages.SM_TYPE.Error)
def _successHandler(self, code, ctx=None): messageType = MESSENGER.SERVICECHANNELMESSAGES_SYSMSG_CUSTOMIZATIONS_SELL SystemMessages.pushI18nMessage(messageType, type=SM_TYPE.Selling, **self._getMsgCtx()) return makeSuccess(auxData=ctx)
def _successHandler(self, code, ctx=None): currency = self.item.buyPrices.itemPrice.price.getCurrency(byWeight=True) messageType = MESSENGER.SERVICECHANNELMESSAGES_SYSMSG_CUSTOMIZATIONS_BUY sysMsgType = CURRENCY_TO_SM_TYPE.get(currency, SM_TYPE.PurchaseForGold) SystemMessages.pushI18nMessage(messageType, type=sysMsgType, **self._getMsgCtx()) return makeSuccess(auxData=ctx)
def onEnqueueError(self, errorCode, *args): self._requestCtx.stopProcessing(True) self._invokeListeners('onEnqueueError', self._queueType, *args) self._exitFromQueueUI() SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error)
def __handleScreenShotMade(self, event): if 'path' not in event.ctx: return SystemMessages.pushMessage( i18n.makeString('#menu:screenshot/save') % {'path': event.ctx['path']}, SystemMessages.SM_TYPE.Information)
def __me_onErrorReceived(self, error): if error.isModal(): DialogsInterface.showDialog(dialogs.SimpleDialogMeta(error.getTitle(), error.getMessage(), dialogs.I18nInfoDialogButtons('common/error')), lambda *args: None) else: SystemMessages.pushMessage(error.getMessage(), type=SystemMessages.SM_TYPE.Error)
def __activateBoosterRequest(self, booster): result = yield BoosterActivator(booster).request() if len(result.userMsg): SystemMessages.pushI18nMessage(result.userMsg, type=result.sysMsgType)
def pe_onKickedFromArena(self, reasonCode): self.__collection.reset() SystemMessages.pushMessage(messages.getKickReasonMessage(reasonCode), type=SystemMessages.SM_TYPE.Error)
def onUnitFlagsChanged(self, flags, timeLeft): if flags.isExternalLegionariesMatchingChanged() and not flags.isInExternalLegionariesMatching(): msgBody = backport.text(R.strings.system_messages.unit.warnings.EXTERNAL_LEGIONARIES_MATCHING_CANCELED()) SystemMessages.pushMessage(msgBody, type=SystemMessages.SM_TYPE.Warning) self.__initState()
def __me_onUserActionReceived(self, action, user): message = getUserActionReceivedMessage(action, user) if message: SystemMessages.pushMessage(message)
def _showError(result, ctx): i18nMsg = clan_formatters.getRequestErrorMsg(result, ctx) if i18nMsg: SystemMessages.pushMessage(i18nMsg, type=SystemMessages.SM_TYPE.Error)
def unitBrowser_onErrorReceived(self, errorCode, errorString): if errorCode not in IGNORED_UNIT_BROWSER_ERRORS: msgType, msgBody = messages.getUnitBrowserMessage( errorCode, errorString) SystemMessages.pushMessage(msgBody, type=msgType)
def unloadTankman(self): tankman = g_itemsCache.items.getTankman(self._tankmanID) result = yield TankmanUnload(g_currentVehicle.item, tankman.vehicleSlotIdx).request() if len(result.userMsg): SystemMessages.pushI18nMessage(result.userMsg, type=result.sysMsgType)
def _showRestrictedSysMessage(): SystemMessages.pushMessage(text=backport.text(R.strings.lootboxes.restrictedMessage.body()), type=SystemMessages.SM_TYPE.ErrorHeader, priority=NotificationPriorityLevel.HIGH, messageData={'header': backport.text(R.strings.lootboxes.restrictedMessage.header())})
def showError(self, value): SystemMessages.pushI18nMessage(value, type=SystemMessages.SM_TYPE.Error)
def _showSysMessage(self, msg): SystemMessages.pushMessage(msg, type=SystemMessages.SM_TYPE.Error)
def dismissTankman(self, tmanInvID): tankman = self.__getTankmanByInvID(int(tmanInvID)) proc = TankmanDismiss(tankman) result = yield proc.request() SystemMessages.pushMessages(result)
def pe_onPrebattleJoinFailure(self, errorCode): SystemMessages.pushMessage(messages.getJoinFailureMessage(errorCode), type=SystemMessages.SM_TYPE.Error) self.__requestCtx.stopProcessing(result=False) self.__requestCtx.clearFlags() g_eventDispatcher.updateUI()