locorebelde 2 Posted March 25, 2017 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 ..) Quote Share this post Link to post Short link Share on other sites
scyorkie 50 #384383 Posted March 26, 2017 (edited) 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 March 26, 2017 by scyorkie 1 Quote Share this post Link to post Short link Share on other sites
locorebelde 2 #384409 Posted March 26, 2017 thx,i try this what you writte Quote Share this post Link to post Short link Share on other sites
locorebelde 2 #384458 Posted March 26, 2017 I've tried to do this and I do not get the colors Quote Share this post Link to post Short link Share on other sites
scyorkie 50 #384459 Posted March 26, 2017 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? Quote Share this post Link to post Short link Share on other sites
locorebelde 2 #384460 Posted March 26, 2017 Sorry for my clumsiness but I copied your configuration and I do not get any color.Yes the statistics come out Quote Share this post Link to post Short link Share on other sites
scyorkie 50 #384461 Posted March 26, 2017 (edited) Remove the // at the start of lines 65-67? Edited March 26, 2017 by scyorkie Quote Share this post Link to post Short link Share on other sites
locorebelde 2 #384462 Posted March 26, 2017 (edited) 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 March 26, 2017 by locorebelde Quote Share this post Link to post Short link Share on other sites
scyorkie 50 #384463 Posted March 26, 2017 (edited) 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 March 27, 2017 by scyorkie Quote Share this post Link to post Short link Share on other sites
locorebelde 2 #384483 Posted March 27, 2017 (edited) I have written your config in my carruselnormal.xc and this is the result: I do not understand why I get this 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 March 27, 2017 by locorebelde Quote Share this post Link to post Short link Share on other sites
scyorkie 50 #384492 Posted March 27, 2017 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. Quote Share this post Link to post Short link Share on other sites
vlad_cs_sr 1,575 #384495 Posted March 27, 2017 doesn't the {{v.c_type}} macro work? @locorebelde, why not to attach a config as recomended? Quote Share this post Link to post Short link Share on other sites
scyorkie 50 #384496 Posted March 27, 2017 (edited) 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 March 27, 2017 by scyorkie Quote Share this post Link to post Short link Share on other sites
locorebelde 2 #384506 Posted March 27, 2017 (edited) 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: 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 March 27, 2017 by locorebelde Quote Share this post Link to post Short link Share on other sites
scyorkie 50 #384515 Posted March 27, 2017 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. Quote Share this post Link to post Short link Share on other sites
locorebelde 2 #384517 Posted March 27, 2017 (edited) I use the 7261 and also installed the py-macro folderI 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 March 27, 2017 by locorebelde Quote Share this post Link to post Short link Share on other sites
vlad_cs_sr 1,575 #384529 Posted March 27, 2017 @locorebelde, {{v.type={{l10n:LT}}?0x00EE00|{{v.type={{l10n:MT}}?0x00B4FF|{{v.type={{l10n:HT}}?0xFE0E00|{{v.type={{l10n:TD}}?0xAE42F3|0xFF00FF}}}}}}}} Quote Share this post Link to post Short link Share on other sites
locorebelde 2 #384537 Posted March 27, 2017 @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?? Quote Share this post Link to post Short link Share on other sites
vlad_cs_sr 1,575 #384543 Posted March 27, 2017 (edited) "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 March 27, 2017 by vlad_cs_sr Quote Share this post Link to post Short link Share on other sites
scyorkie 50 #384556 Posted March 27, 2017 I think vlad's suggestion should fix the problem. Thanks vlad! Quote Share this post Link to post Short link Share on other sites