PixelCrushers.DialogueSystem.LuaConsole Class Reference

An in-game Lua console presented using Unity GUI. More...

Inheritance diagram for PixelCrushers.DialogueSystem.LuaConsole:
Collaboration diagram for PixelCrushers.DialogueSystem.LuaConsole:

Public Attributes

KeyCode firstKey = KeyCode.BackQuote
 Hold down this key and press Second Key to open console.
 
KeyCode secondKey = KeyCode.L
 Hold down First Key and press this key to open console.
 
bool visible = false
 Is the console visible or hidden?
 
GUISkin guiSkin
 Optional GUI Skin to style console window.
 
Vector2 minSize = new Vector2(384f, 384f)
 The minimum size of the console window.
 
int maxHistory = 20
 The max number of previous commands to remember.
 
bool pauseGameWhileOpen = false
 If true, then while open set Time.timeScale to 0.
 

Protected Member Functions

virtual void Start ()
 
virtual void SetVisible (bool newValue)
 
virtual void OnGUI ()
 OnGUI draws the console if it's visible, and toggles visibility based on the key trigger.
 
virtual void DrawConsole ()
 
Rect DefineWindowRect ()
 
virtual void DrawConsoleWindow (int id)
 
virtual bool IsKeyEvent (KeyCode keyCode)
 
virtual void RunLuaCommand ()
 
virtual string GetLuaResultString (Lua.Result result)
 
virtual string FormatTableResult (Lua.Result result)
 
virtual void UseHistory (int direction)
 

Protected Attributes

List< string > m_history = new List<string>()
 
int m_historyPosition = 0
 
string m_input = string.Empty
 
string m_output = string.Empty
 
Rect m_windowRect = new Rect(0, 0, 0, 0)
 
Rect m_closeButtonRect = new Rect(0, 0, 0, 0)
 
Vector2 m_scrollPosition = new Vector2(0, 0)
 
bool m_isFirstKeyDown = false
 

Detailed Description

An in-game Lua console presented using Unity GUI.

This console is activated by the key combination ~(tilde) + L (customizable) and allows you to enter Lua commands and view the results. The up and down keys scroll through previous commands, and Escape closes the console.

Member Function Documentation

◆ DefineWindowRect()

Rect PixelCrushers.DialogueSystem.LuaConsole.DefineWindowRect ( )
inlineprotected

◆ DrawConsole()

virtual void PixelCrushers.DialogueSystem.LuaConsole.DrawConsole ( )
inlineprotectedvirtual

◆ DrawConsoleWindow()

virtual void PixelCrushers.DialogueSystem.LuaConsole.DrawConsoleWindow ( int  id)
inlineprotectedvirtual

◆ FormatTableResult()

virtual string PixelCrushers.DialogueSystem.LuaConsole.FormatTableResult ( Lua::Result  result)
inlineprotectedvirtual

◆ GetLuaResultString()

virtual string PixelCrushers.DialogueSystem.LuaConsole.GetLuaResultString ( Lua::Result  result)
inlineprotectedvirtual

◆ IsKeyEvent()

virtual bool PixelCrushers.DialogueSystem.LuaConsole.IsKeyEvent ( KeyCode  keyCode)
inlineprotectedvirtual

◆ OnGUI()

virtual void PixelCrushers.DialogueSystem.LuaConsole.OnGUI ( )
inlineprotectedvirtual

OnGUI draws the console if it's visible, and toggles visibility based on the key trigger.

◆ RunLuaCommand()

virtual void PixelCrushers.DialogueSystem.LuaConsole.RunLuaCommand ( )
inlineprotectedvirtual

◆ SetVisible()

virtual void PixelCrushers.DialogueSystem.LuaConsole.SetVisible ( bool  newValue)
inlineprotectedvirtual

◆ Start()

virtual void PixelCrushers.DialogueSystem.LuaConsole.Start ( )
inlineprotectedvirtual

◆ UseHistory()

virtual void PixelCrushers.DialogueSystem.LuaConsole.UseHistory ( int  direction)
inlineprotectedvirtual

Member Data Documentation

◆ firstKey

KeyCode PixelCrushers.DialogueSystem.LuaConsole.firstKey = KeyCode.BackQuote

Hold down this key and press Second Key to open console.

◆ guiSkin

GUISkin PixelCrushers.DialogueSystem.LuaConsole.guiSkin

Optional GUI Skin to style console window.

◆ m_closeButtonRect

Rect PixelCrushers.DialogueSystem.LuaConsole.m_closeButtonRect = new Rect(0, 0, 0, 0)
protected

◆ m_history

List<string> PixelCrushers.DialogueSystem.LuaConsole.m_history = new List<string>()
protected

◆ m_historyPosition

int PixelCrushers.DialogueSystem.LuaConsole.m_historyPosition = 0
protected

◆ m_input

string PixelCrushers.DialogueSystem.LuaConsole.m_input = string.Empty
protected

◆ m_isFirstKeyDown

bool PixelCrushers.DialogueSystem.LuaConsole.m_isFirstKeyDown = false
protected

◆ m_output

string PixelCrushers.DialogueSystem.LuaConsole.m_output = string.Empty
protected

◆ m_scrollPosition

Vector2 PixelCrushers.DialogueSystem.LuaConsole.m_scrollPosition = new Vector2(0, 0)
protected

◆ m_windowRect

Rect PixelCrushers.DialogueSystem.LuaConsole.m_windowRect = new Rect(0, 0, 0, 0)
protected

◆ maxHistory

int PixelCrushers.DialogueSystem.LuaConsole.maxHistory = 20

The max number of previous commands to remember.

◆ minSize

Vector2 PixelCrushers.DialogueSystem.LuaConsole.minSize = new Vector2(384f, 384f)

The minimum size of the console window.

◆ pauseGameWhileOpen

bool PixelCrushers.DialogueSystem.LuaConsole.pauseGameWhileOpen = false

If true, then while open set Time.timeScale to 0.

◆ secondKey

KeyCode PixelCrushers.DialogueSystem.LuaConsole.secondKey = KeyCode.L

Hold down First Key and press this key to open console.

◆ visible

bool PixelCrushers.DialogueSystem.LuaConsole.visible = false

Is the console visible or hidden?


The documentation for this class was generated from the following file: