-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Add @hide_from_dialog
and @suffix
annotations for GDScript classes
#100690
Add @hide_from_dialog
and @suffix
annotations for GDScript classes
#100690
Conversation
|
Yep this annotation only affects the behavior in the create dialog, and imo if some words like |
I think this doesn't just sound to specific, I think it is to specific to be an annotation. If we add an annotation for every slight tweak that could be made to the current UI, we will end up with too much annotations in the long run. godotengine/godot-proposals#11238 isn't an issue that is brought up frequently (AFAIK), would be great to find a good solution, but adding two new annotations for it feels like a kind of annotation inflation to me. (Meaning it decreases the average impact that an annotation has and thus raises total annotations, I don't think this is desirable.) |
(Will be off-topic) The problem is that the script cannot serialize and store metadata. Storing the metadata of a script may require a new file, but the crux is in which way this should be implemented. At least adding any redundant dangling file would be a worse practice. Meanwhile, it's also important to make it easy-moved, i.e. if you move it to another directory, it still works without users editing |
There are already two PRs with an annotation to hide a class from editor dialogs:
In this case, introducing an annotation looks ok to me, although I'm not sure about the semantics (should it be something specific like Regarding the suffix, I agree with HolonProduction and commented in the linked proposal that in my opinion the annotation for the suffix is too specific to appear at the language level. And maybe the ability to customize "suffix" is not a problem to be solved at all. |
I completely forgot what i said:
Well... I think I'd better keep what I said... |
Another alternative that closes: godotengine/godot-proposals#11238
Follows up #100135
For the discussion, see the proposal
@hide_from_dialog
allows you to hide a global script with a global type name hidden from the create dialog.@suffix
allows you to set a custom suffix for the script. A custom suffix will replace the file name with the suffix you set. An empty custom suffix will hide the suffix from all create dialogs.E.g.
this will turn
into
Note
I added few protected variables in
Script
class and getter methods, which is beneficial for the future continuations based on this prAlternative: #100349
Only one of the two pr will be merged, and the other one will be closed if not.