From 6abe6654ab0e07cf8c76e5a86c6aaaa061134a50 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 16 Nov 2022 23:56:29 +0100 Subject: [PATCH] Now the new color grid inspector works. --- .../paint_canvas/color_grid_inxpector_plugin.gd | 5 +++-- game/addons/paint_canvas/plugin.gd | 16 ++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/game/addons/paint_canvas/color_grid_inxpector_plugin.gd b/game/addons/paint_canvas/color_grid_inxpector_plugin.gd index 47698e2..18f499c 100644 --- a/game/addons/paint_canvas/color_grid_inxpector_plugin.gd +++ b/game/addons/paint_canvas/color_grid_inxpector_plugin.gd @@ -4,6 +4,7 @@ extends EditorInspectorPlugin func can_handle(object: Object) -> bool: return object is PaintNode - func parse_begin(object: Object) -> void: - add_custom_control(PaintColorGrid.new()) + var pc : PaintColorGrid = PaintColorGrid.new() + pc.on_paint_node_selected(object) + add_custom_control(pc) diff --git a/game/addons/paint_canvas/plugin.gd b/game/addons/paint_canvas/plugin.gd index e243197..5ffc360 100644 --- a/game/addons/paint_canvas/plugin.gd +++ b/game/addons/paint_canvas/plugin.gd @@ -20,10 +20,10 @@ func _enter_tree() -> void: #get_tree().connect("node_removed", self, "on_node_removed") - var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin") - - if paint_editor_plugin: - var sidebar : PaintSidebar = paint_editor_plugin.get_sidebar() +# var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin") +# +# if paint_editor_plugin: +# var sidebar : PaintSidebar = paint_editor_plugin.get_sidebar() #print(sidebar) @@ -31,9 +31,9 @@ func _exit_tree() -> void: if ip: remove_inspector_plugin(ip) - var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin") - - if paint_editor_plugin: - var sidebar : PaintSidebar = paint_editor_plugin.get_sidebar() +# var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin") +# +# if paint_editor_plugin: +# var sidebar : PaintSidebar = paint_editor_plugin.get_sidebar() #print(sidebar)