From c9e59d5b87c4d19ed32ed994a570ceeeb92ec838 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 15 Nov 2022 18:26:43 +0100 Subject: [PATCH] Initial test plugin code setup. --- game/addons/paint/plugin.gd | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/game/addons/paint/plugin.gd b/game/addons/paint/plugin.gd index b582dd9..f6060ec 100644 --- a/game/addons/paint/plugin.gd +++ b/game/addons/paint/plugin.gd @@ -1,10 +1,28 @@ tool extends EditorPlugin - func _enter_tree() -> void: - pass + var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin") + + if paint_editor_plugin: + var sidebar : PaintSidebar = paint_editor_plugin.get_sidebar() + + #print(sidebar) func _exit_tree() -> void: - pass + var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin") + + if paint_editor_plugin: + var sidebar : PaintSidebar = paint_editor_plugin.get_sidebar() + + #print(sidebar) + + +#func _enter_tree() -> void: +# for c in get_parent().get_children(): +# if c is EditorPlugin: +# var ep : EditorPlugin = c as EditorPlugin +# +# if ep.get_class() == "PaintEditorPlugin": +# print(ep.get_class())