This repository was archived by the owner on Feb 4, 2025. It is now read-only.
Selection menu enhancement - Added abstract SelectionMenu and ScrollSelection #76
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.
Pull Request
Pull Request Checklist
Please follow the following steps before opening this PR.
PRs that do not complete the checklist will be subject to denial for
missing information.
or merged features/bug fixes.
Pull Request Information
Check and fill in the blanks for all that apply:
menumodule of the JDA-Utilities library.______.Description
This PR re-structures the SelectionDialog.
There is a new abstract class called
SelectionMenuthat allows easier implementations for menus with selections. The code forSelectionMenuis mainly taken from the formerSelectionDialog, as everySelectionMenubasically works like it.When making new extensions of
SelectionMenu, the only difference should be the Builder and therender(int)method, which is declared abstract inSelectionMenu. It is also possible to overwrite the new methodgetNewSelection(Message, String, int)for other possible reactions. Configuring the reactions is not up to the user yet, however you have to pass a List of Strings (the unicode emojis) to theSelectionMenuconstructor to set the reactions that are available. Currently, this is done internally.In this PR, a new
SelectionMenuis already included: theScrollSelection.The
ScrollSelectionis similar toSelectionDialog, but it only shows the currently selected entry. Also, the content of the embed description is configurable with a format String.I also added a new method for all
SelectionMenuBuilders,setChoices(List<String>).The contents of Kantenkugel's recent PR are also included and function correctly.
All of this is fully mergeable with the current master branch. Existing code will still work, too.
, with one exception: The.public static final Strings inSelectionDialogare gone, they are now inSelectionMenu. They can still be added again and immediately deprecated to avoid any inconvenienceUpdate: Added them again for convenience