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

◆ ExecuteIndividualPlayerMigration()

static void Terraria.GameContent.UI.States.UICharacterSelect.ExecuteIndividualPlayerMigration ( PlayerFileData fileData,
string otherSaveFolderPath )
inlinestaticprivate

Definition at line 503 of file UICharacterSelect.cs.

504 {
505 try
506 {
507 string playerFileName = Path.GetFileNameWithoutExtension(fileData.Path);
508 foreach (string item in from s in Directory.GetFiles(Main.PlayerPath, playerFileName + ".*")
509 where s.EndsWith(".plr") || s.EndsWith(".tplr") || s.EndsWith(".bak")
510 select s)
511 {
512 File.Delete(item);
513 }
514 string existingPlayerMapPath = Path.Combine(Main.PlayerPath, Path.GetFileNameWithoutExtension(fileData.Path));
516 {
518 }
519 foreach (string otherPlayerFile in from s in Directory.GetFiles(otherSaveFolderPath, playerFileName + ".*")
520 where s.EndsWith(".plr") || s.EndsWith(".tplr") || s.EndsWith(".bak")
521 select s)
522 {
523 File.Copy(otherPlayerFile, Path.Combine(Main.PlayerPath, Path.GetFileName(otherPlayerFile)), overwrite: true);
524 }
525 string playerMapPath = Path.Combine(otherSaveFolderPath, Path.GetFileNameWithoutExtension(fileData.Path));
526 if (Directory.Exists(playerMapPath))
527 {
529 }
530 }
531 catch (Exception e)
532 {
533 Logging.tML.Error((object)Language.GetText("tModLoader.MigratePlayersException"), e);
534 }
536 Main.menuMode = 1;
537 }
static LocalizedText GetText(string key)
Retrieves a LocalizedText object for a specified localization key. The actual text value can be retri...
Definition Language.cs:25
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
static void CopyFolder(string sourcePath, string destinationPath)

References Terraria.GameContent.UI.States.UICharacterSelect._currentlyMigratingFiles, Terraria.Utilities.FileUtilities.CopyFolder(), Terraria.Localization.Language.GetText(), Terraria.Main.PlayerPath, and Terraria.ModLoader.Logging.tML.

Referenced by Terraria.GameContent.UI.States.UICharacterSelect.LoadMigratablePlayers().

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