mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:44:42 -04:00
Add PAL palette format import (#315)
* Add PAL palette format import * Move .pal selection into Dialog; Attempt HTML implementation * Fix issue with HTML5 pal palette import.
This commit is contained in:
parent
f121c39ddc
commit
348d758ef4
4 changed files with 38 additions and 2 deletions
|
@ -58,6 +58,13 @@ func on_palette_import_file_selected(path : String) -> void:
|
|||
var text = file.get_as_text()
|
||||
file.close()
|
||||
palette = Import.import_gpl(path, text)
|
||||
elif path.to_lower().ends_with("pal"):
|
||||
var file = File.new()
|
||||
if file.file_exists(path):
|
||||
file.open(path, File.READ)
|
||||
var text = file.get_as_text()
|
||||
file.close()
|
||||
palette = Import.import_pal_palette(path, text)
|
||||
elif path.to_lower().ends_with("png") or path.to_lower().ends_with("bmp") or path.to_lower().ends_with("hdr") or path.to_lower().ends_with("jpg") or path.to_lower().ends_with("svg") or path.to_lower().ends_with("tga") or path.to_lower().ends_with("webp"):
|
||||
var image := Image.new()
|
||||
var err := image.load(path)
|
||||
|
|
|
@ -10,6 +10,6 @@ window_title = "Open a File"
|
|||
resizable = true
|
||||
mode = 0
|
||||
access = 2
|
||||
filters = PoolStringArray( "*.json ; JavaScript Object Notation", "*.gpl ; Gimp Palette Library", "*.png; Portable Network Graphics" )
|
||||
filters = PoolStringArray( "*.json ; JavaScript Object Notation", "*.gpl ; Gimp Palette Library", "*.png; Portable Network Graphics", "*.pal; JASC Palette" )
|
||||
current_dir = "/Users"
|
||||
current_path = "/Users/"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue