Page 1 of 1

Custom vars for UI

Posted: Sat Sep 26, 2015 1:04 am
by ScarleTomato
Hey guys,

Is there a way to define custom variables for the UI? For instance I wanna make a scrap.supply*2 var to use for the scrap gauge in bzgame_scrap_v2_0.cfg so that it'll keep it's aspect ratio.

I'm worried it might not be possible since it wasn't done already in the patch13.pak but I figured i'd ask.

Re: Custom vars for UI

Posted: Sat Sep 26, 2015 3:49 am
by Red Devil
something like this?

ConfigureVarSys()
{
CreateInteger("editor.shell.page", 0);
SetIntegerRange("editor.shell.page", 0, 8);
}

Re: Custom vars for UI

Posted: Sat Sep 26, 2015 3:39 pm
by ScarleTomato
Do you know if there's a way to run math operations on these variables? I see you can use Cmd() to set a literal value but don't see where I could multiply it.

Basically I just want the scrap gauge to go up two pixels instead of one for each scrap.supply

Re: Custom vars for UI

Posted: Sat Sep 26, 2015 4:36 pm
by General BlackDragon
Hmm, seems that the engine does control the height of the gauges. Pooooooooooooooooooooooooooooooooo.

Try this, find the maximum height of the stock?ish scrap gauge, and make a Gauge that is set to UseVar("scrap.supply");

put it on the bottom of your _x2 scrap config, and it should work?

Re: Custom vars for UI

Posted: Sat Sep 26, 2015 6:08 pm
by Red Devil
try this, tomato; been using a larger gauge for awhile now:

2_0 Scrap Gauge

Re: Custom vars for UI

Posted: Sat Sep 26, 2015 7:11 pm
by ScarleTomato
Here's the difference I'm seeing

RD's version vs the stock 2.0 version vs Normal
Image
While the width changes, the height of the gauge is still 40 pixels

I'm not sure i'm following GBD, as far as I'm aware the height doesn't matter at all. In all of the variations, the gauge is defined with a height of 0.

Re: Custom vars for UI

Posted: Sat Sep 26, 2015 10:40 pm
by Red Devil
neat optical delusion there. so, you want the height taller? that is probably determined by the coordinates used for colorize.tga and colorize.tga itself.


i've also seen some scrap gauges that are semi-circular, if that helps.

Re: Custom vars for UI

Posted: Sat Sep 26, 2015 11:10 pm
by ScarleTomato
Afaik the colorize.tga is used to draw the blue border.

I'm talking specifically about the white square (or blue square in your version.) I can change the width, but the height seems to be directly linked with the variable used. As in, when scrap.supply = 20 the bar is 20 pixels tall when scrap.supply = 25 the bar is 25 pixels tall, etc.

Is there a way I can use another var that's a multiple of scrap.supply? like UseVar("scrap.supply" * 2);

Re: Custom vars for UI

Posted: Sat Sep 26, 2015 11:15 pm
by Red Devil
ah, thinking not (via cfg anyways).

Re: Custom vars for UI

Posted: Sun Sep 27, 2015 7:36 am
by General BlackDragon
No, it's controlled by the engine :(

Re: Custom vars for UI

Posted: Sun Sep 27, 2015 7:09 pm
by ScarleTomato
Dang, that's kinda what i figured though.

BTW i decided to put my old toybox recy up on github. It shamelessly swipes assets from other mods so it'll never be released as a final thing, but it's hella fun to play with. Especially on a map with a bunch of pools and the custom thug recys