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

◆ ExecuteIndividualWorldMigration()

static void Terraria.GameContent.UI.States.UIWorldSelect.ExecuteIndividualWorldMigration ( WorldFileData fileData,
string otherSaveFolderPath )
inlinestaticprivate

Definition at line 512 of file UIWorldSelect.cs.

513 {
514 try
515 {
516 string worldFileName = Path.GetFileNameWithoutExtension(fileData.Path);
517 foreach (string item in from s in Directory.GetFiles(Main.WorldPath, worldFileName + ".*")
518 where s.EndsWith(".wld") || s.EndsWith(".twld") || s.EndsWith(".bak")
519 select s)
520 {
521 File.Delete(item);
522 }
523 foreach (string otherWorldFile in from s in Directory.GetFiles(otherSaveFolderPath, worldFileName + ".*")
524 where s.EndsWith(".wld") || s.EndsWith(".twld") || s.EndsWith(".bak")
525 select s)
526 {
527 File.Copy(otherWorldFile, Path.Combine(Main.WorldPath, Path.GetFileName(otherWorldFile)), overwrite: true);
528 }
529 }
530 catch (Exception e)
531 {
532 Logging.tML.Error((object)Language.GetText("tModLoader.MigratePlayersException"), e);
533 }
535 Main.menuMode = 6;
536 }
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

References Terraria.GameContent.UI.States.UIWorldSelect._currentlyMigratingFiles, Terraria.Localization.Language.GetText(), Terraria.ModLoader.Logging.tML, and Terraria.Main.WorldPath.

Referenced by Terraria.GameContent.UI.States.UIWorldSelect.LoadMigratableWorlds().

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