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

Add decorations(Map) to component/style builders #444

Conversation

lynxplay
Copy link
Contributor

@lynxplay lynxplay commented Sep 13, 2021

This commit introduces a new decorations method to the component and
style builderthat takes in a map of text decorations and their state.
This methodalready exists on the Component interface but was
previously missing on the respective builders.

As the style builder stores the decorations in individual fields and
hence cannot natively work with the map layout, the method was
implemented as a default method on the interface and simply delegates
the map entriess to the normal decorate methods.

The main motivation for the addition of this method is the easy
application of a preset map of decorations.


I followed the current precedence of stating that the mutation modifies the "component" instead of the builder as that seems to be the current practice in all other decoration related methods on the interface.

Copy link
Member

@kezz kezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're at it, could probably do with this method in Style.Builder as well.

@lynxplay lynxplay force-pushed the feature/component-builder-decoration-additions branch from e96f5e6 to fc5d0a4 Compare September 13, 2021 21:11
@lynxplay
Copy link
Contributor Author

While you're at it, could probably do with this method in Style.Builder as well.

Got you, thanks for the suggestions 👍

@lynxplay lynxplay requested a review from kezz September 13, 2021 21:11
This commit introduces a new decorations method to the component and
style builderthat takes in a map of text decorations and their state.
This methodalready exists on the Component interface but was
previously missing on the respective builders.

As the style builder stores the decorations in individual fields and
hence cannot natively work with the map layout, the method was
implemented as a default method on the interface and simply delegates
the map entriess to the normal decorate methods.

The main motivation for the addition of this method is the easy
application of a preset map of decorations.
@lynxplay lynxplay force-pushed the feature/component-builder-decoration-additions branch from fc5d0a4 to db91520 Compare September 13, 2021 21:14
@lynxplay lynxplay changed the title Add ComponentBuider#decorations(Map) Add decorations(Map) to component/style builders Sep 13, 2021
@kezz kezz added this to the 4.10.0 milestone Sep 14, 2021
Copy link
Member

@kezz kezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR :)

Copy link
Member

@Proximyst Proximyst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@zml2008 zml2008 merged commit 0635e12 into KyoriPowered:master Oct 16, 2021
@zml2008 zml2008 self-assigned this Oct 16, 2021
@lynxplay lynxplay deleted the feature/component-builder-decoration-additions branch October 21, 2021 17:55
This was referenced Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants