Jump to content
beako

How to update information inside a custom menu

Recommended Posts

HI All,

 

I'm trying to update information within the custom menu and sub-menu so I don't have to keep exiting the menu for it to rerun the function.

 

I there are certain conditions that may get updated during game play, like _ownsRadioTower, my_Money and player getVariable ["REINFORCEMENTS", FALSE] that may change while the player in the custom menu, and I would like it to update the status from being disabled (in grey )to enabled.

 

MY_MENU_inCommunication = 
[
	["DESTRUCTION MENU",true],	
	["MOTOR POOL", 	[2], 	"#USER:MENU_MOTOR_POOL",  -5, [["expression", " player sideChat  ""Order Vehicles"" "]], 	"1", "1"],
	["ARMORY", 	[3], 		"#USER:MY_SUBMENU2_inCommunication", -5, [["expression", " player sideChat  ""Order Emplacements"" "]], 	"1", "1"],
	["RADIO TOWER", [4], 	"#USER:MY_SUBMENU3_inCommunication", -5, [["expression", " player sideChat  ""CALL IN SUPPORT/INTEL"" "]],"1", missionnamespace getvariable ["mainActive3","0"] ], 
	["REINFORCEMENTS", [5], "#USER:MY_SUBMENU4_inCommunication", -5, [["expression", " player sideChat  ""CALL IN REINFORCEMENTS"" "]], "1", missionnamespace getvariable ["mainActive4","0"] ]
];	

if (_ownsARadioTower) then { mainActive3 = 1} else {mainActive3 = 0}; //&& sector1 getVariable "owner" == WEST 
if (my_Money >= 25 and player getVariable ["REINFORCEMENTS",FALSE]) then { mainActive4 = 1} else {mainActive4 = 0};

_array5 = MY_MENU_inCommunication select 3;// 4th line menu item 
_array5 set[6, str mainActive3];// change grey out status 

_array5 = MY_MENU_inCommunication select 4;// 4th line menu item 
_array5 set[6, str mainActive4];// change grey out status 

showCommandingMenu "#USER:MY_MENU_inCommunication";

Thanks for any advice in advance.

Share this post


Link to post
Share on other sites

Have you tried calling the "showCommandingMenu "#USER:MY_MENU_inCommunication";" again when you want to update the menu?

 

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

×