mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-24 11:17:26 -04:00
use only gate icon, fix emty bookmark icon
This commit is contained in:
parent
550f89bcf6
commit
97045e25de
9 changed files with 41 additions and 28 deletions
|
@ -23,11 +23,22 @@ func ready() -> void:
|
|||
on_ready.emit()
|
||||
|
||||
|
||||
func make_first(url: String) -> void:
|
||||
if not gates.has(url): return
|
||||
|
||||
var gate = gates[url]
|
||||
gates.erase(url)
|
||||
gates[url] = gate
|
||||
|
||||
|
||||
func update(gate: Gate) -> void:
|
||||
if not gates.has(gate.url): return
|
||||
|
||||
var replace = gates[gate.url]
|
||||
|
||||
if gate.icon_url == replace.icon_url: gate.icon = replace.icon
|
||||
if gate.image_url == replace.image_url: gate.image = replace.image
|
||||
|
||||
gates.erase(gate.url)
|
||||
gates[gate.url] = gate
|
||||
|
||||
|
|
|
@ -5,28 +5,21 @@ class_name Gate
|
|||
set(value): url = Url.fix_gate_url(value)
|
||||
|
||||
@export var title: String
|
||||
|
||||
@export var description: String
|
||||
|
||||
@export var icon: String:
|
||||
get: return icon if not icon.is_empty() else image
|
||||
set(value): icon = value
|
||||
|
||||
@export var icon_url: String
|
||||
@export var image_url: String
|
||||
@export var icon: String
|
||||
@export var image: String
|
||||
|
||||
var resource_pack: String
|
||||
|
||||
var shared_libs_dir: String # local path where libs downloaded
|
||||
|
||||
|
||||
static func create(_url: String, _title: String, _description: String, _icon: String,
|
||||
_image: String, _resource_pack: String, _shared_libs_dir: String) -> Gate:
|
||||
static func create(_url: String, _title: String, _description: String, _icon_url: String, _image_url: String) -> Gate:
|
||||
var gate = Gate.new()
|
||||
gate.url = _url
|
||||
gate.title = _title
|
||||
gate.description = _description
|
||||
gate.icon = _icon
|
||||
gate.image = _image
|
||||
gate.resource_pack = _resource_pack
|
||||
gate.shared_libs_dir = _shared_libs_dir
|
||||
gate.icon_url = _icon_url
|
||||
gate.image_url = _image_url
|
||||
return gate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue