Skip to content

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

@Daylily-Zeleen

Description

@Daylily-Zeleen

Example:

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<GDictionary> {
		console.log("_get_property_list"); // This log is not be printed.

		const ret = new GArray<GDictionary>();
		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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions