diff options
author | BrickPi <49528459+BrickPi@users.noreply.github.com> | 2024-01-21 21:10:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-21 21:10:47 +0100 |
commit | 0840fd621cf35201f1e5ef90ad09033a2242b181 (patch) | |
tree | 12023bcc0a0b3d598aefec1b70bcd345de946ffe /game/src/Game/LoadingScreen.gd | |
parent | fc0658161f84c7949198c2d907614acaa4332728 (diff) | |
parent | 369cb94556d82a2c273443ed7628c4cc37458ce0 (diff) |
Merge pull request #197 from OpenVicProject/reorganising
Diffstat (limited to 'game/src/Game/LoadingScreen.gd')
-rw-r--r-- | game/src/Game/LoadingScreen.gd | 9 |
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: |