From 3eac80077121fe1ff03c427554ca25ca8fc1d451 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 15 Jul 2022 13:03:40 +0200 Subject: [PATCH] Types part3. --- addons/file-editor/scripts/FileEditor.gd | 10 +++++----- addons/file-editor/scripts/IconLoader.gd | 5 ----- addons/file-editor/scripts/Preview.gd | 2 -- addons/file-editor/scripts/VanillaEditor.gd | 4 ++-- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/addons/file-editor/scripts/FileEditor.gd b/addons/file-editor/scripts/FileEditor.gd index 44d8150..215ff07 100644 --- a/addons/file-editor/scripts/FileEditor.gd +++ b/addons/file-editor/scripts/FileEditor.gd @@ -67,10 +67,10 @@ var LastOpenedFiles : Reference = null var Preview = preload("res://addons/file-editor/scripts/Preview.gd") var VanillaEditor = preload("res://addons/file-editor/scripts/VanillaEditor.gd") -var directories : Array = [] -var files : Array = [] +var directories : Array +var files : Array var current_file_index : int = -1 -var current_file_path : String = "" +var current_file_path : String var save_as : bool = false var current_editor : Control var current_font : DynamicFont @@ -495,13 +495,13 @@ func open_in_vanillaeditor(path : String) -> Control: return editor -func close_file(index) -> void: +func close_file(index : int) -> void: if editing_file: confirmation_close.popup() else: confirm_close(index) -func confirm_close(index) -> void: +func confirm_close(index : int) -> void: LastOpenedFiles.remove_opened_file(index,open_file_list) open_file_list.remove_item(index) open_file_name.clear() diff --git a/addons/file-editor/scripts/IconLoader.gd b/addons/file-editor/scripts/IconLoader.gd index b0f235d..28388ef 100644 --- a/addons/file-editor/scripts/IconLoader.gd +++ b/addons/file-editor/scripts/IconLoader.gd @@ -1,11 +1,6 @@ tool extends Node -var imgBuffer - -func _ready(): - pass - func load_icon_from_name(icon_name : String) -> ImageTexture: var file : File = File.new() var image : Image = Image.new() diff --git a/addons/file-editor/scripts/Preview.gd b/addons/file-editor/scripts/Preview.gd index 144b5bc..3364585 100644 --- a/addons/file-editor/scripts/Preview.gd +++ b/addons/file-editor/scripts/Preview.gd @@ -7,8 +7,6 @@ var table_preview : GridContainer = null signal image_downloaded() signal image_loaded() -var imgBuffer : Image - func _init() -> void: window_title = "File preview" resizable = true diff --git a/addons/file-editor/scripts/VanillaEditor.gd b/addons/file-editor/scripts/VanillaEditor.gd index 69c6d6d..a99a5d6 100644 --- a/addons/file-editor/scripts/VanillaEditor.gd +++ b/addons/file-editor/scripts/VanillaEditor.gd @@ -275,12 +275,12 @@ func update_lastmodified(last_modified : Dictionary, icon : String) -> void: file_info_last_modified.set_text(str(last_modified.hour)+":"+str(last_modified.minute)+" "+str(last_modified.day)+"/"+str(last_modified.month)+"/"+str(last_modified.year)) #file_info_last_modified_icon.texture = IconLoader.load_icon_from_name(icon) -func new_file_create(file_name) -> void: +func new_file_create(file_name : String) -> void: text_editor.set_text("") file_list.invalidate() -func _on_Readonly_toggled(button_pressed) -> void: +func _on_Readonly_toggled(button_pressed : bool) -> void: if button_pressed: file_info_read_only.set_text("Read Only") text_editor.readonly = (true)