2019-09-23 15:06:43 +02:00
|
|
|
tool
|
|
|
|
extends EditorPlugin
|
|
|
|
|
2019-10-03 16:06:46 +02:00
|
|
|
var doc = preload("../scenes/FileEditor.tscn").instance()
|
2019-09-24 17:03:49 +02:00
|
|
|
var plugin_version
|
2019-10-03 16:06:46 +02:00
|
|
|
var toolbar
|
|
|
|
var fileditorbutton
|
|
|
|
var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd")
|
2019-09-23 15:06:43 +02:00
|
|
|
|
|
|
|
func _enter_tree():
|
2019-10-03 16:06:46 +02:00
|
|
|
add_autoload_singleton("IconLoader","res://addons/file-editor/scripts/IconLoader.gd")
|
2019-10-08 00:25:16 +02:00
|
|
|
add_autoload_singleton("LastOpenedFiles","res://addons/file-editor/scripts/LastOpenedFiles.gd")
|
2019-10-03 16:06:46 +02:00
|
|
|
get_editor_interface().get_editor_viewport().add_child(doc)
|
|
|
|
doc.hide()
|
2019-09-24 17:03:49 +02:00
|
|
|
|
2019-09-23 15:06:43 +02:00
|
|
|
func _exit_tree():
|
2019-10-08 00:25:16 +02:00
|
|
|
doc.clean_editor()
|
2019-10-03 16:06:46 +02:00
|
|
|
get_editor_interface().get_editor_viewport().remove_child(doc)
|
|
|
|
remove_autoload_singleton("IconLoader")
|
2019-10-08 00:25:16 +02:00
|
|
|
remove_autoload_singleton("LastOpenedFiles")
|
2019-10-03 16:06:46 +02:00
|
|
|
|
|
|
|
func has_main_screen():
|
|
|
|
return true
|
|
|
|
|
|
|
|
func get_plugin_name():
|
|
|
|
return "File"
|
|
|
|
|
|
|
|
func get_plugin_icon():
|
|
|
|
return IconLoader.load_icon_from_name("file")
|
|
|
|
|
|
|
|
func make_visible(visible):
|
|
|
|
doc.visible = visible
|