fix missing icons in featured gates

This commit is contained in:
Nordup 2025-08-10 11:18:14 +07:00
parent cdacbb2fc6
commit fcb2e5523e
2 changed files with 7 additions and 3 deletions

View file

@ -1,5 +1,8 @@
extends Node
const KEY_ICON = "icon"
const KEY_IMAGE = "image"
@export var api: ApiSettings
@export var bookmarks: Bookmarks
@ -38,7 +41,8 @@ func featured_gates_request() -> void:
func star_gate(gate_d: Dictionary) -> void:
var icon_path = await FileDownloader.download(gate_d["icon"])
var icon_url = gate_d[KEY_ICON] if not gate_d[KEY_ICON].is_empty() else gate_d[KEY_IMAGE]
var icon_path = await FileDownloader.download(icon_url)
var gate = Gate.create(gate_d["url"], gate_d["title"], gate_d["description"], icon_path, "", "", "")
bookmarks.star(gate, true)

View file

@ -8,11 +8,11 @@ class_name Gate
@export var description: String
@export_file("*.png", "*.jpg") var icon: String:
@export var icon: String:
get: return icon if not icon.is_empty() else image
set(value): icon = value
@export_file("*.png", "*.jpg") var image: String
@export var image: String
var resource_pack: String