Godot Version
4.5
Question
I’m building a plugin to create a custom tilemap solution. I need some complex editors but the functionality that EditorInspectorPlugin gives doesn’t seem enough. So I created a .tscn with my UI (this is not all, just a test) and used EditorInspectorPlugin.add_custom_control method. At first it looked bad, overlapping other editors. When I forced a minimum size on the root control, it got better, but still wrong because it renders above and not below the “TileRelationRule” label, also, I’m setting manually custom size, which is error prone when I add more stuff to that scene. Am I doing something wrong here? This is my first Godot plugin and I read all the docs I found. Images:
EditorInpsectorPlugin code:
extends EditorInspectorPlugin
func _can_handle(object):
return object is TileRelationRule
func _parse_begin(object):
var panel_scene = preload("res://addons/teragrid/scenes/ui/rule_tile_panel.tscn")
var panel = panel_scene.instantiate()
# This for later
if panel.has_method("set_rule"):
panel.set_rule(object)
add_custom_control(panel)
func _parse_property(object, type, name, hint, hint_text, usage, wide):
if name in ["below", "adjacent", "above"]:
return true # Godot doesn't draw it
return false
The resource script
class_name TileRelationRule extends Resource
enum TileState {
ANY = 0,
REQUIRE = 1,
FORBID = 2,
}
enum Layer { BELOW, ADJACENT, ABOVE }
enum Direction {
NW, N, NE,
W, C, E,
SW, S, SE
}
@export var below := PackedByteArray([0, 0, 0])
@export var adjacent := PackedByteArray([0, 0, 0])
@export var above := PackedByteArray([0, 0, 0])

