Add console launching to config

This commit is contained in:
Bepis committed 2018-03-03 14:42:06 +11:00
1 parent 79e1446bd6
commit 374b398056
2 files changed
+15 -2

No files matched your search

+11 -1
View File
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEngine;
@@ -33,8 +34,18 @@ namespace BepInEx
if (loaded)
return;
if (bool.Parse(Config.GetEntry("console", "false")))
{
UnityInjector.ConsoleUtil.ConsoleWindow.Attach();
if (bool.Parse(Config.GetEntry("console-shiftjis", "false")))
UnityInjector.ConsoleUtil.ConsoleEncoding.ConsoleCodePage = 932;
}
try
{
BepInLogger.Log($"Chainloader started");
UnityEngine.Object.DontDestroyOnLoad(ManagerObject);
if (Directory.Exists(Utility.PluginsDirectory))
@@ -61,7 +72,6 @@ namespace BepInEx
catch (Exception ex)
{
UnityInjector.ConsoleUtil.ConsoleWindow.Attach();
//UnityInjector.ConsoleUtil.ConsoleEncoding.ConsoleCodePage = 932;
Console.WriteLine("Error occurred starting the game");
Console.WriteLine(ex.ToString());
+4 -1
View File
@@ -1,4 +1,5 @@
using System.Runtime.CompilerServices;
using System;
using System.Runtime.CompilerServices;
namespace BepInEx
{
@@ -28,6 +29,8 @@ namespace BepInEx
{
UnityEngine.UnityLogWriter.WriteStringToUnityLog($"BEPIN - {entry}\r\n");
Console.WriteLine(entry);
EntryLogged?.Invoke(entry, show);
}
}