mirror of https://github.com/OpenRCT2/OpenRCT2.git
This commit is contained in:
parent
06bbf5ddda
commit
2c731273c1
|
@ -91,6 +91,16 @@ declare global {
|
|||
interface Console {
|
||||
clear(): void;
|
||||
log(message?: any, ...optionalParams: any[]): void;
|
||||
|
||||
/**
|
||||
* Executes a command using the legacy console REPL. This should not be used
|
||||
* by plugins, and exists only for servers to continue using old commands until
|
||||
* all functionality can be accomplished with this scripting API.
|
||||
*
|
||||
* @deprecated
|
||||
* @param command The command and arguments to execute.
|
||||
*/
|
||||
executeLegacy(command: string): void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,10 +51,16 @@ namespace OpenRCT2::Scripting
|
|||
return 0;
|
||||
}
|
||||
|
||||
void executeLegacy(const std::string& command)
|
||||
{
|
||||
_console.Execute(command);
|
||||
}
|
||||
|
||||
static void Register(duk_context* ctx)
|
||||
{
|
||||
dukglue_register_method(ctx, &ScConsole::clear, "clear");
|
||||
dukglue_register_method_varargs(ctx, &ScConsole::log, "log");
|
||||
dukglue_register_method(ctx, &ScConsole::executeLegacy, "executeLegacy");
|
||||
}
|
||||
};
|
||||
} // namespace OpenRCT2::Scripting
|
||||
|
|
Loading…
Reference in New Issue