Jump to content
Korean Random
Sign in to follow this  
Kaeptn

xvm.total_hp.mainGun issue.

Recommended Posts

i have an issue with this macro: {{py: xvm.total_hp.mainGun ('', {{hitlog.dmg-total}})% 'i}}

 

if you achieve high caliber value, it will display a negative value:

shot_007.jpg.e6f9aae31e54c2128816dc1ea4e1d7df.jpg

 

do not know if this is some sort of bug, but i would like to show some text instead of it. any ideas?

Share this post


Link to post

Short link
Share on other sites

Может быть так:

{{py:xvm.total_hp.mainGun('', {{hitlog.dmg-total}})%'d}}

 

Edited by ktulho

Share this post


Link to post

Short link
Share on other sites

http://wotreplays.eu/site/4320838?secret=a0a200cab87bdc82b11a547d334cfa04

 

 

complete macro:

    "efficiency": {
      "enabled": true,
      "updateEvent": "PY(ON_BATTLE_EFFICIENCY), PY(ON_UPDATE_HP)",
      "x": 540,
      "y": 54,
      "width": 247,
      "height": 60,
      "screenHAlign": "center",  
      "visibleOnHotKey": true,
      "shadow": { "enabled": true, "distance": 0, "angle": 0, "color": "0x000000", "alpha": 50, "blur": 9, "strength": 2 },
      "textFormat": { "font": "$FieldFont", "size": 13, "color": "0xF0F0F0", "valign": "center" },    
      "format": "<textformat leading='2' tabstops='[70, 95]'>{{battletype?|Großkaliber<tab><img src='cfg://pe3pa/res/mainGun.png' vspace='-3'><tab><font face='$TitleFont'>{{py:xvm.total_hp.mainGun(' ',{{hitlog.dmg-total}})%'s}}</font><br>Ø Schaden<tab><img src='cfg://pe3pa/res/average.png' vspace='-2'><tab><font face='$TitleFont' color='{{py:efficiencyDIFFAvgDmgColor({{tdb}})}}'>{{py:efficiencyDIFFAvgDmg({{tdb}})%'i|0}}</font><br>Erwartet<tab><img src='cfg://pe3pa/res/expected.png' vspace='-2'><tab><font face='$TitleFont' color='{{py:efficiencyDIFFExpDmgColor}}'>{{py:efficiencyDIFFExpDmg%'i}}</font>}}</textformat>" 
    },

 

Edited by Kaeptn

Share this post


Link to post

Short link
Share on other sites

@Kaeptn дело в том что, макрос {{py:xvm.total_hp.mainGun(' ',{{hitlog.dmg-total}})}} возвращает строку, а вы пытаетесь его форматировать, как целое число:

Цитата

" ' " for thousands separator (only for integer numbers)

 

Share this post


Link to post

Short link
Share on other sites

thousand seperator is needed to match the rest of the default UI. is there a way arround this?

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...