mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Add console launching to config
This commit is contained in:
1 parent
79e1446bd6
commit
374b398056
2 files changed
+15
-2
No files matched your search
+11
-1
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user