public string GetBackupFolderTitle() { var townName = Players[0].Personal.TownName; var timestamp = Main.LastSaved.TimeStamp.Replace(':', '.'); return(StringUtil.CleanFileName($"{townName} - {timestamp}")); }
private static void Dump(this DesignPatternPRO dp, string path) { var name = dp.DesignName; var fn = StringUtil.CleanFileName($"{name}.nhpd"); var dest = Path.Combine(path, fn); File.WriteAllBytes(dest, dp.Data); }
/// <summary> /// Dumps all designs to the requested <see cref="path"/>. /// </summary> /// <param name="sav">Save Data to dump from</param> /// <param name="path">Path to dump to</param> public static void DumpDesigns(this MainSave sav, string path) { for (int i = 0; i < 50; i++) { var dp = sav.GetDesign(i); var name = dp.DesignName; var fn = StringUtil.CleanFileName($"{name}.nhd"); var dest = Path.Combine(path, fn); File.WriteAllBytes(dest, dp.Data); } }
private static void Dump(this DesignPatternPRO dp, string path, int index, bool indexed) { var name = dp.DesignName; string fn = indexed ? $"{index:00} - {name}.nhd" : $"{name}.nhd"; fn = StringUtil.CleanFileName(fn); var dest = Path.Combine(path, fn); File.WriteAllBytes(dest, dp.Data); }
private static void Dump(this DesignPatternPRO dp, string path, int index) { // Dump without index var name = dp.DesignName; var fn = StringUtil.CleanFileName($"{name}.nhpd"); var dest = Path.Combine(path, fn); File.WriteAllBytes(dest, dp.Data); // Dump with index fn = StringUtil.CleanFileName($"{index:00} - {name}.nhpd"); dest = Path.Combine(path, fn); File.WriteAllBytes(dest, dp.Data); }