예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 def _setTipsInfo(self):
     self.as_setEventInfoPanelDataS({
         'bgUrl':
         RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT,
         'items':
         getHelpTextAsDicts(self._arenaVisitor)
     })
예제 #4
0
 def _setTipsInfo(self):
     arenaDP = self._battleCtx.getArenaDP()
     if self._arenaVisitor.hasResourcePoints():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT
     elif self._arenaVisitor.hasFlags():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT
     else:
         bgUrl = ''
     if self._arenaVisitor.gui.isFalloutClassic():
         self.as_setEventInfoPanelDataS({
             'bgUrl':
             bgUrl,
             'items':
             getHelpTextAsDicts(self._arenaVisitor)
         })
         self.as_setVisualTipInfoS(self.__makeVisualTipVO(arenaDP))
     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(self._arenaVisitor)
         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, tip))
         self.__isTipInited = True
     return
예제 #5
0
 def _setTipsInfo(self):
     self.as_setEventInfoPanelDataS({
         'bgUrl':
         RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT,
         'items':
         getHelpTextAsDicts(getClientArena().arenaType)
     })
예제 #6
0
 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
예제 #7
0
 def _setTipsInfo(self):
     arenaDP = self._battleCtx.getArenaDP()
     if self._arenaVisitor.hasResourcePoints():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTRESOURCEPOINTSEVENT
     elif self._arenaVisitor.hasFlags():
         bgUrl = RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT
     else:
         bgUrl = ''
     self.as_setEventInfoPanelDataS({'bgUrl': bgUrl,
      'items': getHelpTextAsDicts(self._arenaVisitor)})
     self.as_setVisualTipInfoS(self.__makeVisualTipVO(arenaDP))
예제 #8
0
 def _setTipsInfo(self):
     self.as_setEventInfoPanelDataS({'bgUrl': RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT,
      'items': getHelpTextAsDicts(arena_info.getArenaType())})
예제 #9
0
파일: Statistics.py 프로젝트: IJOL/wotmods
 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
예제 #10
0
 def _setTipsInfo(self):
     self.as_setEventInfoPanelDataS({'bgUrl': RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTFLAGSEVENT,
      'items': getHelpTextAsDicts(self._arenaVisitor)})
예제 #11
0
    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