From c868162ed8b25032c21c057ae28d251e8643ae37 Mon Sep 17 00:00:00 2001 From: Nordup Date: Tue, 19 Aug 2025 02:09:05 +0700 Subject: [PATCH] no results note --- .../components/search/no_results_note.tscn | 51 +++++++++++++++++++ app/scenes/menu_body/search_results.tscn | 6 ++- app/scripts/ui/search/open_meta_link.gd | 9 ++++ app/scripts/ui/search/search_results.gd | 8 ++- 4 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 app/scenes/components/search/no_results_note.tscn create mode 100644 app/scripts/ui/search/open_meta_link.gd diff --git a/app/scenes/components/search/no_results_note.tscn b/app/scenes/components/search/no_results_note.tscn new file mode 100644 index 0000000..7f9e7c8 --- /dev/null +++ b/app/scenes/components/search/no_results_note.tscn @@ -0,0 +1,51 @@ +[gd_scene load_steps=8 format=3 uid="uid://bj6j3nyldlqjm"] + +[ext_resource type="StyleBox" uid="uid://bllkg32sc4iam" path="res://assets/styles/panel.stylebox" id="2_cxiqp"] +[ext_resource type="FontFile" uid="uid://do40418waa8w3" path="res://assets/fonts/Inter-Regular.otf" id="6_drapp"] +[ext_resource type="FontFile" uid="uid://bjeupg0ikc2kv" path="res://assets/fonts/Monospace.ttf" id="7_1pjua"] +[ext_resource type="Script" path="res://scripts/ui/search/open_meta_link.gd" id="7_evwvd"] +[ext_resource type="FontFile" uid="uid://b3xb1fpllhnf4" path="res://assets/fonts/Inter-Italic.otf" id="8_nluj5"] +[ext_resource type="FontFile" uid="uid://tfj3o1e1wytn" path="res://assets/fonts/Inter-BoldItalic.otf" id="9_r0w13"] +[ext_resource type="FontFile" uid="uid://c14w1y1r54wgi" path="res://assets/fonts/Inter-Bold.otf" id="10_fe01c"] + +[node name="NoResultsNote" type="Control"] +custom_minimum_size = Vector2(850, 100) +layout_mode = 3 +anchors_preset = 0 +offset_right = 850.0 +offset_bottom = 100.0 + +[node name="Panel" type="Panel" parent="."] +self_modulate = Color(1, 1, 1, 0) +custom_minimum_size = Vector2(850, 100) +layout_mode = 1 +offset_top = 25.0 +offset_right = 850.0 +offset_bottom = 125.0 +theme_override_styles/panel = ExtResource("2_cxiqp") + +[node name="RichTextLabel" type="RichTextLabel" parent="Panel"] +clip_contents = false +layout_mode = 1 +offset_right = 774.0 +offset_bottom = 368.0 +size_flags_vertical = 3 +theme_override_colors/default_color = Color(0.490196, 0.384314, 0.172549, 1) +theme_override_fonts/normal_font = ExtResource("6_drapp") +theme_override_fonts/mono_font = ExtResource("7_1pjua") +theme_override_fonts/italics_font = ExtResource("8_nluj5") +theme_override_fonts/bold_italics_font = ExtResource("9_r0w13") +theme_override_fonts/bold_font = ExtResource("10_fe01c") +theme_override_font_sizes/bold_italics_font_size = 17 +theme_override_font_sizes/italics_font_size = 17 +theme_override_font_sizes/mono_font_size = 17 +theme_override_font_sizes/normal_font_size = 17 +theme_override_font_sizes/bold_font_size = 17 +bbcode_enabled = true +text = "Right now, things feel a little quiet here. There aren’t many worlds to explore yet — and you won’t find Google, YouTube, or your favorite sites in 3D form. That’s because this is still the early stage of building something completely new.
 +But remember: the internet itself started small too. What you’re seeing now is the seed of what will grow into an entire universe of interconnected worlds — as big and vibrant as today’s internet. + +The best part? You don’t just have to wait for it to grow. You can build your own worlds and be part of creating it. +
