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

Fixed SpriteFrame allowed entering an empty name #70788

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

ZangEldor
Copy link
Contributor

@ZangEldor ZangEldor commented Jan 1, 2023

Fixed issue #70769 where the user could enter an empty name in the SpriteFrame window.
Added a check for an empty string and if so, the name is changed to TTR("Default").
Try to change the name in the attached sample project and see that it is now changes to Default instead of staying as an empty string.
Empty SpriteFrame Test.zip

Bugsquad edit:

@MewPurPur
Copy link
Contributor

Should be lowercase "default" to match other areas of the engine where deleting the name switches to the default one. Otherwise looks good.

@ZangEldor
Copy link
Contributor Author

Should be lowercase "default" to match other areas of the engine where deleting the name switches to the default one. Otherwise looks good.

My reason was that default (in lowecase) doesn't have a translation to other languages in the editor/translations/*.po files, rather than Default which has a translation - therefore I think that Default enables more user-friendly experience to non-english users.

@akien-mga akien-mga requested a review from kleonc January 21, 2023 10:04
@akien-mga
Copy link
Member

FYI, there's the same problem with invalid email to author this commit as discussed in #70675 (comment).

@akien-mga
Copy link
Member

akien-mga commented Feb 17, 2023

I rebased the commit and changed it to use "New Anim" without translation as a fallback name. This is the same name used when adding a new animation, so it's basically equivalent to resetting the name to what the default would be.

Edit: Actually I changed it to new_animation after rebasing on latest master to match #48570.

@akien-mga akien-mga merged commit 0f72c77 into godotengine:master Feb 17, 2023
@akien-mga
Copy link
Member

Thanks!

@hsandt
Copy link
Contributor

hsandt commented Feb 24, 2023

Thanks, I tested in 4.0.rc4 and the base functionality is working.

However I got this error message in the console:

Add Animation
Animation '' doesn't exist.
Rename Animation

I also noticed that if you rename "new_animation" specifically to "", it conflicts with itself and is renamed "new_animation_1". This only occurs once, next time you rename it, it will be renamed back to "new_animation".

Of course it's minor compared to the original issue. I can reopen a new issue for these.

@akien-mga
Copy link
Member

Please do, this could be polished further probably.

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.

SpriteFrames window allow setting animation name to empty string
5 participants