Jump to content
Korean Random
Sign in to follow this  
locorebelde

Carousel in color

Recommended Posts

Hi, I want to know if it is possible to put different colors in the bottom of the boxes of the carousel according to the type of tank that is (eg blue for artys ..)

Share this post


Link to post

Short link
Share on other sites

Yes it is possible.

 

Method 1: Set 5 different lines (one color for each class) and determine which of the 5 is displayed by using "alpha" and the {{v.type}} macro.

 

Example I just tested in my carouselNormal.xc "extraFields":

 

     { "x": 1, "y": 57, "h": 27, "w": "133", "bgColor": "0x420000", "alpha": "{{v.type=SPG?{{v.selected?75|0}}|0}}" },

     { "x": 1, "y": 57, "h": 27, "w": "133", "bgColor": "0x000242", "alpha": "{{v.type=TD?{{v.selected?75|0}}|0}}" },

     ...

 

So SPG is dark red, TD is dark blue, etc. And I've also made the boxes display only when the particular tank is selected with {{v.selected}} macro.

 

Method 2: Contain everything within one line, with the conditions set within "bgColor" using the {{v.type}} macro.

 

Example (using only 2 classes so that the entire line doesn't get too complicated:

 

     { "x": 1, "y": 57, "h": 27, "w": "133", "bgColor": "{{v.type=TD?0x000242|{{v.type=SPG?0x420000|0x000000}}}}", "alpha": "{{v.selected?75|0}}" },

Edited by scyorkie
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

This is the pastebin for my carouselNormal.xc: http://pastebin.com/WY7ywPU0

 

Lines 34-38 (currently commented out) are the test lines I used for the 2 methods above. They work for me.

Lines 65-67 (also commented out) are a further test, where the left border of all the tank icons are colored (5 classes, 5 colors). That works for me also.

 

Test using my carouselNormal.xc and see if it works for you?

Share this post


Link to post

Short link
Share on other sites

Tomorrow I try, but you tell me to the borders, but I like to do it for the background? Thank you very much. Tomorrow I will answer if it works or not.

Edited by locorebelde

Share this post


Link to post

Short link
Share on other sites

See line 69 of this new pastebin for background color: http://pastebin.com/ygWAswmR

 

This is the effect: http://i.imgur.com/sH1vY5e.jpg

 

If you want to, you can also create a definition:

 

"def": {
     "classColor": "{{v.type=LT?0x00EE00|{{v.type=MT?0x00B4FF|{{v.type=HT?0xFE0E00|{{v.type=TD?0xAE42F3|0xFF00FF}}}}}}}}"
},

...

"extraFields": [

     { "x": 1, "y": 1, "h": 84, "w": "135", "bgColor": ${"def.classColor"}, "alpha": "{{v.selected?50|15}}", "layer": "bottom" },

     ...

Edited by scyorkie

Share this post


Link to post

Short link
Share on other sites

I have written your config in my carruselnormal.xc and this is the result:

I do not understand why I get thisK5a5nvK.jpg

 

I previously modified the xvm well with the xvm-editor, but now I no longer understand very well the macros and codes to put

Edited by locorebelde

Share this post


Link to post

Short link
Share on other sites

Hmm I don't understand why everything is the same color XD

Did you copy-paste everything?

 

Anyway here's a different version.

Pastebin here: https://pastebin.com/qrAJELce

Screenshot here: http://i.imgur.com/x5iCmGY.jpg

I felt that having the entire background colored was too distracting.

 

Is there a particular look you are going for btw? I'm merely experimenting with my own config to show you that your idea is possible.

Share this post


Link to post

Short link
Share on other sites

It does, but it also refers to the settings in colors.xc.

 

I didn't want to do that since (i) editing another config = more confusion, and (ii) changing his colors.xc might affect something else that I don't know about.

Edited by scyorkie

Share this post


Link to post

Short link
Share on other sites

I do not understand what happens, I install last version of xvm, I have copied your configuration and I have pasted it in carouselnormal.xc I do not change anything, and this is what I get:

6P99iKV.png

 

Will not the carousel.xc or carouselsmall.xc settings affect?

edit: In line 8 the last color code is imposed on all of the above, I have tried to change it for another color and the same happens, it is imposed on the previous specific colors of each type of tank

Edited by locorebelde

Share this post


Link to post

Short link
Share on other sites

carousel.xc and carouselSmall.xc do not affect what we are trying to achieve here.

 

When you say you installed the latest version of XVM, did you also update the contents of \res_mods\configs\xvm\py_macro ?

 

And which version are you using? I personally cannot get the very latest nightly build to work (they are trying something experimental with builds 7267+), but build 7266 works perfectly.

You can download the latter from my Dropbox here.

Share this post


Link to post

Short link
Share on other sites

I use the 7261 and also installed the py-macro folder
I will try more current

 

edit:Version 7266 tested, I wrote your code and the result did not change, I still have a single color in all the boxes.Color green

Edited by locorebelde

Share this post


Link to post

Short link
Share on other sites

@locorebelde,

{{v.type={{l10n:LT}}?0x00EE00|{{v.type={{l10n:MT}}?0x00B4FF|{{v.type={{l10n:HT}}?0xFE0E00|{{v.type={{l10n:TD}}?0xAE42F3|0xFF00FF}}}}}}}}

Share this post


Link to post

Short link
Share on other sites

 

@locorebelde,

{{v.type={{l10n:LT}}?0x00EE00|{{v.type={{l10n:MT}}?0x00B4FF|{{v.type={{l10n:HT}}?0xFE0E00|{{v.type={{l10n:TD}}?0xAE42F3|0xFF00FF}}}}}}}}

Where and how write this in my confg??

Share this post


Link to post

Short link
Share on other sites

 

"def": {

     "classColor": "{{v.type={{l10n:LT}}?0x00EE00|{{v.type={{l10n:MT}}?0x00B4FF|{{v.type={{l10n:HT}}?0xFE0E00|{{v.type={{l10n:TD}}?0xAE42F3|0xFF00FF}}}}}}}}" <- you may change macro here

},

...

"extraFields": [

     { "x": 1, "y": 1, "h": 84, "w": "135", "bgColor": ${"def.classColor"}, "alpha": "{{v.selected?50|15}}", "layer": "bottom" },

     ...

Edited by vlad_cs_sr

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