Jump to content
Korean Random
Sign in to follow this  
Dumadidak

[XVM] Carousel - how chanege macro into the img?

Recommended Posts

Hello guys, again.

I have a little question. How could I put image of nation (flag) into the carousel?

 

I done something like this:

s68ep2N.jpg


But I was using flash file (Flags.swf), sadly it interacts with other hangar places like "about the tank" or in "tech tree".  So i have to do it in my XVM config carousel.xc.

 

 

I tired to use this macro: {{v.nation}} in carousel.xc

            // Nation Flag
                {
                "x": 0,
                "y": 13,
                "align": "right",
                "alpha": 100,
                "format": "<img src='xvmres://nation_{{v.nation}}.png' width='26' height='26'>",
                "shadow":
                    {
                    "enabled": true,            // false - no shadow.
                    "distance": 0,                // (in pixels)
                    "angle": 0,                    // 0.0 - 360.0
                    "color": "0x000000",        // "0xXXXXXX"
                    "alpha": 80,                // 0 - 100
                    "blur": 6,                    // 0.0 - 255.0; 6 is recommended
                    "strength": 4                // 0.0 - 255.0; 3 is recommended
                    }
                },

 

And ofc i add my icons to the res folder called for example "nation_china.png". It doesn't work. I think, that when macros hiding numbers (like in mastery badge or color code) it is working fine. But when there is text (china, ussr or other) it doesn't work properly.

If someone will have some idea how could I fix it, it will be fabulous :)

Greetings
Dumadidak

Edited by Dumadidak

Share this post


Link to post

Short link
Share on other sites

You made all right, IDK why it doesn't work.

 

Better use "src" for images: { "x": 0, "y": 13, "src": "xvm://res/nation_{{v.nation}}.png" },

