Class: MockConsole
Mock of the X-Ray engine game console.
Implements
CConsole
Constructors
Constructor
new MockConsole(): MockConsole;Returns
MockConsole
Methods
create()
static create(): MockConsole;Returns
MockConsole
getInstance()
static getInstance(): MockConsole;Returns
MockConsole
getInstanceMock()
static getInstanceMock(): CConsole;Returns
CConsole
mock()
static mock(): CConsole;Returns
CConsole
reset()
static reset(): void;Returns
void
Properties
__name
readonly __name: string = "CConsole";LuaBind instance constructor name.
Implementation of
CConsole.__nameexecute
execute: Mock<UnknownFunction>;Execute console command immediately.
Remarks
Executes without adding the command to console history.
Param
command
Console command.
Implementation of
CConsole.executeexecute_deferred
execute_deferred: Mock<UnknownFunction>;Queue console command for deferred execution.
Remarks
Schedules a KERNEL:console event, so the command runs later on the engine event queue.
Param
command
Console command.
Implementation of
CConsole.execute_deferredexecute_script
execute_script: Mock<UnknownFunction>;Execute a config file through the console.
Remarks
The binding prepends cfg_load to the provided path.
Param
script
Config file path.
Implementation of
CConsole.execute_scriptget_bool
get_bool: Mock<() => boolean>;Read console variable as boolean.
Remarks
Returns false when the command is missing or is not a boolean-compatible mask/integer command.
Param
key
Console variable name.
Returns
Boolean value.
Implementation of
CConsole.get_boolget_float
get_float: Mock<() => number>;Read console variable as float.
Remarks
Returns 0 when the command is missing or is not a float command.
Param
key
Console variable name.
Returns
Float value.
Implementation of
CConsole.get_floatget_integer
get_integer: Mock<() => number>;Read console variable as integer.
Remarks
Mask commands are returned as 0 or 1. Missing or incompatible commands return 0.
Param
key
Console variable name.
Returns
Integer value.
Implementation of
CConsole.get_integerget_string
get_string: Mock<() => string>;Read console variable as string.
Remarks
Returns null when the command does not exist.
Param
key
Console variable name.
Returns
String value.
Implementation of
CConsole.get_stringget_token
get_token: Mock<() => string>;Read console variable token text.
Remarks
Uses the same engine path as get_string, so missing commands return null.
Param
key
Console variable name.
Returns
Token text.
Implementation of
CConsole.get_tokenhide
hide: Mock<UnknownFunction>;Hide the console window.
Implementation of
CConsole.hideshow
show: Mock<UnknownFunction>;Show the console window.
Implementation of
CConsole.showinstance
static instance: MockConsole | null = null;