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

Give tabs control over 2d, 3d, and scripts, not the other way around. #3215

Open
skysphr opened this issue Aug 28, 2021 · 1 comment
Open

Comments

@skysphr
Copy link

skysphr commented Aug 28, 2021

Describe the project you are working on

A project with several scenes and scripts.

Describe the problem or limitation you are having in your project

After switching to script mode, editor tabs have a confusing behavior:

  • Each tab is linked to a scene, such that selecting it will switch the currently edited script to the script associated with the scene's parent node. If no parent script exists, a script associated to a child will be selected. Switching between tabs does not remember which script you were previously editing in that tab.
  • Switching between tabs does not remember the list of files loaded in the script panel. It will always load all the scripts it can gather from other tabs.

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

The interface could stay the same but tabs should remember the state of items that are being edited within them:

  • If you are editing a scene, the tab will be in 2d or 3d mode. If you are editing a script or a collection of scripts, the tab will be in script mode. Going back to that tab would switch to the editing mode to what you left it.
  • If in script mode, every tab is associated with a set of scripts loaded in the script panel of the code editor. The user may choose to keep only one script per tab, or edit several.

If tabs remembered the state of the item that you are editing within them, you could organize your editing by logically separating scopes in different tabs.

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

  • User creates a new scene, a tab is opened with the "Create root node" options. User selects 3D, the tab goes in 3D mode. Let's call it scene1.tscn.
  • User opens a new tab, opens a script (scene1_controller.gd) and starts editing it.
  • They go back to the first tab, make some changes to the 3D scene.
  • User creates a new scene in a third tab and sets it to 2D. A fourth tab is added, in which the user edits a number of scripts with a different scope (let's call them menu.gd, menuitem.gd).
  • Switching between tabs goes from editing the 3D scene, to editing scene1_controller.gd, to the 2D scene, to the menu scripts.

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

No (one could use an external editor but that would defeat the point).

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

As far as I am aware, the functionality cannot be achieved with add-ons.

@aaronfranke
Copy link
Member

such that selecting it will switch the currently edited script to the script associated with the scene's parent node. If no parent script exists, a script associated to a child will be selected.

Note: There is an editor setting to disable this.

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

No branches or pull requests

3 participants