mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Merge pull request #741 from Areloch/systemCommandFunction
Adds a systemCommand console utility function
This commit is contained in:
commit
dad0149dfe
1 changed files with 18 additions and 0 deletions
|
|
@ -2859,3 +2859,21 @@ DefineEngineFunction(getTimestamp, const char*, (), ,
|
||||||
|
|
||||||
return returnBuffer;
|
return returnBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TORQUE_TOOLS
|
||||||
|
DefineEngineFunction(systemCommand, S32, (const char* commandLineAction, const char* callBackFunction), , "", "")
|
||||||
|
{
|
||||||
|
if (commandLineAction != "")
|
||||||
|
{
|
||||||
|
S32 result = system(commandLineAction);
|
||||||
|
|
||||||
|
if (callBackFunction != "" && callBackFunction[0])
|
||||||
|
{
|
||||||
|
if (Con::isFunction(callBackFunction))
|
||||||
|
Con::executef(callBackFunction, result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue