Skip to content

Commit

Permalink
Add ability to bind typed arrays to script API
Browse files Browse the repository at this point in the history
Note: Only replaced 2 instances to test, Node.get_children and TileMap.get_used_cells
Note: Will do a mass replace on later PRs of whathever I can find, but probably need
a tool to grep through doc.
Warning: Mono will break, needs to be fixed (and so do TypeScript and NativeScript, need to ask respective maintainers)
  • Loading branch information
reduz committed Apr 21, 2020
1 parent f26b6c0 commit 3dcee28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions visual_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,10 @@ VisualScript::VisualScript() {
is_tool_script = false;
}

bool VisualScript::inherits_script(const Ref<Script> &p_script) const {
return this == p_script.ptr(); //there is no inheritance in visual scripts, so this is enough
}

StringName VisualScript::get_default_func() const {
return StringName("f_312843592");
}
Expand Down
2 changes: 2 additions & 0 deletions visual_script.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ class VisualScript : public Script {
static void _bind_methods();

public:
bool inherits_script(const Ref<Script> &p_script) const;

// TODO: Remove it in future when breaking changes are acceptable
StringName get_default_func() const;
void add_function(const StringName &p_name);
Expand Down

0 comments on commit 3dcee28

Please sign in to comment.