Ejemplo n.º 1
0
 def __addArenaExtraData(self, arenaDP):
     arena = getClientArena()
     if arena:
         extraData = arena.extraData or {}
         descExtra = getPrebattleFullDescription(extraData)
         arenaTypeID = getArenaTypeID()
         arenaSubType = getArenaSubTypeName(arenaTypeID)
         team = arenaDP.getNumberOfTeam()
         enemy = arenaDP.getNumberOfTeam(True)
         hasBase = isBaseExists(arenaTypeID, team)
         opponents = extraData.get('opponents', {})
         team1 = opponents.get(str(team), {}).get('name', '#menu:loading/team1')
         team2 = opponents.get(str(enemy), {}).get('name', '#menu:loading/team2')
         self.as_setTeamsS(team1, team2)
         if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES:
             self.as_setWinTextS(i18n.makeString('#arenas:type/fallout/description'))
         else:
             self.as_setWinTextS(getBattleSubTypeWinText(arenaTypeID, 1 if hasBase else 2))
         if descExtra:
             self.as_setBattleTypeNameS(descExtra)
             self.as_setBattleTypeFrameNumS(arena.guiType + 1)
         elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]:
             self.as_setBattleTypeNameS('#arenas:type/%s/name' % arenaSubType)
             self.as_setBattleTypeFrameNameS(getNecessaryArenaFrameName(arenaSubType, hasBase))
             if arena.guiType == constants.ARENA_GUI_TYPE.TRAINING and self.__logArenaUniID == False:
                 self.__logArenaUniID = True
                 from time import strftime, localtime
                 from debug_utils import LOG_NOTE
                 LOG_NOTE('arenaUniqueID: %d | timestamp: %s' % (arena.arenaUniqueID, strftime('%d.%m.%Y %H:%M:%S', localtime())))
         else:
             self.as_setBattleTypeNameS('#menu:loading/battleTypes/%d' % arena.guiType)
             if arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS:
                 self.as_setBattleTypeFrameNameS(constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType])
             else:
                 self.as_setBattleTypeFrameNumS(arena.guiType + 1)
Ejemplo n.º 2
0
 def __populateData(self, isMutlipleTeams = False):
     arena = avatar_getter.getArena()
     arenaDP = g_sessionProvider.getArenaDP()
     arenaData = ['',
      0,
      '',
      '',
      '']
     if arena:
         arenaData = [toUpper(arena.arenaType.name)]
         descExtra = getPrebattleFullDescription(arena.extraData or {})
         arenaSubType = getArenaSubTypeName(BigWorld.player().arenaTypeID)
         if descExtra:
             arenaData.extend([arena.guiType + 1, descExtra])
         elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]:
             arenaTypeName = '#arenas:type/%s/name' % arenaSubType
             arenaData.extend([getNecessaryArenaFrameName(arenaSubType, isBaseExists(BigWorld.player().arenaTypeID, BigWorld.player().team)), arenaTypeName])
         elif arena.guiType in constants.ARENA_GUI_TYPE.RANGE:
             arenaData.append(constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType])
             if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints():
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_RESOURCEPOINTS_UPPER))
             elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and isMutlipleTeams:
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_MIX_UPPER))
             else:
                 arenaData.append('#menu:loading/battleTypes/%d' % arena.guiType)
         else:
             arenaData.extend([arena.guiType + 1, '#menu:loading/battleTypes/%d' % arena.guiType])
         myTeamNumber = arenaDP.getNumberOfTeam()
         getTeamName = g_sessionProvider.getCtx().getTeamName
         arenaData.extend([getTeamName(myTeamNumber), getTeamName(arenaDP.getNumberOfTeam(enemy=True))])
         teamHasBase = 1 if isBaseExists(BigWorld.player().arenaTypeID, myTeamNumber) else 2
         if not isEventBattle():
             typeEvent = 'normal'
             winText = getBattleSubTypeWinText(BigWorld.player().arenaTypeID, teamHasBase)
         else:
             typeEvent = 'fallout'
             if getIsMultiteam():
                 winText = i18n.makeString(ARENAS.TYPE_FALLOUTMUTLITEAM_DESCRIPTION)
             else:
                 winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType)
         arenaData.append(winText)
         arenaData.append(typeEvent)
         vehInfo = arenaDP.getVehicleInfo(arenaDP.getPlayerVehicleID())
         pqTipData = [None] * 3
         pQuests = vehInfo.player.getPotapovQuests()
         serverSettings = g_lobbyContext.getServerSettings()
         isPQEnabled = serverSettings is not None and serverSettings.isPotapovQuestEnabled()
         if isPQEnabled and (arena.guiType == constants.ARENA_GUI_TYPE.RANDOM or arena.guiType == constants.ARENA_GUI_TYPE.TRAINING and constants.IS_DEVELOPMENT):
             if len(pQuests):
                 quest = pQuests[0]
                 pqTipData = [quest.getUserName(), quest.getUserMainCondition(), quest.getUserAddCondition()]
             else:
                 pqTipData = [i18n.makeString('#ingame_gui:potapovQuests/tip'), None, None]
         arenaData.extend(pqTipData)
         arenaData.extend([getArenaIcon(_SMALL_MAP_SOURCE)])
     self.__callEx('arenaData', arenaData)
     return
