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

Implement GUI annotations and metadata #43

Merged

Conversation

anonymous123-code
Copy link
Contributor

@anonymous123-code anonymous123-code commented Mar 18, 2024

  • DisplayName(String value, translatable=false): The display name of a metadata holder. Applicable to configs, sections, and fields. Metadata processors (like config screens) may define generated translation keys taking precedence if it isn't translatable. If translatable is true, the value should be treated as a translation key
  • DisplayNameConvention(DefaultNamingSchemes value, custom=""): The naming scheme used to derive the fallback display names of the metadata holder for config screens. DisplayName must take precedence, metadata processors (like config screens) may define generated translation keys taking precedence over DisplayNameConvention. Inheritable and applicable to configs, sections, and fields
  • ChangeWarning(metdata.ChangeWarning.Type value, customMessage=""): Used to tell config screen libraries that a warning should be displayed before applying changes. The type can be RequiresRestart, Unsafe, Experimental, CustomTranslatable, or Custom. If it is CustomTranslatable, customMessage is used as a translation key. If it is Custom, customMessage is used as the raw message, but the metdata provider may define translation keys that take precedence.

Fixes #31, fixes #30

@ix0rai ix0rai added the enhancement New feature or request label Mar 18, 2024
@ix0rai ix0rai self-requested a review March 18, 2024 21:05
@ix0rai ix0rai added this to the 1.3 milestone Mar 19, 2024
…ies to provide alternate translation keys for the raw text options
Copy link
Member

@ix0rai ix0rai left a comment

Choose a reason for hiding this comment

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

tests would be appreciated!

@Target({ElementType.FIELD, ElementType.TYPE})
public @interface DisplayName {
/**
* A {@link MetadataType} to supply to {@link Config.Builder#metadata}
Copy link
Member

Choose a reason for hiding this comment

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

not about this pr but we should stop copying this comment everywhere lol

Co-authored-by: ix0rai <ix0rai64@gmail.com>
@ix0rai ix0rai merged commit ca870f3 into QuiltMC:master Apr 2, 2024
1 check passed
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
None yet
2 participants