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

Automatically fix object/group/function/behavior/object/property names when an incorrect one is entered #5561

Merged
merged 5 commits into from
Aug 13, 2023

Conversation

4ian
Copy link
Owner

@4ian 4ian commented Aug 12, 2023

And also for scenes, external events, external layouts and extensions in the project manager.

This removes all the "flow breaking" message boxes. While this might make the reason for the renaming harder to understand, I think it will be well understood. For example in Figma, if you rename a shape to an empty string, it will override it with a default name.
In the future, we could show a snack bar at the bottom that gives an explanation, but not even sure it's required (could be added in the docs, and that's it - the important is that GDevelop fixes the name for you).

Fix #5557

* Also for scenes, external events, external layouts and extensions in
the project manager.
@4ian 4ian marked this pull request as draft August 12, 2023 11:25
@4ian 4ian changed the title Automatically fix object or group names when an incorrect one is entered Automatically fix object/group/function/behavior/object/property names when an incorrect one is entered Aug 12, 2023
@4ian 4ian marked this pull request as ready for review August 12, 2023 14:31
@4ian 4ian merged commit 68968b6 into master Aug 13, 2023
5 checks passed
Comment on lines +1017 to +1020
// Replace all unallowed letters by an underscore.
if (allowedCharacters.find_first_of(std::u32string(1, newName[i])) == gd::String::npos) {
newName.replace(i, 1, '_');
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if none of the characters are safe?
Should the renaming be aboorted rather than using _______?

@Bouh Bouh deleted the feature/autofix-names branch September 2, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component improvement: Display "invalid name" erro under text field, instead of closing the wondow.
2 participants