Skip to content

[Mod] Debugmode in Version 1.0.4

lioncash edited this page Jul 3, 2011 · 6 revisions

This was requested in the issues section, and it was fairly easy to do so I decided to share.
Have fun! -CloudHopper

#Directions ###Part 1 In main.cs, add this:
public static bool debugMode = false;
After:
public static bool autoShutdown = false;

###Part 2 Now, go to line 905 which should look like this at first:
if (netMode != 2)
Change this to:
if ((!debugMode && !gameMenu) && (netMode != 2))

###Part 3 Add:
if (debugMode) { UpdateDebug(); }
After:
if (gameMenu) { UpdateMenu(); if (Main.netMode != 2) { return; } gamePaused = false; }

###Part 4 Add the code located at http://pastebin.com/TDkwtMBK in any part you would normally put a void (in Main.cs, of course)
I put it right before private static void UpdateTime()

#Adding it to ModClass.cs In all of your chat commands you can just change Main.debugMode to true or false. Here is the code I use: case "debug": if (parameter == "true") { Main.debugMode = true; } else Main.debugMode = false; break;

EDIT by Lioncash: A simpler way to implement debug mode into ModClass is to simply paste this into the chat command:

case "debug": Main.debugMode = parameter == "true";

Clone this wiki locally