Jump to content

pierremgi

Member
  • Content Count

    7279
  • Joined

  • Last visited

  • Medals

  • Medals

Community Reputation

4743 Excellent

About pierremgi

  • Rank
    Major

Profile Information

  • Location
    Tahiti

Recent Profile Visitors

14604 profile views

Single Status Update

See all updates by pierremgi

  1. Pierre I am kind of stuck trying to bind a key like maybe  shift+m  to my map I am trying to build.
    Reference code on page below. Do you have any suggestions or know of any code samples?

     

    I have been looking around for examples but have not found any. Kind of lost.

     

    1. Show previous comments  10 more
    2. pierremgi

      pierremgi

      toggle the key   shift M open, shift M close, shift M open, shift M close,

      For that add a variable in your code nil, true, nil true and a condition:

      [] spawn {
         waituntil {!isNull (findDisplay 46)};
         (findDisplay 46) displayAddEventHandler ["keyDown", "_this call your_keyFnc"];
         };

      your_keyFnc = compileFinal "
       _ctrl = _this #0;
       _dikCode = _this #1;
       _shift = _this #2;
       _ctrlKey = _this #3;
       _alt = _this #4;
       private _input = false;

       if (_shift && !_alt && !_ctrlKey) then {
         if (_dikCode == 50) then {
           call {
               if (isNil "passed") exitWith {
                  passed = TRUE;
                 ( [ 'myMiniMap' ] call BIS_fnc_rscLayer ) cutRsc [ 'myMap', 'PLAIN', 1, false ];
               };
               passed = nil;

               '' cutRsc [ 'myMap', 'PLAIN', 1, false ];
           };
         _input = true
         };
       };
       _input
      ";

       

      NOTE: the '' cutRsc is not a forget double quote but 2 single quotes. ('+').

      not tested. Perhaps there is something to do more due to repetitive key down.

       

    3. Antman2o1o

      Antman2o1o

      I just fixed the errors the map was throwing for the just the map itself.  I believe all that is left is to figure out how to close it.

      It's getting late here so I will try your code tomorrow.

      I really want to thank you for helping and for having the patience with questions I really appreciate it.

      Super big THANK YOU for your help.

    4. Antman2o1o

      Antman2o1o

      Hey Pierre I added the code you suggested above to close the map and it throws an error.

      The error it throws is that on line 26 it is missing a ;    

       

      As i went to look for other code examples your syntax looks correct against what is out on the web.

      Not sure where the break is?

       

      shutdown_bug.jpg

    5. Show next comments  9 more
×