Skip to content

Commit

Permalink
Disable "From Current Palette" preset option when creating a new pale…
Browse files Browse the repository at this point in the history
…tte, if there is no current palette

Fixes #659
  • Loading branch information
OverloadedOrama committed Mar 7, 2022
1 parent 07473be commit 294738e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Autoload/Palettes.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
if !current_palette:
return
var new_palette: Palette = current_palette.duplicate()
new_palette.name = name
new_palette.comment = comment
Expand Down
3 changes: 3 additions & 0 deletions src/Palette/CreatePaletteDialog.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ func open(opened_current_palette: Palette) -> void:
# Disable ok button until user enters name
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
Global.dialog_open(true)
popup_centered()
Expand Down

0 comments on commit 294738e

Please sign in to comment.