Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Variables
- {
- public static string ModName = "Tricky.ExtraStorageHoppers";
- public static string ModVersion = "5";
- public static bool ModDebug = true;
- public static string FCEModPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "/ProjectorGames/FortressCraft/Mods/" + ModName + "/" + ModVersion + "/";
- public static void Log(object debug)
- {
- if (ModDebug)
- {
- debug = debug.ToString();
- string str = "[" + ModName + "]V" + ModVersion + "|***LOG***: " + debug;
- WriteStringToFile(str);
- }
- }
- public static void LogPlain(object debug)
- {
- if (ModDebug)
- {
- string str = debug.ToString();
- WriteStringToFile(str);
- }
- }
- public static void LogError(object debug)
- {
- if (ModDebug)
- {
- debug = debug.ToString();
- string str = "[" + ModName + "]V" + ModVersion + "|***ERROR LOG***: " + debug;
- WriteStringToFile(str);
- }
- }
- public static void LogValue(object ValueText, object Value)
- {
- if (ModDebug)
- {
- ValueText = ValueText.ToString();
- Value = Value.ToString();
- string str = "[" + ModName + "]V" + ModVersion + "|***VALUE LOG***: " + ValueText + " = " + Value;
- WriteStringToFile(str);
- }
- }
- public static void PrintLine()
- {
- WriteStringToFile("*******************************************************************************************");
- }
- public static void LogValue(object ValueText, object Value, bool Error)
- {
- if (ModDebug)
- {
- ValueText = ValueText.ToString();
- Value = Value.ToString();
- string str = "[" + ModName + "]V" + ModVersion + "|***VALUE LOG***: " + ValueText + " = " + Value;
- string str2 = "[" + ModName + "]V" + ModVersion + "|***VALUE LOG***: " + ValueText + " = " + Value;
- if (Error)
- {
- WriteStringToFile(str);
- }
- else
- {
- WriteStringToFile(str2);
- }
- }
- }
- public static void WriteStringToFile(string ValueText)
- {
- using (FileStream fs = new FileStream(FCEModPath + "ModLog.log", FileMode.Append, FileAccess.Write))
- using (StreamWriter sw = new StreamWriter(fs))
- {
- sw.WriteLine(ValueText);
- sw.Close();
- fs.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement