1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-03-13 06:45:17 +00:00

Disable "From Current Palette" preset option when creating a new palette, if there is no current palette

Fixes #659
This commit is contained in:
Manolis Papadeas 2022-03-07 19:33:23 +02:00
parent 07473bea95
commit 294738e48a
2 changed files with 5 additions and 0 deletions

View file

@ -119,6 +119,8 @@ func _create_new_empty_palette(name: String, comment: String, width: int, height
func _create_new_palette_from_current_palette(name: String, comment: String) -> void: func _create_new_palette_from_current_palette(name: String, comment: String) -> void:
if !current_palette:
return
var new_palette: Palette = current_palette.duplicate() var new_palette: Palette = current_palette.duplicate()
new_palette.name = name new_palette.name = name
new_palette.comment = comment new_palette.comment = comment

View file

@ -35,6 +35,9 @@ func open(opened_current_palette: Palette) -> void:
# Disable ok button until user enters name # Disable ok button until user enters name
toggle_ok_button_disability(true) toggle_ok_button_disability(true)
# Disable create "From Current Palette" if there's no palette
preset_input.set_item_disabled(1, !current_palette)
# Stop all inputs in the rest of the app # Stop all inputs in the rest of the app
Global.dialog_open(true) Global.dialog_open(true)
popup_centered() popup_centered()