コード例 #1
0
 def __showSettings(self, functional):
     settings = functional.getSettings()
     if settings is None:
         return
     else:
         isCreator = functional.isCreator()
         permissions = functional.getPermissions()
         arenaTypeID = settings['arenaTypeID']
         arenaType = ArenaType.g_cache.get(arenaTypeID)
         if isCreator:
             comment = settings['comment']
         else:
             comment = passCensor(settings['comment'])
         self.as_setInfoS({'isCreator': isCreator,
          'creator': settings[PREBATTLE_SETTING_NAME.CREATOR],
          'title': formatters.getTrainingRoomTitle(arenaType),
          'arenaName': arenaType.name,
          'arenaTypeID': arenaTypeID,
          'arenaSubType': formatters.getArenaSubTypeString(arenaTypeID),
          'description': arenaType.description,
          'maxPlayersCount': arenaType.maxPlayersInTeam * 2,
          'roundLenString': formatters.getRoundLenString(settings['roundLength']),
          'comment': comment,
          'arenaVoipChannels': settings[PREBATTLE_SETTING_NAME.ARENA_VOIP_CHANNELS],
          'canChangeArenaVOIP': permissions.canChangeArenaVOIP()})
         return
コード例 #2
0
 def __showSettings(self, entity):
     settings = entity.getSettings()
     if settings is None:
         return
     else:
         isCreator = entity.isCommander()
         permissions = entity.getPermissions()
         arenaTypeID = settings['arenaTypeID']
         arenaType = ArenaType.g_cache.get(arenaTypeID)
         if isCreator:
             comment = settings['comment']
         else:
             comment = passCensor(settings['comment'])
         creatorFullName, creatorClan, creatorRegion, creatorIgrType = (
             None, None, None, 0)
         creator = self.__getCreatorFromRosters()
         if creator:
             creatorFullName = creator.getFullName()
             creatorClan = creator.clanAbbrev
             creatorRegion = self.lobbyContext.getRegionCode(creator.dbID)
             creatorIgrType = creator.igrType
         self.as_setInfoS({
             'isCreator':
             isCreator,
             'creator':
             settings[PREBATTLE_SETTING_NAME.CREATOR],
             'creatorFullName':
             creatorFullName,
             'creatorClan':
             creatorClan,
             'creatorRegion':
             creatorRegion,
             'creatorIgrType':
             creatorIgrType,
             'title':
             formatters.getTrainingRoomTitle(arenaType),
             'arenaName':
             arenaType.name,
             'arenaTypeID':
             arenaTypeID,
             'arenaSubType':
             formatters.getArenaSubTypeString(arenaTypeID),
             'description':
             arenaType.description,
             'maxPlayersCount':
             arenaType.maxPlayersInTeam * 2,
             'roundLenString':
             formatters.getRoundLenString(settings['roundLength']),
             'comment':
             comment,
             'arenaVoipChannels':
             settings[PREBATTLE_SETTING_NAME.ARENA_VOIP_CHANNELS],
             'canChangeArenaVOIP':
             permissions.canChangeArenaVOIP(),
             'isObserverModeEnabled':
             self.__isObserverModeEnabled()
         })
         return
コード例 #3
0
ファイル: trainingroom.py プロジェクト: wotmods/WOTDecompiled
 def onSettingUpdated(self, functional, settingName, settingValue):
     if settingName == PREBATTLE_SETTING_NAME.ARENA_TYPE_ID:
         arenaType = ArenaType.g_cache.get(settingValue)
         self.as_updateMapS(settingValue, arenaType.maxPlayersInTeam * 2, arenaType.name, formatters.getTrainingRoomTitle(arenaType), formatters.getArenaSubTypeString(settingValue), arenaType.description)
     elif settingName == PREBATTLE_SETTING_NAME.ROUND_LENGTH:
         self.as_updateTimeoutS(formatters.getRoundLenString(settingValue))
     elif settingName == PREBATTLE_SETTING_NAME.COMMENT:
         self.as_updateCommentS(settingValue)
     elif settingName == PREBATTLE_SETTING_NAME.ARENA_VOIP_CHANNELS:
         self.as_setArenaVoipChannelsS(settingValue)
     self.__updateStartButton(functional)
コード例 #4
0
 def onSettingUpdated(self, functional, settingName, settingValue):
     if settingName == PREBATTLE_SETTING_NAME.ARENA_TYPE_ID:
         arenaType = ArenaType.g_cache.get(settingValue)
         self.as_updateMapS(settingValue, arenaType.maxPlayersInTeam * 2, arenaType.name, formatters.getTrainingRoomTitle(arenaType), formatters.getArenaSubTypeString(settingValue), arenaType.description)
     elif settingName == PREBATTLE_SETTING_NAME.ROUND_LENGTH:
         self.as_updateTimeoutS(formatters.getRoundLenString(settingValue))
     elif settingName == PREBATTLE_SETTING_NAME.COMMENT:
         self.as_updateCommentS(settingValue)
     elif settingName == PREBATTLE_SETTING_NAME.ARENA_VOIP_CHANNELS:
         self.as_setArenaVoipChannelsS(settingValue)
     self.__updateStartButton(functional)
