godotjs / godotjs/GodotJS

[Bug] It seems that some virtual functions is not work.

Open
#183 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
765
Forks
46
PR merge metrics
No merged PRs in 30d

Description

Example:
```TypeScript
import { GArray, GDictionary, Node, PropertyUsageFlags, StringName, Variant } from "godot";
import { Tool } from "godot.annotations";

@Tool()
export default class Test extends Node {
testField: number = 0;

_get_property_list(): GArray {
console.log("_get_property_list"); // This log is not be printed.

const ret = new GArray();
ret.push_back(GDictionary.create({
name: "test",
type: Variant.Type.TYPE_INT,
usage: PropertyUsageFlags.PROPERTY_USAGE_DEFAULT,
}));
return ret;
}

_set(property: StringName, value: any): boolean {
if (property === "test") {
this.testField= value;
return true;
}
return false;
}

_get(property: StringName) {
if (property === "test") {
return this.testField;
}
return null;
}
```

In this example, the property "test" can not be recognized and shown in inspector.
It seems that `_get_property_list()` is not be executed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.