Skip to content

Instantly share code, notes, and snippets.

@vintprox
Last active July 2, 2022 21:10
Show Gist options
  • Save vintprox/ef7da94f97cc1c124d55506bcdcaedd9 to your computer and use it in GitHub Desktop.
Save vintprox/ef7da94f97cc1c124d55506bcdcaedd9 to your computer and use it in GitHub Desktop.

Revisions

  1. vintprox revised this gist Jul 2, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion explore.gd
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    func assetlib_search(query: String):
    var assetlib_view: Control = get_editor_interface().get_editor_main_control().find_children("*", "EditorAssetLibrary", false, false).pop_front()
    if not assetlib_view: return
    if not assetlib_view:
    OS.shell_open("https://godotengine.org/asset-library/asset?filter=" + query.uri_encode())
    return

    get_editor_interface().set_main_screen_editor("AssetLib")
    await get_tree().create_timer(1).timeout
  2. vintprox revised this gist Jul 2, 2022. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions explore.gd
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    func assetlib_explore(query: String):
    func assetlib_search(query: String):
    var assetlib_view: Control = get_editor_interface().get_editor_main_control().find_children("*", "EditorAssetLibrary", false, false).pop_front()
    if not assetlib_view: return

    get_editor_interface().set_main_screen_editor("AssetLib")
    await get_tree().create_timer(1).timeout

    var assetlib_search_field: LineEdit = assetlib_view.find_children("*", "LineEdit", true, false).pop_front()
    assetlib_search_field.set_text(query)
    var search_field: LineEdit = assetlib_view.find_children("*", "LineEdit", true, false).pop_front()
    search_field.set_text(query)
    await get_tree().process_frame

    assetlib_search_field.emit_signal("text_changed", query)
    search_field.emit_signal("text_changed", query)
  3. vintprox revised this gist Jul 2, 2022. No changes.
  4. vintprox created this gist Jul 2, 2022.
    12 changes: 12 additions & 0 deletions explore.gd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    func assetlib_explore(query: String):
    var assetlib_view: Control = get_editor_interface().get_editor_main_control().find_children("*", "EditorAssetLibrary", false, false).pop_front()
    if not assetlib_view: return

    get_editor_interface().set_main_screen_editor("AssetLib")
    await get_tree().create_timer(1).timeout

    var assetlib_search_field: LineEdit = assetlib_view.find_children("*", "LineEdit", true, false).pop_front()
    assetlib_search_field.set_text(query)
    await get_tree().process_frame

    assetlib_search_field.emit_signal("text_changed", query)