Jump to content
Korean Random
Sign in to follow this  
LastShot

Информационная Панель

Recommended Posts

Всем привет, подскажите как в "Информационную панель" добавить массу танка ?

подчеркну другие панели: где полная информация о противнеке мне не нужна, нравиться минималистичная, вот только хотелось бы массу танка добавить!

post-15456-0-51233400-1414654891_thumb.png

  • Upvote 1
  • Downvote 2

Share this post


Link to post

Short link
Share on other sites

Всем привет, подскажите как в "Информационную панель" добавить массу танка ?

подчеркну другие панели: где полная информация о противнеке мне не нужна, нравиться минималистичная, вот только хотелось бы массу танка добавить!

В файле InfoPanel.xml false заменить на true, часть кода под споллером : 

 

Файл находиться по пути:Games\World_of_Tanks\res_mods\0.9.3\gui\scaleform

 

<!-- Настройка массы своего танка -->

<playerWeight visible="false"> <!-- visible - видимость элемента, true/false - включено/выключено -->

 

<!-- Настройка массы танка цели -->

<targetWeight visible="false"> <!-- visible - видимость элемента, true/false - включено/выключено -->

Edited by Xotabych
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

А если взять максимальную и в файле .xml выключить ненужные параметры?

Share this post


Link to post

Short link
Share on other sites

Непонятно только, зачем этот вопрос в теме XVM создавать?

ну извините, я не знал что это к xvmУ не относиться!

В файле InfoPanel.xml false заменить на true, часть кода под споллером : 

 

Файл находиться по пути:Games\World_of_Tanks\res_mods\0.9.3\gui\scaleform

 

<!-- Настройка массы своего танка -->

<playerWeight visible="false"> <!-- visible - видимость элемента, true/false - включено/выключено -->

 

<!-- Настройка массы танка цели -->

<targetWeight visible="false"> <!-- visible - видимость элемента, true/false - включено/выключено -->

спасибо )

Edited by LastShot

Share this post


Link to post

Short link
Share on other sites

Всем привет, подскажите как в "Информационную панель" добавить массу танка ?

подчеркну другие панели: где полная информация о противнеке мне не нужна, нравиться минималистичная, вот только хотелось бы массу танка добавить!

Где такую взять, как у вас на скрине ?

  • Upvote 1
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

Где такую взять, как у вас на скрине ?

Пользуюсь Модам от "Протанки"

post-15456-0-92946000-1414661998_thumb.png

Edited by LastShot

Share this post


Link to post

Short link
Share on other sites

Вот кому пригодится подправил InfoPanel.xml.

Там косяк был с макросами, перепутаны были:

post-14141-0-87186000-1414662375_thumb.jpg
Edited by Xotabych

Share this post


Link to post

Short link
Share on other sites

Подскажите как сделать,чтоб при нажатии на Alt показывалась инфопанель,но с параметрами своего танка?

Share this post


Link to post

Short link
Share on other sites

Доброго дня!

 

Подскажите пожалуйста, где можно найти исходники этого или похожего модов?

 

Спасибо.

Share this post


Link to post

Short link
Share on other sites

Подскажите пожалуйста, где можно найти исходники этого или похожего модов?

 

'InfoPanel'

import BigWorld, GUI, Keys
import weakref
import CommandMapping
from Avatar import PlayerAvatar
from gui.Scaleform.Battle import Battle
from gui.shared.utils.TimeInterval import TimeInterval
from gui.Scaleform.Flash import Flash
from gui import DEPTH_OF_Aim

class InfoPanel(Flash):
    __UPDATE_INTERVAL = 0.03

    def __init__(self, parentUI):
        Flash.__init__(self, 'InfoPanel.swf')
        self.__timeInterval = None
        self.__isVisible = None
        self.component.wg_inputKeyMode = 1
        self.component.position.z = DEPTH_OF_Aim
        self.movie.backgroundAlpha = 0.0
        self.component.focus = False
        self.component.moveFocus = False
        self.component.heightMode = 'PIXEL'
        self.component.widthMode = 'PIXEL'
        self.flashSize = GUI.screenResolution()
        self.addExternalCallback('InfoPanel.targetEnable', self.targetEnableCallBack)
        return

    def start(self):
        global isIPVisible
        self.active(True)
        self.setup()
        self.__timeInterval = TimeInterval(self.__UPDATE_INTERVAL, self, 'update')
        self.__timeInterval.start()
        isIPVisible = True
        self.update()
        self.setVisible(True)

    def destroy(self):
        self.active(False)
        self.setVisible(False)
        self.__timeInterval.stop()

    def setVisible(self, isVisible):
        self.__isVisible = isVisible
        self.component.visible = self.__isVisible

    def setup(self):
        pass

    def update(self):
        if self.__isVisible != isIPVisible:
            self.setVisible(isIPVisible)
        if BigWorld.target() or BigWorld.isKeyDown(Keys.KEY_LALT):
            player = BigWorld.player()
            target = BigWorld.target()
            if not target:
                target = player.getVehicleAttached()
            showInfoPanel = self.showInfoPanel(player, target)
            if showInfoPanel:
                typeDescr = target.typeDescriptor
                vTypeDescr = player.vehicleTypeDescriptor
                vType = typeDescr.type.userString
                hullArmor = [typeDescr.hull['primaryArmor'][0], typeDescr.hull['primaryArmor'][1], typeDescr.hull['primaryArmor'][2]]
                turretArmor = [typeDescr.turret['primaryArmor'][0], typeDescr.turret['primaryArmor'][1], typeDescr.turret['primaryArmor'][2]]
                gunName = typeDescr.gun['shortUserString']
                gunReload = typeDescr.gun['reloadTime']
                visionRadius = typeDescr.turret['circularVisionRadius']
                iconName = typeDescr.name.replace(':', '-')
                pWeight = round(vTypeDescr._VehicleDescr__computeWeight()[0] / 1000)
                vWeight = round(typeDescr._VehicleDescr__computeWeight()[0] / 1000)
                shellDamage = [0, 0, 0]
                i = 0
                for element in typeDescr.gun['shots']:
                    shellDamage[i] = element['shell']['damage'][0]
                    i = i + 1

                shellPower = [0, 0, 0]
                j = 0
                for element in typeDescr.gun['shots']:
                    shellPower[j] = element['piercingPower'][0]
                    j = j + 1

                shellType = ['', '', '']
                k = 0
                for element in typeDescr.gun['shots']:
                    if element['shell']['kind'] == 'ARMOR_PIERCING':
                        shellType[k] = element['shell']['kind'].replace('ARMOR_PIERCING', 'AP')
                    elif element['shell']['kind'] == 'HIGH_EXPLOSIVE':
                        shellType[k] = element['shell']['kind'].replace('HIGH_EXPLOSIVE', 'HE')
                    elif element['shell']['kind'] == 'ARMOR_PIERCING_CR':
                        shellType[k] = element['shell']['kind'].replace('ARMOR_PIERCING_CR', 'CR')
                    else:
                        shellType[k] = element['shell']['kind'].replace('HOLLOW_CHARGE', 'HC')
                    k = k + 1

                self.flashCall('InfoPanelValue', [vType,
                 gunName,
                 gunReload,
                 visionRadius,
                 iconName,
                 hullArmor[0],
                 hullArmor[1],
                 hullArmor[2],
                 turretArmor[0],
                 turretArmor[1],
                 turretArmor[2],
                 shellDamage[0],
                 shellDamage[1],
                 shellDamage[2],
                 shellPower[0],
                 shellPower[1],
                 shellPower[2],
                 shellType[0],
                 shellType[1],
                 shellType[2],
                 pWeight,
                 vWeight])
        if BigWorld.player() is not None:
            if BigWorld.player().inputHandler.aim is not None:
                aimMode = BigWorld.player().inputHandler.aim.mode
                self.flashCall('AimMode', [aimMode])
        else:
            aimMode = None
        return

    def flashCall(self, funcName, args = None):
        self.call('InfoPanel.' + funcName, args)

    def targetEnableCallBack(self, cid, team, enemy, dead):
        self.isTeam = team
        self.isEnemy = enemy
        self.isDead = dead

    def showInfoPanel(self, player, target):
        if hasattr(target, 'publicInfo'):
            if player.team == target.publicInfo['team'] and self.isTeam == 'true' and target.health > 0:
                return True
            elif player.team is not target.publicInfo['team'] and self.isEnemy == 'true' and target.health > 0:
                return True
            elif target.health <= 0 and self.isDead == 'true':
                return True
            else:
                return False
        else:
            return False


saved_afterCreate = Battle.afterCreate

def new_afterCreate(self):
    saved_afterCreate(self)
    self.__InfoPanel = InfoPanel(weakref.proxy(self))
    self.__InfoPanel.start()


Battle.afterCreate = new_afterCreate
saved_beforeDelete = Battle.beforeDelete

def new_beforeDelete(self):
    saved_beforeDelete(self)
    self.__InfoPanel.destroy()


Battle.beforeDelete = new_beforeDelete
saved_handleKey = PlayerAvatar.handleKey

def new_handleKey(self, isDown, key, mods):
    global isIPVisible
    cmdMap = CommandMapping.g_instance
    if cmdMap.isFired(CommandMapping.CMD_TOGGLE_GUI, key) and isDown:
        isIPVisible = not isIPVisible
    return saved_handleKey(self, isDown, key, mods)


PlayerAvatar.handleKey = new_handleKey
print '[LOAD_MOD]:  mod_InfoPanel'

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

У меня появилась идея сделать для разминки аналогичную панель для WOWS, но что-то там и .pkg не открывается раром и скрипт мой, лежащий в res_mods, по-моему, игнорится :)

Я вот подумал, может там вообще закрыто все для такого рода модов и я зря мучаюсь? :)

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...