コード例 #5
0
 def onSettingUpdated(self, entity, settingName, settingValue):
     if settingName in (PREBATTLE_SETTING_NAME.ARENA_TYPE_ID, PREBATTLE_SETTING_NAME.LIMITS):
         if settingName == PREBATTLE_SETTING_NAME.ARENA_TYPE_ID:
             arenaTypeID = settingValue
         else:
             arenaTypeID = entity.getSettings()[PREBATTLE_SETTING_NAME.ARENA_TYPE_ID]
         arenaType = ArenaType.g_cache.get(arenaTypeID)
         self.as_updateMapS(arenaTypeID, entity.getTeamLimits()['maxCount'][0] * 2, arenaType.name, formatters.getTrainingRoomTitle(arenaType), formatters.getArenaSubTypeString(arenaTypeID), arenaType.description)
     elif settingName == PREBATTLE_SETTING_NAME.ROUND_LENGTH:
         self.as_updateTimeoutS(formatters.getRoundLenString(settingValue))
     elif settingName == PREBATTLE_SETTING_NAME.COMMENT:
         self.as_updateCommentS(settingValue)
     elif settingName == PREBATTLE_SETTING_NAME.ARENA_VOIP_CHANNELS:
         self.as_setArenaVoipChannelsS(settingValue)
     self.__updateStartButton(entity)
コード例 #6
0
ファイル: trainingroom.py プロジェクト: kblw/wot_client
 def __showSettings(self, functional):
     settings = functional.getSettings()
     if settings is None:
         return
     isCreator = functional.isCreator()
     permissions = functional.getPermissions()
     arenaTypeID = settings["arenaTypeID"]
     arenaType = ArenaType.g_cache.get(arenaTypeID)
     if isCreator:
         comment = settings["comment"]
     else:
         comment = passCensor(settings["comment"])
     creatorFullName, creatorClan, creatorRegion, creatorIgrType = (None, None, None, 0)
     creator = self.__getCreatorFromRosters()
     if creator:
         creatorFullName = creator.getFullName()
         creatorClan = creator.clanAbbrev
         creatorRegion = g_lobbyContext.getRegionCode(creator.dbID)
         creatorIgrType = creator.igrType
     self.as_setInfoS(
         {
             "isCreator": isCreator,
             "creator": settings[PREBATTLE_SETTING_NAME.CREATOR],
             "creatorFullName": creatorFullName,
             "creatorClan": creatorClan,
             "creatorRegion": creatorRegion,
             "creatorIgrType": creatorIgrType,
             "title": formatters.getTrainingRoomTitle(arenaType),
             "arenaName": arenaType.name,
             "arenaTypeID": arenaTypeID,
             "arenaSubType": formatters.getArenaSubTypeString(arenaTypeID),
             "description": arenaType.description,
             "maxPlayersCount": arenaType.maxPlayersInTeam * 2,
             "roundLenString": formatters.getRoundLenString(settings["roundLength"]),
             "comment": comment,
             "arenaVoipChannels": settings[PREBATTLE_SETTING_NAME.ARENA_VOIP_CHANNELS],
             "canChangeArenaVOIP": permissions.canChangeArenaVOIP(),
             "isObserverModeEnabled": self.__isObserverModeEnabled(),
         }
     )
コード例 #7
0
ファイル: trainingroom.py プロジェクト: webiumsk/WOT-0.9.15.1
 def __showSettings(self, functional):
     settings = functional.getSettings()
     if settings is None:
         return
     else:
         isCreator = functional.isCreator()
         permissions = functional.getPermissions()
         arenaTypeID = settings['arenaTypeID']
         arenaType = ArenaType.g_cache.get(arenaTypeID)
         if isCreator:
             comment = settings['comment']
         else:
             comment = passCensor(settings['comment'])
         creatorFullName, creatorClan, creatorRegion, creatorIgrType = (None, None, None, 0)
         creator = self.__getCreatorFromRosters()
         if creator:
             creatorFullName = creator.getFullName()
             creatorClan = creator.clanAbbrev
             creatorRegion = g_lobbyContext.getRegionCode(creator.dbID)
             creatorIgrType = creator.igrType
         self.as_setInfoS({'isCreator': isCreator,
          'creator': settings[PREBATTLE_SETTING_NAME.CREATOR],
          'creatorFullName': creatorFullName,
          'creatorClan': creatorClan,
          'creatorRegion': creatorRegion,
          'creatorIgrType': creatorIgrType,
          'title': formatters.getTrainingRoomTitle(arenaType),
          'arenaName': arenaType.name,
          'arenaTypeID': arenaTypeID,
          'arenaSubType': formatters.getArenaSubTypeString(arenaTypeID),
          'description': arenaType.description,
          'maxPlayersCount': arenaType.maxPlayersInTeam * 2,
          'roundLenString': formatters.getRoundLenString(settings['roundLength']),
          'comment': comment,
          'arenaVoipChannels': settings[PREBATTLE_SETTING_NAME.ARENA_VOIP_CHANNELS],
          'canChangeArenaVOIP': permissions.canChangeArenaVOIP(),
          'isObserverModeEnabled': self.__isObserverModeEnabled()})
         return