mirror of
https://github.com/Relintai/godot-engine.file-editor.git
synced 2025-02-17 20:34:33 +01:00
LastOpenFiles is a reference now.
This commit is contained in:
parent
da0b10d43f
commit
5d1ca70aef
@ -62,7 +62,7 @@ var confirmation_close : ConfirmationDialog = null
|
|||||||
|
|
||||||
var select_font_dialog : FileDialog = null
|
var select_font_dialog : FileDialog = null
|
||||||
|
|
||||||
var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new()
|
var LastOpenedFiles = null
|
||||||
|
|
||||||
var Preview = preload("res://addons/file-editor/scripts/Preview.gd")
|
var Preview = preload("res://addons/file-editor/scripts/Preview.gd")
|
||||||
var VanillaEditor = preload("res://addons/file-editor/scripts/VanillaEditor.gd")
|
var VanillaEditor = preload("res://addons/file-editor/scripts/VanillaEditor.gd")
|
||||||
@ -277,6 +277,7 @@ func _ready():
|
|||||||
clean_editor()
|
clean_editor()
|
||||||
connect_signals()
|
connect_signals()
|
||||||
|
|
||||||
|
if LastOpenedFiles:
|
||||||
var opened_files : Array = LastOpenedFiles.load_opened_files()
|
var opened_files : Array = LastOpenedFiles.load_opened_files()
|
||||||
for opened_file in opened_files:
|
for opened_file in opened_files:
|
||||||
open_file(opened_file[1], opened_file[2])
|
open_file(opened_file[1], opened_file[2])
|
||||||
@ -466,6 +467,7 @@ func generate_file_item(path : String , veditor : Control):
|
|||||||
|
|
||||||
func open_in_vanillaeditor(path : String) -> Control:
|
func open_in_vanillaeditor(path : String) -> Control:
|
||||||
var editor = VanillaEditor.new()
|
var editor = VanillaEditor.new()
|
||||||
|
editor.LastOpenedFiles = LastOpenedFiles
|
||||||
editor.file_list = file_list
|
editor.file_list = file_list
|
||||||
split_editor_container.add_child(editor,true)
|
split_editor_container.add_child(editor,true)
|
||||||
|
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
tool
|
tool
|
||||||
extends Node
|
extends Reference
|
||||||
|
|
||||||
|
var editor_plugin : EditorPlugin = null
|
||||||
|
var editor_settings : EditorSettings = null
|
||||||
|
|
||||||
const lastopenedfile_path : String = "res://addons/file-editor/lastopenedfiles.lastcfg"
|
const lastopenedfile_path : String = "res://addons/file-editor/lastopenedfiles.lastcfg"
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -43,5 +45,5 @@ func store_editor_fonts(file_name : String, font_path : String):
|
|||||||
file.save(lastopenedfile_path)
|
file.save(lastopenedfile_path)
|
||||||
|
|
||||||
func get_editor_font():
|
func get_editor_font():
|
||||||
var editor_plugin : EditorPlugin = EditorPlugin.new()
|
#var editor_plugin : EditorPlugin = EditorPlugin.new()
|
||||||
return editor_plugin.get_editor_interface().get_editor_settings().get_setting("interface/editor/code_font")
|
return editor_plugin.get_editor_interface().get_editor_settings().get_setting("interface/editor/code_font")
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
tool
|
tool
|
||||||
extends WindowDialog
|
extends WindowDialog
|
||||||
|
|
||||||
var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new()
|
|
||||||
|
|
||||||
var text_preview : RichTextLabel = null
|
var text_preview : RichTextLabel = null
|
||||||
var table_preview : GridContainer = null
|
var table_preview : GridContainer = null
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
tool
|
tool
|
||||||
extends VBoxContainer
|
extends VBoxContainer
|
||||||
|
|
||||||
var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new()
|
var LastOpenedFiles = null
|
||||||
|
|
||||||
var text_editor : TextEdit = null
|
var text_editor : TextEdit = null
|
||||||
|
|
||||||
|
@ -2,17 +2,20 @@ tool
|
|||||||
extends EditorPlugin
|
extends EditorPlugin
|
||||||
|
|
||||||
var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new()
|
var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new()
|
||||||
|
var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new()
|
||||||
|
|
||||||
var FileEditor
|
var FileEditor
|
||||||
|
|
||||||
func _enter_tree():
|
func _enter_tree():
|
||||||
add_autoload_singleton("LastOpenedFiles","res://addons/file-editor/scripts/LastOpenedFiles.gd")
|
LastOpenedFiles.editor_plugin = self
|
||||||
|
LastOpenedFiles.editor_settings = get_editor_interface().get_editor_settings()
|
||||||
|
|
||||||
FileEditor = preload("res://addons/file-editor/scripts/FileEditor.gd").new()
|
FileEditor = preload("res://addons/file-editor/scripts/FileEditor.gd").new()
|
||||||
|
FileEditor.LastOpenedFiles = LastOpenedFiles
|
||||||
get_editor_interface().get_editor_viewport().add_child(FileEditor)
|
get_editor_interface().get_editor_viewport().add_child(FileEditor)
|
||||||
FileEditor.hide()
|
FileEditor.hide()
|
||||||
|
|
||||||
func _exit_tree():
|
func _exit_tree():
|
||||||
remove_autoload_singleton("LastOpenedFiles")
|
|
||||||
get_editor_interface().get_editor_viewport().remove_child(FileEditor)
|
get_editor_interface().get_editor_viewport().remove_child(FileEditor)
|
||||||
|
|
||||||
func has_main_screen():
|
func has_main_screen():
|
||||||
|
Loading…
Reference in New Issue
Block a user