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

Godot 4.2+ _get_tool_buttons Fix #13

Open
gillesdami opened this issue Jun 9, 2024 · 0 comments
Open

Godot 4.2+ _get_tool_buttons Fix #13

gillesdami opened this issue Jun 9, 2024 · 0 comments

Comments

@gillesdami
Copy link

This addon does not work in godot 4.2+.
To fix the code you need to check if the object received by the addon is a GDScript and if so instantiate it to be able to run it's code.
"@tool" is not required.

/addons/gd_noise/gd_noise_inspector.gd:37

# buttons defined in _get_tool_buttons show at the top
func _parse_begin(object: Object) -> void:
	var inst
	if object is GDScript:
		inst = object.new()
	else:
		inst = object
	
	if not inst.has_method("_get_tool_buttons"):
		return
	
	for method in inst._get_tool_buttons():
		add_custom_control(InspectorToolButton.new(inst, method, pluginref))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant