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 utility methods to Theme, improve error messages and documentation #47251

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

YuriSizov
Copy link
Contributor

This adds several utility methods that can be used to replace a lot of boilerplate code mentioned in #46593 (comment). While mostly useful internally, users can find them handy as well, especially plugin developers. So I've exposed them.

This PR also includes all theme additions from #46593 and #46808, so that they can be tested and merged separately (and those PRs can then be rebased).

This should be portable to 3.x, likely even cherrypickable.


  • Added missing get_font_size_type_list() method.
  • Added rename_X() methods for renaming theme items.
  • Added add_X_type() method for creating empty theme item types; these methods are not exposed to the API to prevent confusion from users thinking calling them is necessary, when in fact all set_X methods implicitly create types.
  • Added DataType enum and VERB_theme_item_X() methods to perform all the same tasks as are available for individual item types but without hardcoding all the function names.

@YuriSizov YuriSizov added enhancement documentation cherrypick:3.x Considered for cherry-picking into a future 3.x release topic:gui labels Mar 22, 2021
@YuriSizov YuriSizov added this to the 4.0 milestone Mar 22, 2021
@YuriSizov YuriSizov requested a review from a team as a code owner March 22, 2021 11:45
@YuriSizov YuriSizov force-pushed the theme-more-useful-methods branch from b473de1 to 9df0574 Compare March 22, 2021 11:49
@YuriSizov YuriSizov requested a review from a team March 22, 2021 11:53
@akien-mga akien-mga merged commit 9343a8a into godotengine:master Mar 25, 2021
@akien-mga
Copy link
Member

Thanks!

@YuriSizov YuriSizov deleted the theme-more-useful-methods branch April 18, 2021 23:28
@YuriSizov YuriSizov removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 10, 2021
YuriSizov added a commit to YuriSizov/godot that referenced this pull request Jun 10, 2021
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.

2 participants