ModLib
ModLib copied to clipboard
Enums or string validator
Want to use this for my mod as I like the look of the menu, but I need to use the InputKey enum, so I would love to have either a searchable dropdown or a validatable string input.
Setting like this:
[XmlElement]
[SettingProperty("Blabla", "More blabla", typeof(MyOwnStringValidator))]
public string OkayKey { get; set; }
Validator could be like this:
public class MyOwnStringValidator : IStringSettingValidator
{
public bool IsValid(string input) => Enum.TryParse<InputKey>(input, true, out _);
}
Meanwhile: I just realized even strings are not supported yet, my bad
This is defnitely on the list of features to add!