godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 93 forks source link

Right click on script icon should show menu with option to detach script #9534

Open CubeOfCheese opened 6 months ago

CubeOfCheese commented 6 months ago

Describe the project you are working on

Teaching my students how to use Godot

Describe the problem or limitation you are having in your project

Sometimes the students accidentally attach a script to a node they weren't supposed to. I point it out to them by pointing to the script icon. "Look, there's a script attached to this node and it shouldn't be. Let's detach it." They then try to right click on the script icon expecting to get a menu with the option to delete it.

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

Right clicking on the script icon should produce an options menu that allows the script to be detached.

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

20240416_095841

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

I don't think so

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

It would make the engine a little more intuitive to interact with for all beginners

KoBeWi commented 6 months ago

There are already at least 3 ways to detach a script. Also this could lead to accidentally removing the script (it's less likely with right-click, but still).

AThousandShips commented 6 months ago

I agree that this would make it easy to accidentally detach it, especially since the assumption would be a right click would open a menu, and detaching a script is quite destructive, losing all data and exports

CubeOfCheese commented 6 months ago

I think you misunderstand. I don't want it to automatically detach the script on right click, I want it to bring up a menu on right click that includes a detach script option.

AThousandShips commented 6 months ago

Oh that makes more sense, the title of the proposal is very misleading

timothyqiu commented 6 months ago

Icons on the right side are technically buttons, so allowing right clicking feels unusual.

It's fine if we conceptually treat them as icons instead. But how should other icons react to right clicking? It's still bad if only the script icon acts differently.

CubeOfCheese commented 6 months ago

But how should other icons react to right clicking? It's still bad if only the script icon acts differently.

I could imagine the scene icon having a right click menu that includes 'reveal in file system' for example