mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:44:42 -04:00
Makes the background UI darker when a dialog is being opened
This commit is contained in:
parent
0f5c7c5e59
commit
51b6aadbdd
6 changed files with 65 additions and 18 deletions
|
@ -26,6 +26,7 @@ func open(palette : String) -> void:
|
|||
_display_palette()
|
||||
Global.can_draw = false
|
||||
self.popup_centered()
|
||||
Global.control.modulate = Color(0.5, 0.5, 0.5)
|
||||
|
||||
left_color_button.modulate = Global.left_color_picker.color
|
||||
right_color_button.modulate = Global.right_color_picker.color
|
||||
|
@ -188,3 +189,4 @@ func _on_RightColor_pressed() -> void:
|
|||
|
||||
func _on_EditPalettePopup_popup_hide() -> void:
|
||||
Global.can_draw = true
|
||||
Global.control.modulate = Color.white
|
||||
|
|
|
@ -37,11 +37,13 @@ func on_new_empty_palette() -> void:
|
|||
from_palette = null
|
||||
Global.new_palette_dialog.popup_centered()
|
||||
Global.can_draw = false
|
||||
Global.control.modulate = Color(0.5, 0.5, 0.5)
|
||||
|
||||
|
||||
func on_import_palette() -> void:
|
||||
Global.palette_import_file_dialog.popup_centered()
|
||||
Global.can_draw = false
|
||||
Global.control.modulate = Color(0.5, 0.5, 0.5)
|
||||
|
||||
|
||||
func on_palette_import_file_selected(path : String) -> void:
|
||||
|
@ -65,9 +67,13 @@ func on_palette_import_file_selected(path : String) -> void:
|
|||
else:
|
||||
Global.error_dialog.set_text(tr("Error: Palette named '%s' already exists!") % palette.name)
|
||||
Global.error_dialog.popup_centered()
|
||||
Global.can_draw = false
|
||||
Global.control.modulate = Color(0.5, 0.5, 0.5)
|
||||
else:
|
||||
Global.error_dialog.set_text("Invalid Palette file!")
|
||||
Global.error_dialog.popup_centered()
|
||||
Global.can_draw = false
|
||||
Global.control.modulate = Color(0.5, 0.5, 0.5)
|
||||
|
||||
|
||||
func _on_AddPalette_pressed() -> void:
|
||||
|
@ -80,6 +86,8 @@ func on_new_palette_confirmed() -> void:
|
|||
if not result.empty():
|
||||
Global.error_dialog.set_text(result)
|
||||
Global.error_dialog.popup_centered()
|
||||
Global.can_draw = false
|
||||
Global.control.modulate = Color(0.5, 0.5, 0.5)
|
||||
|
||||
|
||||
func add_palette_menu_id_pressed(id : int) -> void:
|
||||
|
@ -132,6 +140,7 @@ func on_edit_palette() -> void:
|
|||
Global.new_palette_name_line_edit.text = "Custom_" + current_palette
|
||||
Global.new_palette_dialog.popup_centered()
|
||||
Global.can_draw = false
|
||||
Global.control.modulate = Color(0.5, 0.5, 0.5)
|
||||
else:
|
||||
from_palette = null
|
||||
Global.edit_palette_popup.open(current_palette)
|
||||
|
@ -270,3 +279,4 @@ func save_palette(palette_name : String, filename : String) -> void:
|
|||
|
||||
func _on_NewPaletteDialog_popup_hide() -> void:
|
||||
Global.can_draw = true
|
||||
Global.control.modulate = Color.white
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue