Jump to content
Sign in to follow this  
GefrManny

Progress Bars

Recommended Posts

Hi everyone,

I'm a little bit confused by the progress bar dialog control. Creating and adding one isn't exactly my problem, but I wonder how to actually use it. I was unable to find a function that lets me set/move the progress bar's current progress. Has anyone worked with this control and wants to share experience?

-- Manny

Share this post


Link to post
Share on other sites

The progress bar never worked in OFP. I fear it may be the same problem here in ArmA.

[EDIT] In my older dialogs, I built my own progress bar control using a standard text field. What I did was set the text and highlight to the same color. You could then create a box and use spaces to make it appear to fill across.

Share this post


Link to post
Share on other sites

Afaik progress bars are controlled by "hardcode" wink_o.gif

Share this post


Link to post
Share on other sites

That's what I feared, when I saw all those "external reference" remarks in the decompiled config.bin files :-(

Ah well, I'll just add it to the endless list of the ArmA feature requests tracker then.

Share this post


Link to post
Share on other sites

Using the new command ctrlSetPosition, you can easily emulate a progress bar with a plain old colored background control. Lets say you want the progress bar at screen position _x,_y with fixed height _h and a full width _w, you can display a progress bar with:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_ctrl ctrlSetPosition[_x,_y,_progress*_w,_h];

_ctrl ctrlCommit 0.0

where _progress is a number between 0.0 and 1.0. Using a different commit time other than 0, you can also animate the bar.

Share this post


Link to post
Share on other sites

I'm aware of that, but thanks smile_o.gif

I was just trying to get behind the secrets of the progress bar itself for the Biki, which lacks some information about dialogs.

Share this post


Link to post
Share on other sites

In ofp a squad mate managed to get a progress bar in a mission called "Rescue RaH". Never investigated how he managed to do it, but i will ask him.

Edit: Ok ive talk to him and he told me it was done by hint. I guess the same principle could be applyed to a dialog.

Edit2: He replyed.

Share this post


Link to post
Share on other sites

i use something like this to display a progress from 100% > 0%

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0

_i = 100

_b = 0.5

#start

Hint Format ["Downloading %1 ", _i]

#loop

? _i < 0:Hint "Download Complete"; Exit

_i = _i - 1

~_b

goto "start"

You could use the RSC to display a bar at every 10% completed.

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  

×