Improve Map Editor Initialization Time #14

Merged
kayomn merged 1 commits from init-performance-improvements into main 2023-02-01 19:29:57 +01:00
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() 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. ## 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. ## [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) LocalPlayer.override_controls(hidden)
show() show()
prompted.emit() prompted.emit()
if label != null: while _worker_thread.is_alive():
label.text = display_message await get_tree().process_frame
_worker_thread.start(func () -> void: _worker_thread.start(func () -> void:
var count := steps.size() var count := steps.size()