Jump to content
Sign in to follow this  
terox

How to Add UserInterface EH to Useraction menu "Deactivate mine"

Recommended Posts

As the title states.

I am wanting to attach an eventhandler that fires when a player selects the "Deactivate mine" option in the player user-action menu.

I would really appreciate a solution to this.

Thanks in advance

Share this post


Link to post
Share on other sites

I'd hazard a guess that it's not possible, some mines change their state from alive to not alive when deactivated and some even move position which could be checked for. There are some that do neither so it could still be a problem.

We really need a way to return default actions when pressed, you can sort of find out when an action is used but not the specific one through.

Share this post


Link to post
Share on other sites

The status of the mine isn't an issue, I'm wanting to run some code when the user action menu "Deactivate mine" is selected.

The user action menu is a dialog control and the menu would be most likely a list box, activeText or button, so what i really need is the IDC number of the dialogue control or which B.I addon it is defined in and will probably be able to return a value, string or data for that control when it is run using a eventhandler (Hopefully anyway)

Edited by Terox

Share this post


Link to post
Share on other sites

Bump still unsolved

Share this post


Link to post
Share on other sites

Have you tried what happens to the mines when they are deactivated? Maybe they go null / a new one is spawned in etc. Maybe that could help.

Share this post


Link to post
Share on other sites

I dont know what the display and idc codes are for the Action Menu are, perhaps someone else can find this, but this is how I would do it

_control = controlNull; // replace this with the control from Action Menu
_control ctrlAddEventHandler ["LBSelChanged",{
   _ctrl = _this select 0;
   _selection = _this select 1;
   _text = _ctrl lbText _selection;
   if (_text isEqualTo "Deactivate Mine") then {
      // Insert your code here
   };
};

The above code will fire once you select the deactivate mine option in the Action Menu

Regards,

Bull

Share this post


Link to post
Share on other sites

Thx Bull.

I suppose i'll have to scan through all the B.I addons to try and find the IDC

Edited by Terox

Share this post


Link to post
Share on other sites

Your assuming it's an addon, I'm sure someone would have found it by now if it was possible, I belive it's part of the actual engine and so hard coded.

You can see all the Displays by using hint str alldisplays commands and if in a loop you can see the numbers change when inventory is opened.

Then you can see the contols hint str (allControls findDisplay 46)

Other display numbers are 0,12,26,46,63 and 602 (inventory)

None of which seem related to Action Menu

Share this post


Link to post
Share on other sites

How'd AGM disable it ? Maybe check their code on github

Share this post


Link to post
Share on other sites
How'd AGM disable it ? Maybe check their code on github

you can disable the entire user action menu using

inGameUISetEventHandler ["Action","hint 'Entire action menu disabled'"];

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  

×