Feature - Inventory & Chat Buttons - #304
Draft
ItsNature wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Description:
Add Inventory Buttons and Chat Buttons, letting servers display clickable buttons on the player inventory and on the chat screen. Buttons are built on a new shared button system: they mix adventure components and icons inside a single button, support tooltips, custom shape/size/position, custom and hover colors, click actions, and live content and tooltips that re-resolve per viewer and resend automatically.
Full Docs:
Changes:
ApolloButton:ApolloButtonContentbuilder: text, icon and live content parts, content scaleApolloButtonTooltip: static lines or a live resolverApolloButtonAction:runCommand,openUrl,clientAction(OPEN_MINIMAP_VIEW,OPEN_WAYPOINTS_MENU)ApolloButtonShape: (ROUNDED_SQUARE,CIRCLE)ApolloButtonSizeInventoryModuleAPI:displayInventoryButtons(Recipients, Collection<InventoryButton>)&displayInventoryButton(Recipients, InventoryButton)removeInventoryButton(Recipients, String)&removeInventoryButton(Recipients, InventoryButton)resetInventoryButtons(Recipients)updateInventoryButton(Recipients, String, ApolloButtonContent, ApolloButtonTooltip),updateInventoryButtonContent(...)&updateInventoryButtonTooltip(...)InventoryButtonbuilder:box(LEFT/RIGHT),inventoryType, size presets & default colorsChatModuleAPI:displayChatButtons(Recipients, Collection<ChatButton>)&displayChatButton(Recipients, ChatButton)removeChatButton(Recipients, String)&removeChatButton(Recipients, ChatButton)resetChatButtons(Recipients)updateChatButton(Recipients, String, ApolloButtonContent, ApolloButtonTooltip),updateChatButtonContent(...)&updateChatButtonTooltip(...)ChatButtonbuilder with chat size presetsbuttons.live-broadcast(defaultfalse): automatically re-resolves and re-sends live button content on each piece's own update interval; combined with the packet enrichment module, updates are only sent to players who currently have their inventory/chat openbuttons.send-defaults(defaultfalse) &buttons.defaults: define static buttons directly inconfig.yml, displayed automatically when a player joinsplayer-inventory-open/player-inventory-closepackets andApolloPlayerInventoryOpenEvent/ApolloPlayerInventoryCloseEventCode Example:
Review Request Checklist
feature/add-module&bugfix/fix-issue)