Ejemplo n.º 3
0
 def __populateData(self, isMutlipleTeams = False):
     arena = avatar_getter.getArena()
     arenaDP = g_sessionProvider.getArenaDP()
     arenaData = ['',
      0,
      '',
      '',
      '']
     if arena:
         arenaData = [toUpper(arena.arenaType.name)]
         descExtra = getPrebattleFullDescription(arena.extraData or {})
         arenaSubType = getArenaSubTypeName(BigWorld.player().arenaTypeID)
         if descExtra:
             arenaData.extend([arena.guiType + 1, descExtra])
         elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]:
             arenaTypeName = '#arenas:type/%s/name' % arenaSubType
             arenaData.extend([getNecessaryArenaFrameName(arenaSubType, isBaseExists(BigWorld.player().arenaTypeID, BigWorld.player().team)), arenaTypeName])
         elif arena.guiType in constants.ARENA_GUI_TYPE.RANGE:
             arenaData.append(constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType])
             if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints():
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_RESOURCEPOINTS_UPPER))
             elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and isMutlipleTeams:
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_MIX_UPPER))
             else:
                 arenaData.append('#menu:loading/battleTypes/%d' % arena.guiType)
         else:
             arenaData.extend([arena.guiType + 1, '#menu:loading/battleTypes/%d' % arena.guiType])
         myTeamNumber = arenaDP.getNumberOfTeam()
         getTeamName = g_sessionProvider.getCtx().getTeamName
         arenaData.extend([getTeamName(myTeamNumber), getTeamName(arenaDP.getNumberOfTeam(enemy=True))])
         teamHasBase = 1 if isBaseExists(BigWorld.player().arenaTypeID, myTeamNumber) else 2
         if not isEventBattle():
             typeEvent = 'normal'
             winText = getBattleSubTypeWinText(BigWorld.player().arenaTypeID, teamHasBase)
         else:
             typeEvent = 'fallout'
             if getIsMultiteam():
                 winText = i18n.makeString(ARENAS.TYPE_FALLOUTMUTLITEAM_DESCRIPTION)
             else:
                 winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType)
         arenaData.append(winText)
         arenaData.append(typeEvent)
         vehInfo = arenaDP.getVehicleInfo(arenaDP.getPlayerVehicleID())
         pqTipData = [None] * 3
         pQuests = vehInfo.player.getPotapovQuests()
         serverSettings = g_lobbyContext.getServerSettings()
         isPQEnabled = serverSettings is not None and serverSettings.isPotapovQuestEnabled()
         if isPQEnabled and (arena.guiType == constants.ARENA_GUI_TYPE.RANDOM or arena.guiType == constants.ARENA_GUI_TYPE.TRAINING and constants.IS_DEVELOPMENT):
             if len(pQuests):
                 quest = pQuests[0]
                 pqTipData = [quest.getUserName(), quest.getUserMainCondition(), quest.getUserAddCondition()]
             else:
                 pqTipData = [i18n.makeString('#ingame_gui:potapovQuests/tip'), None, None]
         arenaData.extend(pqTipData)
         arenaData.extend([getArenaIcon(_SMALL_MAP_SOURCE)])
     self.__callEx('arenaData', arenaData)
