Suggestion: Text input improvements
Pyrofab opened this issue ยท 8 comments
Quite a few mods use specialized strings (like identifiers) in some way in their configuration, but the current string text fields are a bit lacking for that use. A few improvements could be made to make that easier for both the developer and the user.
- String validation: being able to supply a regular expression or a set of valid strings could help a lot with preventing invalid input.
- Suggestions: if a set of valid strings is supplied, the text field could list suggestions based on what the user started typing.
- String sets: when building a string list, Cloth should offer the option of using a Set instead to prevent duplicate values.
Helper methods could also be offered for the special case of Identifier configs. A method could take a Registry and configure all the above based on the registered values.
Are keyshortcut inputs currently supported? I couldn't find any relatable method call inside of ConfigEntryBuilder.
Like the ones under the Control settings. Where you left click the button and press a key on your keyboard.
- String Validation: It is already doable in fields except lists, I will extends more support for lists
- Suggestions: This one is a tricky one, as this could potentially be hard to understand by the user. Implementing the text field like a combobox might be a better solution
- String Sets: Absolutely doable