Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add search input for worlds #448

Merged
merged 4 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="8fa15379a3f63d0a78c17ea4fb527069"
dest_md5="dcf88af512526f155726df0d2cc936f1"
source_md5="fd5ce002f648dd299fa24639ee4324c4"
dest_md5="b763f32d89d11f752bcaf09e32e71bb8"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="b99a48a90998e1d3962c9ad329ed98ca"
dest_md5="90e8d151ae08547e4e2f952162ad53a5"
source_md5="5245cdaed499b223c145090c0f3901da"
dest_md5="0d5ad3d1ffeb49b2715f17a821b4418c"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="5dafe66d07964e3422c7a51506b932a0"
dest_md5="7899cb6f3843f28a7b7d604a91f92607"
source_md5="8010fe3505494e9649d681f9f6dca88a"
dest_md5="8b511d3f50e3fe2ccaff63b417bde079"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="a3a06da50209bbd7d953710e29e750c1"
dest_md5="bdb5fce50a9fda8851b7278d71178fed"
source_md5="d41b8a7ee1a39abaef53175ef2f72162"
dest_md5="2790aa09982b93893ec8f4a891f658b1"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="aa0494a496e5db31be7aa85b625e6aba"
dest_md5="4fbca527521040db849142eadf0c7ede"
source_md5="7ab7581579d78834095a40ae35830e0e"
dest_md5="13ca799cf0ac63c9345ab4afd6c31062"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="f2ad840cd8b67d4ad9b8c0519d8ccfa8"
dest_md5="6b9778e4105f6fced82f57d3cb52a189"
source_md5="5cc069ea84304aab9514d1b0c8a5a2d4"
dest_md5="2ab63f7f2a7a21ed59610e35056ebd73"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="6c21b4af1bce730acbc2975ad568db55"
dest_md5="f19d1c28a074b155d5e1072f528f659f"
source_md5="8df958aff0f6f81ce6a206867717e83d"
dest_md5="e476549417c91cb9169e3e60dae5235d"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="8797822ca0dc006fa8cb7574516957b7"
dest_md5="bdc17274bb0f3ffcf24819f80606e1c4"
source_md5="5e0c3ec7b5ad7cd95fd31a3c156e84f8"
dest_md5="fe017881dd8a5ed8f91167a4762a386b"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="44b25262805775c8ffe94f8476f2c1b7"
dest_md5="2d8360b991bfae8c7d5b37f443655b9e"
source_md5="014088afc6b48bb065179bff22e01a73"
dest_md5="7a8187aeb05138a216223ea77f481f24"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="faf0730ff0bcdcd7c862028bf48c72f7"
dest_md5="c0ec897fa5dbdb070a2df06075a1c4b4"
source_md5="42a8b7e7fea6a2f1486a08aed50030c1"
dest_md5="5578ec75029e9eb572964391c7507cd8"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="6c80be7d7fd233485f2c4128d2c65b2a"
source_md5="498b6b570ee9080cdd302bccb5ef1e35"
dest_md5="0f227582a325563f3a3fdec38cefcba0"

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="933f939a8ae820db6f494f8d5ea25ed9"
source_md5="4f2e7a3f4bc6600dd448ca418677b7a2"
dest_md5="1c83110dae977b05a3a5913e09810bd1"

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="3e2b7d1cd0b176b57ed98b353dd9200c"
dest_md5="68bff749d78b01caaf1e75f51f7632b3"
source_md5="d62d2dfaa15a75eac2a0ffaf7ca12678"
dest_md5="4835449374fffa8346b1df2854a0b718"

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="5c04186d91c240dbce2e74f59aba536b"
dest_md5="b569399d11ec54fc5d0c934ba9c2cd78"
source_md5="e6967246ad2fec1eb6050a4fdc144d9a"
dest_md5="2d7108e6409d71509cbf9b3530ce35d1"

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
2 changes: 2 additions & 0 deletions godot/addons/godot-xr-tools/hands/model/hand_l.gltf.import
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
2 changes: 2 additions & 0 deletions godot/addons/godot-xr-tools/hands/model/hand_r.gltf.import
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=0
gltf/embedded_image_handling=1
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ func _init(_avatar: Avatar, _animation_player: AnimationPlayer, _animation_tree:
animation_player.add_animation_library("idle", idle_animation_library)

# Emote library
emotes_animation_library = AnimationLibrary.new()
animation_player.add_animation_library("emotes", emotes_animation_library)
if not animation_player.has_animation_library("emotes"):
emotes_animation_library = AnimationLibrary.new()
animation_player.add_animation_library("emotes", emotes_animation_library)
else:
emotes_animation_library = animation_player.get_animation_library("emotes")


func stop_emote():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
class_name CarrouselGenerator
extends Node

signal set_consumer_visible(visible: bool)
signal report_loading_status(status: LoadingStatus)
signal item_pressed(data)

enum LoadingStatus { LOADING, OK_WITH_RESULTS, OK_WITHOUT_RESULTS, ERROR }

@export var discover: Discover = null

var item_container: Container = null
var new_search: bool = true

var search_param: String:
set(new_value):
new_search = true
search_param = new_value


func on_request(_offset: int, _limit: int) -> void:
Expand Down
69 changes: 68 additions & 1 deletion godot/src/ui/components/discover/carrousel/discover_carrousel.gd
Original file line number Diff line number Diff line change
@@ -1,25 +1,92 @@
extends Control

@export var generator: CarrouselGenerator = null
@export var with_search: bool = false

@export var title: String = "No title":
set(new_value):
%Label_Title.text = new_value
title = new_value

var _last_search_text: String = ""

@onready var scroll_container = %ScrollContainer
@onready var item_container = %HBoxContainer_Items
@onready var label_error = $VBoxContainer/Label_Error
@onready var label_not_found = $VBoxContainer/Label_NotFound
@onready var h_box_container_loading = $VBoxContainer/HBoxContainer_Loading

@onready var timer_search_bounce = $MarginContainer/HBoxContainer/TimerSearchBounce
@onready var line_edit_search = $MarginContainer/HBoxContainer/LineEdit_Search
@onready var button_search_hide = $MarginContainer/HBoxContainer/Button_SearchHide
@onready var button_search = $MarginContainer/HBoxContainer/Button_Search


func _ready():
if is_instance_valid(generator):
generator.set_consumer_visible.connect(self.set_visible)
generator.report_loading_status.connect(self._on_report_loading_status)
generator.item_container = item_container

scroll_container.item_container = item_container
scroll_container.request.connect(generator.on_request)
scroll_container.start()

button_search.visible = with_search


func _on_report_loading_status(status: CarrouselGenerator.LoadingStatus) -> void:
if status == CarrouselGenerator.LoadingStatus.LOADING:
h_box_container_loading.show()

scroll_container.hide()
label_not_found.hide()
label_error.hide()
elif status == CarrouselGenerator.LoadingStatus.OK_WITH_RESULTS:
scroll_container.show()

h_box_container_loading.hide()
label_not_found.hide()
label_error.hide()
elif status == CarrouselGenerator.LoadingStatus.OK_WITHOUT_RESULTS:
label_not_found.show()

scroll_container.hide()
h_box_container_loading.hide()
label_error.hide()
else:
#elif not ok:
h_box_container_loading.hide()

scroll_container.hide()
label_not_found.hide()
label_error.show()


func _on_scroll_container_scroll_ended():
pass # Replace with function body.


func _on_timer_search_bounce_timeout():
if line_edit_search.text != _last_search_text:
_last_search_text = line_edit_search.text
generator.search_param = line_edit_search.text
scroll_container.restart()
return


func _on_line_edit_search_text_changed(_new_text):
timer_search_bounce.start()


func _on_button_search_pressed():
if not button_search_hide.visible:
button_search_hide.show()
line_edit_search.show()
line_edit_search.text = ""
line_edit_search.call_deferred("grab_focus")


func _on_button_search_hide_pressed():
button_search_hide.hide()
line_edit_search.hide()
line_edit_search.text = ""
Loading
Loading