Jump to content
Sign in to follow this  
gossamersolid

Change RscProgress Bar Colour via Scripts

Recommended Posts

Hey there,

I took a quick search in the forums and in the BIKI, couldn't find any command to change the colorBar value for RscProgress controls via scripting.

I've already tried all of the ctrlSet*Color commands, none have worked.

Share this post


Link to post
Share on other sites

Unfortunately, you can't. This is because it is set through "texture" and not "color". I was able to get around the issue by creating a second, separate progress bar.

It went something like this.

_var = 0.4; // 0.0 - 1
If (_var > 0.3)  then {

_blueCtrl progressSetPosition _var;
_redCtrl progressSetPosition 0;

} else {

_blueCtrl progressSetPosition 0;
_redCtrl progressSetPosition _var;

};

This way, if _var is less than 0.3, the red bar shows. If it is over 0.3, then the blue bar is shown.

You could potentially make it much more intricate. Just know, you need a different control for each color; since its defined in the GUI config class.

Edited by Fight9

Share this post


Link to post
Share on other sites
Unfortunately, you can't. This is because it is set through "texture" and not "color". I was able to get around the issue by creating a second, separate progress bar.

It went something like this.

_var = 0.4; // 0.0 - 1
If (_var > 0.3)  then {

_blueCtrl progressSetPosition _var;
_redCtrl progressSetPosition 0;

} else {

_blueCtrl progressSetPosition 0;
_redCtrl progressSetPosition _var;

};

This way, if _var is less than 0.3, the red bar shows. If it is over 0.3, then the blue bar is shown.

You could potentially make it much more intricate. Just know, you need a different control for each color; since its defined in the GUI config class.

This is what I was thinking was the only workaround, what a shame.

For what I'm trying to do, I'd have to make and handle 9 progress bar controls for 3 progress bars.

Maybe I should submit a feature request, it doesn't seem like it'd be a hard thing to implement for them.

Thanks for the input!

Share this post


Link to post
Share on other sites

I believe Heeeere's Johnny has been complaining and looking for solution to same problem. He already made a ticket for it a few months ago.

Share this post


Link to post
Share on other sites
I believe Heeeere's Johnny has been complaining and looking for solution to same problem. He already made a ticket for it a few months ago.

Do you happen to have a link to the ticket?

Right now I'm back to using the "ghetto" progress bars (background ctrl, frame ctrl, structuredText ctrl).

Edited by GossamerSolid

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×