and use xvm:// schema instead of obsolete xvmres://.

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Sirmax :( I found my mistake. Everything was about align="right", probably if i had other coordinates i could see the flag, and i won't start this topic.

For now it is working fine.

But Sirmax, I have to tell u, that u helped me a lot, becouse quality of "src" is MUCH better, than put this into the "format". Could u tell me something more? How could i change the width or height of that img?
 

The difference: (probably u should change in the default config, part about masterybadge in carusel.xc)
6GQje0Y.png
 

 

Part about mastery badge doesn't work for me:

            // Sign of mastery.
                {
                "x": 2,
                "y": 73,
                "width": 26,
                "height": 26,
                "alpha": 100,
                "src": "img://gui/maps/icons/library/proficiency/class_icons_{{v.mastery}}.png"
                },

Edited by Dumadidak

Share this post


Link to post

Short link
Share on other sites

becouse quality of "src" is MUCH better, than put this into the "format". 

This is the reason for the presence of this field.

But Sirmax, I have to tell u, that u helped me a lot, becouse quality of "src" is MUCH better, than put this into the "format". Could u tell me something more? How could i change the width or height of that img?

Try "w" and "h"

Edited by sirmax
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Thx Sirmax, ofc that "w" and "h" is working good.

 

 

I have one more question, is it some option in code to disable some part of "extrafields"?

 

For example i have this one, and i want disable it:

                // Sign of mastery.
                {
                "x": 2,
                "y": 73,
                "width": 26,
                "height": 26,
                "alpha": 100,
                "src": "img://gui/maps/icons/library/proficiency/class_icons_{{v.mastery}}.png"
                },

 

I know there are 2 options:

- I could use "//" at the beginning of all lines...

- or set "alpha" to 0
 

But I'm looking for option rather like "enable", "visible". Why this options doesn't work in extrafields?

 

 

And one more question, because i also made some little modification ("clean up" in text/lc_messages/menu.mo)

TrdJc3B.jpg

 

It looks like this, but also I have issue about image quality.

o13KW9g.jpg

 

Maybe it's not a 'big deal' about difference of qualities... but I'm wondering, that, is it possible to take some data from game and make macros like this?


{{damaged}}        //    "1" for damaged, empty if not

{{ammoNotFul}}     //    "1" for damaged, empty if not   (no ammo loaded)

{{battle}}         //    "1" for damaged, empty if not   (still in battle)

{{inPrebattle}}    //    "1" for damaged, empty if not   (tank preapared in platoon or CW, for the battle)

{{crewNotFull}}    //    "1" for damaged, empty if not   (there is no crew on this tank)

{{destroyed}}      //    "1" for damaged, empty if not

{{exploded}}       //    "1" for damaged, empty if not



Ofc it is only some idea, i don't want to cause any troubles for U. But maybe someone want use it also?

I also feel the lack of this macro {{v.c_premium}}... maybe or is it other way to make text "gold"? I done "name of tank" in extrafield becouse in the main part i couldnt put short name of it, and that was important for me. Edited by Dumadidak
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

I have one more question, is it some option in code to disable some part of "extrafields"?

 

I know there are 2 options:

- I could use "//" at the beginning of all lines...

- or set "alpha" to 0

 

But I'm looking for option rather like "enable", "visible". Why this options doesn't work in extrafields?

Not required, use line comment.

Maybe it's not a 'big deal' about difference of qualities... but I'm wondering, that, is it possible to take some data from game and make macros like this?

{{damaged}}        //    "1" for damaged, empty if not

{{ammoNotFul}}     //    "1" for damaged, empty if not   (no ammo loaded)

{{battle}}         //    "1" for damaged, empty if not   (still in battle)

{{inPrebattle}}    //    "1" for damaged, empty if not   (tank preapared in platoon or CW, for the battle)

{{crewNotFull}}    //    "1" for damaged, empty if not   (there is no crew on this tank)

{{destroyed}}      //    "1" for damaged, empty if not

{{exploded}}       //    "1" for damaged, empty if not

This macros are planned

I also feel the lack of this macro {{v.c_premium}}... maybe or is it other way to make text "gold"? I done "name of tank" in extrafield becouse in the main part i couldnt put short name of it, and that was important for me.

You can use macro formatting: {{v.premium?#AAAAAA|#BBBBBB}}

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Thanks Sirmax :)

 

 

This macros are planned

Good to hear it! So I'm first one to wait for it :)

 

 

You can use macro formatting: {{v.premium?#AAAAAA|#BBBBBB}}

Problem solved!

 

Sorry for so many questions! I'm pain in the ass, again and again.

 

Btw. I can't believe that U are sooooo helpful, thx for your time!

Share this post


Link to post

Short link
Share on other sites

You are welcome. I understand that it's not easy to guess all features, so you can ask what you need. Our english community is not so big as russian, but we try to help everyone who ask not trivial questions.

Edited by sirmax
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Ok, so i have next trouble.

I have code like this:

            // Vehicle name premium.
                {
                "x": 156,
                "y": 80,
                "align": "right",
                "alpha": "{{v.premium?100|0}}",
                "format": "<font size='12' face='$FieldFont' color='{{v.premium?#F5BE4B|#FFFFFF}}'><b>{{v.name}}<b></font>",
                "shadow":
                    {
                    "distance": 0,               // (in pixels)
                    "angle": 0,                  // 0.0 - 360.0
                    "color": "0xF5BE4B",         // "0xXXXXXX"
                    "alpha": 50,                 // 0 - 100
                    "blur": 1,                   // 0.0 - 255.0; 6 is recommended
                    "strength": 2                // 0.0 - 255.0; 3 is recommended
                    }
                },

            // Vehicle name notpremium.
                {
                "x": 156,
                "y": 80,
                "align": "right",
                "alpha": "{{v.premium?0|100}}",
                "format": "<font size='12' face='$FieldFont' color='{{v.premium?#F5BE4B|#FFFFFF}}'><b>{{v.name}}<b></font>",
                "shadow":
                    {
                    "distance": 0,               // (in pixels)
                    "angle": 0,                  // 0.0 - 360.0
                    "color": "0x000000",         // "0xXXXXXX"
                    "alpha": 50,                 // 0 - 100
                    "blur": 1,                   // 0.0 - 255.0; 6 is recommended
                    "strength": 2                // 0.0 - 255.0; 3 is recommended
                    }
                },

 

I need different shadow for type of vehicle premium/notpremium, and there is a problem which I had earlier. How i could disable all part (no comment lines).

I thought that I could use macro {{v.premium?100|0}} to turn off this part, but it's not working in "alpha" line.

Share this post


Link to post

Short link
Share on other sites

I need different shadow for type of vehicle premium/notpremium, and there is a problem which I had earlier. How i could disable all part (no comment lines).

I thought that I could use macro {{v.premium?100|0}} to turn off this part, but it's not working in "alpha" line.

It must. I'll check this.

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Maybe that format will work?

"alpha": "{{v.premium?#00|#FF}}",

Sadly, also doesn't work :(

 

First I wanted to do it in shadow part (so second field would be unnecessary, and ofc. eneble/disable option too)

But: "color": "{{v.premium?#F5BE4B|#000000}}", doesn't work.

 

I have no idea how could I made glow under the premium name, only premium.

 

Edited:

 

It must. I'll check this.

OMG. "alpha": "{{v.premium?100|0}}" is working...

I probably doesnt put changes with JSGME to the WoT... to many WoT runs... sorry guys for disturbing u.

 

Ok. Now I know that it doesn't work just in shadow part. So I could disable main oneonly. But it is enough! Thx.

Edited by Dumadidak

Share this post


Link to post

Short link
Share on other sites

Ok guys, with your priceless help,  I finished my carousel for now! The XVM developers and community here is wonderful and helpful! Thx everyone for help. Now I "only" need to change position of filters and arrows. Sooo swf changes now!

Now I have something like this:


jlTTcRt.jpg
Edited by Dumadidak
  • Upvote 2

Share this post


Link to post

Short link
Share on other sites

Ok guys, with your priceless help,  I finished my carousel for now! The XVM developers and community here is wonderful and helpful! Thx everyone for help. Now I "only" need to change position of filters and arrows. Sooo swf changes now!

 

Now I have something like this:

jlTTcRt.jpg

Looks great!

 

How did you get the battle tiers (min and max) in there? I tried battletier-min and battletier-max, but that doesn't seem to work in the carousel.

 

EDIT: Nevermind, found the answer. In case someone else is looking for it, it is v.battletiermax and v.battletiermin without the "-".

Edited by HermanHitro
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Hi, thx for appreciating!

 

 

 

How did you get the battle tiers (min and max) in there?

I could share with u my code (It's not finished yet, but close to be ready)

I mark for u the part about BattleTier (green color) just scroll code down to see.

/**
 * Parameters for tank carousel
 * Config by Dumadidak [EU]
 * If you have any questions or observed errors write to me: [email protected]
 * Version | WoT 9.3 | XVM-5.3.7-dev: 3324 (nightlybuild)
 * If u want to disable any "extraFields", use comments "//" (like in MarksOnGun part) or just delete it

 * Thanks to Sirmax [RU] for priceless help in many cases! And the whole XVM team for opportunity to change oryginal carousel!

 * Thanks to my friends: man1aq_ [EU] and Kartoniak [EU], for many sugestions when I was blind after many hours spent on configuring
 */

{
    "carousel":
        {
        "enabled": true,                // false - Disable customizable carousel.
        "zoom": 1,                      // Scale of carousel cells.
        "rows": 2,                      // Number of rows at carousel.
        "padding":                      // Spacing between carousel cells.
            {
            "horizontal": 4,
            "vertical": 4
            },
        "alwaysShowFilters": true,      // true - show filters only if all tanks do not fit on the screen.
        "hideBuyTank": true,            // true - hide cell "Buy tank".
        "hideBuySlot": true,            // true - hide cell "Buy slot".
        "filters":                      // Visibility filters.
            {
            "nation":   { "enabled": true },  // nation
            "type":     { "enabled": true },  // vehicle class
            "level":    { "enabled": true },  // vehicle level
            "favorite": { "enabled": true },  // favorite tanks
            "prefs":    { "enabled": true }   // other filters
            },
        "fields":
            {
            "tankType": { "visible": false, "dx": 0, "dy": 0, "alpha": 100, "scale": 1 },        // Vehicle class icon.
            "level":    { "visible": false, "dx": 2, "dy": -3, "alpha": 100, "scale": 1 },        // Vehicle level.
            "multiXp":  { "visible": true, "dx": 0, "dy":0, "alpha": 100, "scale": 1 },     // Icon of double (triple etc.) dayily exp
            "xp":       { "visible": true, "dx": 0, "dy": 0, "alpha": 100, "scale": 1 },        //
            "tankName": { "visible": false, "dx": 2, "dy": 5, "alpha": 100, "scale": 0.8 }        // Vehicle name.
            },
        "extraFields":                     // Extra cell fields (see playersPanel.xc).
            [
            // Selected horizontal.
                {
                "x": 0,
                "y": 41,
                "w": 160,
                "h": 18,
                "alpha": 100,
                "src": "xvm://res/Dumadidak/Carousel/{{v.selected}}ected_horizontal.png"
                },
            
            // Selected vertical.
                {
                "x": 71,
                "y": 0,
                "w": 18,
                "h": 100,
                "alpha": 100,
                "src": "xvm://res/Dumadidak/Carousel/{{v.selected}}ected_vertical.png"
                },
            
            // Sign of mastery.
                {
                "x": 4,
                "y": 74,
                "w": 26,
                "h": 26,
                "alpha": 100,
                "src": "xvm://res/Dumadidak/Carousel/class_icons_{{v.mastery}}.png"
                },

            // NOT elite tank marker.
                {
                "x": 1,
                "y": 1,
                "alpha": 100,
                "src": "xvm://res/Dumadidak/Carousel/notelitetank{{v.elite}}.png"
                },
            
            // Number of battles.
                {
                "x": 30,
                "y": -1,
                "align": "left",
                "alpha": 100,
                "format": "<font size='12' face='$FieldFont' color='#e3dfc6'>{{v.battles}}</font>",
                "shadow":
                    {
                    "enabled": true,            // false - no shadow.
                    "distance": 0,              // (in pixels)
                    "angle": 0,                 // 0.0 - 360.0
                    "color": "0x000000",        // "0xXXXXXX"
                    "alpha": 80,                // 0.0 - 1.0
                    "blur": 6,                  // 0.0 - 255.0; 6 is recommended
                    "strength": 4               // 0.0 - 255.0; 3 is recommended
                    }
                },
                
            
            // Vehicle name - premium.
                // Color variations:
                // TEXT       |    SHADOW
                // #E7B622    |    0x642D1A  -   more yellow
                // #F68A4A    |    0x6A1A00  -   more orange (similar to the vanilla)
                {
                "x": 156,
                "y": 80,
                "align": "right",
                "alpha": "{{v.premium?100|0}}",
                "format": "<font size='12' face='$FieldFont' color='{{v.premium?#E7B622|#FFFFFF}}'>{{v.name}}</font>",
                "shadow":
                    {
                    "distance": 0,                           // (in pixels)
                    "angle": 0,                              // 0.0 - 360.0
                    "color": "0x642D1A",                     // "0xXXXXXX"
                    "alpha": "1",                            // 0.0 - 1.0
                    "blur": 6,                               // 0.0 - 255.0; 6 is recommended
                    "strength": 3                            // 0.0 - 255.0; 3 is recommended
                    }
                },
                
            // Vehicle name - normal.
                {
                "x": 156,
                "y": 80,
                "align": "right",
                "alpha": "{{v.premium?0|100}}",
                "format": "<font size='12' face='$FieldFont' color='{{v.premium?#E7B622|#FFFFFF}}'>{{v.name}}</font>",
                "shadow":
                    {
                    "distance": 0,                           // (in pixels)
                    "angle": 0,                              // 0.0 - 360.0
                    "color": "0x434343",                     // "0xXXXXXX"
                    "alpha": "1",                            // 0.0 - 1.0
                    "blur": 6,                               // 0.0 - 255.0; 6 is recommended
                    "strength": 3                            // 0.0 - 255.0; 3 is recommended
                    }
                },
            
            // Winrate.
                {
                "x": 30,
                "y": 13,
                "align": "left",
                "alpha": 100,            
                "format": "<font size='12' face='$FieldFont' color='#7d7d75'>{{v.winrate%d~%}}</font>",
                "shadow":
                    {
                    "distance": 0,                // (in pixels)
                    "angle": 0,                   // 0.0 - 360.0
                    "color": "0x000000",          // "0xXXXXXX"
                    "alpha": 80,                  // 0.0 - 1.0
                    "blur": 6,                    // 0.0 - 255.0; 6 is recommended
                    "strength": 4                 // 0.0 - 255.0; 3 is recommended
                    }
                },
            
            // MarksOnGun.
            //    {
            //    "x": 160,
            //    "y": 50,
            //    "alpha": 60,
            //    "align": "right",
            //    "format": "{{v.marksOnGun}}"
            //    },

            // Nation Flag.
                {
                "x": 2,
                "y": 1,
                "w": 28,
                "h": 28,
                "alpha": 100,
                "src": "xvm://res/Dumadidak/Carousel/Flags/nation_{{v.nation}}.png"
                },
            
            // Battle Tier for vehicle.
                {
                "x": 156,
                "y": 67,
                "align": "right",
                "alpha": 100,
                "format": "<font size='12' color='#7d7d75'>({{v.battletiermin}}-{{v.battletiermax}}) <font size='12' color='#FFFFFF'><b>{{v.rlevel}}</b></font></textformat>",
                "shadow":
                    {
                    "distance": 0,                // (in pixels)
                    "angle": 0,                   // 0.0 - 360.0
                    "color": "0x000000",          // "0xXXXXXX"
                    "alpha": 80,                  // 0.0 - 1.0
                    "blur": 6,                    // 0.0 - 255.0; 6 is recommended
                    "strength": 4                 // 0.0 - 255.0; 3 is recommended
                    }
                }
            
            ]
        }
}

Edited by Dumadidak

Share this post


Link to post

Short link
Share on other sites

@nixxxie

 

Ofc, but i don't have full pack.

 

For now only without icons of [no ammo/crew not full/tank damaged]

My pack:

- Flags.swf - to switch off background

- advanced.swf - to change (x2, x3, x5) image to shorter

- carousel.xc - place to your config folder

- res with my icons

- Deep Vehicle Icons (if u want vehicle icons more contrast, I'm using 'deep' graphic filter so it is better for me)

DOWNLOAD

Edited by Dumadidak
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

@nixxxie and it's there, check this directory:

"Dumadidak CarouselPack.rar\Dumadidak CarouselPack\Dumadidak Clear Carousel\xvm\res\Dumadidak\Carousel"

 

and there you find your files:

  • selected_horizontal.png
  • selected_vertical.png

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