Improve map editor initialization time

This commit is contained in:
kayomn 2023-02-01 18:26:41 +00:00
parent e6b115a9e2
commit 7ce7256386
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()