From fb587a6d30e06de414734409b4e4752adc97ec5f Mon Sep 17 00:00:00 2001 From: Nordup Date: Fri, 6 Dec 2024 10:01:32 +0400 Subject: [PATCH] remove is_cached arg --- app/scripts/loading/gate_loader.gd | 3 +-- app/scripts/resources/gate_events.gd | 6 +++--- app/scripts/ui/menu/star.gd | 2 +- app/scripts/ui/world/foreground.gd | 2 +- app/scripts/ui/world/gate_info.gd | 2 +- app/scripts/ui/world/loading_status.gd | 4 ++-- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/scripts/loading/gate_loader.gd b/app/scripts/loading/gate_loader.gd index 8e49bff..1145cbe 100644 --- a/app/scripts/loading/gate_loader.gd +++ b/app/scripts/loading/gate_loader.gd @@ -22,8 +22,7 @@ func load_gate(config_url: String) -> void: var image_path = await FileDownloader.download(c_gate.image_url) var gate = Gate.create(config_url, c_gate.title, c_gate.description, image_path, "", "") - var is_cached = FileDownloader.is_cached(c_gate.resource_pack_url) - gate_events.gate_info_loaded_emit(gate, is_cached) + gate_events.gate_info_loaded_emit(gate) gate.resource_pack = await FileDownloader.download(c_gate.resource_pack_url) if gate.resource_pack.is_empty(): return error(GateEvents.GateError.MISSING_PACK) diff --git a/app/scripts/resources/gate_events.gd b/app/scripts/resources/gate_events.gd index 877e2b2..1463a97 100644 --- a/app/scripts/resources/gate_events.gd +++ b/app/scripts/resources/gate_events.gd @@ -4,7 +4,7 @@ class_name GateEvents signal search(query: String) signal open_gate(url: String) signal gate_config_loaded(url: String, config: ConfigGate) -signal gate_info_loaded(gate: Gate, is_cached: bool) +signal gate_info_loaded(gate: Gate) signal gate_loaded(gate: Gate) signal gate_entered signal first_frame @@ -45,9 +45,9 @@ func gate_config_loaded_emit(url: String, config: ConfigGate) -> void: gate_config_loaded.emit(url, config) -func gate_info_loaded_emit(gate: Gate, is_cached: bool) -> void: +func gate_info_loaded_emit(gate: Gate) -> void: current_gate = gate - gate_info_loaded.emit(gate, is_cached) + gate_info_loaded.emit(gate) func gate_loaded_emit(gate: Gate) -> void: diff --git a/app/scripts/ui/menu/star.gd b/app/scripts/ui/menu/star.gd index 4bdc8ba..1b8de5c 100644 --- a/app/scripts/ui/menu/star.gd +++ b/app/scripts/ui/menu/star.gd @@ -36,7 +36,7 @@ func hide_buttons() -> void: gate = null -func update_info(_gate: Gate, _is_cached: bool) -> void: +func update_info(_gate: Gate) -> void: gate = _gate if bookmarks.gates.has(gate.url): bookmarks.update(gate) diff --git a/app/scripts/ui/world/foreground.gd b/app/scripts/ui/world/foreground.gd index f9c854e..57f46f3 100644 --- a/app/scripts/ui/world/foreground.gd +++ b/app/scripts/ui/world/foreground.gd @@ -15,7 +15,7 @@ func _ready() -> void: click_anywhere.hide() -func show_thumbnail(gate: Gate, _is_cached: bool) -> void: +func show_thumbnail(gate: Gate) -> void: splash_screen.texture = FileTools.load_external_tex(gate.image) vignette_blur.show() vignette_blur.thumbnail_params() diff --git a/app/scripts/ui/world/gate_info.gd b/app/scripts/ui/world/gate_info.gd index 2e18f9c..a5b4f8d 100644 --- a/app/scripts/ui/world/gate_info.gd +++ b/app/scripts/ui/world/gate_info.gd @@ -18,7 +18,7 @@ func _ready() -> void: clear_info() -func display_info(_gate: Gate, _is_cached: bool) -> void: +func display_info(_gate: Gate) -> void: gate = _gate title.text = "Unnamed" if gate.title.is_empty() else gate.title description.text = "No description" if gate.description.is_empty() else gate.description diff --git a/app/scripts/ui/world/loading_status.gd b/app/scripts/ui/world/loading_status.gd index 1491749..c36c23e 100644 --- a/app/scripts/ui/world/loading_status.gd +++ b/app/scripts/ui/world/loading_status.gd @@ -25,13 +25,13 @@ var first_zero_ticks: int func _ready() -> void: - gate_events.gate_info_loaded.connect(func(_gate, _is_cached): on_gate_info_loaded()) + gate_events.gate_info_loaded.connect(on_gate_info_loaded) gate_events.gate_entered.connect(on_gate_entered) gate_events.gate_error.connect(on_gate_error) set_progress("Connecting...", ProgressStatus.CONNECTING) -func on_gate_info_loaded() -> void: +func on_gate_info_loaded(_gate: Gate) -> void: gate_events.download_progress.connect(show_progress)