mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
This commit is contained in:
10
distribution/openrct2.d.ts
vendored
10
distribution/openrct2.d.ts
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user