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