Ejemplo n.º 4
0
 def _addArenaExtraData(self, arenaDP):
     arena = getClientArena()
     if arena:
         arenaType = arena.arenaType
         extraData = arena.extraData or {}
         descExtra = getPrebattleFullDescription(extraData)
         arenaTypeID = getArenaTypeID()
         arenaSubType = getArenaSubTypeName(arenaTypeID)
         team = arenaDP.getNumberOfTeam()
         enemy = arenaDP.getNumberOfTeam(True)
         hasBase = isBaseExists(arenaTypeID, team)
         allyTeamName, enemyTeamName = self._battleCtx.getTeamName(
             team), self._battleCtx.getTeamName(enemy)
         if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES:
             winText = i18n.makeString('#arenas:type/%s/description' %
                                       arenaSubType)
         else:
             winText = getBattleSubTypeWinText(arenaTypeID,
                                               1 if hasBase else 2)
         if descExtra:
             battleTypeLocaleStr = descExtra
             if arena.guiType != constants.ARENA_GUI_TYPE.UNKNOWN and arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS:
                 battleTypeFrameLabel = constants.ARENA_GUI_TYPE_LABEL.LABELS[
                     arena.guiType]
             else:
                 battleTypeFrameLabel = 'neutral'
         elif arena.guiType in [
                 constants.ARENA_GUI_TYPE.RANDOM,
                 constants.ARENA_GUI_TYPE.TRAINING
         ]:
             battleTypeLocaleStr = '#arenas:type/%s/name' % arenaSubType
             battleTypeFrameLabel = getNecessaryArenaFrameName(
                 arenaSubType, hasBase)
         elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints(
         ):
             battleTypeFrameLabel = 'resourcePoints'
             battleTypeLocaleStr = MENU.LOADING_BATTLETYPES_RESOURCEPOINTS
         else:
             battleTypeLocaleStr = '#menu:loading/battleTypes/%d' % arena.guiType
             if arena.guiType != constants.ARENA_GUI_TYPE.UNKNOWN and arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS:
                 battleTypeFrameLabel = constants.ARENA_GUI_TYPE_LABEL.LABELS[
                     arena.guiType]
             else:
                 battleTypeFrameLabel = 'neutral'
         arenaInfoData = {
             'mapName': arenaType.name,
             'winText': winText,
             'battleTypeLocaleStr': battleTypeLocaleStr,
             'battleTypeFrameLabel': battleTypeFrameLabel,
             'allyTeamName': allyTeamName,
             'enemyTeamName': enemyTeamName
         }
         self._setArenaInfo(arenaInfoData)
Ejemplo n.º 5
0
 def __populateData(self, isMutlipleTeams = False):
     arena = avatar_getter.getArena()
     arenaDP = g_sessionProvider.getArenaDP()
     arenaData = ['',
      0,
      '',
      '',
      '']
     if arena:
         arenaData = [toUpper(arena.arenaType.name)]
         descExtra = getPrebattleFullDescription(arena.extraData or {})
         arenaSubType = getArenaSubTypeName(BigWorld.player().arenaTypeID)
         if descExtra:
             arenaData.extend([arena.guiType + 1, descExtra])
         elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]:
             arenaTypeName = '#arenas:type/%s/name' % arenaSubType
             arenaData.extend([getNecessaryArenaFrameName(arenaSubType, isBaseExists(BigWorld.player().arenaTypeID, BigWorld.player().team)), arenaTypeName])
         elif arena.guiType in constants.ARENA_GUI_TYPE.RANGE:
             arenaData.append(constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType])
             if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints():
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_RESOURCEPOINTS_UPPER))
             elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and isMutlipleTeams:
                 arenaData.append(i18n.makeString(MENU.LOADING_BATTLETYPES_MIX_UPPER))
             else:
                 arenaData.append('#menu:loading/battleTypes/%d' % arena.guiType)
         else:
             arenaData.extend([arena.guiType + 1, '#menu:loading/battleTypes/%d' % arena.guiType])
         myTeamNumber = arenaDP.getNumberOfTeam()
         getTeamName = g_sessionProvider.getCtx().getTeamName
         arenaData.extend([getTeamName(myTeamNumber), getTeamName(arenaDP.getNumberOfTeam(enemy=True))])
         teamHasBase = 1 if isBaseExists(BigWorld.player().arenaTypeID, myTeamNumber) else 2
         if not isEventBattle():
             typeEvent = 'normal'
             winText = getBattleSubTypeWinText(BigWorld.player().arenaTypeID, teamHasBase)
         else:
             typeEvent = 'fallout'
             if getIsMultiteam():
                 winText = i18n.makeString(ARENAS.TYPE_FALLOUTMUTLITEAM_DESCRIPTION)
             else:
                 winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType)
         arenaData.append(winText)
         arenaData.append(typeEvent)
         arenaData.extend(_getQuestsTipData(arena, arenaDP))
         arenaData.extend([getArenaIcon(_SMALL_MAP_SOURCE)])
     self.__callEx('arenaData', arenaData)
