mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-25 05:17:25 -04:00
gate icon and undiscoverable mode
This commit is contained in:
parent
fb6cf98f2b
commit
414ad4eeda
18 changed files with 108 additions and 52 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue