Cloth Config API (Fabric/Forge/NeoForge)

Cloth Config API (Fabric/Forge/NeoForge)

169M Downloads

Suggestion: Text input improvements

Pyrofab opened this issue ยท 8 comments

commented

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.

commented

String Validation & Suggestions (Dropdown Menus) are now done

commented

Are keyshortcut inputs currently supported? I couldn't find any relatable method call inside of ConfigEntryBuilder.

commented

Can you elaborate? What do you mean by key shortcuts?

commented

Like the ones under the Control settings. Where you left click the button and press a key on your keyboard.

commented

Wow, awesome!

commented

They are done in v2.5.1

commented
  • 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