-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 PluginScript to customize language's can_inherit_from_file attribute #44177
Allow PluginScript to customize language's can_inherit_from_file attribute #44177
Conversation
@@ -78,7 +78,7 @@ class PluginScriptLanguage : public ScriptLanguage { | |||
virtual Script *create_script() const; | |||
virtual bool has_named_classes() const; | |||
virtual bool supports_builtin_mode() const; | |||
virtual bool can_inherit_from_file() { return true; } | |||
virtual bool can_inherit_from_file(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be const
like the other ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree, however the parent method is not const:
Line 313 in d9f0477
virtual bool can_inherit_from_file() { return false; } |
I can provide another PR to fix this if you want ;-)
@@ -127,6 +127,7 @@ typedef struct { | |||
const char **string_delimiters; // nullptr terminated array | |||
godot_bool has_named_classes; | |||
godot_bool supports_builtin_mode; | |||
godot_bool can_inherit_from_file; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is godot_bool
value initialized automatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nop, godot_bool
is just and alias to a base type (defined as typedef bool godot_bool;
)
In fact nothing is initialized automatically here given this .h is part of the gdnative C API (so this structure is created from C code, so everything must be explicitly initialized/teardown)
Thanks! |
can_inherit_from_file
should be customizable, not sure why it's not already the case ;-)This change break Pluginscript API so it shouldn't be cherry picked for 3.2