@@ -11,14 +11,17 @@ const SCRIPT_IDE: StringName = &"plugin/script_ide/"
1111const OUTLINE_POSITION_RIGHT : StringName = SCRIPT_IDE + & "outline_position_right"
1212## Editor setting to control whether private members (annotated with '_' should be hidden or not)
1313const HIDE_PRIVATE_MEMBERS : StringName = SCRIPT_IDE + & "hide_private_members"
14- ## Editor setting to control whether we want to auto navigate to the script in the filesystem when selected
15- const AUTO_NAVIGATE_IN_FS : StringName = SCRIPT_IDE + & "auto_navigate_in_fs"
14+ ## Editor setting to control whether we want to auto navigate to the script
15+ ## in the filesystem (dock) when selected
16+ const AUTO_NAVIGATE_IN_FS : StringName = SCRIPT_IDE + & "auto_navigate_in_filesystem_dock"
1617## Editor setting to control whether the script list should be visible or not
1718const SCRIPT_LIST_VISIBLE : StringName = SCRIPT_IDE + & "script_list_visible"
1819## Editor setting for the 'Open Outline Popup' shortcut
1920const OPEN_OUTLINE_POPUP : StringName = SCRIPT_IDE + & "open_outline_popup"
2021## Editor setting for the 'Open Scripts Popup' shortcut
2122const OPEN_SCRIPTS_POPUP : StringName = SCRIPT_IDE + & "open_scripts_popup"
23+ ## Editor setting for the 'Open Scripts Popup' shortcut
24+ const OPEN_QUICK_SEARCH_POPUP : StringName = SCRIPT_IDE + & "open_quick_search_popup"
2225
2326const GETTER : StringName = & "get"
2427const SETTER : StringName = & "set"
@@ -46,6 +49,7 @@ var hide_private_members: bool = false
4649var is_auto_navigate_in_fs : bool = true
4750var open_outline_popup_shc : Shortcut
4851var open_scripts_popup_shc : Shortcut
52+ var open_quick_search_popup_shc : Shortcut
4953#endregion
5054
5155#region Existing controls we modify
@@ -69,6 +73,7 @@ var outline_popup: PopupPanel
6973var filter_box : HBoxContainer
7074
7175var scripts_popup : PopupPanel
76+ var quick_open_popup : PopupPanel
7277
7378var class_btn : Button
7479var constant_btn : Button
@@ -91,11 +96,14 @@ var last_tab_hovered: int = -1
9196var sync_script_list : bool = false
9297var suppress_settings_sync : bool = false
9398
99+ const SHORTCUT_INTERVAL : int = 400
100+ var last_shortcut_time : int = - SHORTCUT_INTERVAL
101+
94102#region Enter / Exit -> Plugin setup
95103## Change the Godot script UI and transform into an IDE like UI
96104func _enter_tree () -> void :
97105 var script_path : String = get_script ().get_path ().get_base_dir ()
98-
106+
99107 keyword_icon = create_editor_texture (load (script_path .path_join ("icon/keyword.svg" )))
100108 func_icon = create_editor_texture (load (script_path .path_join ("icon/func.svg" )))
101109 func_get_icon = create_editor_texture (load (script_path .path_join ("icon/func_get.svg" )))
@@ -144,8 +152,19 @@ func _enter_tree() -> void:
144152 editor_settings .set_setting (OPEN_SCRIPTS_POPUP , shortcut )
145153 editor_settings .set_initial_value (OPEN_SCRIPTS_POPUP , shortcut , false )
146154
155+ if (! editor_settings .has_setting (OPEN_QUICK_SEARCH_POPUP )):
156+ var shortcut : Shortcut = Shortcut .new ()
157+ var event : InputEventKey = InputEventKey .new ()
158+ event .device = - 1
159+ event .keycode = KEY_SHIFT
160+
161+ shortcut .events = [ event ]
162+ editor_settings .set_setting (OPEN_QUICK_SEARCH_POPUP , shortcut )
163+ editor_settings .set_initial_value (OPEN_QUICK_SEARCH_POPUP , shortcut , false )
164+
147165 open_outline_popup_shc = editor_settings .get_setting (OPEN_OUTLINE_POPUP )
148166 open_scripts_popup_shc = editor_settings .get_setting (OPEN_SCRIPTS_POPUP )
167+ open_quick_search_popup_shc = editor_settings .get_setting (OPEN_QUICK_SEARCH_POPUP )
149168
150169 # Update on filesystem changed (e.g. save operation).
151170 var file_system : EditorFileSystem = EditorInterface .get_resource_filesystem ()
@@ -307,6 +326,9 @@ func _exit_tree() -> void:
307326 if (outline_popup != null ):
308327 outline_popup .free ()
309328
329+ if (quick_open_popup != null ):
330+ quick_open_popup .free ()
331+
310332 get_editor_settings ().settings_changed .disconnect (sync_settings )
311333#endregion
312334
@@ -317,13 +339,20 @@ func _process(delta: float) -> void:
317339
318340## Process the user defined shortcuts
319341func _shortcut_input (event : InputEvent ) -> void :
342+ if (open_quick_search_popup_shc .matches_event (event ) && event .is_released ()):
343+ var old_time : int = last_shortcut_time
344+ last_shortcut_time = Time .get_ticks_msec ()
345+
346+ if (last_shortcut_time - old_time <= SHORTCUT_INTERVAL ):
347+ get_viewport ().set_input_as_handled ()
348+ open_quick_search ()
349+ return
350+
320351 if (open_outline_popup_shc .matches_event (event )):
321352 get_viewport ().set_input_as_handled ()
322-
323353 open_outline_popup ()
324354 elif (open_scripts_popup_shc .matches_event (event )):
325355 get_viewport ().set_input_as_handled ()
326-
327356 open_scripts_popup ()
328357
329358## Schedules an update on the next frame
@@ -342,6 +371,15 @@ func update_editor():
342371 update_outline_cache ()
343372 update_outline ()
344373
374+ func open_quick_search ():
375+ if (quick_open_popup == null ):
376+ var script_path : String = get_script ().get_path ().get_base_dir ()
377+ quick_open_popup = load (script_path .path_join ("quickopen/quick_open_panel.tscn" )).instantiate ()
378+
379+ if (quick_open_popup .get_parent () != null ):
380+ quick_open_popup .get_parent ().remove_child (quick_open_popup )
381+ quick_open_popup .popup_exclusive_on_parent (EditorInterface .get_script_editor (), get_center_editor_rect ())
382+
345383func create_set_scripts_popup ():
346384 panel_container = scripts_item_list .get_parent ().get_parent ()
347385
0 commit comments