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

Allow PluginScript to customize language's can_inherit_from_file attribute #44177

Conversation

touilleMan
Copy link
Member

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

@@ -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();
Copy link
Member

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?

Copy link
Member Author

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:

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;
Copy link
Member

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?

Copy link
Member Author

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)

@akien-mga akien-mga merged commit d94de32 into godotengine:master Dec 8, 2020
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants