Class: CConsole
Engine console interface.
Source
C++ class CConsole
Custom Constructor
CConsole
Remarks
Use get_console() to access the engine-owned console. Scripts do not create console instances.
Extends
Methods
execute()
execute(command: string): void;Execute console command immediately.
Parameters
| Parameter | Type | Description |
|---|---|---|
command | string | Console command. |
Returns
void
Remarks
Executes without adding the command to console history.
execute_deferred()
execute_deferred(command: string): void;Queue console command for deferred execution.
Parameters
| Parameter | Type | Description |
|---|---|---|
command | string | Console command. |
Returns
void
Remarks
Schedules a KERNEL:console event, so the command runs later on the engine event queue.
execute_script()
execute_script(script: string): void;Execute a config file through the console.
Parameters
| Parameter | Type | Description |
|---|---|---|
script | string | Config file path. |
Returns
void
Remarks
The binding prepends cfg_load to the provided path.
get_bool()
get_bool(key: string): boolean;Read console variable as boolean.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Console variable name. |
Returns
boolean
Boolean value.
Remarks
Returns false when the command is missing or is not a boolean-compatible mask/integer command.
get_float()
get_float(key: string): number;Read console variable as float.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Console variable name. |
Returns
number
Float value.
Remarks
Returns 0 when the command is missing or is not a float command.
get_integer()
get_integer(key: string): number;Read console variable as integer.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Console variable name. |
Returns
number
Integer value.
Remarks
Mask commands are returned as 0 or 1. Missing or incompatible commands return 0.
get_string()
get_string(key: string): Nullable<string>;Read console variable as string.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Console variable name. |
Returns
Nullable<string>
String value.
Remarks
Returns null when the command does not exist.
get_token()
get_token(key: string): Nullable<string>;Read console variable token text.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Console variable name. |
Returns
Nullable<string>
Token text.
Remarks
Uses the same engine path as get_string, so missing commands return null.
hide()
hide(): void;Hide the console window.
Returns
void
show()
show(): void;Show the console window.
Returns
void
Properties
__name
readonly __name: string;LuaBind instance constructor name.
Inherited from
__name
readonly static __name: string;LuaBind class constructor name.