godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add a grid listing functions in the script editor #8699

Open pietru2004 opened 9 months ago

pietru2004 commented 9 months ago

Describe the project you are working on

N/A

Describe the problem or limitation you are having in your project

When the code gets large it might be sometimes hard to read.

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

I want to propose ability to see functions as blocks that on click can be edited. The blocks would be displayed on graph, with ability to make comment arrows to mark what functions relate to which ones... Function names would be block names

Like text blocks in https://twinery.org/

(edit) You can think of it as visual scripting, but each node is editable function and connecting them is optional for it to work. Connecting would be more like a way to visualize what runs what

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

It would work similar to https://twinery.org/ It would be lie visual shaders, but each node is clickable btn that opens code editor that allows to edit function. However after clicking to edit function block the code editor would popup allowing to modify function, starting with top

func func_name(args...):

If you change func_name it changes block name. On block duplication it would duplicate block and add number on back of func. If there would at one time be 2 function blocks with the same name they would be both saved to prevent accidental code lose.

The new code regions would work here as marker bounding boxes for code allowing for dynamic move in and out from code region. Also code regions could allow to collapse multiple functions into 1 block, that could be uncollapsed.

Comment with screens: https://github.com/godotengine/godot-proposals/issues/8699#issuecomment-1866659580

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

N/A

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

It would allow for easier view of code.

Calinou commented 9 months ago

Can you post a screenshot or mockup of what the function grid would look like? I don't really understand what it's supposed to look like.

AThousandShips commented 9 months ago

I spent quite a bit of time looking at the linked webpage and found no visual examples, so indeed add a description 🙂

pietru2004 commented 9 months ago

obraz screen from Twine, idea is functions are on grid display like in middle and you get popup code edit panel on right, left or where you define/select

obraz it also can have multiple views

and can be maximized obraz

AThousandShips commented 9 months ago

In what way is a grid any better than a list? There's no spatial logic to this so adding a second dimension as it were doesn't help structuring it, except any grouping you yourself add, but how is that any different than just grouping the methods in the file? There's no connection between the code and the grid

I'm quite a spatially oriented person but I have never used or felt the need to organise this kind of information in a grid or similar, it doesn't make sense to me since it in no way relates to the actual code or it's organisation

This feels like something best served by a plugin, and not an engine feature

pietru2004 commented 9 months ago

I fought it might be good way to visualise functions side by side and have better visibility of them

AThousandShips commented 9 months ago

Visualize what?

Nothing about the methods are visualizable in two dimensions

pietru2004 commented 9 months ago

visualize all functions that are in script and allow to mayby make arrows showing what functions invoke which...

pietru2004 commented 9 months ago

think it of as visual scripting, but each node is editable function and connecting them is optional for it to work

AThousandShips commented 9 months ago

This is things not mentioned (at least not clearly) in the original post, I'd suggest improving the details of the proposal 🙂

Zireael07 commented 9 months ago

@pietru2004 Godot already has visual scripting

pietru2004 commented 9 months ago

This is things not mentioned (at least not clearly) in the original post, I'd suggest improving the details of the proposal 🙂

I fought it would be if people checked web editor of twine... anyway I edited Describe the feature

pietru2004 commented 9 months ago

@pietru2004 Godot already has visual scripting

I know that, godot 3 has it for both gdscript and shaders... My proposal is more like alternate way to view and edit code/functions

AThousandShips commented 9 months ago

I fought it would be if people checked web editor of twine

You can't expect people to try out other software to figure out what you want, you should fill in how your feature should work 🙂

Especially you shouldn't depend on other people's interpretation of what you mean by saying "do it like this does"

pietru2004 commented 9 months ago

Ye sorry I rarely make proposals and I forgot that...