diff --git a/CharacterRecordsGenerator/RecordEditor.xaml.cs b/CharacterRecordsGenerator/RecordEditor.xaml.cs index 5fea787..93e2939 100644 --- a/CharacterRecordsGenerator/RecordEditor.xaml.cs +++ b/CharacterRecordsGenerator/RecordEditor.xaml.cs @@ -1,4 +1,4 @@ -using MahApps.Metro.Controls.Dialogs; +using MahApps.Metro.Controls.Dialogs; using System; using System.Collections.Generic; using System.Diagnostics; @@ -94,6 +94,24 @@ namespace CharacterRecordsGenerator throw new ArgumentOutOfRangeException(); } } + // have a path, outdated extension + if (Path.GetExtension(_currentFilePath) != ".ss13records") + { + switch ( + await + this.ShowMessageAsync("Outdated File Extension", + "This profile is using an outdated extension from an older version of the CRG. Press \"OK\" to convert to the new file extension (.ss13records).", + MessageDialogStyle.AffirmativeAndNegative)) + { + case MessageDialogResult.Affirmative: + SaveContentAs(null, null); + return; + case MessageDialogResult.Negative: + return; + default: + throw new ArgumentOutOfRangeException(); + } + } var fs = File.Open(_currentFilePath, FileMode.Truncate); ProtoBuf.Serializer.Serialize(fs, Data); @@ -107,7 +125,8 @@ namespace CharacterRecordsGenerator AddExtension = true, CheckFileExists = true, CheckPathExists = true, - Filter = "Character Profiles (*.ss13prof)|*.ss13prof|All Files (*.*)|*.*" + Filter = "Character Profiles (*.ss13records, *.ss13prof)|*.ss13records;*.ss13prof|" + + "All Files (*.*)|*.*" }; if (!(dialog.ShowDialog() ?? false)) return; @@ -133,7 +152,8 @@ namespace CharacterRecordsGenerator { AddExtension = true, CheckPathExists = true, - Filter = "Character Profiles (*.ss13prof)|*.ss13prof|All Files (*.*)|*.*" + Filter = "Character Profiles (*.ss13records)|*.ss13records|" + + "All Files (*.*)|*.*" }; if (!(dialog.ShowDialog() ?? false)) return; var fs = File.Open(dialog.FileName, FileMode.Create); diff --git a/CharacterRecordsGenerator/Utility.cs b/CharacterRecordsGenerator/Utility.cs index 1ca1c22..ce35588 100644 --- a/CharacterRecordsGenerator/Utility.cs +++ b/CharacterRecordsGenerator/Utility.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Reflection; @@ -53,14 +53,6 @@ namespace CharacterRecordsGenerator return builder.ToString(); } - /// - /// Returns true if the specified species has gender. - /// - /// - /// - public static bool HasGender(this SpeciesType species) => - !(species == SpeciesType.Diona || species == SpeciesType.IPC || species == SpeciesType.Vaurca); - public static string SubspeciesNiceName(SpeciesSubType species) { var attr = species.GetAttributeOfType();