Ejemplo n.º 6
0
 def _addArenaExtraData(self, arenaDP):
     arena = getClientArena()
     if arena:
         arenaType = arena.arenaType
         extraData = arena.extraData or {}
         descExtra = getPrebattleFullDescription(extraData)
         arenaTypeID = getArenaTypeID()
         arenaSubType = getArenaSubTypeName(arenaTypeID)
         team = arenaDP.getNumberOfTeam()
         enemy = arenaDP.getNumberOfTeam(True)
         hasBase = isBaseExists(arenaTypeID, team)
         allyTeamName, enemyTeamName = self._battleCtx.getTeamName(team), self._battleCtx.getTeamName(enemy)
         if arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES:
             winText = i18n.makeString('#arenas:type/%s/description' % arenaSubType)
         else:
             winText = getBattleSubTypeWinText(arenaTypeID, 1 if hasBase else 2)
         if descExtra:
             battleTypeLocaleStr = descExtra
             if arena.guiType != constants.ARENA_GUI_TYPE.UNKNOWN and arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS:
                 battleTypeFrameLabel = constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType]
             else:
                 battleTypeFrameLabel = 'neutral'
         elif arena.guiType in [constants.ARENA_GUI_TYPE.RANDOM, constants.ARENA_GUI_TYPE.TRAINING]:
             battleTypeLocaleStr = '#arenas:type/%s/name' % arenaSubType
             battleTypeFrameLabel = getNecessaryArenaFrameName(arenaSubType, hasBase)
         elif arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES and hasResourcePoints():
             battleTypeFrameLabel = 'resourcePoints'
             battleTypeLocaleStr = MENU.LOADING_BATTLETYPES_RESOURCEPOINTS
         else:
             battleTypeLocaleStr = '#menu:loading/battleTypes/%d' % arena.guiType
             if arena.guiType != constants.ARENA_GUI_TYPE.UNKNOWN and arena.guiType in constants.ARENA_GUI_TYPE_LABEL.LABELS:
                 battleTypeFrameLabel = constants.ARENA_GUI_TYPE_LABEL.LABELS[arena.guiType]
             else:
                 battleTypeFrameLabel = 'neutral'
         arenaInfoData = {'mapName': arenaType.name,
          'winText': winText,
          'battleTypeLocaleStr': battleTypeLocaleStr,
          'battleTypeFrameLabel': battleTypeFrameLabel,
          'allyTeamName': allyTeamName,
          'enemyTeamName': enemyTeamName}
         self._setArenaInfo(arenaInfoData)
Ejemplo n.º 7
0
 def getFrameLabel(self):
     return getNecessaryArenaFrameName(
         functions.getArenaSubTypeName(self._visitor.type.getID()),
         self.isBaseExists())
Ejemplo n.º 8
0
 def getFrameLabel(self):
     return getNecessaryArenaFrameName(functions.getArenaSubTypeName(self._visitor.type.getID()), self.isBaseExists())
Ejemplo n.º 9
0
 def getFrameLabel(self):
     return getNecessaryArenaFrameName(functions.getArenaSubTypeName(self._arena.arenaType.id), self.isBaseExists())