Skip to content

Fix singleton conflict caused in godot 4.7.1 - #443

Merged
bitbrain merged 2 commits into
bitbrain:godot-4.xfrom
RawsharkTang:singleton_bug_4.7.1
Jul 29, 2026
Merged

Fix singleton conflict caused in godot 4.7.1#443
bitbrain merged 2 commits into
bitbrain:godot-4.xfrom
RawsharkTang:singleton_bug_4.7.1

Conversation

@RawsharkTang

@RawsharkTang RawsharkTang commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

Pr for Issue442

Addressed issues

  • modified the plugin initialization process to prevent breaking the godot in-editor singleton

Closes #442

Comment thread addons/beehave/debug/debugger.gd Outdated
floating_window.transient = true
floating_window.close_requested.connect(_on_window_close_requested)
editor_interface.get_base_control().add_child(floating_window)
EditorInterface.get_base_control().add_child(floating_window)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is this will break Beehave for anything below Godot 4.2, which is why ideally we should not change this unless it is causing us issues. For the sake of "clean code" we cannot do it, was we'd effectively make Beehave incompatible with anything below Godot 4.2

Comment thread addons/beehave/debug/debugger_tab.gd Outdated
var graph
var blackboard_vbox: VBoxContainer
var message: Label
static var frame: RefCounted

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static was introduced somewhat during Godot 4.x development and we should avoid using it, as it makes this addon incompatible with Godot versions where static is unsupported.

Comment thread addons/beehave/debug/debugger_tab.gd Outdated
const TREE_ICON = preload("../icons/tree.svg")
const OldGraph = preload("old_graph_edit.gd")
const NewGraph = preload("new_graph_edit.gd")
# const Utils = preload("res://addons/beehave/utils/utils.gd")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure to not include any commented out code.

Comment thread addons/beehave/debug/debugger_tab.gd Outdated
if item_list.is_inside_tree() and not item_list.get_selected_items().is_empty():
_on_item_selected(item_list.get_selected_items()[0])
get_tree().create_timer(0.2).timeout.connect(
func():

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RawsharkTang out of curiosity: what formatter are you using? A lot of files have changed here and we should avoid including unwanted reformatting changes.

We could perhaps agree to adopt the official GDQuest formatter for this repo, but that would need to happen as part of a separate PR/discussion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im using gdtoolkit and gdscript formatter to format my code.

Comment thread addons/beehave/plugin.cfg
name="Beehave"
description="馃悵 Behavior Tree addon for Godot Engine"
author="bitbrain"
version="2.9.3-dev"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not change this

@bitbrain

bitbrain commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Thank you for your contribution @RawsharkTang. Unfortunately, this pull request contains a lot more than just the singleton conflict changes (i.e. formatting fixes and cleanups). Ideally, those need to be separated out into separate pull requests, as otherwise it is very difficult for me (in case something breaks or bugs are introduced) what PR exactly caused the change.

Also be mindful that with Beehave, there is a strict compatibility approach where all Godot 4.x versions should be supported. Using things like static unfortunately breaks older versions of Godot 4 and the benefit currently does not overwhelm the lockout. Unless we can justify that using something like static or EditorInterface will solve real bugs for us of course. In that case, we can discuss it :) that being said, I realise this might not be clear to first-time contributors so I will update the contributor guidelines accordingly.

@bitbrain bitbrain changed the title Fix singleton confiict caused in godot 4.7.1 Fix singleton conflict caused in godot 4.7.1 Jul 26, 2026
@RawsharkTang

RawsharkTang commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the instructions!!! I really dont know much as first time contributing.

@RawsharkTang
RawsharkTang force-pushed the singleton_bug_4.7.1 branch from 6ad5e3d to 801d125 Compare July 27, 2026 03:03
@RawsharkTang

Copy link
Copy Markdown
Contributor Author

Im closing this pr and i will open up a new one with only the conflict fix

@RawsharkTang

RawsharkTang commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

I just forced push and found this pr's old change is lost ahhhh
Update: It seems I can just reuse this pr and dont have to reopen one.
I cleaned up my commit and only preserve the conflict fix

@RawsharkTang RawsharkTang reopened this Jul 27, 2026
Comment thread addons/beehave/plugin.gd Outdated
@bitbrain
bitbrain merged commit dd1df2d into bitbrain:godot-4.x Jul 29, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

Beehave Singleton Registration possibly break plugins like Phantom Camera

2 participants