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

Highlight scripts used by current scene #10750

Open
aXu-AP opened this issue Sep 15, 2024 · 7 comments · May be fixed by godotengine/godot#97041
Open

Highlight scripts used by current scene #10750

aXu-AP opened this issue Sep 15, 2024 · 7 comments · May be fixed by godotengine/godot#97041

Comments

@aXu-AP
Copy link

aXu-AP commented Sep 15, 2024

Describe the project you are working on

I was just tinkering with the engine and accidentally found a 9 year old feature which was later removed...

Describe the problem or limitation you are having in your project

There is a fairly common confusion as to how script editor relates to opened scene. Usually in form of "add scripts to top tabs instead of it's own list" or something.

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

Highlight the scripts that are used by currently opened scene.

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

highlighting
This feature is actually still fully implemented and functional (added in e9bbb97), it's just overridden by 1 line of code (in 081a236). Just need to tweak the color, originally it was really attention grabbing and also covered the selected/hover color.
PS. custom icons in the screenshot above are unrelated here, I just grabbed it from my current build where I accidentally summoned the feature.

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

No

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

It's already existing feature and also one that cannot be implemented by addon. Either reimplement it or remove unused code if the feature is not wanted.

@Calinou
Copy link
Member

Calinou commented Sep 15, 2024

Out of curiosity, does this feature work with C# scripts (when the external editor is disabled)?

@aXu-AP
Copy link
Author

aXu-AP commented Sep 15, 2024

I'll do a pr to get the mono build, I'm not feeling like learning how to do it myself 👀

@aXu-AP
Copy link
Author

aXu-AP commented Sep 15, 2024

Ah, shortsighted me forgot that artifacts don't include Mono build for Windows. Well, if any Linux user wants to test it, the build is there for grabs in linked pr.

Judging by code I believe it should work on C# scripts also. It all boils down to this function, which I think is language agnostic: https://github.com/godotengine/godot/blob/6681f2563b99e14929a8acb27f4908fece398ef1/editor/plugins/script_editor_plugin.cpp#L1962-L1977

@mgrider
Copy link

mgrider commented Sep 20, 2024

There is a fairly common confusion as to how script editor relates to opened scene. Usually in form of "add scripts to top tabs instead of it's own list" or something.

I came to this repo to find someone griping about the issue you mention. (And to pile on.) I realize this issue is not exactly the one I'm complaining about, but I do want to chime in and say that I think re-enabling this might make the issue I'm looking to gripe about worse.

(My proposed solution is to fully deselect any nodes in the Scene tab – and Files in the FileSystem tab – if they don't pertain to the currently edited/shown script.)

@aXu-AP
Copy link
Author

aXu-AP commented Sep 21, 2024

My proposed solution is to fully deselect any nodes in the Scene tab – and Files in the FileSystem tab – if they don't pertain to the currently edited/shown script.

Could you elaborate what is the problem this solves?

@mgrider
Copy link

mgrider commented Sep 21, 2024

I did elaborate a bit in a comment on 10163, but in essence each editor panel has its own selection, and it's quite easy for the selections to get out of sync with one another.

That's one aspect of the issue, but I think the more important one is how easy it is to hide the Scripts Panel, which is literally the only thing that shows you which file you are editing in the code editor. I've been thinking about this for a few days now, and I think that's a proposal I'm sure about now. I think Godot should show the current filename (& optionally path) somewhere either above or below the code as its being edited.

Finally, I think there's also an issue of the "visual weight" of all the selections shown in the editor. Currently, the eye really doesn't know what is the most important thing. It's entirely possible Godot also doesn't know the most important thing. But it does have some concept of which panel is "active" (although I think the 2d/3d scene "steals" the active selection when you just hover over it, which feels like another issue).

@aXu-AP
Copy link
Author

aXu-AP commented Sep 21, 2024

I did elaborate a bit in a comment on 10163, but in essence each editor panel has its own selection, and it's quite easy for the selections to get out of sync with one another.

I kind of see the point, but I think there's value of each panel having their own state. Whenever I need something from the filesystem, it's easier to orient myself if it is in the state I left it. Of course, some things are linked strongly together, like selecting a node in 2D or 3D view selects it also in the Scene tab and vice versa. I think coding is a slighly different thing, however, which warrants a different approach. It would be hard to imagine that selecting different nodes would open their scripts automatically for example. I inspect variety of nodes during scripting for checking/adjusting various properties for example. And there's the script button besides node name so there is a link when you need it.

Changing scenes is a different thing because youre changing the whole context. That's why I have turned on editor setting text_editor/behavior/files/open_dominant_script_on_scene_change. This proposal also helps with understanding the state of the editor.

Finally, I think there's also an issue of the "visual weight" of all the selections shown in the editor.

That's why you have the option to turn this proposed feature and also script temperature off. In fact, there's the distraction free mode which hides all the other panels. I'm not sure how else one could reduce visual weight in the editor, it's all useful information that should be available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants