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

Allow changing feature profile via EditorInterface #74382

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

RedMser
Copy link
Contributor

@RedMser RedMser commented Mar 4, 2023

  • Add EditorInterface.set_current_feature_profile(profile_name: String) method to load a feature profile by name.
    • Validate the specified feature profile (ensures the profile file exists).
  • Add complementary EditorInterface.get_current_feature_profile() method. This returns a string, but you can easily retrieve the EditorFeatureProfile instance from it (see example project).
  • Add documentation hints for how to programmatically register feature profiles.
  • Refactor UI code (since the current feature profile is fully determined by the UI...).

This allows creating a plugin or editor script which can automatically generate and/or change feature profiles. Example project here.

@RedMser RedMser requested a review from a team as a code owner March 4, 2023 19:38
@RedMser RedMser changed the title Allow changing feature profile via EditorInterface Allow changing feature profile via EditorInterface Mar 4, 2023
@Chaosus Chaosus added this to the 4.1 milestone Mar 6, 2023
@RedMser RedMser force-pushed the feature-profile-api branch 2 times, most recently from 7cfcba2 to 4652603 Compare June 3, 2023 17:52
@akien-mga akien-mga modified the milestones: 4.1, 4.2 Jun 19, 2023
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Looks okay to me, though I haven't tested / reviewed in depth.

Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

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

Haven't tested either, but aside from a couple of notes the code seems fine. Comments need to be addressed though.

@RedMser
Copy link
Contributor Author

RedMser commented Jul 24, 2023

Here's a simple project for testing the new API: Feature Profiles API Test.zip

It adds menu items in the "Project -> Tools -> Feature Profile" menu, and prints stuff to the Output window. The 3D feature gets toggled by it.

Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

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

One style change is needed, but otherwise looks fine.

@YuriSizov YuriSizov merged commit c3727c3 into godotengine:master Jul 24, 2023
@YuriSizov
Copy link
Contributor

Thanks!

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.

4 participants