Jump to content
shadowrecon

Halt_ifmissing_display_incluemanager

Recommended Posts

Finally a solution for missing includes for newbies who do not know how to install them. Simply place this right before you include a file in a script and type the name of the include like so 'OSI/' and it will HALT the script and show the includes manager if the include does not exist and show a message to install the script in the debug box!

 

[sCAR]

Procedure HALT_IFMISSING_DISPLAY_INCLUEMANAGER(INCLUDE: STRING);

begin

if (NOT DirectoryExists(IncludesPath + INCLUDE)) then

begin

VKeyDown(18);

VKeyDown(CharToVKey('F'));

VKeyDown(CharToVKey('I'));

VKeyDown(13);

VKeyUp(13);

VKeyUp(CharToVKey('I'));

VKeyUp(CharToVKey('F'));

VKeyUp(18);

ClearDebug;

Writeln('');

Writeln('PLEASE SELECT '+INCLUDE+' AND INSTALL THE INCLUDE');

Writeln('TO USE THIS SCRIPT!');

end;

end;

[/sCAR]

 

Example of USE in GMRL:

[sCAR]

{$IFDEF OSI}

HALT_DISPLAY_IFMISSING_INCLUEMANAGER('OSI/');

{$I OSI\OSI.scar}

{$ENDIF}

[/sCAR]

 

Credit to SLACKY for giving me this idea using hot keys!

Edited by shadowrecon
Link to comment
Share on other sites

Thanks, Ive been looking for a method for a while and slacky suggested hot-keys and i made this and it worked. So what i did in GMRL is put all the defines in the setup procedure and then call this function before defining OSI. :) I was surprised the solution was so simple!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...