Jump to content
Sign in to follow this  
Cain_

Disable doubleclick on map

Recommended Posts

Hello again. I would like to disable the abillity to doubble click on the map and make new markers.

I worked out that i need

map onDoubleClick

The problem is I have no idea how this is used.

http://community.bistudio.com/wiki/onDoubleClick

player map onDoubleClick {execVM "exit.sqf"}; etc dosnt work.

Im using Squint so I can see if its working or not.

Thanks guys! Friday soon!

Share this post


Link to post
Share on other sites

Hi,

It would be more something like this:

waitUntil { !isNull (findDisplay 46) };
(findDisplay 46) displayAddEventHandler ["MouseButtonDblClick", "CODE HERE"];

You can read more here.

_neo_

Share this post


Link to post
Share on other sites

1. There is no reason to put "player." As it says on the Biki page, there are no object parameters for the command.

2. You are supposed to replace "map" with the variable name of a map control (element within a dialog). I'm not sure off-hand how to reference the default map.

Share this post


Link to post
Share on other sites

Great!, Now i just need to find the action to close the map screen.

player closedisplay dosnt seem right. Isnt there just a

Player presskey "M" command?

or the

forceMap show ? whats the opposite to show?

46 is main display, anyone know the nubmer for map display?

Edited by Cain_

Share this post


Link to post
Share on other sites

forceMap true, forceMap false -- show is just a descriptive name for understanding what it does

Share this post


Link to post
Share on other sites

I got this far, but it simply wont close the map screen. :(

waitUntil {sleep 0.01; (!(isNull (findDisplay 46)))};
(findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'showMap') then {[] execVM 'noclick.sqf'}; false"];

waitUntil {sleep 0.01; (!(isNull (findDisplay 46)))};


(findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'showMap') then {[] execVM {noclick.sqf}"]

noclick.sqf

sleep 0.1;
waitUntil {sleep 0.05; (!(isNull (findDisplay 12)))};
(findDisplay 12) displayAddEventHandler ["MouseButtonDblClick",{closeDialog 0}];

---------- Post added at 12:19 AM ---------- Previous post was Yesterday at 10:30 PM ----------

Go a little bit further. Problem is that nothing happens once the script starts. It simply dosnt understand i press down my mousebutton.

waitUntil {sleep 0.01;(!(isNull (findDisplay 12)))};
(findDisplay 12) displayAddEventHandler ["onMouseButtonClick ","hint format ['%1',_this]; true"];

Share this post


Link to post
Share on other sites

Hi,

Try:

init.sqf

if (!isDedicated) then
{
  waitUntil { player == player };
  waitUntil { !isNull (findDisplay 46) };
  (findDisplay 46) displayAddEventHandler ["MouseButtonDblClick", " if (visibleMap) then { openMap [false, true] " ];
};

Not tested.

That checks when the player double clicks on the map and then checks if the map is being shown, if yes, force close.

_neo_

Edited by neokika

Share this post


Link to post
Share on other sites

Still cant get it too work. It seems the displyAddEventHandler isn't able to be run. I already have 2 others to check if someones tries to access the chat and map. Its probly something with these that conflict.

I runt it as my own host in MP when testing. I am gonna do a sensitivity analysis and check each part :)

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  

×