Skip to content

Releases: CottonMC/LibGui

4.1.1 for 1.17.1 RC 1

01 Jul 20:11
Compare
Choose a tag to compare

Repository version: 4.1.1+1.17.1-rc1

  • Updated to 1.17.1 RC 1

4.1.0 for 1.17

01 Jul 19:47
Compare
Choose a tag to compare

Repository version: 4.1.0+1.17

Added

Changed

  • Some warnings are now visible in dev environments above screens that cause them

Fixed

  • WBar.withConstantMaximum
  • Screen.onClose not being called in CottonInventoryScreen

4.0.0 for 1.17

09 Jun 09:28
Compare
Choose a tag to compare

Repository version: 4.0.0+1.17
>> Migration guide <<

Added

API

  • InputResult: an enum describing whether mouse events are processed or ignored
    • This allows mouse clicks, scrolling etc. to "pass through" to the parent panel, for example.
  • Insets: a data class describing how far the children of a panel are from each side
    • WPanelWithInsets: a panel that has insets applied and can automatically reposition children when they are changed
    • WPlainPanel, WGridPanel and WBox support insets out of the box
  • Exposed WAbstractSlider.dragging with isDragging (#100)
  • Vec2i: a generic 2D integer vector used for screen positions
  • GuiDescription.get/setTitlePos: used to adjust the title position

Non-API features

  • WScrollBar: scrolling is 4 times faster
  • WListPanel: added scrolling support
  • WScrollPanel: added scrolling support
  • WButton: dark mode textures
  • Widgets cannot be added recursively to themselves or their children

Changed

API changes

  • All rendering methods now take a MatrixStack
  • 9patch background painters are now implemented using LibNinePatch.
    • BackgroundPainters.createNinePatch was reworked
    • The NinePatch background painter class was replaced with NinePatchBackgroundPainter
  • Texture is now a record
  • CottonHud methods are now static; CottonHud.INSTANCE was removed
  • WTextField fields are now private

Non-API changes

  • Updated to Java 16 and Minecraft 1.17
  • Updated Mod Menu support for the 2.0 API
  • BackgroundPainter.VANILLA no longer has any padding
  • The default title position is now (8, 6) like in vanilla (from (10, 10) before)
  • Root panels are validated automatically, and it is safe to validate them multiple times

Removed

  • io.github.cottonmc.libgui.client.LibGuiClient
  • WTextField.insertText (was unimplemented)
  • WWidget.createPeers (replaced with validate)

Fixed

  • Labeled slider rendering bugs
  • Memory leak in ScreenNetworking
  • WTextField.onChanged is not called for typing (#111)
  • ValidatedSlot#setVisible crashes on 1.17 (#113)

4.0.0 Beta 4 for 1.17-rc1

04 Jun 21:46
Compare
Choose a tag to compare
Pre-release

Repository version: 4.0.0-beta.4+1.17-rc1

Added

  • WPanelWithInsets as a common superclass for WBox, WGridPanel and WPlainPanel handling the insets logic
  • Automatically resizing the children of a panel when its insets are modified
  • Automatically validating root panels

Changed

  • Updated Mod Menu support to 2.0

Fixed

  • ValidatedSlot#setVisible crashes on 1.17 (#113)

4.0.0 Beta 3 for 1.17-pre1

29 May 13:00
Compare
Choose a tag to compare
Pre-release

Repository version: 4.0.0-beta.3+1.17-pre1

4.0.0 Beta 2 for 1.17-pre1

29 May 12:57
Compare
Choose a tag to compare
Pre-release
  • The old NinePatch background painter class was partially recreated as NinePatchBackgroundPainter, which has the same padding methods.

4.0.0 Beta 1 for 1.17-pre1

27 May 19:37
Compare
Choose a tag to compare
Pre-release

Repository version: 4.0.0-beta.1+1.17-pre1

Changed

  • Improved background painter javadoc
  • Updated LibNinePatch to 1.1.0 with a more efficient implementation
  • WTextField changes
    • All instance fields are private; use the getters
    • Removed unimplemented WTextField.insertText
  • Converted CottonHud from singleton enum to a bunch of static methods
  • Converted Texture into a record
  • Moved Vec2i into widget.data

Fixed

  • #111 (partially, a proper fix requires larger rewriting of WTextField internals)

4.0.0 Alpha 3 for 21w20a

27 May 16:48
Compare
Choose a tag to compare
Pre-release

Repository version: 4.0.0-alpha.3+21w20a

Added

  • math.Vec2i: a simple two-dimensional int vector
  • GuiDescription.get/setTitlePosition for adjusting the screen's title position

Changed

  • The default title position is now (8, 6) like in vanilla (was (8, 8) in 3.4 for normal screens and (10, 10) for normal screens)
  • Insets is now a record
  • 9patch background painters are now implemented with LibNinePatch

Removed

  • The NinePatch class, 9patch background painters are now created using BackgroundPainter.createNinePatch

Fixed

  • Titles being positioned incorrectly
  • Item icons making everything fly away (#108)

4.0.0 Alpha 2 for 21w20a

21 May 13:52
494e8a6
Compare
Choose a tag to compare
Pre-release

Repository version: 4.0.0-alpha.2+21w20a

3.4.0

18 Apr 13:21
753e06f
Compare
Choose a tag to compare

Repository version: 3.4.0+1.16.5

  • Added MatrixStack overloads for ScreenDrawing methods. The other ones are now deprecated, to be removed in 4.0.0.
  • Added LibGui.isDarkMode() as a replacement for directly accessing LibGuiClient.config.darkMode, which will be removed in 4.0.0.
  • Fixed dupe bug (#104 by @GabrielOlvH)