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

Restrict Autoloads from having keywords as their names #24365

Merged
merged 1 commit into from
May 29, 2019

Conversation

YeldhamDev
Copy link
Member

@YeldhamDev YeldhamDev commented Dec 15, 2018

A re-take on #22107, fixes #17494.

A comment in the original PR suggests using ScriptServer::is_scripting_enabled(), but as it always returns false, this condition is not used.

Some small enhancements where also added:

  • Passing an invalid name now only clears the name field, avoiding having to choose the path again.
  • Pressing Enter while having the name field focused now counts as having pressed "Add".

While doing this, I also made an interesting discovery: Classes registered which names start with "_" (such as _Engine, _OS, etc), even though they can be identified without the underscore while scripting, searching for it in the ClassDB will result in nothing without it.

This explains why you can name Autoloads which such classes, and also why they don't inherent the Object icon in the new Editor Help dialog.

Now here's the question: Should we make those two places also check the class names with "_" when searching the database, or should something be done in the ClassDB itself?

UPDATE: The above can be fixed by either #26990 or #26922.

@Chaosus Chaosus added this to the 3.2 milestone Dec 15, 2018
@YeldhamDev YeldhamDev force-pushed the autoload_restrict_keywords branch from 62ffa88 to b4d654b Compare May 2, 2019 17:24
@YeldhamDev YeldhamDev force-pushed the autoload_restrict_keywords branch from b4d654b to f470d41 Compare May 17, 2019 02:52
@YeldhamDev YeldhamDev force-pushed the autoload_restrict_keywords branch from f470d41 to 57a03f0 Compare May 21, 2019 14:57
@akien-mga akien-mga merged commit bc816f9 into godotengine:master May 29, 2019
@akien-mga
Copy link
Member

Thanks!

@YeldhamDev YeldhamDev deleted the autoload_restrict_keywords branch May 29, 2019 17:00
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.

Singletons can have keywords for a name
5 participants