Jump to content
Korean Random
Heliomalt

How to add {{friend}} and {{ignored}} in PlayersPanel

Recommended Posts

Has someone a working config example for this two macos?

Does this mean that an icon is displayed or the name is colored?

Thanks for your help

Share this post


Link to post

Short link
Share on other sites

@Heliomalt 
Personally i never used {{friend}}, {{ignored}}, {{muted}} or {{chatban}}.
Not sure if return is 1|0, yes|no or just friend|nothing.
But my guess is they all work similar to {{ally}} & {{squad}}

So In "theory" you should be able to do: :huh:
-as color

<font color='{{friend?#yes|#no}}'>{{name}},{{vehicle}}....

-as image

<img src='cfg:default//icons/{{friend?ImageName}}.png'>

-something else

<font alpha='{{ignored?0|100}}'>{{name}}</font>
{{ignored?IGNORED|{{name}}}}

Also not sure if you will be able to preview it on replays or must be on live game.
Not all macros work on replays. :wink:

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites
1 hour ago, Ress said:

Not sure if return is 1|0, yes|no or just friend|nothing.

friend|nothing

The macros should work in replays too. At least {{ingored}} does.

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Can you please post your solution/code for the ignored. Tried different ways, can't get it working. Thank you.

Edited by Heliomalt

Share this post


Link to post

Short link
Share on other sites

@Heliomalt

 
{{ignored?IGNORED|{{friend?FRIEND|}}}}
{{ignored?#ignored_color|{{friend?#friend_color|#otherwise_color}}}}
{{ignored?ImageName|{{friend?ImageName|}}}}

Yesterday in game tested all 4 ({{friend}}{{ignored}}{{muted}}{{chatban}}), blocked someone random and shows as ignored and muted.

Share this post


Link to post

Short link
Share on other sites

hello,
i´m new to xvm editing and have a question related to the markers:

if i want a friendmarker on my playerspanel, do i have to enter it somewhere in this rows?
 

      "nickFormatLeft": "<font face='mono' size='{{xvm-stat?13|0}}' color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{r}}</font> {{name%.15s~..}}<font alpha='#A0'>{{clan}}</font>",
      "nickFormatRight": "<font alpha='#A0'>{{clan}}</font>{{name%.15s~..}} <font face='mono' size='{{xvm-stat?13|0}}' color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{r}}</font>",

and paste something like this:
 

<font color='{{friend?#AAAAAA|#BBBBBB}}>{{nick}}</font>

or this:
 

{{friend?<img src='cfg://xxx/xxx/friend.png'>}}



i would be very greatful if someone can help me out and may provide me a working sample!
thx in advance

Edited by elektrosmoker

Share this post


Link to post

Short link
Share on other sites

@elektrosmoker 
Well if you only wanna colorize name and not clan tag use {{friend}} color on {{name}}, also if you only wanna colorize IF FRIEND then add only first color {{friend?#AAAAAA}}.

<font color='{{friend?#AAAAAA|}}'>{{{name%.15s~..}}</font>

But if you wanna use {{nick}} macro no point having {{clan}} part:

"nickFormatLeft": "<font face='mono' size='{{xvm-stat?13|0}}' color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{r}}</font> <font color='{{friend?#AAAAAA|}}'>{{{nick}}</font>",

 

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

thank you for your quick answer!
as i said, i´m new in xvm, coding isnt my profession ;)
but i will try that out!


and if i want to add a picture for that instead of colorizing the name,
will that following do the trick?

"{{friend?<img src='cfg://res_mods/mods/shared_resources/xvm/res/clanicons/EU/friend.png'>|<img src='cfg://res_mods/mods/shared_resources/xvm/res/clanicons/EU/nofriend.png'>}}"

if added to (e.g.) this lines (showing only vehicle name right now)
 

      "vehicleFormatLeft": "<font color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{vehicle}}</font>",
      "vehicleFormatRight": "<font color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{vehicle}}</font>",

or did i just mess it all up?
edited:
 

      "vehicleFormatLeft": "{{friend?<img src='cfg://res_mods/mods/shared_resources/xvm/res/clanicons/EU/friend.png'>|<img src='cfg://res_mods/mods/shared_resources/xvm/res/clanicons/EU/nofriend.png'>}}<font color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{vehicle}}</font>",
      "vehicleFormatRight": "<font color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{vehicle}}</font>{{friend?<img src='cfg://res_mods/mods/shared_resources/xvm/res/clanicons/EU/friend.png'>|<img src='cfg://res_mods/mods/shared_resources/xvm/res/clanicons/EU/nofriend.png'>}}",


i also tried this one:
 

     "vehicleFormatLeft": "<img src='cfg:default//icons/{{friend?friend}}.png'><font color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{vehicle}}</font>",
      "vehicleFormatRight": "<font color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{vehicle}}</font><img src='cfg:default//icons/{{friend?friend}}.png'>",



what i want to do is only adding the friend/nofriend picture to the config, not changing anything else if possible.
this is my players panel, but i cant get the changes to work playersPanel.xc
if possible, can you give me another hint please?

Edited by elektrosmoker

Share this post


Link to post

Short link
Share on other sites
"vehicleFormatLeft": "{{friend?<img src='cfg://res_mods/mods/shared_resources/xvm/res/clanicons/EU/friend.png'>

First of, that is kinda strange path to look for image, you are calling for image from inside config folder "res_mods"? :huh:


If you have image inside config folder use:

<img src='cfg://config_folder/whatever_folder/imagename.png'>

if you have image inside xvm resources(res) folder use:

<img src='xvm://res/whatever_folder/imagename.png'>

or if you wanna use image from game files (example:res/packages/gui) use:

<img src='img://gui/maps/icons/whatever_folder/imagename.png'>

Simple way create/find 2 png images name them friend.png and nofriend.png create icons folder inside your config folder (default for example)
and add this to vehicle formats:

<img src='cfg://default/icons/{{friend?friend|nofriend}}.png'>

It should work in game, on replays don't think so.
Make sure to double check naming, image path, and macros. Missing  { " ' , <  or space are common errors.
Also if needed after .png' you can add width='XX' height='XX' vspace='XX'> (sometimes image have to be shift up/down using vspace to align with text or you might not see text at all)

EDIT: You can still test images width, height, vspace on replays by using different macro, for example {{alive}}
Once you are done fine tuning image replace alive with friend :wink:

<img src='cfg://default/icons/{{alive?friend|nofriend}}.png' width='24' height='24' vspace='-12'>

 

Edited by Ress
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

wow, thats a service!
i´m impressed again of the quick reactions to my post and about this very good "manual"!

just in case nobody else does  - BIG THX !!

 

i will trial and error it out to get it to work, thanks again!

 

 

 

Share this post


Link to post

Short link
Share on other sites

This is my solution in the playersPanel.xc

 

add this in the def section (I don't use an icon for nofriend)

    // Friend icon.
    "friend": {
      "enabled": true,
      //"hotKeyCode": 56, "onHold": "true", "visibleOnHotKey": true,
      "x": 70, "y": 5, "width": 12, "height": 18, "align": "center", "alpha": 100, "bindToIcon": false,
      "src": "xvm://res/icons/friend/{{friend?friend}}.png"
    },
    // Ignored icon.
    "ignored": {
      "enabled": true,
      //"hotKeyCode": 56, "onHold": "true", "visibleOnHotKey": true,
      "x": 70, "y": 5, "width": 14, "height": 14, "align": "center", "alpha": 100, "bindToIcon": false,
      "src": "img://gui/maps/icons/library/{{ignored?marker_blocked}}.png"
    }

this in the extraFields Left and Right in each panel, if you like it, I use it only at the large panel

 

${"def.friend"},
${"def.ignored"}

Hope this help you.

 

Edit:

I have this little problem, if a player is on my ignore list, I see also the standard icon from WG. How to remove/resolve this problem?

shot_108.jpg.6524094c1cf057e2d43c436b991870f7.jpg

shot_109.jpg

Edited by Heliomalt

Share this post


Link to post

Short link
Share on other sites

another big thx goes out to heliomalt! ;)

 
I just got one problem:

before i wanted to make a patchfile that implements the code into playerspanel.xc, i tested it by doing it manually.
after starting wot, it seems that the backup/standard-xvm-config was loaded - my whole config was gone.
 

this happened to me sometimes when i saved a configfile with wrong character encoding (ansi/utf), or false textformatting,

but i can exclude both ( #1 checked that, #2 the code is yours ;) )

... and it also happens when i want to create any new entry in the def-section. 
 

 

you may have a clue what i´ve done wrong this time? 
if not - no problem! thx anyways for poviding the code!
 

Share this post


Link to post

Short link
Share on other sites

There's most likely some syntax error. You should see the info about the error during battle loading. You can also find that info in the xvm.log file. 

If you can't solve it by yourself, just attach your playersPanel.xc file. 

 

Share this post


Link to post

Short link
Share on other sites

@konrad509
found the error in xvm.log. there was a hidden \ufeff character that caused that (maybe forum copy/paste problem). 
now it works just fine!

 great, thank you again! all 3 of you!


 

Share this post


Link to post

Short link
Share on other sites

Yep copy/paste from post or inside spoiler can create hidden \ufeff characters.

You always wanna paste inside code and then check for red squares and delete them.
Otherwise you will have hard time running over config and finding each hidden character.

hint:You can simply copy from post (if not inside <Code>), start Reply and paste inside code and check for red squares.  :wink::wink:

Edited by Ress
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Well you need to use "<img src=' '>" when typing inside a "format":
but if you wanna use image as/inside extra field you don't need that part, only "src": " "
(You can look inside default carouselNormal.xc for example with extra field images)

I am little bit confused what you are exactly trying to do here...
But my guess is you do need "<img src=' '>" as well. (unless you are removing "format": part)
You are replacing/adding inside "format": , right?

ps.its already 01:05 here, my brain is slow, maybe i miss read your entire post, sorry in advance. :yawn:

EDIT: i better go night-night maybe someone awake can help...

Edited by Ress

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.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...