Matt-MX / KtPaperGui

Declarative GUI focused library for PaperMC. Made for personal use but open source enjoy! :)
Apache License 2.0
25 stars 5 forks source link

Hotbars #37

Open Matt-MX opened 3 months ago

Matt-MX commented 3 months ago

Add a better api support for hotbar and player-inventory based GUIs.

Hotbars allow players to quickly scroll to access buttons.

This addition should introduce button callbacks such as the user scrolling over the button.

e.g:

class TestHotbar : Hotbar() {
    init {
        button(Material.GRAY_BED) {
            named(!"<dull>Something".branding())
            click.any {
                player.sendMessage(!"<green>clicked".branding())
            }
        } slot middle() holdingSendActionBar !"<title>Some text pops up when you hover!".branding()
    }
}

image

Matt-MX commented 3 months ago

Experimental API example from another plugin I'm working on scrollbar