Added a Tween to make the background UI darker when a dialog is opened

This commit is contained in:
OverloadedOrama 2020-05-08 18:37:45 +03:00
parent 51b6aadbdd
commit 7484ce1b9e
8 changed files with 58 additions and 80 deletions

View file

@ -15,8 +15,7 @@ func _ready() -> void:
func _on_FrameTagDialog_about_to_show() -> void:
Global.can_draw = false
Global.control.modulate = Color(0.5, 0.5, 0.5)
Global.dialog_open(true)
for vbox in tag_vboxes:
vbox.queue_free()
tag_vboxes.clear()
@ -58,8 +57,7 @@ func _on_FrameTagDialog_about_to_show() -> void:
func _on_FrameTagDialog_popup_hide() -> void:
Global.can_draw = true
Global.control.modulate = Color.white
Global.dialog_open(false)
func _on_AddTag_pressed() -> void:

View file

@ -52,8 +52,7 @@ func _on_ImportSprites_files_selected(paths : PoolStringArray) -> void:
var file_name : String = path.get_file()
Global.error_dialog.set_text(tr("Can't load file '%s'.\nError code: %s") % [file_name, str(err)])
Global.error_dialog.popup_centered()
Global.can_draw = false
Global.control.modulate = Color(0.5, 0.5, 0.5)
Global.dialog_open(true)
continue
var canvas : Canvas = load("res://src/Canvas.tscn").instance()
@ -100,8 +99,7 @@ func _on_ImportSprites_files_selected(paths : PoolStringArray) -> void:
var file_name : String = first_path.get_file()
Global.error_dialog.set_text(tr("Can't load file '%s'.\nError code: %s") % [file_name, str(err)])
Global.error_dialog.popup_centered()
Global.can_draw = false
Global.control.modulate = Color(0.5, 0.5, 0.5)
Global.dialog_open(true)
return
spritesheet_horizontal = min(spritesheet_horizontal, image.get_size().x)