Class ConsoleManager

Handles the set of currently active CVar instances.

Constructors

Accessors

Methods

  • Executes a console command.

    Parameters

    • command: string

      The command to execute.

    Returns boolean

    true upon sucess

    The method tokenizes the string into arguments that are then passed to the ConsoleCommand that matches the name of the first argument. If no ConsoleCommand has been found, the system tries to locate a CVar that matches the name of the first argument. If a CVar has been found it's value will be written to the console if no furhter argument is present. If another argument is available, it will be used to set the value of the CVar. Arguments can be escapted using quotes. Quotes themselve can be escaped using a backslash.

  • Gets a list of commands that match the autocompletion.

    Parameters

    • entry: string

    Returns string[]

  • Gets a list of cvars that match the autocompletion.

    Parameters

    • entry: string

    Returns string[]

  • Tries to find a CVar by the given name. If no such CVar exists, returns nullptr.

    Parameters

    • name: string

    Returns CVar

  • Loads variable definitions from a configuration file.

    Parameters

    • path: FilePath

      The path to the configuration file to be loaded.

    Returns void

  • Saves variable definitions to a configuration file.

    Parameters

    • path: FilePath

      The path to the configuration file to be written with the current configuration.

    Returns void

  • Tries to load the configuration from a file. Unlike loadConfigurationFromFile(), this method checks if the file exists before loading it.

    Parameters

    Returns boolean