File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ extends EditorPlugin
55const MainPanel := preload ("res://addons/block_code/ui/main_panel.tscn" )
66static var main_panel
77
8+ var editor_inspector : EditorInspector
9+
810var old_feature_profile : String = ""
911
1012const DISABLED_CLASSES := [
@@ -47,6 +49,8 @@ const DISABLED_CLASSES := [
4749func _enter_tree ():
4850 Types .init_cast_graph ()
4951
52+ editor_inspector = EditorInterface .get_inspector ()
53+
5054 main_panel = MainPanel .instantiate ()
5155 main_panel .undo_redo = get_undo_redo ()
5256
@@ -91,6 +95,16 @@ func _exit_tree():
9195 EditorInterface .set_current_feature_profile ("" )
9296
9397
98+ func _ready ():
99+ editor_inspector .connect ("edited_object_changed" , _on_editor_inspector_edited_object_changed )
100+
101+
102+ func _on_editor_inspector_edited_object_changed ():
103+ var block_code : BlockCode = editor_inspector .get_edited_object () as BlockCode
104+ if block_code :
105+ BlockCodePlugin .main_panel .switch_script (block_code )
106+
107+
94108func _has_main_screen ():
95109 return true
96110
You can’t perform that action at this time.
0 commit comments