summaryrefslogtreecommitdiff
path: root/src/SMAPI/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Program.cs')
-rw-r--r--src/SMAPI/Program.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs
index a8664160..b2e213fe 100644
--- a/src/SMAPI/Program.cs
+++ b/src/SMAPI/Program.cs
@@ -181,27 +181,40 @@ namespace StardewModdingAPI
bool writeToConsole = !args.Contains("--no-terminal") && Environment.GetEnvironmentVariable("SMAPI_NO_TERMINAL") == null;
// get mods path
+ bool? developerMode = null;
string modsPath;
{
string rawModsPath = null;
- // get from command line args
+ // get mods path from command line args
int pathIndex = Array.LastIndexOf(args, "--mods-path") + 1;
if (pathIndex >= 1 && args.Length >= pathIndex)
rawModsPath = args[pathIndex];
+ // get developer mode from command line args
+ if (args.Contains("--developer-mode"))
+ developerMode = true;
+ if (args.Contains("--developer-mode-off"))
+ developerMode = false;
+
// get from environment variables
if (string.IsNullOrWhiteSpace(rawModsPath))
rawModsPath = Environment.GetEnvironmentVariable("SMAPI_MODS_PATH");
+ if (developerMode is null)
+ {
+ string rawDeveloperMode = Environment.GetEnvironmentVariable("SMAPI_DEVELOPER_MODE");
+ if (rawDeveloperMode != null)
+ developerMode = bool.Parse(rawDeveloperMode);
+ }
- // normalise
+ // normalize
modsPath = !string.IsNullOrWhiteSpace(rawModsPath)
? Path.Combine(Constants.GamePath, rawModsPath)
: Constants.DefaultModsPath;
}
// load SMAPI
- using SCore core = new(modsPath, writeToConsole);
+ using SCore core = new(modsPath, writeToConsole, developerMode);
core.RunInteractively();
}