Jump to content
Korean Random
Sign in to follow this  
nmdelrio

Need help: battleLabelsTemplates.xc

Recommended Posts

I want an image to appear as the battle starts. But I want it to disappear after I make a kill. I have the following code in battleLabelsTemplates.xc but the image does not appear at start of battle at all.

 

"toggleJtext": {
        "enabled": true,
        "updateEvent": "ON_VEHICLE_DESTROYED",
        "hotKeyCode": null,
        "onHold": false,
        "x": 230,
        "y": 0,
        "width": 330,
        "height": 54,
        "alpha": 100,
        "rotation": "",
        "scaleX": "",
        "scaleY": "",
        "autoSize": "center",
        "align": "left",
        "valign": "bottom",
        "antiAliasType": "advanced",
        "bgColor": null,
        "borderColor": null,
        "shadow": {},
        "currentFieldDefaultStyle": {},
        "format": "{{my-frags=0?<img src='cfg://default/m2k/toggleJtext.png' width='330' height='54'>|}}"
  },

 

 

Without the {{my-frags}}, the image appears, but will of course does not disappear after I make a kill.

 

  "format": "<img src='cfg://default/m2k/toggleJtext.png' width='330' height='54'>"

 

 

 

This is my battleLabels.xc

 

{
     "labels": {
         // Referenced labels. Note, that every custom field can be separate enabled or disabled by "enabled" switch in their settings
        "formats": [
         ${ "battleLabelsTemplates.xc":"def.winChance" },
        ${ "battleLabelsTemplates.xc":"def.toggleJtext" }
  
        ]
    }
}

 

 

What am I do wrong with {{my-frags}}?

 

Any help will be appreciated.

Share this post


Link to post

Short link
Share on other sites

{{my-frags}} returns no value when frag count is 0.

Do it this way "format": "{{my-frags?|<img src='cfg://default/m2k/toggleJtext.png' width='330' height='54'>}}"

  • Upvote 2

Share this post


Link to post

Short link
Share on other sites

{{my-frags}} returns no value when frag count is 0.

Do it this way "format": "{{my-frags?|<img src='cfg://default/m2k/toggleJtext.png' width='330' height='54'>}}"

 

It works! You are a very clever and generous person, thank you!  :ic:  Been whacking myself on the head for the past 24 hours for this problem.

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

No problem ;)

But I'm curious what I should compare this macro to, to make it work the way you tried at first. I tried '', null, 'null' and few others but none worked either. I wonder if it's possible at all.

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