The Debug Window is a window which receives and prints debug output through use of it's DPrint(str) function.  It will be used to print out debug notices (loading level, switching section, etc.), warnings and errors.  It is currently at Revision 1.


The debug window, DebugForm.cs, will be instantiated in Main under the name Debug.  By default, the window will not be visible but will still be printed to.  To make it visible, the user would press a key combination (not yet decided), or the developer can set the Visible property to True.  To print to it, call Main.Debug.DPrint, or insert and call this subroutine in your classes:

public void DPrintL(str message)

The form has a limit of 10,000 characters and should be cleared if it gets that high.  The log can also be saved to disk for later use.

A newline is not required, it is inserted automatically.

Objects in DebugForm

bool CanWriteText = true;
This determines whether the form can print text.  DPrint ignores messages if this variable is false.  It is set to false when the limit is reached, and set to true upon clear.

public void dPrint(string input)

This is the main function.  It concatenates the input with the current text after checking it against the limit and adding a newline.

Last edited Jun 15, 2011 at 8:44 PM by smcgamer, version 1


No comments yet.