diff --git a/MLEM.Ui/Elements/TextField.cs b/MLEM.Ui/Elements/TextField.cs index 4176ed0..5c2775f 100644 --- a/MLEM.Ui/Elements/TextField.cs +++ b/MLEM.Ui/Elements/TextField.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Linq; using System.Text; using Microsoft.Xna.Framework; @@ -36,6 +37,14 @@ namespace MLEM.Ui.Elements { /// A that only allows letters and numerals /// public static readonly Rule LettersNumbers = (field, add) => add.All(c => char.IsLetter(c) || char.IsNumber(c)); + /// + /// A that only allows characters not contained in + /// + public static readonly Rule PathNames = (field, add) => add.IndexOfAny(Path.GetInvalidPathChars()) < 0; + /// + /// A that only allows characters not contained in + /// + public static readonly Rule FileNames = (field, add) => add.IndexOfAny(Path.GetInvalidFileNameChars()) < 0; /// /// The color that this text field's text should display with