diff options
author | Gone2Daly <71726742+Gone2Daly@users.noreply.github.com> | 2023-07-22 21:05:42 +0200 |
---|---|---|
committer | Gone2Daly <71726742+Gone2Daly@users.noreply.github.com> | 2023-07-22 21:05:42 +0200 |
commit | 71b3cd829f80de4c2cd3972d8bfd5ee470a5d180 (patch) | |
tree | b4280fde6eef2ae6987648bc7bf8e00e9011bb7f /game/addons/zylann.hterrain/tools/progress_window.gd | |
parent | ce9022d0df74d6c33db3686622be2050d873ab0b (diff) |
init_testtest3d
Diffstat (limited to 'game/addons/zylann.hterrain/tools/progress_window.gd')
-rw-r--r-- | game/addons/zylann.hterrain/tools/progress_window.gd | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/game/addons/zylann.hterrain/tools/progress_window.gd b/game/addons/zylann.hterrain/tools/progress_window.gd new file mode 100644 index 0000000..791717f --- /dev/null +++ b/game/addons/zylann.hterrain/tools/progress_window.gd @@ -0,0 +1,32 @@ +@tool +extends AcceptDialog + + +#onready var _label = get_node("VBoxContainer/Label") +@onready var _progress_bar : ProgressBar = $VBoxContainer/ProgressBar + + +func _init(): + get_ok_button().hide() + + +func _show_progress(message, progress): + self.title = message + _progress_bar.ratio = progress + + +func handle_progress(info: Dictionary): + if info.has("finished") and info.finished: + hide() + + else: + if not visible: + popup_centered() + + var message = "" + if info.has("message"): + message = info.message + + _show_progress(info.message, info.progress) + # TODO Have builtin modal progress bar + # https://github.com/godotengine/godot/issues/17763 |