diff --git a/addons/gdfxr/editor/Editor.gd b/addons/gdfxr/editor/Editor.gd index 1c29d4b..188c669 100644 --- a/addons/gdfxr/editor/Editor.gd +++ b/addons/gdfxr/editor/Editor.gd @@ -86,7 +86,14 @@ func _notification(what: int): popup.set_item_icon(popup.get_item_index(ExtraOption.PASTE), get_theme_icon("ActionPaste", "EditorIcons")) -func edit(path: String) -> void: +func edit(object: Variant) -> void: + if not object: + if not _modified: + _set_editing_file("") + # TODO: prompt? + return + + var path := object.resource_path as String if _modified: _popup_confirm( translator.tr("There are unsaved changes.\nOpen '%s' anyway?") % path, diff --git a/addons/gdfxr/plugin.gd b/addons/gdfxr/plugin.gd index 1b261dc..c1d30f5 100644 --- a/addons/gdfxr/plugin.gd +++ b/addons/gdfxr/plugin.gd @@ -29,7 +29,7 @@ func _handles(object: Variant) -> bool: func _edit(object: Variant): - sfxr_editor.edit(object.resource_path) # Should already passed `handles()` checks + sfxr_editor.edit(object) func _make_visible(visible: bool): diff --git a/project.godot b/project.godot index 52bf027..b261274 100644 --- a/project.godot +++ b/project.godot @@ -15,10 +15,6 @@ run/main_scene="res://example/Example.tscn" config/features=PackedStringArray("4.0") config/icon="res://icon.png" -[editor] - -export/convert_text_resources_to_binary=true - [editor_plugins] enabled=PackedStringArray("res://addons/gdfxr/plugin.cfg")