Mods in singleplayer (-msco-singleplayer), 2.10.10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+16
-6
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Harmony;
|
||||
@@ -33,6 +33,12 @@ namespace MSCO
|
||||
/// <summary>Ordner von MSCO.dll (<Spiel>\MSCO).</summary>
|
||||
public static string Folder { get { return folder; } }
|
||||
static bool patchedGame, patchedPlayMaker, started;
|
||||
|
||||
/// <summary>
|
||||
/// Singleplayer mit Mods (Launcher: SINGLEPLAYER, "-msco-singleplayer"): nur die eigenen Mods laden - kein
|
||||
/// MSCO-Menü, kein Multiplayer, das Spiel bleibt sonst unverändert.
|
||||
/// </summary>
|
||||
public static readonly bool Singleplayer = Array.IndexOf(Environment.GetCommandLineArgs(), "-msco-singleplayer") >= 0;
|
||||
static StreamWriter log;
|
||||
|
||||
public static void Start()
|
||||
@@ -43,6 +49,7 @@ namespace MSCO
|
||||
log = new StreamWriter(Path.Combine(folder, "MSCO_Loader.txt"), false) { AutoFlush = true };
|
||||
Log("MSCO " + MSCO.ModVersion + " loader started (standalone, without MSCLoader)");
|
||||
Log("Command line: " + string.Join(" ", Environment.GetCommandLineArgs()));
|
||||
if (Singleplayer) Log("Singleplayer mode: only mods, no multiplayer");
|
||||
AppDomain.CurrentDomain.AssemblyResolve += Resolve;
|
||||
AppDomain.CurrentDomain.AssemblyLoad += (_, e) => OnAssemblyLoaded(e.LoadedAssembly);
|
||||
foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) OnAssemblyLoaded(a);
|
||||
@@ -126,7 +133,7 @@ namespace MSCO
|
||||
{
|
||||
host = this;
|
||||
MscoLog.Info("Welcome to MSCO by mbm.wtf");
|
||||
MenuBranding.ApplyWindow();
|
||||
if (!Bootstrap.Singleplayer) MenuBranding.ApplyWindow();
|
||||
// Den Nachrichten-Bildschirm des Spiels ("Latest news ... press any key") überspringen - direkt ins Hauptmenü
|
||||
string scene = Application.loadedLevelName;
|
||||
Bootstrap.Log("First scene: " + scene);
|
||||
@@ -142,7 +149,7 @@ namespace MSCO
|
||||
AudioListener.volume = 0f;
|
||||
return;
|
||||
}
|
||||
MultiplayerManager.Ensure();
|
||||
if (!Bootstrap.Singleplayer) MultiplayerManager.Ensure();
|
||||
SceneChanged(scene);
|
||||
}
|
||||
|
||||
@@ -220,9 +227,12 @@ namespace MSCO
|
||||
loadingScreen = false;
|
||||
if (previousVolume >= 0f) { AudioListener.volume = previousVolume; previousVolume = -1f; }
|
||||
Bootstrap.Log("Level loaded: " + Application.loadedLevelName);
|
||||
MenuBranding.ApplyWindow();
|
||||
if (Application.loadedLevelName == "MainMenu") StartCoroutine(BrandMenu());
|
||||
MultiplayerManager.Ensure();
|
||||
if (!Bootstrap.Singleplayer)
|
||||
{
|
||||
MenuBranding.ApplyWindow();
|
||||
if (Application.loadedLevelName == "MainMenu") StartCoroutine(BrandMenu());
|
||||
MultiplayerManager.Ensure();
|
||||
}
|
||||
SceneChanged(Application.loadedLevelName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user