LibGui

Buttons & Co

MIT License

Stars
288
Committers
34

Bot releases are visible (Hide)

LibGui - 4.0.0 for 1.17

Published by Juuxel over 3 years ago

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)
LibGui - 4.0.0 Beta 4 for 1.17-rc1

Published by Juuxel over 3 years ago

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)
LibGui - 4.0.0 Beta 3 for 1.17-pre1

Published by Juuxel over 3 years ago

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

  • Forward-ported dupe bug fix (#104 by @GabrielOlvH)
LibGui - 4.0.0 Beta 2 for 1.17-pre1

Published by Juuxel over 3 years ago

  • The old NinePatch background painter class was partially recreated as NinePatchBackgroundPainter, which has the same padding methods.
LibGui - 4.0.0 Beta 1 for 1.17-pre1

Published by Juuxel over 3 years ago

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)
LibGui - 4.0.0 Alpha 3 for 21w20a

Published by Juuxel over 3 years ago

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)
LibGui - 4.0.0 Alpha 2 for 21w20a

Published by Juuxel over 3 years ago

Repository version: 4.0.0-alpha.2+21w20a

  • Port to 21w20a. Fixes #109 (#110) by @Rover656
  • support new modmenu api (#103) by @DragonEggBedrockBreaking
LibGui - 3.4.0

Published by Juuxel over 3 years ago

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)
LibGui - 4.0.0 Alpha 1 for 21w11a

Published by Juuxel over 3 years ago

Repository version: 4.0.0-alpha.1+21w11a