🤍 Start creating here: [url=https://thegates-docs.super.site]thegates-docs[/url]" +scroll_active = false +script = ExtResource("7_evwvd") diff --git a/app/scenes/menu_body/search_results.tscn b/app/scenes/menu_body/search_results.tscn index 13436ed..119619c 100644 --- a/app/scenes/menu_body/search_results.tscn +++ b/app/scenes/menu_body/search_results.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=15 format=3 uid="uid://dh3owgirapji5"] +[gd_scene load_steps=16 format=3 uid="uid://dh3owgirapji5"] [ext_resource type="Script" path="res://scripts/ui/search/search_results.gd" id="1_bycb5"] [ext_resource type="FontFile" uid="uid://do40418waa8w3" path="res://assets/fonts/Inter-Regular.otf" id="1_mgpxk"] @@ -8,6 +8,7 @@ [ext_resource type="Script" path="res://scripts/ui/search/search_results_header.gd" id="3_cuw8t"] [ext_resource type="PackedScene" uid="uid://i3lgu2dyypcq" path="res://scenes/components/search/result.tscn" id="4_yxn4t"] [ext_resource type="PackedScene" uid="uid://dntnp0igpccdt" path="res://scenes/components/search/suggestion.tscn" id="8_1alsm"] +[ext_resource type="PackedScene" uid="uid://bj6j3nyldlqjm" path="res://scenes/components/search/no_results_note.tscn" id="8_kxod6"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_u8k0c"] bg_color = Color(0.113725, 0.117647, 0.14902, 1) @@ -77,7 +78,7 @@ size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_constants/margin_left = 0 theme_override_constants/margin_top = 0 -theme_override_constants/margin_right = 0 +theme_override_constants/margin_right = 899 theme_override_constants/margin_bottom = 0 script = ExtResource("1_scp2i") limit = Vector2(1015, -1) @@ -126,6 +127,7 @@ result_scene = ExtResource("4_yxn4t") header = NodePath("../Header") suggestions_root = NodePath("SearchSuggestions") suggestion_scene = ExtResource("8_1alsm") +no_results_note = ExtResource("8_kxod6") [node name="SearchSuggestions" type="HFlowContainer" parent="MarginContainer/ScrollContainer/MaxSizeContainer/HBoxContainer/VBoxContainer/SearchResults"] layout_mode = 2 diff --git a/app/scripts/ui/search/open_meta_link.gd b/app/scripts/ui/search/open_meta_link.gd new file mode 100644 index 0000000..0c61db7 --- /dev/null +++ b/app/scripts/ui/search/open_meta_link.gd @@ -0,0 +1,9 @@ +extends RichTextLabel + + +func _ready() -> void: + meta_clicked.connect(on_meta_clicked) + + +func on_meta_clicked(meta) -> void: + OS.shell_open(str(meta)) diff --git a/app/scripts/ui/search/search_results.gd b/app/scripts/ui/search/search_results.gd index f38be6b..3ee84a8 100644 --- a/app/scripts/ui/search/search_results.gd +++ b/app/scripts/ui/search/search_results.gd @@ -7,6 +7,7 @@ extends VBoxContainer @export var header: SearchResultsHeader @export var suggestions_root: Control @export var suggestion_scene: PackedScene +@export var no_results_note: PackedScene var result_str: String = "{}" var suggestions_str: String = "{}" @@ -55,14 +56,17 @@ func suggestions() -> void: if suggs == null or suggs.is_empty(): Debug.logclr("No suggestions found", Color.YELLOW) return - + + header.set_suggestion_header() + for sugg in suggs: Debug.logr(sugg) var suggestion: Suggestion = suggestion_scene.instantiate() suggestion.fill(sugg) suggestions_root.add_child(suggestion) - header.set_suggestion_header() + var note = no_results_note.instantiate() + add_child(note) func suggestions_request() -> void: