Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-Platform GUI API [v5] #106

Draft
wants to merge 117 commits into
base: v5.0.0
Choose a base branch
from
Draft

Cross-Platform GUI API [v5] #106

wants to merge 117 commits into from

Conversation

WolfyScript
Copy link
Owner

@WolfyScript WolfyScript commented Jan 12, 2023

The current GUI API is only available on Spigot.
There should be a cross-platform (Spigot, Sponge, Paper) API, which then would make it easier to create cross-platform inventory GUIs.
Plus, the current GUI is pretty much hardcoded and not customizable outside Java classes.

The new system will be build using a functional style, meaning there is no need to create custom implementations for GUI Components and menus.
All is done via builders and callback lambda functions.

API:

  • Basic interface structure

  • Basic common Implementation

  • Component Builders

    • Allow for builder sharing across platforms.
      Create a builder with a common implementation, then access it on each platform to extend it.
  • Config

    • Dynamically create builders from config.
    • Extend builders with states and actions via code.
    • Register builders that are done

Implementation

  • Spigot/Paper
  • Sponge

* Renamed ButtonInteractionResult to InteractionResult
* This should allow for access to NBT etc. of stacks in common implementations in the future.
* Note this is more limited than v4, because other types of inventories may contain slots that do not act like normal container slots.
@WolfyScript WolfyScript added this to the v5.0.0 milestone Jan 12, 2023
@WolfyScript WolfyScript added the enhancement New feature or request label Jan 12, 2023
@WolfyScript WolfyScript self-assigned this Jan 12, 2023
* #getCurrentWindowState
* #getRenderContext(UUID)
* #getRouter
These interfaces are used to detect used variables, like signals, at runtime.
* The WindowRenderer is now instantiated for each GuiViewManager and constructs the initial state, including signals and components. After that, components are only updated via signals.
* Slots are stored inside the ComponentBuilder now.
* Add SignalledObject that can be linked to Signals
* Removed old unused code
* Removed WindowState and ComponentState
* this function requires a ReactiveResult to be returned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant