mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-08-11 17:34:44 -04:00
Drag and drop palette files to open them
This commit is contained in:
parent
f7cc9a8104
commit
25d9aca0c4
4 changed files with 11 additions and 7 deletions
|
@ -20,9 +20,12 @@ func _ready() -> void:
|
|||
func handle_loading_files(files : PoolStringArray) -> void:
|
||||
for file in files:
|
||||
file = file.replace("\\", "/")
|
||||
if file.get_extension().to_lower() == "pxo":
|
||||
var file_ext : String = file.get_extension().to_lower()
|
||||
if file_ext == "pxo": # Pixelorama project file
|
||||
open_pxo_file(file)
|
||||
else:
|
||||
elif file_ext == "json" or file_ext == "gpl": # Palettes
|
||||
Global.palette_container.on_palette_import_file_selected(file)
|
||||
else: # Image files
|
||||
var image := Image.new()
|
||||
var err := image.load(file)
|
||||
if err != OK: # An error occured
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue