aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/LoadingScreen.gd
diff options
context:
space:
mode:
author BrickPi <ajmach6@gmail.com>2024-01-19 22:52:24 +0100
committer BrickPi <ajmach6@gmail.com>2024-01-21 16:25:06 +0100
commit2940411cb33a64cd41c2d39ddf98aab54edc9f69 (patch)
tree8cefa44e20d3fd26f7ba083454ffdcbb43c1d05f /game/src/Game/LoadingScreen.gd
parentfb2561bd998f211d2099f811a6b6b25a57118160 (diff)
Reorganise Asset File Structure
Diffstat (limited to 'game/src/Game/LoadingScreen.gd')
-rw-r--r--game/src/Game/LoadingScreen.gd9
1 files changed, 6 insertions, 3 deletions
diff --git a/game/src/Game/LoadingScreen.gd b/game/src/Game/LoadingScreen.gd
index c1bfdc6..2b96bed 100644
--- a/game/src/Game/LoadingScreen.gd
+++ b/game/src/Game/LoadingScreen.gd
@@ -1,6 +1,6 @@
extends Control
-@export var quote_file_path : String = "res://common/quotes.txt"
+@export var quote_file_path : String = "res://assets/localisation/quotes.txt"
@export_subgroup("Nodes")
@export var progress_bar: ProgressBar
@@ -15,7 +15,10 @@ func start_loading_screen(thread_safe_function : Callable) -> void:
await ready
# set first quote
progress_bar.value = 0
- quote_label.text = quotes[randi() % quotes.size()]
+ if quotes.size() > 0:
+ quote_label.text = quotes[randi() % quotes.size()]
+ else:
+ quote_label.text = "NO QUOTES DEFINED!"
if thread != null and thread.is_started():
thread.wait_to_finish()
@@ -26,7 +29,7 @@ func try_update_loading_screen(percent_complete: float, quote_should_change := f
# forces the function to behave as if deferred
await get_tree().process_frame
progress_bar.value = percent_complete
- if quote_should_change:
+ if quote_should_change and quotes.size() > 0:
quote_label.text = quotes[randi() % quotes.size()]
func _ready() -> void: