Skip to content

✨ feat: add a new bs.components module #284

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

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

theogiraudet
Copy link
Contributor

@theogiraudet theogiraudet commented Nov 30, 2024

Tasks to do before merging

  • I accept to publish my contribution under MPL v2 License
  • My pull request is linked to an existing issue
  • I have added my contribution to the changelog
  • If my pull request is a new or modify an existing feature:
    • I have documented my contribution (/docs)
    • I have added or updated the header of the features' root function I contribute
    • I have tested my contribution

@theogiraudet theogiraudet changed the title Component New module bs.components Nov 30, 2024
@theogiraudet theogiraudet added the ✨ Module New module request label Nov 30, 2024
@theogiraudet theogiraudet added this to the 3.0.0 milestone Nov 30, 2024
@theogiraudet theogiraudet linked an issue Nov 30, 2024 that may be closed by this pull request
8 tasks
@aksiome aksiome changed the title New module bs.components ✨ feat: add a new bs.components module Feb 26, 2025
@theogiraudet
Copy link
Contributor Author

@aksiome Before implementing, I would like feedback on what I plan to do (cf documentation).

@theogiraudet
Copy link
Contributor Author

theogiraudet commented Feb 27, 2025

Summary of the discussion:

  • Remove all entity specific properties except the required ones
  • Group/merge related properties
  • Callback should be optional when component is stateful
  • selected or select, propose both?
  • click_button=left|right for on_click
  • Radio button → radio
  • check for checkbox?
  • edit → update
  • Add ID to radio
  • way to easily get the state for a group

@theogiraudet theogiraudet modified the milestones: 3.0.0, 3.1.0 Apr 2, 2025
@aksiome
Copy link
Member

aksiome commented Apr 26, 2025

After thinking more about the size-related issues, I believe I've found a way to significantly reduce the complexity.

What if we create functions like make_button, make_checkbox, etc., that are designed to run on already summoned entities? Each entity type can have its own specific implementation, with a fallback for others. This allows users to summon the entities and the command only adds GUI-like behavior. For example, we could use passengers for display entities but not for mobs. The only potential issue is if we need parameters that differ by entity type, but I don't think that’s necessary. What we mainly need is different default behavior per entity type. This approach also means users are responsible for setting the appropriate size when creating the button.

For radios, I remember there was an issue about using a string ID for the group to avoid manually creating a group, but I can't recall exactly why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Module New module request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bs.interaction, bs.component: Modules to create GUI in Minecraft
2 participants