beehave icon indicating copy to clipboard operation
beehave copied to clipboard

Debugger visuals broken in 4.2

Open bitbrain opened this issue 2 years ago • 7 comments
trafficstars

Godot version: 4.2 Beehave Version: 2.7.6

Describe the bug

With the debugger being fixed in 4.2, its visuals are still broken: Screenshot 2023-10-14 142405

bitbrain avatar Oct 14 '23 13:10 bitbrain

@bitbrain Partially able to fix this by updating the property reference from port_offset to port_h_offset. That only fixed the x axis though https://github.com/bitbrain/beehave/blob/6597b7524d2154c8921dd24650bd70335d04178c/addons/beehave/debug/graph_node.gd#L146

bits-by-brandon avatar Dec 01 '23 05:12 bits-by-brandon

Also from this PR: https://github.com/godotengine/godot/pull/79311

GraphNode: get_port_input/output_position returns no longer the position premultiplied with the scale

Could this be part of the issue?

bits-by-brandon avatar Dec 01 '23 06:12 bits-by-brandon

Oh wait I think I see the issue. The ports positions are now based on the inner container node, not the outermost node.

bits-by-brandon avatar Dec 01 '23 17:12 bits-by-brandon

@bits-by-brandon feel free to raise a PR!

bitbrain avatar Dec 02 '23 11:12 bitbrain

Fiddled around with it for a little bit, and I can't seem go find a way to fix this without changing a lot of the layout implementation. I'm hesitant to lay a bunch of conditionals in here, im wondering if we need a different 4.2.x branch, or some other strategy for separating the layout needed for 4.2

bits-by-brandon avatar Dec 03 '23 17:12 bits-by-brandon

@bits-by-brandon I recommend creating a new scene structure for 4.2 (but keep the existing debugger) and have a toggle like this somewhere:

if godot 4.2+: load new debugger else: load old debugger

bitbrain avatar Dec 03 '23 18:12 bitbrain

@bitbrain Okay working with something along these lines. I could also use has_method to branch based on capabilities instead of version numbers

func _ready() -> void:
	var version_info = Engine.get_version_info()
	if version_info.minor >= 2:
		modify_node_layout()
	else:
		build_custom_layout()

bits-by-brandon avatar Dec 03 '23 20:12 bits-by-brandon