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

Ability to easily extend gd scripts #4584

Closed
kubecz3k opened this issue May 8, 2016 · 7 comments
Closed

Ability to easily extend gd scripts #4584

kubecz3k opened this issue May 8, 2016 · 7 comments

Comments

@kubecz3k
Copy link
Contributor

kubecz3k commented May 8, 2016

Operating system or device - Godot version:

Issue description (what happened, and what was expected):
Currently when I want to extend some script that is attached to a scene I need to make a lot of quite tiring (in the long term) steps.

  1. Create new text file.
  2. Find path to the file I want to extend
  3. Write proper 'extend' line in new scipt
  4. Remove 'base' script from a node that should use extended script.
  5. Attach 'extended' script to a node
  6. Reset all exported variables of the script.

It would be so incredibly easier if Godot editor could do all this for me (button like 'new Extended script'/'Extend'). We don't even need new button, when I want to create new script for a node I'm clicking:
newscript
And then popup with question about file location cames out.
It would make perfect sense for me if the same could happen when I'm clicking this button on a node that already have a script, just this time 'extends path/2/parent/script.gd' line would be filled automatically.
Related issue: #4585

Steps to reproduce:

Link to minimal example project (optional but very welcome):

@kubecz3k
Copy link
Contributor Author

kubecz3k commented May 8, 2016

I think this issue is related to plugin system since currently extending a custom plugin is executed in exactly the same painful way. That's why I'm thinking it should be considered before releasing 2.1.

@LeonardMeagher2
Copy link
Contributor

It would be nice if the "inherits:" section when creating a script just accepted a path as well as a class name, and had a little file browser button next to it, but it still defaulted to the Node type of the current node.

@bojidar-bg
Copy link
Contributor

@LeonardMeagher2 Well, I don't think there is another way to do this 😄

Actually, we might have two buttons, one for selecting a class and one for script file, or we might have a new dialog that merges both of those ideas.

@MarianoGnu
Copy link
Contributor

Copypaste from #4584 since same proposal fixes both issues:

I belive an option on contextual menu is enought for this
If no script:
-create script
If has script
-edit script
-extend script

This should not only work for scene instance, but for every node with a script assigned

@akien-mga
Copy link
Member

Not critical for the upcoming 2.1, so moving to the next milestone.

@kubecz3k
Copy link
Contributor Author

In general I wrote external plugin which can be eventually used to solve this issue, it's available in asset store but it's implementation is not perfect since I dont have ability to add an entry under right click button (#6128).

@akien-mga akien-mga removed this from the 2.2 milestone Aug 8, 2017
@vnen
Copy link
Member

vnen commented Aug 17, 2018

I think this is now solved by #20233.

@vnen vnen closed this as completed Aug 17, 2018
@vnen vnen added this to the 3.1 milestone Aug 17, 2018
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

6 participants