You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating a plugin like the Command Palette.
Its main idea is to allow users to create their own commands easily.
Each command (I call it an action) is a gdscript file or gdscript class which extends Action class.
It has func run() that should be overridden by the user. This function is called when the command is executed.
Also it has fields (properties) like id (uuid string), info (Dictionary with the command name, author, version and description) and these properties should also be "overridden"/set by the user.
Describe the problem or limitation you are having in your project
Idk how implement it better than having must-override methods and properties, so I would really like to have this feature in GDScript.
It also could help us, developers, not allowing making mistakes like forgotten overrides
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Must-override methods proposal already exists #1631
so this one is for must-override properties
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This can use mustoverride annotation, the name can be more intuitive tho.
it can be named abstract as well
If you don't set x explicitly in B, the error will be raised like "x should be overridden"
** as you can see it requires new feature — ability to override parent class properties default values #338
Also note that Godot 4.1 introduces static vars. And they should (logically) be mustoverridable as well.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No. At least currently there is no a way to manually (using a plugin for example) check if the script has a property in the parent class that should be overridden but doesn't, and raise the editor error
Is there a reason why this should be core and not an add-on in the asset library?
This is a GDScript feature
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
I'm creating a plugin like the Command Palette.
Its main idea is to allow users to create their own commands easily.
Each command (I call it an action) is a gdscript file or gdscript class which extends Action class.
It has
func run()
that should be overridden by the user. This function is called when the command is executed.Also it has fields (properties) like
id
(uuid string),info
(Dictionary with the command name, author, version and description) and these properties should also be "overridden"/set by the user.Describe the problem or limitation you are having in your project
Idk how implement it better than having must-override methods and properties, so I would really like to have this feature in GDScript.
It also could help us, developers, not allowing making mistakes like forgotten overrides
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Must-override methods proposal already exists
#1631
so this one is for must-override properties
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This can use
mustoverride
annotation, the name can be more intuitive tho.it can be named
abstract
as wellIf you don't set x explicitly in B, the error will be raised like "x should be overridden"
** as you can see it requires new feature — ability to override parent class properties default values
#338
Also note that Godot 4.1 introduces
static var
s. And they should (logically) be mustoverridable as well.If this enhancement will not be used often, can it be worked around with a few lines of script?
No. At least currently there is no a way to manually (using a plugin for example) check if the script has a property in the parent class that should be overridden but doesn't, and raise the editor error
Is there a reason why this should be core and not an add-on in the asset library?
This is a GDScript feature
The text was updated successfully, but these errors were encountered: