TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ SetSavePath()

static void Terraria.Program.SetSavePath ( )
inlinestaticprivate

Definition at line 481 of file Program.cs.

482 {
483 if (LaunchParameters.TryGetValue("-tmlsavedirectory", out var customSavePath))
484 {
487 }
488 else if (File.Exists("savehere.txt"))
489 {
490 SavePathShared = "tModLoader";
492 }
493 else
494 {
495 SavePathShared = Path.Combine(SavePath, "tModLoader");
496 string savePathCopy = SavePath;
497 SavePath = Path.Combine(SavePath, SaveFolderName);
498 try
499 {
501 }
502 catch (Exception e)
503 {
504 ErrorReporting.FatalExit("An error occured migrating files and folders to the new structure", e);
505 }
506 }
507 Logging.tML.Info((object)("Saves Are Located At: " + Path.GetFullPath(SavePath)));
509 {
510 Logging.tML.Info((object)"Controlled Folder Access detection failed, something is preventing the game from accessing the registry.");
511 }
513 {
514 Logging.tML.Info((object)("Controlled Folder Access feature detected. If game fails to launch make sure to add \"" + Environment.ProcessPath + "\" to the \"Allow an app through Controlled folder access\" menu found in the \"Ransomware protection\" menu."));
515 }
516 }
static void FatalExit(string message)
This class handles displaying errors that require a OS-provided modal message box....
static void PortFilesMaster(string savePath, bool isCloud)
Definition Program.cs:470
static string SaveFolderName
Definition Program.cs:78
static string SavePathShared
Definition Program.cs:75
static string SavePath
Definition Program.cs:37
static Dictionary< string, string > LaunchParameters
Definition Program.cs:35
@ Environment
Will override vanilla SceneEffect for Sandstorm, Hell, Above surface during Eclipse,...

References Terraria.ModLoader.Engine.ControlledFolderAccessSupport.ControlledFolderAccessDetected, Terraria.ModLoader.Engine.ControlledFolderAccessSupport.ControlledFolderAccessDetectionPrevented, Terraria.ModLoader.Engine.ErrorReporting.FatalExit(), Terraria.Program.LaunchParameters, Terraria.Program.PortFilesMaster(), Terraria.Program.SaveFolderName, Terraria.Program.SavePath, Terraria.Program.SavePathShared, and Terraria.ModLoader.Logging.tML.

Referenced by Terraria.Program.StartupSequenceTml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: