Beispiel #1
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
Beispiel #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
Beispiel #3
0
 def __setTipsInfo(self):
     showFalloutEventInfo = False
     arena = getClientArena()
     if arena is not None:
         showFalloutEventInfo = arena.guiType == constants.ARENA_GUI_TYPE.EVENT_BATTLES
     if showFalloutEventInfo:
         self.as_setEventInfoPanelDataS({'bgUrl': RES_ICONS.MAPS_ICONS_EVENTINFOPANEL_FALLOUTEVENT,
          'items': FalloutInfoPanelHelper.getHelpTextAsDicts(arena.arenaType)})
     elif self.__updateTipTI is None:
         battlesCount = DEFAULT_BATTLES_COUNT
         if g_lobbyContext.getBattlesCount() is not None:
             battlesCount = g_lobbyContext.getBattlesCount()
         arenaDP = self.__battleCtx.getArenaDP()
         vType, vLvl, nation = arenaDP.getVehicleInfo().getTypeInfo()
         self.__tipsGetter = tips.getTipsIterator(battlesCount, vType, nation, vLvl)
         if self.__tipsGetter is not None:
             self._updateTipsInfo()
             self.__updateTipTI = TimeInterval(NEW_TIP_DURATION, self, '_updateTipsInfo')
             self.__updateTipTI.start()
     return
Beispiel #4
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
Beispiel #5
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