YetAnotherConfigLib

YetAnotherConfigLib (yacl) is just that. A builder-based configuration library for Minecraft.

LGPL-3.0 License

Stars
79

Bot releases are visible (Hide)

YetAnotherConfigLib - v2.2.0

Published by isXander almost 2 years ago

User Changes

  • New List is empty text when lists are empty
  • Fix category buttons sometimes not being clickable when you can scroll
  • Fix the list add button not disabling when lists are disabled
  • Fix the option list background not quite reaching the edge of the screen.

Developer Changes

  • New LabelOption for shorthand to making labels!
  • Log when option bindings don't match up after using their save function
  • Internally move YACLScreen button actions into separate methods for future features :o
  • Fully publish sources jar & javadoc jar now that the loom plugin is fixed.
YetAnotherConfigLib - v2.1.1

Published by isXander almost 2 years ago

  • Remove padding between list items
  • No longer hide add and reset buttons when lists are collapsed, but automatically expand them when clicked
  • Fix removing items from lists didn't update up and down buttons
  • Fix lists not updating properly when removing the final item from a list
  • Refactor some gui list code to abstract all list functionality from main gui classes
  • Fix option entries sometimes overlapping due to the reset button
  • Fix string elements cropping 1px off the top of the text
  • Abstracted builders to restrict API usage
YetAnotherConfigLib - v2.1.0

Published by isXander almost 2 years ago

Lists

Implements mutable list options where you can create, remove and shift entries in a list.

API

Lists hack option groups with their own implementation for this, so each individual list takes form as a whole option group.

ListOption.createBuilder(String.class)
    .name(Text.of("List Option"))
    .binding(/* gets and sets a List, requires list field to be not final, does not manipulate the list */)
    .controller(StringController::new) // usual controllers, passed to every entry
    .initial("") // when adding a new entry to the list, this is the initial value it has
    .build()

Implementation details

When implementing this, it was vital to me that all controllers work with lists, not ones specifically designed
for list entries. This was achieved quite easily by having each entry being its own option with an empty name and tooltip with its own controller, that pairs with its list "parent" to actually modify the option.

Option groups were taken advantage of and hacked into its own option, only minor changes had to be made to get this
to work with value application.

Applicable controllers have been modified to expand their inputs to near full width when no name is present.

Screenshots

screenshot

String improvements

  • Allow StringControllerElement to have unlimited text length
  • When pressing Delete in a text field whilst text is highlighted,
    it will act like Backspace like it should.

Other changes

  • Slightly compacted elements
YetAnotherConfigLib - v2.0.0

Published by isXander almost 2 years ago

  • Update to 1.19.3
  • Colour field controllers
  • Better carot positioning when clicking in text fields
  • Better text selection for text fields
  • Smooth scrolling for category list
  • Fix category list scrollbar appearing under option list background in-game
  • Fix tick box name text length limiting
YetAnotherConfigLib - v1.7.1

Published by isXander almost 2 years ago

  • Breaking change: GsonConfigInstance now only serializes fields annotated with @ConfigEntry to prevent strange GSON problem.
YetAnotherConfigLib - v1.7.0

Published by isXander almost 2 years ago

End-user changes

  • Smooth category scrolling
  • Individual reset buttons for every option
  • Fix bug where option lists that just went over into scrolling scrolled extremely slow.

Developer API changes

  • Actual Config API to save and load fields in a class automatically (documentation)
  • Separate Dimension into Dimension and MutableDimension
  • Make dim private in AbstractWidget so mods can't change the dimension without setDimension
  • New Option API method isPendingValueDefault to check if pending value is equal to default value of binding
  • Fix Option#requestSetDefault and Option#forgetPendingValue implementations weren't notifying listeners
YetAnotherConfigLib - v1.6.0

Published by isXander about 2 years ago

  • Expanded option cycling capability, now allowing any list to be cycled, not just enums.
YetAnotherConfigLib - v1.5.0

Published by isXander about 2 years ago

  • Make controller names go italic when there are pending changes
  • Allow availableValues to be passed to EnumController
  • More validation for slider controllers
YetAnotherConfigLib - v1.4.5

Published by isXander about 2 years ago

  • Remove debug logging
YetAnotherConfigLib - v1.4.4

Published by isXander about 2 years ago

  • Fix search not behaving properly with default collapsed option groups
  • Minor refactors
YetAnotherConfigLib - v1.4.3

Published by isXander about 2 years ago

  • Cache search query results for huge performance gains
  • Allow some StringControllerElement methods to be inheritable
YetAnotherConfigLib - v1.4.2

Published by isXander about 2 years ago

  • Improve search performance (even when empty) by a LOT
  • API to add listeners before building
  • Fix cancel/reset button tooltip going off-screen
YetAnotherConfigLib - v1.4.1

Published by isXander about 2 years ago

  • Fix slider tooltip showing when not hovering
YetAnotherConfigLib - v1.4.0

Published by isXander about 2 years ago

  • Improve tooltips a lot:
    • They now never get cut off by the edge of the screen
    • They never overlap the hovered option/group/category
    • They don't take half a second to appear
    • They don't disappear when you move your mouse
  • ButtonOption now consumes itself, so you can access it when building.
  • Make Option#available mutable with Option#setAvailable
YetAnotherConfigLib - v1.3.0

Published by isXander about 2 years ago

  • Option tooltips now have access to the pending value to dynamically change
  • PlaceholderCategory: A category that when selected, just opens a screen
  • instant property for option builders: makes the option apply instantly instead of when pressing "Apply"
YetAnotherConfigLib - v1.2.1

Published by isXander about 2 years ago

  • Search can now query categories and groups
YetAnotherConfigLib - v1.2.0

Published by isXander about 2 years ago

  • Categories can now be scrolled when overflowing
  • Available property for options, so you can disable certain options in some conditions
  • Fix all first tooltip line having a larger line height
YetAnotherConfigLib - v1.1.1

Published by isXander about 2 years ago

  • Fix search field rendering over tooltips
YetAnotherConfigLib - v1.1.0

Published by isXander about 2 years ago

  • Improved search - Now searches every category rather than the currently selected one
  • Option Flags - Add flags to options that when changed, the flag is executed once per the whole config.
  • Deprecated "Require Restart" in favour of option flags.
  • Fix search field overlapping undo and cancel at some GUI scales
  • Fix scrollbar appearing in the wrong place at some GUI scales
  • Fix option entries not extending to fill the list's width at some GUI scales
  • Fix tooltips rendering below the scrollbar
YetAnotherConfigLib - v1.0.0

Published by isXander about 2 years ago

  • Add search field
  • Make collapse button more obvious
  • Change "Finished" button text to "Done"
  • Input field improvements
Badges
Extracted from project README
Java 17 Discord Modrinth CurseForge Ko-fi