Jump to content
Sign in to follow this  
iceman77

Parsing magazine amount - half working

Recommended Posts

I'm parsing some numbers into a structured text control. I can parse the number of magazines the player has, when I call the dialog. That works fine. What doesn't work, is when I try and parse the magazine quantity on the fly (via button press). The text doesn't change. Below is the function PWAddMags that gets spawned by a button press. It does give the player the magazine, but it will not parse anything.

Private ["_PWCounter", ...More Privates...];
DisableSerialization;
_display = uiNamespace getVariable "IceDisplay";
_PWCounter = _display displayCtrl 1400;        

...Other functions...

[color=#ff0000]PWAddMags[/color] = 

  {
       If (!Local Player) ExitWith {};

       Player AddMagazine [color=#000000]"30Rnd_556x45_Stanag"[/color];

       [color=#ff0000] // This works fine upon the dialog opening[/color], [color=#ff0000]just not when this function is called[/color]
       [color=#0000cd]_PWCounter ctrlSetStructuredText parseText format["%1", {_x == "30Rnd_556x45_Stanag"} count magazines player];[/color]

  };

Edited by Iceman77

Share this post


Link to post
Share on other sites

Are you pre-compiling this function? If so it might be a Serialization issue, try adding DisableSerialization in the function.

Share this post


Link to post
Share on other sites

yes . Also, im using DisableSerialization

---------- Post added at 04:16 ---------- Previous post was at 04:15 ----------

Ahh, but not in the fuctions scope...

---------- Post added at 04:25 ---------- Previous post was at 04:16 ----------

Dang, no luck. Ahh well, I've another thing I can do until I find a solution. Need to steer clear of this part for now, it's been giving me a headache! This is pretty much the last thing I need for this dialog to move out of "alpha" stage. In that, all of the dialogs functions will be working. In any case, there's still a couple small things I can do until I find a solution.

Share this post


Link to post
Share on other sites

Solved.

((uiNamespace getVariable "myDisplay") displayCtrl 1400) ctrlSetStructuredText parseText format["%1", {_x == PWMag} count magazines player]; 

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  

×