godot-engine.file-editor/addons/file-editor/scripts/file-editor.gd

34 lines
942 B
GDScript3
Raw Normal View History

2019-09-23 15:06:43 +02:00
tool
extends EditorPlugin
2020-03-17 18:11:08 +01:00
#var doc = preload("../scenes/FileEditor.tscn")
2019-10-18 01:22:11 +02:00
var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new()
2019-09-23 15:06:43 +02:00
2020-01-21 16:22:18 +01:00
var FileEditor
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")
2020-03-17 18:11:08 +01:00
FileEditor = preload("../scenes/FileEditor.tscn").instance()
2020-01-21 16:22:18 +01:00
get_editor_interface().get_editor_viewport().add_child(FileEditor)
FileEditor.hide()
2019-09-24 17:03:49 +02:00
2019-09-23 15:06:43 +02:00
func _exit_tree():
2020-03-17 18:11:08 +01:00
# FileEditor.clean_editor()
2019-10-03 16:06:46 +02:00
remove_autoload_singleton("IconLoader")
2019-10-08 00:25:16 +02:00
remove_autoload_singleton("LastOpenedFiles")
2020-01-21 16:22:18 +01:00
get_editor_interface().get_editor_viewport().remove_child(FileEditor)
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):
2020-01-21 16:22:18 +01:00
FileEditor.visible = visible