godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.17k stars 98 forks source link

Implement specific functional metadatas for Script instances that contain custom global classes #11238

Open Lazy-Rabbit-2001 opened 4 days ago

Lazy-Rabbit-2001 commented 4 days ago

Describe the project you are working on

Script improvement + Addons

Describe the problem or limitation you are having in your project

Extension of https://github.com/godotengine/godot-proposals/issues/1047 During the practice of Godot, I (together with some users) have encountered these inconveniences:

  1. Some custom global nodes/resources are always visible in create dialogue, which are, in practice, just for private use and polluting the dialog.
  2. Some custom global nodes/resources that should be visible displays with suffix, which would be a bit incoherent with other items in the create dialogue. Sometimes we want the suffix to be something else that contains some information.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

They all have one solution that is flexible and optional: metadata. Since a metadata is allowed to be manually added to a script in the latter's inspector, this would be solved in few fingers.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Adding some metadata - object_show_in_dialog and script_suffix respectively.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Since the create dialog and the scene tree dock is not exposed to the engine, it is impossible.

Is there a reason why this should be core and not an add-on in the asset library?

Same as "If this enhancement will not be used often, can it be worked around with a few lines of script?"

Progress

Lazy-Rabbit-2001 commented 4 days ago

It is a problematic work to remove the script icon (or "open script" button) from the scene tree editor, and will cause potential issues, so I removed it from the list