Now the new color grid inspector works.

This commit is contained in:
Relintai 2022-11-16 23:56:29 +01:00
parent 912e9b2f79
commit 6abe6654ab
2 changed files with 11 additions and 10 deletions

View File

@ -4,6 +4,7 @@ extends EditorInspectorPlugin
func can_handle(object: Object) -> bool: func can_handle(object: Object) -> bool:
return object is PaintNode return object is PaintNode
func parse_begin(object: Object) -> void: 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)

View File

@ -20,10 +20,10 @@ func _enter_tree() -> void:
#get_tree().connect("node_removed", self, "on_node_removed") #get_tree().connect("node_removed", self, "on_node_removed")
var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin") # var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin")
#
if paint_editor_plugin: # if paint_editor_plugin:
var sidebar : PaintSidebar = paint_editor_plugin.get_sidebar() # var sidebar : PaintSidebar = paint_editor_plugin.get_sidebar()
#print(sidebar) #print(sidebar)
@ -31,9 +31,9 @@ func _exit_tree() -> void:
if ip: if ip:
remove_inspector_plugin(ip) remove_inspector_plugin(ip)
var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin") # var paint_editor_plugin : EditorPlugin = Engine.get_global("PaintEditorPlugin")
#
if paint_editor_plugin: # if paint_editor_plugin:
var sidebar : PaintSidebar = paint_editor_plugin.get_sidebar() # var sidebar : PaintSidebar = paint_editor_plugin.get_sidebar()
#print(sidebar) #print(sidebar)