C# Class DeveloperConsole.DeveloperConsole

The console model
Inheritance: Script, IDeveloperConsole
Mostra file Open project: Dakota628/GTAVDeveloperConsole Class Usage Examples

Public Properties

Property Type Description
Debug bool
Input string

Public Methods

Method Description
ClearLines ( ) : void

Clears all the lines in the console

DeveloperConsole ( ) : System

Creates the console

PrintCommandInfo ( DeveloperConsole.CommandDispatcher cmd ) : void

Prints the man page for a specified command to the console

PrintCommandInfo ( string cmd ) : void

Prints the man page for a specified command to the console

PrintDebug ( string s ) : void

Prints a debug line to the console if Debug is true

PrintError ( string s ) : void

Prints an error line to the console

PrintLine ( string s ) : void

Prints a line to the console with the default text color

PrintLine ( string s, Color c ) : void

Prints a line to the console

PrintWarning ( string s ) : void

Prints a warning line to the console

RemoveLastLine ( ) : void

Removes the last line of the console

ShowConsole ( bool show ) : void

Show the console

Private Methods

Method Description
BackSpace ( ) : void

Delete 1 character before the cursor

CursorLeft ( ) : void

Move the cursor to the left 1 character

CursorRight ( ) : void

Move the cursor to the right 1 character

Del ( ) : void

Delete 1 character after the cursor

DrawConsole ( ) : void

Draws the console on screen

GetLargeStringUIText ( string s, Point p, float sz, Color c, GTA.Font f, bool cnt ) : List

Breaks a large string up into multiple UIText objects

InjectToGAC ( ) : void

Inject our assembly to the Global Assembly Cache so all scripts have access to it

LastInput ( ) : void

Set the input line to the last item in input history

NextInput ( ) : void

Set the input line to the next item in input history If no next line in input history, clears input

OnKeyDown ( object sender, KeyEventArgs e ) : void

Handles key presses

OnKeyUp ( object sender, KeyEventArgs e ) : void

Handles key releases

OnTick ( object sender, EventArgs e ) : void

This method is called every game tick

RegisterConsoleScript ( Script s, OnConsoleAttached c ) : void

Register a script with the console

RunCommand ( ) : void

Run the command string from the input line

ScrollDown ( ) : void

Scroll the console down

ScrollUp ( ) : void

Scroll the console up

SetConsoleControls ( ) : void

Disables all controls not enabled while using the console

SetKeyDown ( Keys k ) : bool
Split ( string str, int chunkSize ) : List

Splits a string up into chunks of a specified size

Method Details

ClearLines() public method

Clears all the lines in the console
public ClearLines ( ) : void
return void

DeveloperConsole() public method

Creates the console
public DeveloperConsole ( ) : System
return System

PrintCommandInfo() public method

Prints the man page for a specified command to the console
public PrintCommandInfo ( DeveloperConsole.CommandDispatcher cmd ) : void
cmd DeveloperConsole.CommandDispatcher The command to print info for
return void

PrintCommandInfo() public method

Prints the man page for a specified command to the console
public PrintCommandInfo ( string cmd ) : void
cmd string The name of the command to print info for
return void

PrintDebug() public method

Prints a debug line to the console if Debug is true
public PrintDebug ( string s ) : void
s string The message
return void

PrintError() public method

Prints an error line to the console
public PrintError ( string s ) : void
s string The message
return void

PrintLine() public method

Prints a line to the console with the default text color
public PrintLine ( string s ) : void
s string The message
return void

PrintLine() public method

Prints a line to the console
public PrintLine ( string s, Color c ) : void
s string The message
c Color The color of the line
return void

PrintWarning() public method

Prints a warning line to the console
public PrintWarning ( string s ) : void
s string The message
return void

RemoveLastLine() public method

Removes the last line of the console
public RemoveLastLine ( ) : void
return void

ShowConsole() public method

Show the console
public ShowConsole ( bool show ) : void
show bool Whether or not the console should be shown
return void

Property Details

Debug public_oe property

Whether or not console debug is enabled
public bool Debug
return bool

Input public_oe property

The consoles input text
public string Input
return string