File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ var default_parent: Control
77var script_editor :ScriptEditor = null
88var last_screen := ''
99
10+
11+
1012func _enter_tree ()-> void :
13+ # print(" current screen " ,get_main_screen())
1114 script_editor = EditorInterface .get_script_editor ()
1215 script_editor .editor_script_changed .connect (script_visibility_changed )
1316 script_editor .visibility_changed .connect (script_visibility_changed )
@@ -20,9 +23,12 @@ func _enter_tree()->void:
2023 control .size_flags_vertical = Control .SIZE_EXPAND_FILL
2124 control .name = "Scripts"
2225 add_control_to_dock (EditorPlugin .DOCK_SLOT_LEFT_BR , control )
26+
2327 ## connect to what screen is active
2428 main_screen_changed .connect (screen_changed )
25-
29+
30+
31+
2632func screen_changed (screen )-> void :
2733 last_screen = screen
2834 if ! script_editor && ! script_editor .is_visible_in_tree ():
@@ -41,7 +47,7 @@ func script_visibility_changed(a = null)->void:
4147 return
4248
4349 if last_screen == "" :
44- last_screen = "Script"
50+ return
4551
4652 if last_screen == "Script" :
4753 var parent : TabContainer = control .get_parent ()
You can’t perform that action at this time.
0 commit comments