From c77584fd0d453ee8dd05eb5c900dc9a8296781b0 Mon Sep 17 00:00:00 2001 From: Zakarya Date: Fri, 28 Feb 2025 12:17:34 -0800 Subject: [PATCH] Fix some weird errors --- addons/bson/bson.gd | 5 ++++- project.godot | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/bson/bson.gd b/addons/bson/bson.gd index 47ba328..72e1a05 100644 --- a/addons/bson/bson.gd +++ b/addons/bson/bson.gd @@ -2,7 +2,10 @@ # This file is the BSON serializer for the Godot Engine, # published under the MIT license. https://opensource.org/license/MIT -class_name BSON +extends Node +# Unfortunately, this has to be a node in order to be a singleton. +# I'd rather BSON wasn't in the scenetree, but it seems like that's +# the only way to do this. Hopefully this will change in the future. static func to_bson(data: Dictionary) -> PackedByteArray: diff --git a/project.godot b/project.godot index 1ffbe97..4ee103b 100644 --- a/project.godot +++ b/project.godot @@ -15,6 +15,10 @@ run/main_scene="res://BSON Examples/dunk.tscn" config/features=PackedStringArray("4.3", "Forward Plus") config/icon="res://icon.svg" +[autoload] + +BSON="*res://addons/bson/bson.gd" + [editor_plugins] enabled=PackedStringArray("res://addons/bson/plugin.cfg")