gate icon and undiscoverable mode

This commit is contained in:
Nordup 2025-06-29 01:26:39 +07:00
parent fb6cf98f2b
commit 414ad4eeda
18 changed files with 108 additions and 52 deletions

View file

@ -1,23 +1,30 @@
extends Control
class_name SearchResult
const KEY_URL = "url"
const KEY_TITLE = "title"
const KEY_DESCRIPTION = "description"
const KEY_ICON = "icon"
const KEY_IMAGE = "image"
@export var gate_events: GateEvents
@export var url: Label
@export var title: Label
@export var description: RichTextLabel
@export var image: TextureRect
@export var icon: TextureRect
func fill(gate: Dictionary) -> void:
if gate == null: return
url.text = gate["url"]
title.text = "Unnamed" if gate["title"].is_empty() else gate["title"]
description.text = gate["description"]
url.text = gate[KEY_URL]
title.text = "Unnamed" if gate[KEY_TITLE].is_empty() else gate[KEY_TITLE]
description.text = gate[KEY_DESCRIPTION]
var image_path = await FileDownloader.download(gate["image"])
image.texture = FileTools.load_external_tex(image_path)
var icon_url = gate[KEY_ICON] if not gate[KEY_ICON].is_empty() else gate[KEY_IMAGE]
var icon_path = await FileDownloader.download(icon_url)
icon.texture = FileTools.load_external_tex(icon_path)
func _on_button_pressed() -> void: