mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Fixed crash in Palette.gd where json files for palettes may not have had "comments" and "editable"
Also updated com.orama_interactive.Pixelorama.appdata.xml
This commit is contained in:
parent
b5ea3303a1
commit
2ea71475ea
|
@ -2,15 +2,15 @@
|
|||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Next_Frame_hover.png-29e3bdc3bfb09dbf24f0d4ef57cdadd0.stex"
|
||||
path="res://.import/Next_Frame_Hover.png-ba92cf8a5dbcda245610c78c96d6bf93.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Dark Themes/Timeline/Next_Frame_hover.png"
|
||||
dest_files=[ "res://.import/Next_Frame_hover.png-29e3bdc3bfb09dbf24f0d4ef57cdadd0.stex" ]
|
||||
source_file="res://Assets/Graphics/Dark Themes/Timeline/Next_Frame_Hover.png"
|
||||
dest_files=[ "res://.import/Next_Frame_Hover.png-ba92cf8a5dbcda245610c78c96d6bf93.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (c) 2019 OverloadedOrama -->
|
||||
<!-- Copyright (c) 2019 Orama Interactive -->
|
||||
<component type="desktop">
|
||||
<id>com.orama_interactive.Pixelorama.desktop</id>
|
||||
<name>Pixelorama</name>
|
||||
|
@ -12,18 +12,18 @@
|
|||
</description>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>MIT</project_license>
|
||||
<developer_name>OverloadedOrama</developer_name>
|
||||
<developer_name>Orama Interactive</developer_name>
|
||||
<url type="homepage">https://www.orama-interactive.com/pixelorama</url>
|
||||
<url type="bugtracker">https://github.com/OverloadedOrama/Pixelorama/issues</url>
|
||||
<url type="bugtracker">https://github.com/Orama-Interactive/Pixelorama/issues</url>
|
||||
<screenshots>
|
||||
<screenshot type="default" width="1918" height="1054">
|
||||
<image type="source">https://functionoverload590613498.files.wordpress.com/2019/11/screenshot_268.png</image>
|
||||
<caption>Editing an animated sprite</caption>
|
||||
<screenshot type="default" width="1919" height="1079">
|
||||
<image type="source">https://static.wixstatic.com/media/673cdd_b31327135c20489d8d632cfe9e642257~mv2.png</image>
|
||||
<caption>Art by Erevos</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<content_rating type="oars-1.1"/>
|
||||
<releases>
|
||||
<release version="0.4" date="2019-11-13"/>
|
||||
<release version="0.5" date="2019-12-12"/>
|
||||
</releases>
|
||||
<update_contact>hugo.locurcio@hugo.pro</update_contact>
|
||||
</component>
|
||||
|
|
|
@ -31,10 +31,10 @@ func move_color(from : int, to : int) -> void:
|
|||
|
||||
func get_color(index : int) -> Color:
|
||||
var result := Color.black
|
||||
|
||||
|
||||
if index < colors.size():
|
||||
result = colors[index].color
|
||||
|
||||
|
||||
return result
|
||||
|
||||
func set_color(index : int, new_color : Color) -> void:
|
||||
|
@ -43,10 +43,10 @@ func set_color(index : int, new_color : Color) -> void:
|
|||
|
||||
func get_color_data(index : int) -> String:
|
||||
var result := ""
|
||||
|
||||
|
||||
if index < colors.size():
|
||||
result = colors[index].data
|
||||
|
||||
|
||||
return result
|
||||
|
||||
func set_color_data(index : int, new_color : String) -> void:
|
||||
|
@ -55,10 +55,10 @@ func set_color_data(index : int, new_color : String) -> void:
|
|||
|
||||
func get_color_name(index : int) -> String:
|
||||
var result = ""
|
||||
|
||||
|
||||
if index < colors.size():
|
||||
result = colors[index].name
|
||||
|
||||
|
||||
return result
|
||||
|
||||
func set_color_name(index : int, new_name : String) -> void:
|
||||
|
@ -90,14 +90,14 @@ func _serialize() -> String:
|
|||
}
|
||||
for color in colors:
|
||||
serialize_data.colors.push_back(color.toDict())
|
||||
|
||||
|
||||
result = JSON.print(serialize_data)
|
||||
|
||||
|
||||
return result;
|
||||
|
||||
func deserialize(input_string : String) -> Palette:
|
||||
var result = get_script().new()
|
||||
|
||||
|
||||
var result_json = JSON.parse(input_string)
|
||||
#
|
||||
if result_json.error != OK: # If parse has errors
|
||||
|
@ -110,11 +110,13 @@ func deserialize(input_string : String) -> Palette:
|
|||
if data.has("name"): #If data is 'valid' palette file
|
||||
result = get_script().new()
|
||||
result.name = data.name
|
||||
result.comments = data.comments
|
||||
result.editable = data.editable
|
||||
if data.has("comments"):
|
||||
result.comments = data.comments
|
||||
if data.has("editable"):
|
||||
result.editable = data.editable
|
||||
for color_data in data.colors:
|
||||
result.add_color(color_data.data, color_data.name)
|
||||
|
||||
|
||||
return result
|
||||
|
||||
func load_from_file(path : String) -> Palette:
|
||||
|
|
Loading…
Reference in a new issue