Skip to content

Commit fbec8a8

Browse files
committed
Add setting to disable splash when console is enabled
1 parent ffb228e commit fbec8a8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

BepInEx.SplashScreen.Patcher/BepInExSplashScreenPatcher.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,27 @@ public static void Initialize()
4747
try
4848
{
4949
var config = (ConfigFile)AccessTools.Property(typeof(ConfigFile), "CoreConfig").GetValue(null, null);
50-
if (!config.Bind("SplashScreen", "Enabled", true, "Display a splash screen with information about game load progress on game start-up.").Value)
50+
51+
var isEnabled = config.Bind("SplashScreen", "Enabled", true, "Display a splash screen with information about game load progress on game start-up.").Value;
52+
#if DEBUG
53+
const bool onlyNoConsoleDefault = false;
54+
#else
55+
const bool onlyNoConsoleDefault = true;
56+
#endif
57+
var consoleNotAllowed = config.Bind("SplashScreen", "OnlyNoConsole", onlyNoConsoleDefault, "Only display the splash screen if the logging console is turned off.").Value;
58+
59+
if (!isEnabled)
5160
return;
5261

62+
if (consoleNotAllowed)
63+
{
64+
if (config.TryGetEntry("Logging.Console", "Enabled", out ConfigEntry<bool> entry) && entry.Value)
65+
{
66+
Logger.LogDebug("Not showing because console is enabled");
67+
return;
68+
}
69+
}
70+
5371
var guiExecutablePath = Path.Combine(Path.GetDirectoryName(typeof(BepInExSplashScreenPatcher).Assembly.Location) ?? Paths.PatcherPluginPath, "BepInEx.SplashScreen.GUI.exe");
5472

5573
if (!File.Exists(guiExecutablePath))

0 commit comments

Comments
 (0)