From fcb2e5523e2c238734415c26648df24e0ebaf040 Mon Sep 17 00:00:00 2001 From: Nordup Date: Sun, 10 Aug 2025 11:18:14 +0700 Subject: [PATCH] fix missing icons in featured gates --- app/scripts/api/featured_gates.gd | 6 +++++- app/scripts/resources/gate.gd | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/scripts/api/featured_gates.gd b/app/scripts/api/featured_gates.gd index f664167..70baace 100644 --- a/app/scripts/api/featured_gates.gd +++ b/app/scripts/api/featured_gates.gd @@ -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) diff --git a/app/scripts/resources/gate.gd b/app/scripts/resources/gate.gd index fde5d34..8731082 100644 --- a/app/scripts/resources/gate.gd +++ b/app/scripts/resources/gate.gd @@ -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