Merge pull request 'Improve Map Editor Initialization Time' (#14) from init-performance-improvements into main

Reviewed-on: #14
This commit is contained in:
kayomn 2023-02-01 19:29:57 +01:00
commit 98e8d22b30
8 changed files with 19 additions and 22 deletions

Binary file not shown.

BIN
interior/tiles/dungeon_01_tiling_tile.res (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
map_editor.scn (Stored with Git LFS)

Binary file not shown.

BIN
map_editor/edit_action_button_group.res (Stored with Git LFS)

Binary file not shown.

View File

@ -12,12 +12,6 @@ signal prompted()
var _worker_thread := Thread.new()
##
## Used to display a message from the prompt or [code]null[/code] to not display anything.
##
@export
var label: Label = null
##
## Used to display the progress of the prompt or [code]null[/code] to not display anything.
##
@ -29,13 +23,16 @@ var progress: Range = null
##
## [signal prompt_completed] is emitted when the work being performed by the prompt has ended.
##
func prompt(display_message: String, steps: Array) -> void:
## Either this function or [signal prompt_completed] can be awaited upon to handle asynchronous
## scheduling of tasks to execute after completion.
##
func prompt(steps: Array) -> void:
LocalPlayer.override_controls(hidden)
show()
prompted.emit()
if label != null:
label.text = display_message
while _worker_thread.is_alive():
await get_tree().process_frame
_worker_thread.start(func () -> void:
var count := steps.size()