Added

  • Insets to replace padding added by background painters. They describe the inner padding of a panel (distance between the content and the panel's edges).
  • A LibGui class with LibGui.isDarkMode to check for dark mode instead of looking in the config.
  • Button dark mode support with textures originally by @shedaniel (#10)
  • Improved mouse events that use an InputResult enum for cascading (for example, scrolling events can pass through to the scroll panel)
  • WAbstractSlider.isDragging (#100)
  • Mouse scrolling support for WScrollPanel and WListPanel
  • ScreenDrawing.drawTextHover for drawing text hover effects

Changed

  • WScrollBar: Scrolling speed increased to 4x the previous amount
  • BackgroundPainter.VANILLA and BackgroundPainter.createColorful no longer have any padding applied
  • All rendering now uses MatrixStacks.
  • All implementation classes are now in the impl package or its subpackages.

Fixed

  • Labeled slider rendering issues
  • Memory leak in ScreenNetworking
LibGui - 3.3.5

Published by Juuxel over 3 years ago

Repository version: 3.3.5+1.16.5

  • Use Slot#getMaxItemCount(ItemStack) instead of Slot#getMaxItemCount() (#99 by @GabrielOlvH)
LibGui - 3.3.3

Published by Juuxel over 3 years ago

Repository version: 3.3.3+1.16.5

  • Fixed Screen.renderBackground calls being super.renderBackground(); in LibGui screens. They should now be properly overrideable.
  • Replaced Screen.init(MinecraftClient, int, int) with init() (should be more maintainable).
  • Fixed a rendering bug with large slots.
  • Fixed a rendering bug with labeled sliders.
LibGui - 3.3.2

Published by Juuxel almost 4 years ago

Repository version: 3.3.2+1.16.4

Fixed

  • REI overlapping with LibGui screens
LibGui - 3.3.1

Published by Juuxel almost 4 years ago

Repository version: 3.3.1+1.16.4

Fixed

  • Dedicated server crash on launch (ea894bba)
LibGui - 3.3.0

Published by Juuxel almost 4 years ago

Repository version: 3.3.0+1.16.4

Added

  • Screen networking API (#61)
    • Note that LibGui requires Fabric Networking API v1 now
LibGui - 3.2.2

Published by Juuxel almost 4 years ago

Repository version: 3.2.2+1.16.3 (also works on 1.16.3)

This update includes two scroll bar improvement PRs by @Sturmlilie.

Added

  • Mouse wheel scrolling for scroll bars (#90)

Changed

  • Scroll bars now have a more intuitive drag scroll threshold (#91)
LibGui - 3.2.1

Published by Juuxel almost 4 years ago

Repository version: 3.2.1+1.16.3

Changed

  • Replaced javax annotations with Jetbrains annotations (should not affect dependents' code)

Fixed

  • HUD widgets not being ticked
LibGui - 3.2.0

Published by Juuxel about 4 years ago

Repository version: 3.2.0+1.16.3

Added

  • Constructor to ItemIcon that takes an Item and uses its default stack
  • Portuguese translation (#88 by @cominixo)
  • Finnish translation

Changed

  • The WTabPanel.Tab constructor is now deprecated in favour of the builder

Fixed

  • Tab panels not working on servers (#86)
  • Slot insertion checks working incorrectly (#87)
LibGui - 3.1.0

Published by Juuxel about 4 years ago

Repository version: 3.1.0+1.16.3

Added

  • WCardPanel.getCardCount: returns the number of cards in the panel
  • WPlayerInvPanel.createInventoryLabel: creates an "Inventory" label for player inventories, useful when you want to customize the label
LibGui - 3.0.0

Published by Juuxel about 4 years ago

Repository version: 3.0.0+1.16.3

Added

  • TooltipBuilder for creating widget tooltips. It replaces the old List<Text> with a nicer API that can take both Texts and OrderedTexts.
  • Texture for specifying UV values for any textures
    • Texture objects can be used with these widgets and icons:
      • TextureIcon
      • WBar
      • WSprite
      • WTiledSprite
      • WToggleButton
    • ScreenDrawing has new methods for drawing Textures
  • Change listeners for WItemSlot and ValidatedSlot
    • Instances of WItemSlot.ChangeListener can be added to WItemSlots using WItemSlot.addChangeListener
    • Slot change listeners are fired when a slot is modified or otherwise marked dirty
  • Tab panels that have a list of tabs at the top
  • Card panels that show one widget ("card") at a time
  • WWidget now has two methods, onShown and onHidden, that can be called when a widget is shown or hidden by its parent panel
    • This is used in card panels and tab panels for hiding slots properly

Changed

  • Updated to Minecraft 1.16.2 RC2 and latest versions of dependencies
  • Widgets now take a Text again instead of StringVisitable
  • ScreenDrawing takes OrderedTexts instead of StringVisitables
  • WWidget.addTooltip takes a TooltipBuilder instead of a List<Text>
  • The texture fields in WBar, WSprite and WToggleButton use Textures instead of Identifiers

Fixed

  • Centering issues with big item slots and button icons (#77)
  • Rendering of vertical labeled sliders
  • Keyboard repeat events not always working (#27)
  • Some overrides of WWidget.paint missing @Environment(CLIENT) annotations
LibGui - 3.0.0 Beta 1

Published by Juuxel about 4 years ago

Repository version: 3.0.0-beta.1+1.16.2-rc2

Added

  • TooltipBuilder for creating widget tooltips. It replaces the old List<Text> with a nicer API that can take both Texts and OrderedTexts.
  • Texture for specifying UV values for any textures
    • Texture objects can be used with these widgets and icons:
      • TextureIcon
      • WBar
      • WSprite
      • WTiledSprite
      • WToggleButton
    • ScreenDrawing has new methods for drawing Textures
  • Change listeners for WItemSlot and ValidatedSlot
    • Instances of WItemSlot.ChangeListener can be added to WItemSlots using WItemSlot.addChangeListener
    • Slot change listeners are fired when a slot is modified or otherwise marked dirty

Changed

  • Updated to Minecraft 1.16.2 RC2 and latest versions of dependencies
  • Widgets now take a Text again instead of StringVisitable
  • ScreenDrawing takes OrderedTexts instead of StringVisitables
  • WWidget.addTooltip takes a TooltipBuilder instead of a List<Text>
  • The texture fields in WBar, WSprite and WToggleButton use Textures instead of Identifiers

Fixed

  • Centering issues with big item slots and button icons (#77)
  • Rendering of vertical labeled sliders
  • Keyboard repeat events not always working (#27)
  • Some overrides of WWidget.paint missing @Environment(CLIENT) annotations