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

Fix saving editor folder colors #81344

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented Sep 5, 2023

Also clears the setting if no folder is configured

If the addition of folder colors are added to the release blog post I think adding a note about it not currently working would be good

@AThousandShips AThousandShips added this to the 4.2 milestone Sep 5, 2023
@AThousandShips AThousandShips requested a review from a team as a code owner September 5, 2023 14:43
@KoBeWi
Copy link
Member

KoBeWi commented Sep 5, 2023

I think you should check if the setting exists. Setting it is only needed when it doesn't.

@AThousandShips
Copy link
Member Author

Am just about to push that change, was testing it out

Also clears setting if none are assigned
if (!ProjectSettings::get_singleton()->has_setting("file_customization/folder_colors")) {
ProjectSettings::get_singleton()->set_setting("file_customization/folder_colors", assigned_folder_colors);
} else if (assigned_folder_colors.is_empty()) {
ProjectSettings::get_singleton()->set_setting("file_customization/folder_colors", Variant());
Copy link
Member Author

Choose a reason for hiding this comment

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

Can remove if wanted, but thought it'd be good to avoid taking up space in the settings if nothing is configured

@YuriSizov YuriSizov merged commit 008dc63 into godotengine:master Sep 6, 2023
16 checks passed
@AThousandShips AThousandShips deleted the folder_color_fix branch September 6, 2023 13:11
@YuriSizov
Copy link
Contributor

Thanks!

@AThousandShips
Copy link
Member Author

Thank you!

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.

Folder color is not retained after editor restart
3 participants