-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow inherit from BaseButton
when creating new script to create custom buttons
#8101
Comments
Base button doesn't contain much of the logic required You are not providing any reasons for being able to extend this, please fill in the form properly, all entries must be filled in:
This one should be filled in with what you need, not what to do |
@AThousandShips I think they mean that you cannot pick abstract classes to inherit from in the script creation wizard. |
Yes, that's by design, you're not supposed to be able to extend these classes, that's not a bug, |
Therefore, things like |
See the discussion in #5641 |
Is there any reason why I shouldn't use it specifically? For example, this is
And it works as I expect. I think that that is better than:
which I would use to avoid exposing properties like This is another example of a complex custom button ( @AThousandShips , how I am supposed to create custom buttons if I can't use |
As far as I recall generally the I asked from the start why you needed this, and that this information should have been added to the proposal as that's what the instructions say, that's exactly why I asked... Also please do not tag people when they don't respond immediately |
@AThousandShips sorry... I editted the issue. |
BaseButton
when creating new scriptBaseButton
when creating new script to create custom buttons
But with a script, you can create any kind of button. Unfortunately, it's laggy as hell UPDATE: |
This looks like a bug to me. Since godotengine/godot#58972 there's a distinction in binding between "abstract" and "virtual" classes. Quote:
If "virtual" classes (like BaseButton) are said to be extendable from script then I see no reason to disallow picking them as a base class when creating a new script from the FileSystem dock. In case of adding to the scene tree a scriptless instance of a "virtual" class within the Scene dock I'm not sure why would it need to be forbidden. But even if it's forbidden for some sensible reason note that it's easily workaroundable, example: class_name Test
extends BaseButton
Not sure if e.g. detaching a script from a "virtual" class should be forbidden or what. For sure there are many inconsistencies in the logic of handling such classes. Also note that currently you can manually type in BaseButton etc. as the base class: |
Describe the project you are working on
A plugin for app development widgets.
Describe the problem or limitation you are having in your project
I want to create custom buttons, therefore inherit from
BaseButton
, however you cannot create a script that inherits fromBaseButton
from theFileSystem
tab.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add the option to inherit from
BaseButton
to allow users to create scripts that inherit from it directly. This will allow the creation of custom buttons directly (without workaround).Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add the option to inherit from
BaseButton
when creating a script so users can create custom buttons.If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes, you can modify the created script.
Is there a reason why this should be core and not an add-on in the asset library?
Yes, I think it is a limitation saying "you shouldn't do that".
The text was updated successfully, but these errors were encountered: