1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Fixed an issue where Pixelorama crashed when a user coming from a new version to an old one and had selected a tool that doesn't exist in an older version

This commit is contained in:
Manolis Papadeas 2020-12-13 21:42:45 +02:00
parent fe0fb7d21f
commit 35eeaf4e90

View file

@ -68,8 +68,12 @@ func _ready() -> void:
_tool_buttons = Global.find_node_by_name(Global.control, "ToolButtons") _tool_buttons = Global.find_node_by_name(Global.control, "ToolButtons")
var value = Global.config_cache.get_value(_slots[BUTTON_LEFT].kname, "tool", "Pencil") var value = Global.config_cache.get_value(_slots[BUTTON_LEFT].kname, "tool", "Pencil")
if not value in _tools:
value = "Pencil"
set_tool(value, BUTTON_LEFT) set_tool(value, BUTTON_LEFT)
value = Global.config_cache.get_value(_slots[BUTTON_RIGHT].kname, "tool", "Eraser") value = Global.config_cache.get_value(_slots[BUTTON_RIGHT].kname, "tool", "Eraser")
if not value in _tools:
value = "Eraser"
set_tool(value, BUTTON_RIGHT) set_tool(value, BUTTON_RIGHT)
value = Global.config_cache.get_value(_slots[BUTTON_LEFT].kname, "color", Color.black) value = Global.config_cache.get_value(_slots[BUTTON_LEFT].kname, "color", Color.black)
assign_color(value, BUTTON_LEFT, false) assign_color(value, BUTTON_LEFT, false)