From cc2fe90a13601e5569cd9f7a690b7f5c7615427e Mon Sep 17 00:00:00 2001 From: arctia Date: Sun, 21 Dec 2025 21:41:08 +0100 Subject: [PATCH] feat: proper plugin addition --- plugin.cfg | 2 +- plugin.gd | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 plugin.gd diff --git a/plugin.cfg b/plugin.cfg index 505b25e..fc03514 100644 --- a/plugin.cfg +++ b/plugin.cfg @@ -4,4 +4,4 @@ name="SimpleLogger" description="A simple godot 4 logger" author="Arctia" version="0.1.0" -script="logger.gd" +script="plugin.gd" diff --git a/plugin.gd b/plugin.gd new file mode 100644 index 0000000..7833dcd --- /dev/null +++ b/plugin.gd @@ -0,0 +1,15 @@ +@tool +extends EditorPlugin + + +const AUTOLOAD_NAME = "Log" + + +func _enter_tree() -> void: + # Add the autoload when the plugin is enabled + add_autoload_singleton(AUTOLOAD_NAME, "res://addons/SimpleLogger/logger.gd") + + +func _exit_tree() -> void: + # Remove the autoload when the plugin is disabled + remove_autoload_singleton(AUTOLOAD_NAME)