JDA-Utilities icon indicating copy to clipboard operation
JDA-Utilities copied to clipboard

Experimental - Cancel-able Menus

Open kantenkugel opened this issue 5 years ago • 1 comments

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.

Pull Request Information

Check and fill in the blanks for all that apply:

  • [ ] My PR fixes a bug, error, or other issue with the library's codebase.
  • [x] My PR is for the menu and commons modules of the JDA-Utilities library.
  • [ ] My PR creates a new module for the JDA-Utilities library: ______.

Description

This module adds the possibility to cancel EventWaiter tasks via the new return value of EventWaiter#waitForEvent (Future<Void>)

This new feature is used to add Menu#cancel() to cancel menus that are already running.

Todo:

  • [ ] Discuss if this is the proper way of doing this or if some mechanics should be changed
  • [x] Javadocs
  • [x] Decide how to handle cancelFuture.cancel(true) vs false
  • [ ] Should there be a cancel method that doesn't execute the cancel/final action? What about the EventWaiter cancellation?
  • [ ] Eventually throw errors on display() if already being displayed somewhere, as this would currently prevent proper functionality of Menu#cancel()
  • [ ] Wait for PR #58 to be merged and patch it as well in this PR
  • [ ] Extensive testing
  • [ ] Final review

kantenkugel avatar Aug 10 '18 12:08 kantenkugel

Should probably also wait for #58 to be merged so i can apply the changes from this PR to that code as well. Adding it to the TODO

kantenkugel avatar Aug 15 '18 17:08 kantenkugel