Jump to content
gc8

Check support menu

Recommended Posts

Hi

Is it possible to detect when player opens the supports menu? (0-8)

I could check that with commandingMenu but then I'd need to check it like each frame. An event handler would be better..

 

thx!

Share this post


Link to post
Share on other sites

Perhaps try:  inGameUISetEventHandler

 

Never used it though.  You would need the 'engine based action name' for (8) in (0-8).  Don't know whether it uses the action name, or Action names, or the CfgCommunicationMenu classname of the selection (or the class's text value), or what.

inGameUISetEventHandler ["Action", "if (_this select 3 == << Support menu (8) >>) then {<< code >>; << code >>; << boolean >>}"];

 

Share this post


Link to post
Share on other sites

@opusfmspol Tried that one already but didn't work. I think it's only for the scroll actions. thx :)

 

Share this post


Link to post
Share on other sites
36 minutes ago, beno_83au said:

What about key pressed event handlers?

 

Not sure how to go about doing that but it might be one option

Share this post


Link to post
Share on other sites

Well I hacked in this code:

 

#include "\a3\ui_f\hpp\definedikcodes.inc"


waituntil { !isnull (findDisplay 46) };
findDisplay 46 displayAddEventHandler ["KeyDown", 
{
params ["_display","_key"];

if(commandingMenu == "RscMenuReply") then
{
 if(_key == DIK_8) then // About to open support menu
 {
  systemchat "Opening support menu...";
  showCommandingMenu ""; // Deny opening (Close the whole menu)
 };
};
  
}];

 

You can also return true from the EH to ignore the key presses

Share this post


Link to post
Share on other sites
12 minutes ago, gc8 said:

You can also return true from the EH ignore the key presses

 

Yep, good for a range of things.

Share this post


Link to post
Share on other sites
56 minutes ago, gc8 said:

if(_key == DIK_8)

What happens if the user has changed/not bound any keybindings for commandingMenu selection?

I don't, 1-0 is unit selection, F1-F10 are 'Open Menu #', everything else I do by scroll and middle mouse.

 

TAG_fnc_isNotSupportMenu = {
	if ( commandingMenu == "#User:BIS_fnc_addCommMenuItem_menu" ) then {
		hint "Closing Support Menu";
		showCommandingMenu "";
		false
	}else{
		true
	};
};

findDisplay 46 displayAddEventHandler[ "KeyUp", {
	[] call TAG_fnc_isNotSupportMenu;
}];

findDisplay 46 displayAddEventHandler[ "MouseButtonUp", {
	[] call TAG_fnc_isNotSupportMenu;
}];

 

  • Thanks 2

Share this post


Link to post
Share on other sites
6 minutes ago, Larrow said:

What happens if the user has changed/not bound any keybindings for commandingMenu selection?

 

Thx Larrow. I thought I probably forgot something :)

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

×