def _createVehicleMarker(self, isAlly, mProv): markerLinkage = 'VehicleMarkerAlly' if isAlly else 'VehicleMarkerEnemy' if arena_info.hasFlags(): markerID = self.__ownUI.addFalloutMarker(mProv, markerLinkage) else: markerID = self.__ownUI.addMarker(mProv, markerLinkage) return markerID
def _setTipsInfo(self): arena = arena_info.getClientArena() arenaDP = self._battleCtx.getArenaDP() if arena_info.hasResourcePoints(): bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT elif arena_info.hasFlags(): bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT else: bgUrl = '' if self.__isFallout: self.as_setEventInfoPanelDataS({'bgUrl': bgUrl, 'items': getHelpTextAsDicts(arena_info.getArenaType())}) self.as_setVisualTipInfoS(self.__makeVisualTipVO(arenaDP, arena)) elif not self.__isTipInited: battlesCount = DEFAULT_BATTLES_COUNT if g_lobbyContext.getBattlesCount() is not None: battlesCount = g_lobbyContext.getBattlesCount() classTag, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo() criteria = tips.getTipsCriteria(arena) criteria.setBattleCount(battlesCount) criteria.setClassTag(classTag) criteria.setLevel(vLvl) criteria.setNation(nation) tip = criteria.find() self.as_setTipTitleS(text_styles.highTitle(tip.status)) self.as_setTipS(text_styles.playerOnline(tip.body)) self.as_setVisualTipInfoS(self.__makeVisualTipVO(arenaDP, arena, tip)) self.__isTipInited = True return
def __init__(self, appNS): self.__ns = appNS self.__soundManager = None self.__arena = BigWorld.player().arena self.__plugins = PluginsCollection(self) plugins = {} if hasFlags(): plugins['flagNotification'] = FlagNotificationPlugin if hasRespawns() and not BattleReplay.g_replayCtrl.isPlaying: plugins['respawnView'] = RespawnViewPlugin if hasResourcePoints(): plugins['resources'] = ResourcePointsPlugin self.__plugins.addPlugins(plugins) BattleWindow.__init__(self, 'battle.swf') self.__isHelpWindowShown = False self.__cameraMode = None self.component.wg_inputKeyMode = 1 self.component.position.z = DEPTH_OF_Battle self.movie.backgroundAlpha = 0 self.addFsCallbacks({'battle.leave': self.onExitBattle}) self.addExternalCallbacks({'battle.showCursor': self.cursorVisibility, 'battle.tryLeaveRequest': self.tryLeaveRequest, 'battle.populateFragCorrelationBar': self.populateFragCorrelationBar, 'Battle.UsersRoster.Appeal': self.onDenunciationReceived, 'Battle.selectPlayer': self.selectPlayer, 'battle.helpDialogOpenStatus': self.helpDialogOpenStatus, 'battle.initLobbyDialog': self._initLobbyDialog, 'battle.reportBug': self.reportBug}) self.__dynSquadListener = None BigWorld.wg_setRedefineKeysMode(False) self.onPostmortemVehicleChanged(BigWorld.player().playerVehicleID) return
def _setTipsInfo(self): arena = getClientArena() isFallout = arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES arenaDP = self._battleCtx.getArenaDP() if hasResourcePoints(): bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT elif hasFlags(): bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT else: bgUrl = '' if isFallout: self.as_setEventInfoPanelDataS({'bgUrl': bgUrl, 'items': getHelpTextAsDicts(arena.arenaType)}) elif not self.__isTipInited: battlesCount = DEFAULT_BATTLES_COUNT if g_lobbyContext.getBattlesCount() is not None: battlesCount = g_lobbyContext.getBattlesCount() vType, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo() tipsIterator = tips.getTipsIterator(arena.guiType, battlesCount, vType, nation, vLvl) statusStr, tipStr = ('', '') if tipsIterator is not None: statusStr, tipStr = next(tipsIterator) else: LOG_ERROR('No required tips found') self.as_setTipTitleS(text_styles.highTitle(statusStr)) self.as_setTipS(text_styles.playerOnline(tipStr)) self.__isTipInited = True return
def __init__(self, appNS): self.__ns = appNS self.__soundManager = None self.__arena = BigWorld.player().arena self.__plugins = PluginsCollection(self) plugins = {} if hasFlags(): plugins['flagNotification'] = FlagNotificationPlugin if hasRespawns() and not BattleReplay.g_replayCtrl.isPlaying: plugins['respawnView'] = RespawnViewPlugin if hasResourcePoints(): plugins['resources'] = ResourcePointsPlugin self.__plugins.addPlugins(plugins) BattleWindow.__init__(self, 'battle.swf') self.__isHelpWindowShown = False self.__cameraMode = None self.component.wg_inputKeyMode = 1 self.component.position.z = DEPTH_OF_Battle self.movie.backgroundAlpha = 0 self.addFsCallbacks({'battle.leave': self.onExitBattle}) self.addExternalCallbacks({'battle.showCursor': self.cursorVisibility, 'battle.tryLeaveRequest': self.tryLeaveRequest, 'battle.populateFragCorrelationBar': self.populateFragCorrelationBar, 'Battle.UsersRoster.Appeal': self.onDenunciationReceived, 'Battle.selectPlayer': self.selectPlayer, 'battle.helpDialogOpenStatus': self.helpDialogOpenStatus, 'battle.initLobbyDialog': self._initLobbyDialog, 'battle.reportBug': self.reportBug}) self.__dynSquadListener = None BigWorld.wg_setRedefineKeysMode(False) self.onPostmortemVehicleChanged(BigWorld.player().playerVehicleID)
def _setTipsInfo(self): arena = getClientArena() isFallout = arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES arenaDP = self._battleCtx.getArenaDP() if hasResourcePoints(): bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT elif hasFlags(): bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT else: bgUrl = '' if isFallout: self.as_setEventInfoPanelDataS({ 'bgUrl': bgUrl, 'items': getHelpTextAsDicts(arena.arenaType) }) elif not self.__isTipInited: battlesCount = DEFAULT_BATTLES_COUNT if g_lobbyContext.getBattlesCount() is not None: battlesCount = g_lobbyContext.getBattlesCount() vType, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo() tipsIterator = tips.getTipsIterator(arena.guiType, battlesCount, vType, nation, vLvl) statusStr, tipStr = ('', '') if tipsIterator is not None: statusStr, tipStr = next(tipsIterator) else: LOG_ERROR('No required tips found') self.as_setTipTitleS(text_styles.highTitle(statusStr)) self.as_setTipS(text_styles.playerOnline(tipStr)) self.__isTipInited = True
def __init__(self, appNS): g_sessionProvider.registerViewComponents(*_COMPONENTS_TO_CTRLS) self.__ns = appNS self.__soundManager = None self.__arena = BigWorld.player().arena self.__plugins = PluginsCollection(self) plugins = {} if hasFlags(): plugins['flagNotification'] = FlagNotificationPlugin if hasRepairPoints(): plugins['repairTimer'] = RepairTimerPlugin if hasRespawns() and (constants.IS_DEVELOPMENT or not BattleReplay.g_replayCtrl.isPlaying): plugins['respawnView'] = RespawnViewPlugin if hasResourcePoints(): plugins['resources'] = ResourcePointsPlugin if hasGasAttack(): plugins['gasAttack'] = GasAttackPlugin self.__plugins.addPlugins(plugins) self.__denunciator = BattleDenunciator() self.__timerSounds = {} for timer, sounds in self.VEHICLE_DEATHZONE_TIMER_SOUND.iteritems(): self.__timerSounds[timer] = {} for level, sound in sounds.iteritems(): self.__timerSounds[timer][level] = SoundGroups.g_instance.getSound2D(sound) self.__timerSound = None BattleWindow.__init__(self, 'battle.swf') self.__isHelpWindowShown = False self.__cameraMode = None self.component.wg_inputKeyMode = 1 self.component.position.z = DEPTH_OF_Battle self.movie.backgroundAlpha = 0 self.addFsCallbacks({'battle.leave': self.onExitBattle}) self.addExternalCallbacks({'battle.showCursor': self.cursorVisibility, 'battle.tryLeaveRequest': self.tryLeaveRequest, 'battle.populateFragCorrelationBar': self.populateFragCorrelationBar, 'Battle.UsersRoster.Appeal': self.onDenunciationReceived, 'Battle.selectPlayer': self.selectPlayer, 'battle.helpDialogOpenStatus': self.helpDialogOpenStatus, 'battle.initLobbyDialog': self._initLobbyDialog, 'battle.reportBug': self.reportBug}) self.__dynSquadListener = None BigWorld.wg_setRedefineKeysMode(False) self.onPostmortemVehicleChanged(BigWorld.player().playerVehicleID) return
def __getHelpText(self): arena = BigWorld.player().arena arenaType = arena.arenaType isSolo = len(list(g_sessionProvider.getArenaDP().getVehiclesIterator())) == 1 plusStr = makeString(FALLOUT.INFOPANEL_SINGLEHELPTEXT_PLUS) isMultiteam = isFalloutMultiTeam() headerStr = makeHtmlString(_HTML_TEMPLATE_FALLOUT_INFO_KEY, 'header', makeString(FALLOUT.INFOPANEL_SECRETWIN_HEAD)) additionalBlockTemplate = makeHtmlString(_HTML_TEMPLATE_FALLOUT_INFO_KEY, 'winPoints') costKill, costFlags, costDamage = getCosts(arenaType, isSolo, True) helpStr = '' if hasFlags(arenaType, arena.bonusType) and len(costFlags) > 0: costFlags = list(costFlags)[0] helpStr = self.__getAdditionalBlockStr(additionalBlockTemplate, FALLOUT.INFOPANEL_SINGLEHELPTEXT_WINPOINTS_FLAGCAPTURE, warning(plusStr + str(costFlags))) if isMultiteam and isSolo: helpStr = self.__getAdditionalBlockStr(additionalBlockTemplate, FALLOUT.INFOPANEL_SINGLEHELPTEXT_WINPOINTS_FLAGDESTROY, warning(plusStr + str(costFlags))) helpStr += self.__getAdditionalBlockStr(additionalBlockTemplate, FALLOUT.INFOPANEL_SINGLEHELPTEXT_WINPOINTS_KILL, warning(plusStr + str(costKill))) damageDealt, points = costDamage points = warning(plusStr + str(points)) helpStr += additionalBlockTemplate % makeString(FALLOUT.INFOPANEL_SINGLEHELPTEXT_WINPOINTS_DAMAGE, points=points, damageDealt=damageDealt) return headerStr + helpStr
def __init__(self, parentUI): Flash.__init__(self, _MARKERS_MANAGER_SWF) self.component.wg_inputKeyMode = 2 self.component.position.z = DEPTH_OF_VehicleMarker self.component.drawWithRestrictedViewPort = False self.movie.backgroundAlpha = 0 self.colorManager = ColorSchemeManager._ColorSchemeManager() self.colorManager.populateUI(weakref.proxy(self)) self.__plugins = PluginsCollection(self) plugins = {'equipments': _EquipmentsMarkerPlugin} if arena_info.hasFlags(): plugins['flags'] = _FlagsMarkerPlugin if arena_info.hasRepairPoints(): plugins['repairs'] = _RepairsMarkerPlugin if arena_info.hasResourcePoints(): plugins['resources'] = _ResourceMarkerPlugin self.__plugins.addPlugins(plugins) self.__ownUI = None self.__parentUI = parentUI self.__markers = {}
def new_setTipsInfo(self): DEFAULT_BATTLES_COUNT = 100 arena = getClientArena() isFallout = arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES arenaDP = self._battleCtx.getArenaDP() if hasResourcePoints(): bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT elif hasFlags(): bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT else: bgUrl = '' if isFallout: self.as_setEventInfoPanelDataS({'bgUrl': bgUrl, 'items': getHelpTextAsDicts(arena.arenaType)}) if not self._BattleLoading__isTipInited: battlesCount = DEFAULT_BATTLES_COUNT if g_lobbyContext.getBattlesCount() is not None: battlesCount = g_lobbyContext.getBattlesCount() vType, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo() tipsIterator = tips.getTipsIterator(arena.guiType, battlesCount, vType, nation, vLvl) statusStr, tipStr = ('', '') if tipsIterator is not None: statusStr, tipStr = next(tipsIterator) else: LOG_ERROR('No required tips found') self.as_setTipTitleS(text_styles.highTitle(statusStr)) #------win chance---- content = text_styles.playerOnline(tipStr) if Statistics.myConf['win_chance_enable'] and Statistics.okCw(): win_chance = Statistics.getWinChance() if win_chance: arenaTypeID = getArenaTypeID() colour = '#ff0000' if win_chance < 49: colour = '#ff0000' elif win_chance >= 49 and win_chance <= 51: colour = '#ffff00' elif win_chance > 51: colour = '#00ff00' formatz = {'win_chance':win_chance,'color':colour} content += Statistics.myConf['win_chance_text'].format(**formatz) self.as_setTipS(content) #--------------------- #----- table ---------- if Statistics.myConf['table_enable'] and Statistics.okCw(): x, y = GUI.screenResolution() Statistics.table = BattleLoadingBarTable(Statistics.myConf['table_texture']) Statistics.table.setWidthMode('PIXEL') Statistics.table.setHeightMode('PIXEL') Statistics.table.setVerticalPositionMode('PIXEL') Statistics.table.setHorizontalPositionMode('PIXEL') Statistics.table.setHorizontalAnchor('LEFT') Statistics.table.setVerticalAnchor('TOP') Statistics.table.setWidth(Statistics.myConf['table_width'])#400 Statistics.table.setHeight(Statistics.myConf['table_height'])#5 Statistics.table.setPosition(eval(Statistics.myConf['table_position'])) Statistics.table.setMaterialFx(Statistics.myConf['table_materialFX']) Statistics.table.setColor(eval(Statistics.myConf['table_color'])) Statistics.table.setVisible(True) Statistics.table.add() config = {} config['texture'] = Statistics.myConf['table_bars_texture'] config['width'] = Statistics.myConf['table_bars_width'] config['height'] = Statistics.myConf['table_bars_height'] config['position'] = eval(Statistics.myConf['table_bars_position']) config['delta'] = Statistics.myConf['table_bars_delta'] config['font'] = Statistics.myConf['table_bars_font'] config['materialFX'] = Statistics.myConf['table_bars_materialFX'] config['color'] = (eval(Statistics.myConf['table_bars_color'][0]),eval(Statistics.myConf['table_bars_color'][1])) config[VEHICLE_CLASS_NAME.LIGHT_TANK] = Statistics.myConf[VEHICLE_CLASS_NAME.LIGHT_TANK] config[VEHICLE_CLASS_NAME.MEDIUM_TANK] = Statistics.myConf[VEHICLE_CLASS_NAME.MEDIUM_TANK] config[VEHICLE_CLASS_NAME.HEAVY_TANK] = Statistics.myConf[VEHICLE_CLASS_NAME.HEAVY_TANK] config[VEHICLE_CLASS_NAME.SPG] = Statistics.myConf[VEHICLE_CLASS_NAME.SPG] config[VEHICLE_CLASS_NAME.AT_SPG] = Statistics.myConf[VEHICLE_CLASS_NAME.AT_SPG] config['table_bars_label'] = Statistics.myConf['table_bars_label'] config['table_bars_odd_pos'] = Statistics.myConf['table_bars_label_pos'] config['show_label'] = Statistics.myConf['table_bars_tankType_show'] config['show_perc'] = Statistics.myConf['table_bars_label_show'] config['align'] = Statistics.myConf['table_bars_align'] Statistics.table.addBars(config) #--------------------- self._BattleLoading__isTipInited = True return
def new_setTipsInfo(self): DEFAULT_BATTLES_COUNT = 100 arena = getClientArena() isFallout = arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES arenaDP = self._battleCtx.getArenaDP() if hasResourcePoints(): bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT elif hasFlags(): bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT else: bgUrl = '' if isFallout: self.as_setEventInfoPanelDataS({ 'bgUrl': bgUrl, 'items': getHelpTextAsDicts(arena.arenaType) }) if not self._BattleLoading__isTipInited: battlesCount = DEFAULT_BATTLES_COUNT if g_lobbyContext.getBattlesCount() is not None: battlesCount = g_lobbyContext.getBattlesCount() vType, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo() tipsIterator = tips.getTipsIterator(arena.guiType, battlesCount, vType, nation, vLvl) statusStr, tipStr = ('', '') if tipsIterator is not None: statusStr, tipStr = next(tipsIterator) else: LOG_ERROR('No required tips found') self.as_setTipTitleS(text_styles.highTitle(statusStr)) #------win chance---- content = text_styles.playerOnline(tipStr) if Statistics.myConf['win_chance_enable'] and Statistics.okCw(): win_chance = Statistics.getWinChance() if win_chance: arenaTypeID = getArenaTypeID() colour = '#ff0000' if win_chance < 49: colour = '#ff0000' elif win_chance >= 49 and win_chance <= 51: colour = '#ffff00' elif win_chance > 51: colour = '#00ff00' formatz = {'win_chance': win_chance, 'color': colour} content += Statistics.myConf['win_chance_text'].format( **formatz) self.as_setTipS(content) #--------------------- #----- table ---------- if Statistics.myConf['table_enable'] and Statistics.okCw(): x, y = GUI.screenResolution() Statistics.table = BattleLoadingBarTable( Statistics.myConf['table_texture']) Statistics.table.setWidthMode('PIXEL') Statistics.table.setHeightMode('PIXEL') Statistics.table.setVerticalPositionMode('PIXEL') Statistics.table.setHorizontalPositionMode('PIXEL') Statistics.table.setHorizontalAnchor('LEFT') Statistics.table.setVerticalAnchor('TOP') Statistics.table.setWidth( Statistics.myConf['table_width']) #400 Statistics.table.setHeight( Statistics.myConf['table_height']) #5 Statistics.table.setPosition( eval(Statistics.myConf['table_position'])) Statistics.table.setMaterialFx( Statistics.myConf['table_materialFX']) Statistics.table.setColor( eval(Statistics.myConf['table_color'])) Statistics.table.setVisible(True) Statistics.table.add() config = {} config['texture'] = Statistics.myConf['table_bars_texture'] config['width'] = Statistics.myConf['table_bars_width'] config['height'] = Statistics.myConf['table_bars_height'] config['position'] = eval( Statistics.myConf['table_bars_position']) config['delta'] = Statistics.myConf['table_bars_delta'] config['font'] = Statistics.myConf['table_bars_font'] config['materialFX'] = Statistics.myConf[ 'table_bars_materialFX'] config['color'] = ( eval(Statistics.myConf['table_bars_color'][0]), eval(Statistics.myConf['table_bars_color'][1])) config[VEHICLE_CLASS_NAME.LIGHT_TANK] = Statistics.myConf[ VEHICLE_CLASS_NAME.LIGHT_TANK] config[VEHICLE_CLASS_NAME.MEDIUM_TANK] = Statistics.myConf[ VEHICLE_CLASS_NAME.MEDIUM_TANK] config[VEHICLE_CLASS_NAME.HEAVY_TANK] = Statistics.myConf[ VEHICLE_CLASS_NAME.HEAVY_TANK] config[VEHICLE_CLASS_NAME.SPG] = Statistics.myConf[ VEHICLE_CLASS_NAME.SPG] config[VEHICLE_CLASS_NAME.AT_SPG] = Statistics.myConf[ VEHICLE_CLASS_NAME.AT_SPG] config['table_bars_label'] = Statistics.myConf[ 'table_bars_label'] config['table_bars_odd_pos'] = Statistics.myConf[ 'table_bars_label_pos'] config['show_label'] = Statistics.myConf[ 'table_bars_tankType_show'] config['show_perc'] = Statistics.myConf[ 'table_bars_label_show'] config['align'] = Statistics.myConf['table_bars_align'] Statistics.table.addBars(config) #--------------------- self._BattleLoading__isTipInited = True return