From d4309adfad7b128b33ddb9c3d012b4beeac41f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:14:08 +0200 Subject: [PATCH 01/21] Add scripts for custom font feature --- scripts/CsvEditor.gd | 217 +++++++++++++ scripts/FileEditor.gd | 604 ++++++++++++++++++++++++++++++++++++ scripts/FileEditorButton.gd | 19 ++ scripts/FileScene.gd | 198 ++++++++++++ scripts/IconLoader.gd | 20 ++ scripts/IniVisualEditor.gd | 284 +++++++++++++++++ scripts/LastOpenedFiles.gd | 42 +++ scripts/Preview.gd | 160 ++++++++++ scripts/VanillaEditor.gd | 220 +++++++++++++ scripts/file-editor.gd | 33 ++ 10 files changed, 1797 insertions(+) create mode 100644 scripts/CsvEditor.gd create mode 100644 scripts/FileEditor.gd create mode 100644 scripts/FileEditorButton.gd create mode 100644 scripts/FileScene.gd create mode 100644 scripts/IconLoader.gd create mode 100644 scripts/IniVisualEditor.gd create mode 100644 scripts/LastOpenedFiles.gd create mode 100644 scripts/Preview.gd create mode 100644 scripts/VanillaEditor.gd create mode 100644 scripts/file-editor.gd diff --git a/scripts/CsvEditor.gd b/scripts/CsvEditor.gd new file mode 100644 index 0000000..6530df5 --- /dev/null +++ b/scripts/CsvEditor.gd @@ -0,0 +1,217 @@ +tool +extends Control + +var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() +var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() + +onready var Table = $Editor/TableContainer/ScrollContainer/Table +onready var AlignBTN = $Editor/Buttons/align_bt.get_popup() +onready var EditBTN = $Editor/Buttons/edit_bt.get_popup() +onready var OptionsBTN = $Editor/Buttons/options_btn.get_popup() +onready var FileInfo = $Editor/FileInfo +onready var ReadOnly = $Editor/FileInfo/Readonly + +onready var Horizontal = $Editor/Horizontal +onready var Vertical = $Editor/TableContainer/Vertical + +onready var ChangeDelimiterDialog = $ChangeDelimiterDialog + +var current_file_path : String = "" + +var rows : int +var columns : int +var csv_delimiter : String +var filepath : String + +signal update_file() + +func _ready(): + add_to_group("csv_editor") + connect_signals() + + load_icons() + +func connect_signals(): + AlignBTN.connect("id_pressed",self,"on_align_pressed") + EditBTN.connect("id_pressed",self,"on_edit_pressed") + OptionsBTN.connect("id_pressed",self,"on_options_pressed") + ReadOnly.connect("toggled",self,"_on_Readonly_toggled") + ChangeDelimiterDialog.connect("confirmed",self,"on_changedelimiter_confirmed") + + connect("visibility_changed",self,"_on_visibility_changed") + +func load_icons(): + $Editor/Buttons/align_bt.set_button_icon(IconLoader.load_icon_from_name("align")) + $Editor/Buttons/edit_bt.set_button_icon(IconLoader.load_icon_from_name("edit_")) + + AlignBTN.set_item_icon(0,IconLoader.load_icon_from_name("text-left")) + AlignBTN.set_item_icon(1,IconLoader.load_icon_from_name("text-center")) + AlignBTN.set_item_icon(2,IconLoader.load_icon_from_name("text-right")) + AlignBTN.set_item_icon(3,IconLoader.load_icon_from_name("text-fill")) + + EditBTN.set_item_icon(0,IconLoader.load_icon_from_name("row")) + EditBTN.set_item_icon(1,IconLoader.load_icon_from_name("column")) + EditBTN.set_item_icon(3,IconLoader.load_icon_from_name("save")) + + ReadOnly.set("custom_icons/checked",IconLoader.load_icon_from_name("read")) + ReadOnly.set("custom_icons/unchecked",IconLoader.load_icon_from_name("edit")) + +func open_csv_file(filepath : String, csv_delimiter : String) -> void: + self.filepath = filepath + var csv = File.new() + csv.open(filepath,File.READ) + var rows : Array = [] + var columns = -1 + while not csv.eof_reached(): + var csv_line = csv.get_csv_line(csv_delimiter) + if Array(csv_line) != [""]: + rows.append(csv_line) + if columns == -1: + columns = rows[0].size() + csv.close() + self.csv_delimiter = csv_delimiter + load_file_in_table(rows,columns) + ReadOnly.pressed = (true) + $Editor/FileInfo/delimiter.set_text(csv_delimiter) + ChangeDelimiterDialog.get_node("VBoxContainer/delim_read").set_text(csv_delimiter) + +func load_file_in_table(rows : Array, columns : int) -> void: + Table.set_columns(columns) + for row in rows: + add_row(row.size(),"",row) + update_dimensions(rows.size()-1,columns) + +func add_row(columns : int, cell_text : String = "", cell2text : PoolStringArray = []): + for i in range(0,columns): + if cell2text.size()<1: + var cell = LineEdit.new() + cell.set_h_size_flags(2) + cell.set_h_size_flags(3) + cell.set_text(cell_text) + Table.add_child(cell) + if ReadOnly.pressed: + cell.set_editable(false) + + else: +# if cell2text[i]!="": + var cell = LineEdit.new() + cell.set_h_size_flags(2) + cell.set_h_size_flags(3) + Table.add_child(cell) + if cell2text: + cell.set_text(cell2text[i]) + else: + cell.set_text(cell_text) + if ReadOnly.pressed: + cell.set_editable(false) + +func add_column(rows : int ,cell_text : String = ""): + for i in range(0,rows): + var cell = LineEdit.new() + cell.set_h_size_flags(2) + cell.set_h_size_flags(3) + Table.add_child(cell) + Table.move_child(cell,(columns)*(i+1)-1) + cell.set_text(cell_text) + if ReadOnly.pressed: + cell.set_editable(false) + +func on_align_pressed(index : int) -> void: + for cell in Table.get_children(): + cell.set_align(index) + +func on_edit_pressed(index :int) -> void: + match index: + 0: + update_dimensions(rows+1,columns) + add_row(columns) + 1: + update_dimensions(rows,columns+1) + add_column(rows) + 3: + save_table() + +func on_options_pressed(index : int) -> void: + match index: + 0: + ChangeDelimiterDialog.popup() + +func table_ruler(rows : int, columns : int): + for child in Vertical.get_children(): + child.queue_free() + for child in Horizontal.get_children(): + child.queue_free() + for i in range(0,rows): + var lb = Label.new() + lb.set_h_size_flags(2) + lb.set_h_size_flags(3) + lb.set_text(str(i+1)) + Vertical.add_child(lb) + var lb = Label.new() + lb.set_text(" ") + Horizontal.add_child(lb) + for j in range(0,columns): + var lb2 = Label.new() + lb2.set_h_size_flags(2) + lb2.set_h_size_flags(3) + lb2.set_align(1) + lb2.set_text(str(j+1)) + Horizontal.add_child(lb2) + +func update_dimensions(rows : int, columns : int): + self.rows = rows + self.columns = columns + table_ruler(rows,columns) + Table.set_columns(columns) + FileInfo.get_node("rows").set_text(str(rows)) + FileInfo.get_node("columns").set_text(str(columns)) + +func _on_Readonly_toggled(button_pressed): + if button_pressed: + ReadOnly.set_text("Read Only") + for cell in Table.get_children(): + cell.set_editable(false) + else: + ReadOnly.set_text("Can Edit") + for cell in Table.get_children(): + cell.set_editable(true) + +func save_table(): + var content : Array = [] + var column = 0 + var row_ : PoolStringArray = [] + for cell in Table.get_children(): + if column < columns: + row_.append(cell.get_text()) + column+=1 + else: + content.append(row_) + row_ = [] + row_.append(cell.get_text()) + column = 1 + content.append(row_) + + var file = File.new() + file.open(filepath, File.WRITE) + for line in content: + file.store_csv_line(line,csv_delimiter) + file.close() + + emit_signal("update_file") + +func on_changedelimiter_confirmed(): + change_delimiter(ChangeDelimiterDialog.get_node("VBoxContainer/delim_read").get_text()) + +func change_delimiter(delim : String): + csv_delimiter = delim + reload() + +func reload(): + for element in Table.get_children(): + element.queue_free() + open_csv_file(current_file_path,csv_delimiter) + FileInfo.show() + +func _on_visibility_changed(): + if visible: + reload() diff --git a/scripts/FileEditor.gd b/scripts/FileEditor.gd new file mode 100644 index 0000000..fede799 --- /dev/null +++ b/scripts/FileEditor.gd @@ -0,0 +1,604 @@ +tool +extends Control + +onready var FileList = $FileList + +onready var NewFileDialogue = $NewFileDialogue +onready var NewFileDialogue_name = $NewFileDialogue/VBoxContainer/new_filename + +onready var FileBTN = $FileEditorContainer/TobBar/file_btn.get_popup() +onready var PreviewBTN = $FileEditorContainer/TobBar/preview_btn.get_popup() +onready var EditorBTN = $FileEditorContainer/TobBar/editor_btn.get_popup() +onready var SettingsBTN : PopupMenu = $FileEditorContainer/TobBar/SettingsBtn.get_popup() + +onready var Version = $FileEditorContainer/TobBar/version + +onready var SelectFontDialog : FileDialog = $SelectFontDialog + +onready var FileContainer = $FileEditorContainer/SplitContainer/FileContainer +onready var OpenFileList = $FileEditorContainer/SplitContainer/FileContainer/OpenFileList +onready var OpenFileName = $FileEditorContainer/SplitContainer/EditorContainer/HBoxContainer/OpenFileName +onready var SplitEditorContainer = $FileEditorContainer/SplitContainer/EditorContainer +onready var WrapBTN = $FileEditorContainer/SplitContainer/EditorContainer/HBoxContainer/wrap_button +onready var MapBTN = $FileEditorContainer/SplitContainer/EditorContainer/HBoxContainer/map_button + +var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() +var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() + +var Preview = preload("res://addons/file-editor/scenes/Preview.tscn") +var IniEditor = preload("res://addons/file-editor/scenes/IniEditor.tscn") +var VanillaEditor = preload("res://addons/file-editor/scenes/VanillaEditor.tscn") +var CsvEditor = preload("res://addons/file-editor/scenes/CsvEditor.tscn") + +onready var EditorContainer = $FileEditorContainer/SplitContainer + +var DIRECTORY : String = "res://" +var EXCEPTIONS : String = "addons" +var EXTENSIONS : PoolStringArray = [ +"*.txt ; Plain Text File", +"*.rtf ; Rich Text Format File", +"*.log ; Log File", +"*.md ; MD File", +"*.doc ; WordPad Document", +"*.doc ; Microsoft Word Document", +"*.docm ; Word Open XML Macro-Enabled Document", +"*.docx ; Microsoft Word Open XML Document", +"*.bbs ; Bulletin Board System Text", +"*.dat ; Data File", +"*.xml ; XML File", +"*.sql ; SQL database file", +"*.json ; JavaScript Object Notation File", +"*.html ; HyperText Markup Language", +"*.csv ; Comma-separated values", +"*.cfg ; Configuration File", +"*.ini ; Initialization File (same as .cfg Configuration File)", +"*.csv ; Comma-separated values File", +"*.res ; Resource File", +] + +var directories = [] +var files = [] +var current_file_index = -1 +var current_file_path = "" +var save_as = false +var current_editor : Control +var current_ini_editor : Control +var current_csv_editor : Control +var current_font : DynamicFont + + +func _ready(): + + clean_editor() + update_version() + connect_signals() + create_shortcuts() + load_icons() + + var opened_files : Array = LastOpenedFiles.load_opened_files() + for opened_file in opened_files: + open_file(opened_file[1], opened_file[2]) + + FileList.set_filters(EXTENSIONS) + +func create_shortcuts(): + var hotkey + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_S + hotkey.control = true + FileBTN.set_item_accelerator(4,hotkey.get_scancode_with_modifiers()) # save file + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_N + hotkey.control = true + FileBTN.set_item_accelerator(0,hotkey.get_scancode_with_modifiers()) # new file + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_O + hotkey.control = true + FileBTN.set_item_accelerator(1,hotkey.get_scancode_with_modifiers()) # open file + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_D + hotkey.control = true + FileBTN.set_item_accelerator(6,hotkey.get_scancode_with_modifiers()) # delete file + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_S + hotkey.control = true + hotkey.alt = true + FileBTN.set_item_accelerator(5,hotkey.get_scancode_with_modifiers()) #save file as + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_C + hotkey.control = true + hotkey.alt = true + FileBTN.set_item_accelerator(2,hotkey.get_scancode_with_modifiers()) # close file + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_F + hotkey.control = true + FileBTN.set_item_accelerator(8,hotkey.get_scancode_with_modifiers()) # search + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_R + hotkey.control = true + FileBTN.set_item_accelerator(9,hotkey.get_scancode_with_modifiers()) # replace + + # vanilla editor ----------------------- + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_1 + hotkey.control = true + EditorBTN.set_item_accelerator(0,hotkey.get_scancode_with_modifiers()) # vanilla editor + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_2 + hotkey.control = true + EditorBTN.set_item_accelerator(1,hotkey.get_scancode_with_modifiers()) # csv editor + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_3 + hotkey.control = true + EditorBTN.set_item_accelerator(2,hotkey.get_scancode_with_modifiers()) # inieditor editor + +func load_icons(): + $FileEditorContainer/TobBar/file_btn.icon = IconLoader.load_icon_from_name("file") + $FileEditorContainer/TobBar/preview_btn.icon = IconLoader.load_icon_from_name("read") + $FileEditorContainer/TobBar/editor_btn.icon = IconLoader.load_icon_from_name("edit_") + $FileEditorContainer/TobBar/SettingsBtn.icon = IconLoader.load_icon_from_name("settings") + +func connect_signals(): + FileList.connect("confirmed",self,"update_list") + FileBTN.connect("id_pressed",self,"_on_filebtn_pressed") + PreviewBTN.connect("id_pressed",self,"_on_previewbtn_pressed") + EditorBTN.connect("id_pressed",self,"_on_editorbtn_pressed") + SettingsBTN.connect("id_pressed",self,"_on_settingsbtn_pressed") + + OpenFileList.connect("item_selected",self,"_on_fileitem_pressed") + WrapBTN.connect("item_selected",self,"on_wrap_button") + MapBTN.connect("item_selected",self,"on_minimap_button") + + SelectFontDialog.connect("file_selected",self,"_on_font_selected") + +func update_version(): + var plugin_version = "" + var config = ConfigFile.new() + var err = config.load("res://addons/file-editor/plugin.cfg") + if err == OK: + plugin_version = config.get_value("plugin","version") + Version.set_text("v"+plugin_version) + print(plugin_version) + +func create_selected_file(): + update_list() + FileList.mode = FileDialog.MODE_SAVE_FILE + FileList.set_title("Create a new File") + if FileList.is_connected("file_selected",self,"delete_file"): + FileList.disconnect("file_selected",self,"delete_file") + if FileList.is_connected("file_selected",self,"open_file"): + FileList.disconnect("file_selected",self,"open_file") + if not FileList.is_connected("file_selected",self,"create_new_file"): + FileList.connect("file_selected",self,"create_new_file") + open_filelist() + +func open_selected_file(): + update_list() + FileList.mode = FileDialog.MODE_OPEN_FILE + FileList.set_title("Select a File you want to edit") + if FileList.is_connected("file_selected",self,"delete_file"): + FileList.disconnect("file_selected",self,"delete_file") + if FileList.is_connected("file_selected",self,"create_new_file"): + FileList.disconnect("file_selected",self,"create_new_file") + if not FileList.is_connected("file_selected",self,"open_file"): + FileList.connect("file_selected",self,"open_file") + open_filelist() + +func delete_selected_file(): + update_list() + FileList.mode = FileDialog.MODE_OPEN_FILES + FileList.set_title("Select one or more Files you want to delete") + if FileList.is_connected("file_selected",self,"open_file"): + FileList.disconnect("file_selected",self,"open_file") + if FileList.is_connected("file_selected",self,"create_new_file"): + FileList.disconnect("file_selected",self,"create_new_file") + if not FileList.is_connected("files_selected",self,"delete_file"): + FileList.connect("files_selected",self,"delete_file") + open_filelist() + +func save_current_file_as(): + update_list() + FileList.mode = FileDialog.MODE_SAVE_FILE + FileList.set_title("Save this File as...") + if FileList.is_connected("file_selected",self,"delete_file"): + FileList.disconnect("file_selected",self,"delete_file") + if FileList.is_connected("file_selected",self,"open_file"): + FileList.disconnect("file_selected",self,"open_file") + if not FileList.is_connected("file_selected",self,"create_new_file"): + FileList.connect("file_selected",self,"create_new_file") + open_filelist() + +func _on_filebtn_pressed(index : int): + match index: + 0: + create_selected_file() + 1: + open_selected_file() + 2: + if current_file_index!=-1 and current_file_path != "": + close_file(current_file_index) + + 3: + if current_file_index!=-1 and current_file_path != "": + save_as = false + if current_csv_editor and current_csv_editor.visible: + current_csv_editor.save_table() + save_file(current_file_path) + 4: + if current_file_index!=-1 and current_file_path != "": + save_as = true + save_file(current_file_path) + save_current_file_as() + 5: + delete_selected_file() + 6: + current_editor.open_searchbox() + 7: + current_editor.open_replacebox() + +func _on_previewbtn_pressed(id : int): + if id == 0: + bbcode_preview() + elif id == 1: + markdown_preview() + elif id == 2: + html_preview() + elif id == 3: + csv_preview() + elif id == 4: + xml_preview() + elif id == 5: + json_preview() + +func _on_editorbtn_pressed(index : int): + match index: + 0: + if not current_editor.visible: + current_editor.show() + if current_csv_editor: + current_csv_editor.hide() + if current_ini_editor: + current_ini_editor.hide() + 1: + if current_csv_editor and not current_csv_editor.visible: + if current_ini_editor: + current_ini_editor.hide() + current_editor.hide() + current_csv_editor = open_in_csveditor(current_file_path) + current_csv_editor.show() + 2: + if current_ini_editor and not current_ini_editor.visible: + current_editor.hide() + if current_csv_editor: + current_csv_editor.hide() + current_ini_editor = open_in_inieditor(current_file_path) + current_ini_editor.show() + +func _on_settingsbtn_pressed(index : int): + match index: + 0: + SelectFontDialog.popup() + +func _on_font_selected(font_path : String): + current_editor.set_font(font_path) + LastOpenedFiles.store_editor_fonts(current_file_path.get_file(), font_path) +# Enable this part of code to apply the new font to all Vanilla Editors opened +# for file in [0,OpenFileList.get_child_count()]: +# OpenFileList.get_item_metadata(file)[0].set_font(dynamic_font) +# current_font = dynamic_font + +func _on_fileitem_pressed(index : int): + current_file_index = index + var selected_item_metadata = OpenFileList.get_item_metadata(current_file_index) + var extension = selected_item_metadata[0].current_path.get_file().get_extension() + + current_file_path = selected_item_metadata[0].current_path + if current_editor.visible: + current_editor.hide() + current_editor = selected_item_metadata[0] + current_editor.show() + OpenFileName.set_text(current_editor.current_path) + current_csv_editor = selected_item_metadata[2] + current_ini_editor = selected_item_metadata[1] + if WrapBTN.get_selected_id() == 1: + current_editor.set_wrap_enabled(true) + else: + current_editor.set_wrap_enabled(false) + if MapBTN.get_selected_id() == 1: + current_editor.draw_minimap(true) + else: + current_editor.draw_minimap(false) + elif current_csv_editor and current_csv_editor.visible: + if extension == "csv": + current_csv_editor.hide() + current_csv_editor = selected_item_metadata[2] + current_csv_editor.show() + OpenFileName.set_text(current_csv_editor.current_file_path) + current_editor = selected_item_metadata[0] + current_ini_editor = selected_item_metadata[1] + else: + if current_csv_editor: + current_csv_editor.hide() + current_csv_editor = selected_item_metadata[2] + if current_ini_editor: + current_ini_editor.hide() + current_ini_editor = selected_item_metadata[1] + current_editor.hide() + current_editor = selected_item_metadata[0] + current_editor.show() + OpenFileName.set_text(current_editor.current_path) + elif current_ini_editor and current_ini_editor.visible: + if extension == "cfg" or extension == "ini": + current_ini_editor.hide() + current_ini_editor = selected_item_metadata[1] + current_ini_editor.show() + OpenFileName.set_text(current_ini_editor.current_file_path) + else: + if current_ini_editor: + current_ini_editor.hide() + current_ini_editor = selected_item_metadata[1] + if current_csv_editor: + current_csv_editor.hide() + current_csv_editor = selected_item_metadata[2] + current_editor.hide() + current_editor = selected_item_metadata[0] + current_editor.show() + OpenFileName.set_text(current_editor.current_path) + +func open_file(path : String, font : String = "null"): + if current_file_path != path: + current_file_path = path + + var vanilla_editor = open_in_vanillaeditor(path) + if font != "null": + vanilla_editor.set_font(font) + var ini_editor = open_in_inieditor(path) + var csv_editor = open_in_csveditor(path) + + generate_file_item(path,vanilla_editor,ini_editor,csv_editor) + + LastOpenedFiles.store_opened_files(OpenFileList) + current_editor.show() + +func generate_file_item(path : String , veditor : Control , inieditor : Control, csveditor : Control): + OpenFileName.set_text(path) + OpenFileList.add_item(path.get_file(),IconLoader.load_icon_from_name("file"),true) + current_file_index = OpenFileList.get_item_count()-1 + OpenFileList.set_item_metadata(current_file_index,[veditor,inieditor,csveditor]) + OpenFileList.select(OpenFileList.get_item_count()-1) + +func open_in_vanillaeditor(path : String) -> Control: + var editor = VanillaEditor.instance() + SplitEditorContainer.add_child(editor,true) + + if current_editor and current_editor!=editor: + editor.show() + current_editor.hide() + if current_csv_editor and current_csv_editor.visible: + current_csv_editor.hide() + if current_ini_editor and current_ini_editor.visible: + current_ini_editor.hide() + + current_editor = editor + + + editor.connect("text_changed",self,"_on_vanillaeditor_text_changed") + + var current_file : File = File.new() + current_file.open(path,File.READ) + var current_content = "" + current_content = current_file.get_as_text() + + var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(path)) + + current_file.close() + + editor.new_file_open(current_content,last_modified,current_file_path) + + update_list() + + if WrapBTN.get_selected_id() == 1: + current_editor.set_wrap_enabled(true) + + + return editor + +func open_in_inieditor(path : String) -> Control: + var extension = path.get_file().get_extension() + if extension == "ini" or extension == "cfg": + var inieditor = IniEditor.instance() + SplitEditorContainer.add_child(inieditor) + inieditor.hide() + inieditor.connect("update_file",self,"_on_update_file") + current_ini_editor = inieditor + inieditor.current_file_path = path + var current_file : ConfigFile = ConfigFile.new() + var err = current_file.load(path) + if err == OK: + var sections = current_file.get_sections() + var filemap = [] + for section in sections: + var keys = [] + var section_keys = current_file.get_section_keys(section) + for key in section_keys: + keys.append([key,current_file.get_value(section,key)]) + + filemap.append([section,keys]) + + inieditor.open_file(filemap) + return inieditor + else: + current_ini_editor = null + return null + +func open_in_csveditor(path : String) -> Control: + var extension = path.get_file().get_extension() + if extension == "csv": + var csveditor = CsvEditor.instance() + SplitEditorContainer.add_child(csveditor) + csveditor.hide() + csveditor.connect("update_file",self,"_on_update_file") + current_csv_editor = csveditor + csveditor.current_file_path = path + csveditor.open_csv_file(path,"|") + return csveditor + else: + current_csv_editor = null + return null + +func close_file(index): + LastOpenedFiles.remove_opened_file(index,OpenFileList) + OpenFileList.remove_item(index) + OpenFileName.clear() + current_editor.queue_free() + + if index>0: + OpenFileList.select(OpenFileList.get_item_count()-1) + _on_fileitem_pressed(OpenFileList.get_item_count()-1) + +func _on_update_file(): +# current_editor.clean_editor() + var current_file : File = File.new() + current_file.open(current_file_path,File.READ) + + var current_content = current_file.get_as_text() + var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(current_file_path)) + + current_file.close() + + current_editor.new_file_open(current_content,last_modified,current_file_path) + +func delete_file(files_selected : PoolStringArray): + var dir = Directory.new() + for file in files_selected: + dir.remove(file) + + update_list() + +func open_newfiledialogue(): + NewFileDialogue.popup() + NewFileDialogue.set_position(OS.get_screen_size()/2 - NewFileDialogue.get_size()/2) + +func open_filelist(): + update_list() + FileList.popup() + FileList.set_position(OS.get_screen_size()/2 - FileList.get_size()/2) + +func create_new_file(given_path : String): + var current_file = File.new() + current_file.open(given_path,File.WRITE) + if save_as : + current_file.store_line(current_editor.get_node("TextEditor").get_text()) + current_file.close() + + open_file(given_path) + +func save_file(current_path : String): + var current_file = File.new() + current_file.open(current_path,File.WRITE) + var current_content = "" + var lines = current_editor.get_node("TextEditor").get_line_count() + for line in range(0,lines): + current_content = current_editor.get_node("TextEditor").get_text() + current_file.store_line(current_editor.get_node("TextEditor").get_line(line)) + current_file.close() + + current_file_path = current_path + + var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(current_file_path)) + + current_editor.update_lastmodified(last_modified,"save") + OpenFileList.set_item_metadata(current_file_index,[current_editor,current_ini_editor,current_csv_editor]) + print(OpenFileList.get_item_metadata(current_file_index)) + + if OpenFileList.get_item_text(current_file_index).ends_with("(*)"): + OpenFileList.set_item_text(current_file_index,OpenFileList.get_item_text(current_file_index).rstrip("(*)")) + +# OpenFileList.set_item_metadata(current_file_index,[current_editor,open_in_inieditor(current_file_path),open_in_csveditor(current_file_path)]) + + update_list() + +func clean_editor() -> void : + for inieditor in get_tree().get_nodes_in_group("ini_editor"): + inieditor.queue_free() + for vanillaeditor in get_tree().get_nodes_in_group("vanilla_editor"): + vanillaeditor.queue_free() + OpenFileName.clear() + OpenFileList.clear() + + +func csv_preview(): + var preview = Preview.instance() + get_parent().get_parent().get_parent().add_child(preview) + preview.popup() + preview.window_title += " ("+current_file_path.get_file()+")" + var lines = current_editor.get_node("TextEditor").get_line_count() + var rows = [] + for i in range(0,lines-1): + rows.append(current_editor.get_node("TextEditor").get_line(i).rsplit(",",false)) + preview.print_csv(rows) + +func bbcode_preview(): + var preview = Preview.instance() + get_parent().get_parent().get_parent().add_child(preview) + preview.popup() + preview.window_title += " ("+current_file_path.get_file()+")" + preview.print_bb(current_editor.get_node("TextEditor").get_text()) + +func markdown_preview(): + var preview = Preview.instance() + get_parent().get_parent().get_parent().add_child(preview) + preview.popup() + preview.window_title += " ("+current_file_path.get_file()+")" + preview.print_markdown(current_editor.get_node("TextEditor").get_text()) + +func html_preview(): + var preview = Preview.instance() + get_parent().get_parent().get_parent().add_child(preview) + preview.popup() + preview.window_title += " ("+current_file_path.get_file()+")" + preview.print_html(current_editor.get_node("TextEditor").get_text()) + +func xml_preview(): + pass + +func json_preview(): + pass + + +func _on_vanillaeditor_text_changed(): + if not OpenFileList.get_item_text(current_file_index).ends_with("(*)"): + OpenFileList.set_item_text(current_file_index,OpenFileList.get_item_text(current_file_index)+"(*)") + + +func update_list(): + FileList.invalidate() + +func on_wrap_button(index:int): + match index: + 0: + current_editor.set_wrap_enabled(false) + 1: + current_editor.set_wrap_enabled(true) + +func on_minimap_button(index:int): + match index: + 0: + current_editor.draw_minimap(false) + 1: + current_editor.draw_minimap(true) + +func check_file_preview(file : String): + # check whether the opened file has a corresponding preview session for its extension + pass diff --git a/scripts/FileEditorButton.gd b/scripts/FileEditorButton.gd new file mode 100644 index 0000000..95b3ac3 --- /dev/null +++ b/scripts/FileEditorButton.gd @@ -0,0 +1,19 @@ +tool +extends ToolButton + +var fileditor_workspace +var fileditor + +func _ready(): + connect("pressed",self,"show_fileditor") + +func show_fileditor(): + fileditor_workspace.get_children()[0].hide() + fileditor_workspace.get_children()[1].hide() + fileditor_workspace.get_children()[2].hide() + fileditor_workspace.add_child(fileditor) + fileditor.show() + +func load_values(fi, fe): + fileditor_workspace = fi + fileditor = fe diff --git a/scripts/FileScene.gd b/scripts/FileScene.gd new file mode 100644 index 0000000..7fbdc1f --- /dev/null +++ b/scripts/FileScene.gd @@ -0,0 +1,198 @@ +tool +extends VBoxContainer + +var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() +var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() + +onready var ReadOnly = $FileInfo/Readonly + +onready var TextEditor = $TextEditor + +onready var LastModified = $FileInfo/lastmodified + +onready var FileList = get_parent().get_parent().get_parent().get_node("FileList") + +onready var ClosingFile = get_parent().get_parent().get_parent().get_node("ConfirmationDialog") + +onready var LastModifiedIcon = $FileInfo/lastmodified_icon + +onready var SearchBox = $SearchBox +onready var ReplaceBox = $ReplaceBox + +onready var c_counter = $FileInfo/c_counter + +var current_path = "" +var current_filename = "" +var Preview = load("res://addons/file-editor/scenes/Preview.tscn") + + +var search_flag = 0 + +signal text_changed() + +func _ready(): + ClosingFile.connect("confirmed",self,"queue_free") + + ReadOnly.connect("toggled",self,"_on_Readonly_toggled") + + ReadOnly.set("custom_icons/checked",IconLoader.load_icon_from_name("read")) + ReadOnly.set("custom_icons/unchecked",IconLoader.load_icon_from_name("edit")) + + add_to_group("vanilla_editor") + +func color_region(filextension : String): # -----------------------------> dal momento che voglio creare un editor per ogni file, renderĂ² questa funzione singola in base all'estensione del file + match(filextension): + "bbs": + TextEditor.add_color_region("[b]","[/b]",Color8(153,153,255,255),false) + TextEditor.add_color_region("[i]","[/i]",Color8(153,255,153,255),false) + TextEditor.add_color_region("[s]","[/s]",Color8(255,153,153,255),false) + TextEditor.add_color_region("[u]","[/u]",Color8(255,255,102,255),false) + TextEditor.add_color_region("[url","[/url]",Color8(153,204,255,255),false) + TextEditor.add_color_region("[code]","[/code]",Color8(192,192,192,255),false) + TextEditor.add_color_region("[img]","[/img]",Color8(255,204,153,255),false) + TextEditor.add_color_region("[center]","[/center]",Color8(175,238,238,255),false) + TextEditor.add_color_region("[right]","[/right]",Color8(135,206,235,255),false) + "html": + TextEditor.add_color_region("","",Color8(153,153,255,255),false) + TextEditor.add_color_region("","",Color8(153,255,153,255),false) + TextEditor.add_color_region("","",Color8(255,153,153,255),false) + TextEditor.add_color_region("","",Color8(255,255,102,255),false) + TextEditor.add_color_region("",Color8(153,204,255,255),false) + TextEditor.add_color_region("",Color8(255,204,153,255),true) + TextEditor.add_color_region("
","
",Color8(192,192,192,255),false) + TextEditor.add_color_region("
","
",Color8(175,238,238,255),false) + TextEditor.add_color_region("","",Color8(135,206,235,255),false) + "md": + TextEditor.add_color_region("**","**",Color8(153,153,255,255),false) + TextEditor.add_color_region("*","*",Color8(153,255,153,255),false) + TextEditor.add_color_region("+ ","",Color8(255,178,102,255),false) + TextEditor.add_color_region("- ","",Color8(255,178,102,255),false) + TextEditor.add_color_region("~~","~~",Color8(255,153,153,255),false) + TextEditor.add_color_region("__","__",Color8(255,255,102,255),false) + TextEditor.add_color_region("[",")",Color8(153,204,255,255),false) + TextEditor.add_color_region("`","`",Color8(192,192,192,255),false) + TextEditor.add_color_region('"*.','"',Color8(255,255,255,255),true) + TextEditor.add_color_region("# ","",Color8(105,105,105,255),true) + TextEditor.add_color_region("## ","",Color8(128,128,128,255),true) + TextEditor.add_color_region("### ","",Color8(169,169,169,255),true) + TextEditor.add_color_region("#### ","",Color8(192,192,192,255),true) + TextEditor.add_color_region("##### ","",Color8(211,211,211,255),true) + TextEditor.add_color_region("###### ","",Color8(255,255,255,255),true) + "cfg": + TextEditor.add_color_region("[","]",Color8(153,204,255,255),false) + TextEditor.add_color_region('"','"',Color8(255,255,102,255),false) + _: + pass + +func clean_editor(): + TextEditor.set_text("") + LastModifiedIcon.texture = IconLoader.load_icon_from_name("save") + LastModified.set_text("") + FileList.invalidate() + current_filename = "" + current_path = "" + +func new_file_open(file_content, last_modified , current_file_path): + current_path = current_file_path + current_filename = current_file_path.get_file() + color_region(current_filename.get_extension()) + TextEditor.set_text(file_content) + update_lastmodified(last_modified,"save") + FileList.invalidate() + count_characters() + +func update_lastmodified(last_modified : Dictionary, icon : String): + LastModified.set_text(str(last_modified.hour)+":"+str(last_modified.minute)+" "+str(last_modified.day)+"/"+str(last_modified.month)+"/"+str(last_modified.year)) + LastModifiedIcon.texture = IconLoader.load_icon_from_name(icon) + +func new_file_create(file_name): + TextEditor.set_text("") + + FileList.invalidate() + +func _on_Readonly_toggled(button_pressed): + if button_pressed: + ReadOnly.set_text("Read Only") + TextEditor.readonly = (true) + else: + ReadOnly.set_text("Can Edit") + TextEditor.readonly = (false) + +func _on_TextEditor_text_changed(): + LastModifiedIcon.texture = IconLoader.load_icon_from_name("saveas") + count_characters() + emit_signal("text_changed") + +func count_characters(): + var counted : int = 0 + for line in TextEditor.get_line_count(): + counted += TextEditor.get_line(line).length() + c_counter.set_text(str(counted)) + +func _on_LineEdit_text_changed(new_text): + var linecount = TextEditor.get_line_count() + if new_text != "": + var found + var find = false + for line in range(0,linecount): + for column in range(0,TextEditor.get_line(line).length()): + found = TextEditor.search( new_text, search_flag, line , column ) + if found.size(): + if found[1] == line: +# if not find: + TextEditor.select(line,found[0],found[1],found[0]+new_text.length()) +# find = true + else: + TextEditor.select(0,0,0,0) + else: + TextEditor.select(0,0,0,0) + +func _on_matchcase_toggled(button_pressed): + if button_pressed: + search_flag = 1 + else: + if $SearchBox/wholewords.is_pressed(): + search_flag = 2 + else: + search_flag = 0 + _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) + +func _on_wholewords_toggled(button_pressed): + if button_pressed: + search_flag = 2 + else: + if $SearchBox/matchcase.is_pressed(): + search_flag = 1 + else: + search_flag = 0 + _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) + +func _on_close_pressed(): + SearchBox.hide() + +func open_searchbox(): + if SearchBox.visible: + SearchBox.hide() + else: + SearchBox.show() + SearchBox.get_node("LineEdit").grab_focus() + +func _on_Button_pressed(): + var linecount = TextEditor.get_line_count()-1 + var old_text = $ReplaceBox/replace.get_text() + var new_text = $ReplaceBox/with.get_text() + var text = TextEditor.get_text() + TextEditor.set_text(text.replace(old_text,new_text)) + +func open_replacebox(): + if ReplaceBox.visible: + ReplaceBox.hide() + else: + ReplaceBox.show() + ReplaceBox.get_node("replace").grab_focus() + +func _on_close2_pressed(): + ReplaceBox.hide() + +func _on_LineEdit_focus_entered(): + _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) diff --git a/scripts/IconLoader.gd b/scripts/IconLoader.gd new file mode 100644 index 0000000..a832ca2 --- /dev/null +++ b/scripts/IconLoader.gd @@ -0,0 +1,20 @@ +tool +extends Node + +var imgBuffer + +func _ready(): + pass + +func load_icon_from_name(icon_name : String) -> ImageTexture: + var file = File.new() + var image = Image.new() + var texture = ImageTexture.new() + + file.open("res://addons/file-editor/icons.pngs/"+icon_name+".png.buttonicon", File.READ) + var buffer = file.get_buffer(file.get_len()) + file.close() + + image.load_png_from_buffer(buffer) + texture.create_from_image(image) + return texture diff --git a/scripts/IniVisualEditor.gd b/scripts/IniVisualEditor.gd new file mode 100644 index 0000000..3e0d642 --- /dev/null +++ b/scripts/IniVisualEditor.gd @@ -0,0 +1,284 @@ +tool +extends Control + +var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() +var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() + +onready var Keys = $VBoxContainer/HSplitContainer/VBoxContainer2/keys +onready var Sections = $VBoxContainer/HSplitContainer/VBoxContainer/sections2 + +onready var BtnAddSection = $VBoxContainer/HSplitContainer/VBoxContainer/HBoxContainer2/btn_add_section +onready var BtnRemoveSection = $VBoxContainer/HSplitContainer/VBoxContainer/HBoxContainer2/btn_remove_section + +onready var BtnAddKey = $VBoxContainer/HSplitContainer/VBoxContainer2/HBoxContainer3/btn_add_key +onready var BtnEditKey = $VBoxContainer/HSplitContainer/VBoxContainer2/HBoxContainer3/btn_edit_key +onready var BtnRemoveKey = $VBoxContainer/HSplitContainer/VBoxContainer2/HBoxContainer3/btn_remove_key + +onready var Section = $Section +onready var Key = $Key + +var selected_key +var selected_section : int = -1 +var root : TreeItem + +var current_file_path : String = "" + +signal update_file() + +func _ready(): + create_table_names() + connect_signals() + load_icons() + clean_editor() + + add_to_group("ini_editor") + +# var metadata = [["name","Godot Engine"],["version","1.0.0"],["color","Light Blue"]] +# load_section("Engine", metadata) + +func connect_signals(): + Sections.connect("item_selected",self,"_on_section_selected") + Sections.connect("nothing_selected",self,"_on_nosection_selected") + + BtnAddSection.connect("pressed",self,"_on_addsection_pressed") + BtnRemoveSection.connect("pressed",self,"_on_removesection_pressed") + + Keys.connect("item_selected",self,"_on_key_selected") + Keys.connect("nothing_selected",self,"_on_nokey_selected") + + BtnAddKey.connect("pressed",self,"_on_addkey_pressed") + BtnRemoveKey.connect("pressed",self,"_on_removekey_pressed") + BtnEditKey.connect("pressed",self,"_on_editkey_pressed") + + connect("visibility_changed",self,"_on_visibility_changed") + +func create_table_names(): + create_root() + Keys.hide_root = true + + Keys.set_column_titles_visible(true) + Keys.set_column_title(0,"Name") + Keys.set_column_title(1,"Value") + +func load_icons(): + $VBoxContainer/HSplitContainer/VBoxContainer/HBoxContainer/sections_icon.texture = IconLoader.load_icon_from_name("sections") + $VBoxContainer/HSplitContainer/VBoxContainer2/HBoxContainer2/keys_icon.texture = IconLoader.load_icon_from_name("keys") + BtnAddSection.icon = IconLoader.load_icon_from_name("add") + BtnAddSection.hint_tooltip = "Add a new Section" + BtnRemoveSection.icon = IconLoader.load_icon_from_name("delete") + BtnRemoveSection.hint_tooltip = "Remove selected Section" + + BtnAddKey.icon = IconLoader.load_icon_from_name("add") + BtnAddKey.hint_tooltip = "Add a new Key" + BtnRemoveKey.icon = IconLoader.load_icon_from_name("delete") + BtnRemoveKey.hint_tooltip = "Remove selected Key" + BtnEditKey.icon = IconLoader.load_icon_from_name("edit_") + BtnEditKey.hint_tooltip = "Edit selected Key" + +func _on_addsection_pressed(): + Section.get_node("Container/section/_name").show() + Section.window_title = "Add a new Section" + if not Section.is_connected("confirmed",self,"new_section"): + Section.connect("confirmed",self,"new_section") + if Section.is_connected("confirmed",self,"remove_section"): + Section.disconnect("confirmed",self,"remove_section") + Section.popup() + +func _on_removesection_pressed(): + Section.get_node("Container").hide() + Section.window_title = "Remove selected Section" + Section.dialog_text = "Are you sure you want to remove this Section?" + if not Section.is_connected("confirmed",self,"remove_section"): + Section.connect("confirmed",self,"remove_section") + if Section.is_connected("confirmed",self,"new_section"): + Section.disconnect("confirmed",self,"new_section") + Section.popup() + +func _on_addkey_pressed(): + Key.get_node("data").show() + Key.get_node("data/HBoxContainer/name").editable = true + Key.get_node("data/HBoxContainer/name").set_text("") + Key.window_title = "Add a new Key" + Key.dialog_text = "" + if not Key.is_connected("confirmed",self,"new_key"): + Key.connect("confirmed",self,"new_key") + if Key.is_connected("confirmed",self,"edit_key"): + Key.disconnect("confirmed",self,"edit_key") + if Key.is_connected("confirmed",self,"remove_key"): + Key.disconnect("confirmed",self,"remove_key") + Key.popup() + +func _on_removekey_pressed(): + Key.get_node("data").hide() + Key.window_title = "Delete selected Key" + Key.dialog_text = "Are you sure you want to remove the selected Key?" + if not Key.is_connected("confirmed",self,"remove_key"): + Key.connect("confirmed",self,"remove_key") + if Key.is_connected("confirmed",self,"edit_key"): + Key.disconnect("confirmed",self,"edit_key") + if Key.is_connected("confirmed",self,"new_key"): + Key.disconnect("confirmed",self,"new_key") + Key.popup() + +func _on_editkey_pressed(): + Key.get_node("data").show() + Key.get_node("data/HBoxContainer/name").editable = false + Key.get_node("data/HBoxContainer/name").set_text(str(selected_key.get_text(0))) + Key.get_node("data/HBoxContainer2/value").set_text(str(selected_key.get_text(1))) + Key.window_title = "Edit selected Key" + Key.dialog_text = "" + if not Key.is_connected("confirmed",self,"edit_key"): + Key.connect("confirmed",self,"edit_key") + if Key.is_connected("confirmed",self,"remove_key"): + Key.disconnect("confirmed",self,"remove_key") + if Key.is_connected("confirmed",self,"new_key"): + Key.disconnect("confirmed",self,"new_key") + Key.popup() + +func clean_editor(): + Keys.clear() + Sections.clear() + selected_section = -1 + BtnAddKey.disabled = true + if current_file_path == "": + BtnAddSection.disabled = true + else: + BtnAddSection.disabled = false + BtnEditKey.disabled = true + BtnRemoveKey.disabled = true + BtnRemoveSection.disabled = true + + create_root() + +func open_file(filemap : Array): + clean_editor() + for section in filemap: + load_sections(section[0],section[1]) + +func new_section(): + var file = ConfigFile.new() + file.load(current_file_path) + + var section_name = str(Section.get_node("Container/section/_name").get_text()) + var key_name = str(Section.get_node("Container/key/_name").get_text()) + var key_value = Section.get_node("Container/value/_value").get_text() + + if section_name and key_name and key_value: + file.set_value(section_name,key_name,key_value) + file.save(current_file_path) + + load_sections(section_name,[[key_name,key_value]]) + + emit_signal("update_file") + else: + print("Section <",section_name,"> with Key name: <",key_name,"> and Key value: <",key_value,"> not valid.") + +func remove_section(): + var file = ConfigFile.new() + file.load(current_file_path) + var current_section = Sections.get_item_text(selected_section) + file.erase_section(current_section) + Sections.remove_item(selected_section) + file.save(current_file_path) + + emit_signal("update_file") + +func new_key(): + var key_name = str(Key.get_node("data/HBoxContainer/name").get_text()) + var key_value = Key.get_node("data/HBoxContainer2/value").get_text() + if key_name and key_value: + + var file = ConfigFile.new() + file.load(current_file_path) + + var current_section = Sections.get_item_text(selected_section) + + file.set_value(current_section,key_name,key_value) + file.save(current_file_path) + + load_keys_selected_section([[key_name,key_value]]) + + file.save(current_file_path) + + emit_signal("update_file") + else: + print("Key name: <",key_name,"> with Key value: <",key_value,"> not valid.") + +func remove_key(): + var section = Sections.get_item_text(selected_section) + var sectionmetadata = Sections.get_item_metadata(selected_section) + + for meta in sectionmetadata: + if meta.has(selected_key.get_text(0)): + sectionmetadata.erase(meta) + + Sections.set_item_metadata(selected_section,sectionmetadata) + + if Sections.get_item_metadata(selected_section) == []: + Sections.remove_item(selected_section) + + var file = ConfigFile.new() + file.load(current_file_path) + file.set_value(section,selected_key.get_text(0),null) + file.save(current_file_path) + + Keys.clear() + create_root() + load_keys_selected_section(sectionmetadata) + + emit_signal("update_file") + +func edit_key(): + remove_key() + new_key() + +# load a section with custom fields @section_name = name of section ; @section_metadata = keys of this section with keys' properties +func load_sections(section_name : String, section_metadata : Array): + Sections.add_item(section_name,IconLoader.load_icon_from_name("section"),true) + Sections.set_item_metadata(Sections.get_item_count()-1,section_metadata) + +# load a key of a selected section to fill the "keys" list +func load_keys_selected_section(metadata : Array): + for key in metadata: + var key_item = Keys.create_item(root) + key_item.set_text(0,key[0]) + key_item.set_text(1,key[1]) + +func _on_section_selected(index : int): + Keys.clear() + create_root() + BtnRemoveSection.disabled = false + BtnAddSection.disabled = false + BtnAddKey.disabled = false + BtnRemoveKey.disabled = true + BtnEditKey.disabled = true + + selected_section = index + if Sections.get_item_metadata(index): + load_keys_selected_section(Sections.get_item_metadata(index)) + +func _on_key_selected(): + selected_key = Keys.get_selected() + BtnRemoveKey.disabled = false + BtnEditKey.disabled = false + +func _on_nosection_selected(): + BtnRemoveKey.disabled = true + BtnAddKey.disabled = true + BtnEditKey.disabled = true + BtnRemoveSection.disabled = true + Keys.clear() + selected_section = -1 + +func _on_nokey_selected(): + BtnRemoveKey.disabled = true + BtnEditKey.disabled = true + +func create_root(): + root = Keys.create_item() + root.set_text(0,"KEY_NAME") + root.set_text(1,"KEY_VALUE") + +func _on_visibility_changed(): + if visible: + pass diff --git a/scripts/LastOpenedFiles.gd b/scripts/LastOpenedFiles.gd new file mode 100644 index 0000000..e47f517 --- /dev/null +++ b/scripts/LastOpenedFiles.gd @@ -0,0 +1,42 @@ +tool +extends Node + +const lastopenedfile_path : String = "res://addons/file-editor/lastopenedfiles.lastcfg" + +func _ready(): + pass + +func store_opened_files(filecontainer : Control): + var file = ConfigFile.new() + file.load(lastopenedfile_path) + for child in range(0,filecontainer.get_item_count()): + var filepath = filecontainer.get_item_metadata(child)[0].current_path + file.set_value("Opened",filepath.get_file(),filepath) + + file.save(lastopenedfile_path) + +func remove_opened_file(index : int , filecontainer : Control): + var file = ConfigFile.new() + file.load(lastopenedfile_path) + var filepath = filecontainer.get_item_metadata(index)[0].current_path + file.set_value("Opened",filepath.get_file(),null) + file.save(lastopenedfile_path) + +func load_opened_files() -> Array: + var file = ConfigFile.new() + file.load(lastopenedfile_path) + var keys = [] + # Load opened files + if file.has_section("Opened"): + var openedfiles = file.get_section_keys("Opened") + for openedfile in openedfiles: + # Load each single file which was opened + # creating and returning an Array with this format [1:file name, 2:file path, 3:file font] + keys.append([openedfile, file.get_value("Opened",openedfile), file.get_value("Fonts",openedfile) if file.has_section_key("Fonts",openedfile) else "null"]) + return keys + +func store_editor_fonts(file_name : String, font_path : String): + var file = ConfigFile.new() + file.load(lastopenedfile_path) + file.set_value("Fonts",file_name,font_path) + file.save(lastopenedfile_path) diff --git a/scripts/Preview.gd b/scripts/Preview.gd new file mode 100644 index 0000000..93bbcd4 --- /dev/null +++ b/scripts/Preview.gd @@ -0,0 +1,160 @@ +tool +extends WindowDialog + +var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() +var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() + +onready var TextPreview = $Container/TextPreview +onready var TablePreview = $Container/TablePreview + +signal image_downloaded() +signal image_loaded() + +var imgBuffer : Image + +func _ready(): + TextPreview.hide() + TablePreview.hide() + +func print_preview(content : String): + TextPreview.append_bbcode(content) + TextPreview.show() + +func print_bb(content : String): + TextPreview.append_bbcode(content) + TextPreview.show() + +func print_markdown(content : String): + var result = "" + var bolded = [] + var italics = [] + var striked = [] + var coded = [] + var linknames = [] + var images = [] + var links = [] + var lists = [] + var underlined = [] + + var regex = RegEx.new() + regex.compile('\\*\\*(?.*)\\*\\*') + result = regex.search_all(content) + if result: + for res in result: + bolded.append(res.get_string("boldtext")) + + regex.compile('\\_\\_(?.*)\\_\\_') + result = regex.search_all(content) + if result: + for res in result: + underlined.append(res.get_string("underlinetext")) + + regex.compile("\\*(?.*)\\*") + result = regex.search_all(content) + if result: + for res in result: + italics.append(res.get_string("italictext")) + + regex.compile("~~(?.*)~~") + result = regex.search_all(content) + if result: + for res in result: + striked.append(res.get_string("strikedtext")) + + regex.compile("`(?.*)`") + result = regex.search_all(content) + if result: + for res in result: + coded.append(res.get_string("coded")) + + regex.compile("[+-*](?\\s.*)") + result = regex.search_all(content) + if result: + for res in result: + lists.append(res.get_string("element")) + + regex.compile("(?!\\[.*?\\))") + result = regex.search_all(content) + if result: + for res in result: + images.append(res.get_string("img")) + + regex.compile("\\[(?.*?)\\]|\\((?[h\\.]\\S*?)\\)") + result = regex.search_all(content) + if result: + for res in result: + if res.get_string("link")!="": + links.append(res.get_string("link")) + if res.get_string("linkname")!="": + linknames.append(res.get_string("linkname")) + + for bold in bolded: + content = content.replace("**"+bold+"**","[b]"+bold+"[/b]") + for italic in italics: + content = content.replace("*"+italic+"*","[i]"+italic+"[/i]") + for strik in striked: + content = content.replace("~~"+strik+"~~","[s]"+strik+"[/s]") + for underline in underlined: + content = content.replace("__"+underline+"__","[u]"+underline+"[/u]") + for code in coded: + content = content.replace("`"+code+"`","[code]"+code+"[/code]") + for image in images: + var substr = image.split("(") + var imglink = substr[1].rstrip(")") + content = content.replace(image,"[img]"+imglink+"[/img]") + for i in links.size(): + content = content.replace("["+linknames[i]+"]("+links[i]+")","[url="+links[i]+"]"+linknames[i]+"[/url]") + for element in lists: + if content.find("- "+element): + content = content.replace("-"+element,"[indent]-"+element+"[/indent]") + if content.find("+ "+element): + content = content.replace("+"+element,"[indent]-"+element+"[/indent]") + if content.find("* "+element): + content = content.replace("+"+element,"[indent]-"+element+"[/indent]") + + TextPreview.append_bbcode(content) + TextPreview.show() + +func print_html(content : String): + content = content.replace("","[i]") + content = content.replace("","[/i]") + content = content.replace("","[b]") + content = content.replace("","[/b]") + content = content.replace("","[u]") + content = content.replace("","[/u]") + content = content.replace("","[u]") + content = content.replace("","[/u]") + content = content.replace("","[s]") + content = content.replace("","[/s]") + content = content.replace('',"]") + content = content.replace("","[/url]") + content = content.replace('',"[/img]") + content = content.replace('"/>',"[/img]") + content = content.replace("
","[code]")
+	content = content.replace("
","[/code]") + content = content.replace("
","[center]") + content = content.replace("
","[/center]") + content = content.replace("","[right]") + content = content.replace("","[/right]") + + TextPreview.append_bbcode(content) + TextPreview.show() + +func print_csv(rows : Array): + TablePreview.columns = rows[0].size() + for item in rows: + for string in item: + var label = Label.new() + label.text = str(string) + label.set_h_size_flags(SIZE_EXPAND) + label.set_align(1) + label.set_valign(1) + TablePreview.add_child(label) + + + TablePreview.show() + +func _on_Preview_popup_hide(): + queue_free() diff --git a/scripts/VanillaEditor.gd b/scripts/VanillaEditor.gd new file mode 100644 index 0000000..4068a3e --- /dev/null +++ b/scripts/VanillaEditor.gd @@ -0,0 +1,220 @@ +tool +extends VBoxContainer + +var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() +var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() + +onready var ReadOnly = $FileInfo/Readonly + +onready var TextEditor = $TextEditor + +onready var LastModified = $FileInfo/lastmodified + +onready var FileList = get_parent().get_parent().get_parent().get_parent().get_node("FileList") + +onready var ClosingFile = get_parent().get_parent().get_parent().get_parent().get_node("ConfirmationDialog") + +onready var LastModifiedIcon = $FileInfo/lastmodified_icon + +onready var SearchBox = $SearchBox +onready var ReplaceBox = $ReplaceBox + +onready var c_counter = $FileInfo/c_counter + +var current_path = "" +var current_filename = "" +var Preview = load("res://addons/file-editor/scenes/Preview.tscn") + + +var search_flag = 0 + +signal text_changed() + +func _ready(): + ClosingFile.connect("confirmed",self,"queue_free") + + ReadOnly.connect("toggled",self,"_on_Readonly_toggled") + + ReadOnly.set("custom_icons/checked",IconLoader.load_icon_from_name("read")) + ReadOnly.set("custom_icons/unchecked",IconLoader.load_icon_from_name("edit")) + + add_to_group("vanilla_editor") + +func set_font(font_path : String) -> void: + var dynamic_font : DynamicFont = DynamicFont.new() + var dynamic_font_data : DynamicFontData = DynamicFontData.new() + dynamic_font_data.set_font_path(font_path) + dynamic_font.set_font_data(dynamic_font_data) + TextEditor.set("custom_fonts/font",dynamic_font) + +func set_wrap_enabled(enabled:bool): + TextEditor.set_wrap_enabled(enabled) + TextEditor.update() + +func draw_minimap(value:bool): + TextEditor.draw_minimap(value) + TextEditor.update() + +func color_region(filextension : String): # -----------------------------> dal momento che voglio creare un editor per ogni file, renderĂ² questa funzione singola in base all'estensione del file + match(filextension): + "bbs": + TextEditor.add_color_region("[b]","[/b]",Color8(153,153,255,255),false) + TextEditor.add_color_region("[i]","[/i]",Color8(153,255,153,255),false) + TextEditor.add_color_region("[s]","[/s]",Color8(255,153,153,255),false) + TextEditor.add_color_region("[u]","[/u]",Color8(255,255,102,255),false) + TextEditor.add_color_region("[url","[/url]",Color8(153,204,255,255),false) + TextEditor.add_color_region("[code]","[/code]",Color8(192,192,192,255),false) + TextEditor.add_color_region("[img]","[/img]",Color8(255,204,153,255),false) + TextEditor.add_color_region("[center]","[/center]",Color8(175,238,238,255),false) + TextEditor.add_color_region("[right]","[/right]",Color8(135,206,235,255),false) + "html": + TextEditor.add_color_region("","",Color8(153,153,255,255),false) + TextEditor.add_color_region("","",Color8(153,255,153,255),false) + TextEditor.add_color_region("","",Color8(255,153,153,255),false) + TextEditor.add_color_region("","",Color8(255,255,102,255),false) + TextEditor.add_color_region("",Color8(153,204,255,255),false) + TextEditor.add_color_region("",Color8(255,204,153,255),true) + TextEditor.add_color_region("
","
",Color8(192,192,192,255),false) + TextEditor.add_color_region("
","
",Color8(175,238,238,255),false) + TextEditor.add_color_region("","",Color8(135,206,235,255),false) + "md": + TextEditor.add_color_region("***","***",Color8(126,186,181,255),false) + TextEditor.add_color_region("**","**",Color8(153,153,255,255),false) + TextEditor.add_color_region("*","*",Color8(153,255,153,255),false) + TextEditor.add_color_region("+ ","",Color8(255,178,102,255),false) + TextEditor.add_color_region("- ","",Color8(255,178,102,255),false) + TextEditor.add_color_region("~~","~~",Color8(255,153,153,255),false) + TextEditor.add_color_region("__","__",Color8(255,255,102,255),false) + TextEditor.add_color_region("[",")",Color8(153,204,255,255),false) + TextEditor.add_color_region("`","`",Color8(192,192,192,255),false) + TextEditor.add_color_region('"*.','"',Color8(255,255,255,255),true) + TextEditor.add_color_region("# ","",Color8(105,105,105,255),true) + TextEditor.add_color_region("## ","",Color8(128,128,128,255),true) + TextEditor.add_color_region("### ","",Color8(169,169,169,255),true) + TextEditor.add_color_region("#### ","",Color8(192,192,192,255),true) + TextEditor.add_color_region("##### ","",Color8(211,211,211,255),true) + TextEditor.add_color_region("###### ","",Color8(255,255,255,255),true) + TextEditor.add_color_region("> ","",Color8(172,138,79,255),true) + "cfg": + TextEditor.add_color_region("[","]",Color8(153,204,255,255),false) + TextEditor.add_color_region('"','"',Color8(255,255,102,255),false) + TextEditor.add_color_region(';','',Color8(128,128,128,255),true) + "ini": + TextEditor.add_color_region("[","]",Color8(153,204,255,255),false) + TextEditor.add_color_region('"','"',Color8(255,255,102,255),false) + TextEditor.add_color_region(';','',Color8(128,128,128,255),true) + _: + pass + +func clean_editor(): + TextEditor.set_text("") + LastModifiedIcon.texture = IconLoader.load_icon_from_name("save") + LastModified.set_text("") + FileList.invalidate() + current_filename = "" + current_path = "" + +func new_file_open(file_content : String, last_modified : Dictionary, current_file_path : String): + current_path = current_file_path + current_filename = current_file_path.get_file() + color_region(current_filename.get_extension()) + TextEditor.set_text(file_content) + update_lastmodified(last_modified,"save") + FileList.invalidate() + count_characters() + +func update_lastmodified(last_modified : Dictionary, icon : String): + LastModified.set_text(str(last_modified.hour)+":"+str(last_modified.minute)+" "+str(last_modified.day)+"/"+str(last_modified.month)+"/"+str(last_modified.year)) + LastModifiedIcon.texture = IconLoader.load_icon_from_name(icon) + +func new_file_create(file_name): + TextEditor.set_text("") + + FileList.invalidate() + +func _on_Readonly_toggled(button_pressed): + if button_pressed: + ReadOnly.set_text("Read Only") + TextEditor.readonly = (true) + else: + ReadOnly.set_text("Can Edit") + TextEditor.readonly = (false) + +func _on_TextEditor_text_changed(): + LastModifiedIcon.texture = IconLoader.load_icon_from_name("saveas") + count_characters() + emit_signal("text_changed") + +func count_characters(): + var counted : int = 0 + for line in TextEditor.get_line_count(): + counted += TextEditor.get_line(line).length() + c_counter.set_text(str(counted)) + +func _on_LineEdit_text_changed(new_text): + var linecount = TextEditor.get_line_count() + if new_text != "": + var found + var find = false + for line in range(0,linecount): + for column in range(0,TextEditor.get_line(line).length()): + found = TextEditor.search( new_text, search_flag, line , column ) + if found.size(): + if found[1] == line: +# if not find: + TextEditor.select(line,found[0],found[1],found[0]+new_text.length()) +# find = true + else: + TextEditor.select(0,0,0,0) + else: + TextEditor.select(0,0,0,0) + +func _on_matchcase_toggled(button_pressed): + if button_pressed: + search_flag = 1 + else: + if $SearchBox/wholewords.is_pressed(): + search_flag = 2 + else: + search_flag = 0 + _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) + +func _on_wholewords_toggled(button_pressed): + if button_pressed: + search_flag = 2 + else: + if $SearchBox/matchcase.is_pressed(): + search_flag = 1 + else: + search_flag = 0 + _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) + +func _on_close_pressed(): + SearchBox.hide() + +func open_searchbox(): + if SearchBox.visible: + SearchBox.hide() + else: + SearchBox.show() + SearchBox.get_node("LineEdit").grab_focus() + +func _on_Button_pressed(): + var linecount = TextEditor.get_line_count()-1 + var old_text = $ReplaceBox/replace.get_text() + var new_text = $ReplaceBox/with.get_text() + var text = TextEditor.get_text() + TextEditor.set_text(text.replace(old_text,new_text)) + +func open_replacebox(): + if ReplaceBox.visible: + ReplaceBox.hide() + else: + ReplaceBox.show() + ReplaceBox.get_node("replace").grab_focus() + +func _on_close2_pressed(): + ReplaceBox.hide() + +func _on_LineEdit_focus_entered(): + _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) diff --git a/scripts/file-editor.gd b/scripts/file-editor.gd new file mode 100644 index 0000000..e347a83 --- /dev/null +++ b/scripts/file-editor.gd @@ -0,0 +1,33 @@ +tool +extends EditorPlugin + +#var doc = preload("../scenes/FileEditor.tscn") + +var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() + +var FileEditor + +func _enter_tree(): + add_autoload_singleton("IconLoader","res://addons/file-editor/scripts/IconLoader.gd") + add_autoload_singleton("LastOpenedFiles","res://addons/file-editor/scripts/LastOpenedFiles.gd") + FileEditor = preload("../scenes/FileEditor.tscn").instance() + get_editor_interface().get_editor_viewport().add_child(FileEditor) + FileEditor.hide() + +func _exit_tree(): +# FileEditor.clean_editor() + remove_autoload_singleton("IconLoader") + remove_autoload_singleton("LastOpenedFiles") + get_editor_interface().get_editor_viewport().remove_child(FileEditor) + +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): + FileEditor.visible = visible From 3785e44ad42a0868c06995915a5cb4ef0fbb4f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:17:18 +0200 Subject: [PATCH 02/21] Delete file-editor.gd --- scripts/file-editor.gd | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 scripts/file-editor.gd diff --git a/scripts/file-editor.gd b/scripts/file-editor.gd deleted file mode 100644 index e347a83..0000000 --- a/scripts/file-editor.gd +++ /dev/null @@ -1,33 +0,0 @@ -tool -extends EditorPlugin - -#var doc = preload("../scenes/FileEditor.tscn") - -var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() - -var FileEditor - -func _enter_tree(): - add_autoload_singleton("IconLoader","res://addons/file-editor/scripts/IconLoader.gd") - add_autoload_singleton("LastOpenedFiles","res://addons/file-editor/scripts/LastOpenedFiles.gd") - FileEditor = preload("../scenes/FileEditor.tscn").instance() - get_editor_interface().get_editor_viewport().add_child(FileEditor) - FileEditor.hide() - -func _exit_tree(): -# FileEditor.clean_editor() - remove_autoload_singleton("IconLoader") - remove_autoload_singleton("LastOpenedFiles") - get_editor_interface().get_editor_viewport().remove_child(FileEditor) - -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): - FileEditor.visible = visible From 3a9cf072fbb80005bde7f563f382b1115ebab334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:17:24 +0200 Subject: [PATCH 03/21] Delete CsvEditor.gd --- scripts/CsvEditor.gd | 217 ------------------------------------------- 1 file changed, 217 deletions(-) delete mode 100644 scripts/CsvEditor.gd diff --git a/scripts/CsvEditor.gd b/scripts/CsvEditor.gd deleted file mode 100644 index 6530df5..0000000 --- a/scripts/CsvEditor.gd +++ /dev/null @@ -1,217 +0,0 @@ -tool -extends Control - -var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() -var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() - -onready var Table = $Editor/TableContainer/ScrollContainer/Table -onready var AlignBTN = $Editor/Buttons/align_bt.get_popup() -onready var EditBTN = $Editor/Buttons/edit_bt.get_popup() -onready var OptionsBTN = $Editor/Buttons/options_btn.get_popup() -onready var FileInfo = $Editor/FileInfo -onready var ReadOnly = $Editor/FileInfo/Readonly - -onready var Horizontal = $Editor/Horizontal -onready var Vertical = $Editor/TableContainer/Vertical - -onready var ChangeDelimiterDialog = $ChangeDelimiterDialog - -var current_file_path : String = "" - -var rows : int -var columns : int -var csv_delimiter : String -var filepath : String - -signal update_file() - -func _ready(): - add_to_group("csv_editor") - connect_signals() - - load_icons() - -func connect_signals(): - AlignBTN.connect("id_pressed",self,"on_align_pressed") - EditBTN.connect("id_pressed",self,"on_edit_pressed") - OptionsBTN.connect("id_pressed",self,"on_options_pressed") - ReadOnly.connect("toggled",self,"_on_Readonly_toggled") - ChangeDelimiterDialog.connect("confirmed",self,"on_changedelimiter_confirmed") - - connect("visibility_changed",self,"_on_visibility_changed") - -func load_icons(): - $Editor/Buttons/align_bt.set_button_icon(IconLoader.load_icon_from_name("align")) - $Editor/Buttons/edit_bt.set_button_icon(IconLoader.load_icon_from_name("edit_")) - - AlignBTN.set_item_icon(0,IconLoader.load_icon_from_name("text-left")) - AlignBTN.set_item_icon(1,IconLoader.load_icon_from_name("text-center")) - AlignBTN.set_item_icon(2,IconLoader.load_icon_from_name("text-right")) - AlignBTN.set_item_icon(3,IconLoader.load_icon_from_name("text-fill")) - - EditBTN.set_item_icon(0,IconLoader.load_icon_from_name("row")) - EditBTN.set_item_icon(1,IconLoader.load_icon_from_name("column")) - EditBTN.set_item_icon(3,IconLoader.load_icon_from_name("save")) - - ReadOnly.set("custom_icons/checked",IconLoader.load_icon_from_name("read")) - ReadOnly.set("custom_icons/unchecked",IconLoader.load_icon_from_name("edit")) - -func open_csv_file(filepath : String, csv_delimiter : String) -> void: - self.filepath = filepath - var csv = File.new() - csv.open(filepath,File.READ) - var rows : Array = [] - var columns = -1 - while not csv.eof_reached(): - var csv_line = csv.get_csv_line(csv_delimiter) - if Array(csv_line) != [""]: - rows.append(csv_line) - if columns == -1: - columns = rows[0].size() - csv.close() - self.csv_delimiter = csv_delimiter - load_file_in_table(rows,columns) - ReadOnly.pressed = (true) - $Editor/FileInfo/delimiter.set_text(csv_delimiter) - ChangeDelimiterDialog.get_node("VBoxContainer/delim_read").set_text(csv_delimiter) - -func load_file_in_table(rows : Array, columns : int) -> void: - Table.set_columns(columns) - for row in rows: - add_row(row.size(),"",row) - update_dimensions(rows.size()-1,columns) - -func add_row(columns : int, cell_text : String = "", cell2text : PoolStringArray = []): - for i in range(0,columns): - if cell2text.size()<1: - var cell = LineEdit.new() - cell.set_h_size_flags(2) - cell.set_h_size_flags(3) - cell.set_text(cell_text) - Table.add_child(cell) - if ReadOnly.pressed: - cell.set_editable(false) - - else: -# if cell2text[i]!="": - var cell = LineEdit.new() - cell.set_h_size_flags(2) - cell.set_h_size_flags(3) - Table.add_child(cell) - if cell2text: - cell.set_text(cell2text[i]) - else: - cell.set_text(cell_text) - if ReadOnly.pressed: - cell.set_editable(false) - -func add_column(rows : int ,cell_text : String = ""): - for i in range(0,rows): - var cell = LineEdit.new() - cell.set_h_size_flags(2) - cell.set_h_size_flags(3) - Table.add_child(cell) - Table.move_child(cell,(columns)*(i+1)-1) - cell.set_text(cell_text) - if ReadOnly.pressed: - cell.set_editable(false) - -func on_align_pressed(index : int) -> void: - for cell in Table.get_children(): - cell.set_align(index) - -func on_edit_pressed(index :int) -> void: - match index: - 0: - update_dimensions(rows+1,columns) - add_row(columns) - 1: - update_dimensions(rows,columns+1) - add_column(rows) - 3: - save_table() - -func on_options_pressed(index : int) -> void: - match index: - 0: - ChangeDelimiterDialog.popup() - -func table_ruler(rows : int, columns : int): - for child in Vertical.get_children(): - child.queue_free() - for child in Horizontal.get_children(): - child.queue_free() - for i in range(0,rows): - var lb = Label.new() - lb.set_h_size_flags(2) - lb.set_h_size_flags(3) - lb.set_text(str(i+1)) - Vertical.add_child(lb) - var lb = Label.new() - lb.set_text(" ") - Horizontal.add_child(lb) - for j in range(0,columns): - var lb2 = Label.new() - lb2.set_h_size_flags(2) - lb2.set_h_size_flags(3) - lb2.set_align(1) - lb2.set_text(str(j+1)) - Horizontal.add_child(lb2) - -func update_dimensions(rows : int, columns : int): - self.rows = rows - self.columns = columns - table_ruler(rows,columns) - Table.set_columns(columns) - FileInfo.get_node("rows").set_text(str(rows)) - FileInfo.get_node("columns").set_text(str(columns)) - -func _on_Readonly_toggled(button_pressed): - if button_pressed: - ReadOnly.set_text("Read Only") - for cell in Table.get_children(): - cell.set_editable(false) - else: - ReadOnly.set_text("Can Edit") - for cell in Table.get_children(): - cell.set_editable(true) - -func save_table(): - var content : Array = [] - var column = 0 - var row_ : PoolStringArray = [] - for cell in Table.get_children(): - if column < columns: - row_.append(cell.get_text()) - column+=1 - else: - content.append(row_) - row_ = [] - row_.append(cell.get_text()) - column = 1 - content.append(row_) - - var file = File.new() - file.open(filepath, File.WRITE) - for line in content: - file.store_csv_line(line,csv_delimiter) - file.close() - - emit_signal("update_file") - -func on_changedelimiter_confirmed(): - change_delimiter(ChangeDelimiterDialog.get_node("VBoxContainer/delim_read").get_text()) - -func change_delimiter(delim : String): - csv_delimiter = delim - reload() - -func reload(): - for element in Table.get_children(): - element.queue_free() - open_csv_file(current_file_path,csv_delimiter) - FileInfo.show() - -func _on_visibility_changed(): - if visible: - reload() From 5022ddf3a23728cadccb7a4e8f2b2f9cd4dfb9b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:17:32 +0200 Subject: [PATCH 04/21] Delete FileEditor.gd --- scripts/FileEditor.gd | 604 ------------------------------------------ 1 file changed, 604 deletions(-) delete mode 100644 scripts/FileEditor.gd diff --git a/scripts/FileEditor.gd b/scripts/FileEditor.gd deleted file mode 100644 index fede799..0000000 --- a/scripts/FileEditor.gd +++ /dev/null @@ -1,604 +0,0 @@ -tool -extends Control - -onready var FileList = $FileList - -onready var NewFileDialogue = $NewFileDialogue -onready var NewFileDialogue_name = $NewFileDialogue/VBoxContainer/new_filename - -onready var FileBTN = $FileEditorContainer/TobBar/file_btn.get_popup() -onready var PreviewBTN = $FileEditorContainer/TobBar/preview_btn.get_popup() -onready var EditorBTN = $FileEditorContainer/TobBar/editor_btn.get_popup() -onready var SettingsBTN : PopupMenu = $FileEditorContainer/TobBar/SettingsBtn.get_popup() - -onready var Version = $FileEditorContainer/TobBar/version - -onready var SelectFontDialog : FileDialog = $SelectFontDialog - -onready var FileContainer = $FileEditorContainer/SplitContainer/FileContainer -onready var OpenFileList = $FileEditorContainer/SplitContainer/FileContainer/OpenFileList -onready var OpenFileName = $FileEditorContainer/SplitContainer/EditorContainer/HBoxContainer/OpenFileName -onready var SplitEditorContainer = $FileEditorContainer/SplitContainer/EditorContainer -onready var WrapBTN = $FileEditorContainer/SplitContainer/EditorContainer/HBoxContainer/wrap_button -onready var MapBTN = $FileEditorContainer/SplitContainer/EditorContainer/HBoxContainer/map_button - -var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() -var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() - -var Preview = preload("res://addons/file-editor/scenes/Preview.tscn") -var IniEditor = preload("res://addons/file-editor/scenes/IniEditor.tscn") -var VanillaEditor = preload("res://addons/file-editor/scenes/VanillaEditor.tscn") -var CsvEditor = preload("res://addons/file-editor/scenes/CsvEditor.tscn") - -onready var EditorContainer = $FileEditorContainer/SplitContainer - -var DIRECTORY : String = "res://" -var EXCEPTIONS : String = "addons" -var EXTENSIONS : PoolStringArray = [ -"*.txt ; Plain Text File", -"*.rtf ; Rich Text Format File", -"*.log ; Log File", -"*.md ; MD File", -"*.doc ; WordPad Document", -"*.doc ; Microsoft Word Document", -"*.docm ; Word Open XML Macro-Enabled Document", -"*.docx ; Microsoft Word Open XML Document", -"*.bbs ; Bulletin Board System Text", -"*.dat ; Data File", -"*.xml ; XML File", -"*.sql ; SQL database file", -"*.json ; JavaScript Object Notation File", -"*.html ; HyperText Markup Language", -"*.csv ; Comma-separated values", -"*.cfg ; Configuration File", -"*.ini ; Initialization File (same as .cfg Configuration File)", -"*.csv ; Comma-separated values File", -"*.res ; Resource File", -] - -var directories = [] -var files = [] -var current_file_index = -1 -var current_file_path = "" -var save_as = false -var current_editor : Control -var current_ini_editor : Control -var current_csv_editor : Control -var current_font : DynamicFont - - -func _ready(): - - clean_editor() - update_version() - connect_signals() - create_shortcuts() - load_icons() - - var opened_files : Array = LastOpenedFiles.load_opened_files() - for opened_file in opened_files: - open_file(opened_file[1], opened_file[2]) - - FileList.set_filters(EXTENSIONS) - -func create_shortcuts(): - var hotkey - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_S - hotkey.control = true - FileBTN.set_item_accelerator(4,hotkey.get_scancode_with_modifiers()) # save file - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_N - hotkey.control = true - FileBTN.set_item_accelerator(0,hotkey.get_scancode_with_modifiers()) # new file - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_O - hotkey.control = true - FileBTN.set_item_accelerator(1,hotkey.get_scancode_with_modifiers()) # open file - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_D - hotkey.control = true - FileBTN.set_item_accelerator(6,hotkey.get_scancode_with_modifiers()) # delete file - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_S - hotkey.control = true - hotkey.alt = true - FileBTN.set_item_accelerator(5,hotkey.get_scancode_with_modifiers()) #save file as - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_C - hotkey.control = true - hotkey.alt = true - FileBTN.set_item_accelerator(2,hotkey.get_scancode_with_modifiers()) # close file - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_F - hotkey.control = true - FileBTN.set_item_accelerator(8,hotkey.get_scancode_with_modifiers()) # search - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_R - hotkey.control = true - FileBTN.set_item_accelerator(9,hotkey.get_scancode_with_modifiers()) # replace - - # vanilla editor ----------------------- - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_1 - hotkey.control = true - EditorBTN.set_item_accelerator(0,hotkey.get_scancode_with_modifiers()) # vanilla editor - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_2 - hotkey.control = true - EditorBTN.set_item_accelerator(1,hotkey.get_scancode_with_modifiers()) # csv editor - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_3 - hotkey.control = true - EditorBTN.set_item_accelerator(2,hotkey.get_scancode_with_modifiers()) # inieditor editor - -func load_icons(): - $FileEditorContainer/TobBar/file_btn.icon = IconLoader.load_icon_from_name("file") - $FileEditorContainer/TobBar/preview_btn.icon = IconLoader.load_icon_from_name("read") - $FileEditorContainer/TobBar/editor_btn.icon = IconLoader.load_icon_from_name("edit_") - $FileEditorContainer/TobBar/SettingsBtn.icon = IconLoader.load_icon_from_name("settings") - -func connect_signals(): - FileList.connect("confirmed",self,"update_list") - FileBTN.connect("id_pressed",self,"_on_filebtn_pressed") - PreviewBTN.connect("id_pressed",self,"_on_previewbtn_pressed") - EditorBTN.connect("id_pressed",self,"_on_editorbtn_pressed") - SettingsBTN.connect("id_pressed",self,"_on_settingsbtn_pressed") - - OpenFileList.connect("item_selected",self,"_on_fileitem_pressed") - WrapBTN.connect("item_selected",self,"on_wrap_button") - MapBTN.connect("item_selected",self,"on_minimap_button") - - SelectFontDialog.connect("file_selected",self,"_on_font_selected") - -func update_version(): - var plugin_version = "" - var config = ConfigFile.new() - var err = config.load("res://addons/file-editor/plugin.cfg") - if err == OK: - plugin_version = config.get_value("plugin","version") - Version.set_text("v"+plugin_version) - print(plugin_version) - -func create_selected_file(): - update_list() - FileList.mode = FileDialog.MODE_SAVE_FILE - FileList.set_title("Create a new File") - if FileList.is_connected("file_selected",self,"delete_file"): - FileList.disconnect("file_selected",self,"delete_file") - if FileList.is_connected("file_selected",self,"open_file"): - FileList.disconnect("file_selected",self,"open_file") - if not FileList.is_connected("file_selected",self,"create_new_file"): - FileList.connect("file_selected",self,"create_new_file") - open_filelist() - -func open_selected_file(): - update_list() - FileList.mode = FileDialog.MODE_OPEN_FILE - FileList.set_title("Select a File you want to edit") - if FileList.is_connected("file_selected",self,"delete_file"): - FileList.disconnect("file_selected",self,"delete_file") - if FileList.is_connected("file_selected",self,"create_new_file"): - FileList.disconnect("file_selected",self,"create_new_file") - if not FileList.is_connected("file_selected",self,"open_file"): - FileList.connect("file_selected",self,"open_file") - open_filelist() - -func delete_selected_file(): - update_list() - FileList.mode = FileDialog.MODE_OPEN_FILES - FileList.set_title("Select one or more Files you want to delete") - if FileList.is_connected("file_selected",self,"open_file"): - FileList.disconnect("file_selected",self,"open_file") - if FileList.is_connected("file_selected",self,"create_new_file"): - FileList.disconnect("file_selected",self,"create_new_file") - if not FileList.is_connected("files_selected",self,"delete_file"): - FileList.connect("files_selected",self,"delete_file") - open_filelist() - -func save_current_file_as(): - update_list() - FileList.mode = FileDialog.MODE_SAVE_FILE - FileList.set_title("Save this File as...") - if FileList.is_connected("file_selected",self,"delete_file"): - FileList.disconnect("file_selected",self,"delete_file") - if FileList.is_connected("file_selected",self,"open_file"): - FileList.disconnect("file_selected",self,"open_file") - if not FileList.is_connected("file_selected",self,"create_new_file"): - FileList.connect("file_selected",self,"create_new_file") - open_filelist() - -func _on_filebtn_pressed(index : int): - match index: - 0: - create_selected_file() - 1: - open_selected_file() - 2: - if current_file_index!=-1 and current_file_path != "": - close_file(current_file_index) - - 3: - if current_file_index!=-1 and current_file_path != "": - save_as = false - if current_csv_editor and current_csv_editor.visible: - current_csv_editor.save_table() - save_file(current_file_path) - 4: - if current_file_index!=-1 and current_file_path != "": - save_as = true - save_file(current_file_path) - save_current_file_as() - 5: - delete_selected_file() - 6: - current_editor.open_searchbox() - 7: - current_editor.open_replacebox() - -func _on_previewbtn_pressed(id : int): - if id == 0: - bbcode_preview() - elif id == 1: - markdown_preview() - elif id == 2: - html_preview() - elif id == 3: - csv_preview() - elif id == 4: - xml_preview() - elif id == 5: - json_preview() - -func _on_editorbtn_pressed(index : int): - match index: - 0: - if not current_editor.visible: - current_editor.show() - if current_csv_editor: - current_csv_editor.hide() - if current_ini_editor: - current_ini_editor.hide() - 1: - if current_csv_editor and not current_csv_editor.visible: - if current_ini_editor: - current_ini_editor.hide() - current_editor.hide() - current_csv_editor = open_in_csveditor(current_file_path) - current_csv_editor.show() - 2: - if current_ini_editor and not current_ini_editor.visible: - current_editor.hide() - if current_csv_editor: - current_csv_editor.hide() - current_ini_editor = open_in_inieditor(current_file_path) - current_ini_editor.show() - -func _on_settingsbtn_pressed(index : int): - match index: - 0: - SelectFontDialog.popup() - -func _on_font_selected(font_path : String): - current_editor.set_font(font_path) - LastOpenedFiles.store_editor_fonts(current_file_path.get_file(), font_path) -# Enable this part of code to apply the new font to all Vanilla Editors opened -# for file in [0,OpenFileList.get_child_count()]: -# OpenFileList.get_item_metadata(file)[0].set_font(dynamic_font) -# current_font = dynamic_font - -func _on_fileitem_pressed(index : int): - current_file_index = index - var selected_item_metadata = OpenFileList.get_item_metadata(current_file_index) - var extension = selected_item_metadata[0].current_path.get_file().get_extension() - - current_file_path = selected_item_metadata[0].current_path - if current_editor.visible: - current_editor.hide() - current_editor = selected_item_metadata[0] - current_editor.show() - OpenFileName.set_text(current_editor.current_path) - current_csv_editor = selected_item_metadata[2] - current_ini_editor = selected_item_metadata[1] - if WrapBTN.get_selected_id() == 1: - current_editor.set_wrap_enabled(true) - else: - current_editor.set_wrap_enabled(false) - if MapBTN.get_selected_id() == 1: - current_editor.draw_minimap(true) - else: - current_editor.draw_minimap(false) - elif current_csv_editor and current_csv_editor.visible: - if extension == "csv": - current_csv_editor.hide() - current_csv_editor = selected_item_metadata[2] - current_csv_editor.show() - OpenFileName.set_text(current_csv_editor.current_file_path) - current_editor = selected_item_metadata[0] - current_ini_editor = selected_item_metadata[1] - else: - if current_csv_editor: - current_csv_editor.hide() - current_csv_editor = selected_item_metadata[2] - if current_ini_editor: - current_ini_editor.hide() - current_ini_editor = selected_item_metadata[1] - current_editor.hide() - current_editor = selected_item_metadata[0] - current_editor.show() - OpenFileName.set_text(current_editor.current_path) - elif current_ini_editor and current_ini_editor.visible: - if extension == "cfg" or extension == "ini": - current_ini_editor.hide() - current_ini_editor = selected_item_metadata[1] - current_ini_editor.show() - OpenFileName.set_text(current_ini_editor.current_file_path) - else: - if current_ini_editor: - current_ini_editor.hide() - current_ini_editor = selected_item_metadata[1] - if current_csv_editor: - current_csv_editor.hide() - current_csv_editor = selected_item_metadata[2] - current_editor.hide() - current_editor = selected_item_metadata[0] - current_editor.show() - OpenFileName.set_text(current_editor.current_path) - -func open_file(path : String, font : String = "null"): - if current_file_path != path: - current_file_path = path - - var vanilla_editor = open_in_vanillaeditor(path) - if font != "null": - vanilla_editor.set_font(font) - var ini_editor = open_in_inieditor(path) - var csv_editor = open_in_csveditor(path) - - generate_file_item(path,vanilla_editor,ini_editor,csv_editor) - - LastOpenedFiles.store_opened_files(OpenFileList) - current_editor.show() - -func generate_file_item(path : String , veditor : Control , inieditor : Control, csveditor : Control): - OpenFileName.set_text(path) - OpenFileList.add_item(path.get_file(),IconLoader.load_icon_from_name("file"),true) - current_file_index = OpenFileList.get_item_count()-1 - OpenFileList.set_item_metadata(current_file_index,[veditor,inieditor,csveditor]) - OpenFileList.select(OpenFileList.get_item_count()-1) - -func open_in_vanillaeditor(path : String) -> Control: - var editor = VanillaEditor.instance() - SplitEditorContainer.add_child(editor,true) - - if current_editor and current_editor!=editor: - editor.show() - current_editor.hide() - if current_csv_editor and current_csv_editor.visible: - current_csv_editor.hide() - if current_ini_editor and current_ini_editor.visible: - current_ini_editor.hide() - - current_editor = editor - - - editor.connect("text_changed",self,"_on_vanillaeditor_text_changed") - - var current_file : File = File.new() - current_file.open(path,File.READ) - var current_content = "" - current_content = current_file.get_as_text() - - var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(path)) - - current_file.close() - - editor.new_file_open(current_content,last_modified,current_file_path) - - update_list() - - if WrapBTN.get_selected_id() == 1: - current_editor.set_wrap_enabled(true) - - - return editor - -func open_in_inieditor(path : String) -> Control: - var extension = path.get_file().get_extension() - if extension == "ini" or extension == "cfg": - var inieditor = IniEditor.instance() - SplitEditorContainer.add_child(inieditor) - inieditor.hide() - inieditor.connect("update_file",self,"_on_update_file") - current_ini_editor = inieditor - inieditor.current_file_path = path - var current_file : ConfigFile = ConfigFile.new() - var err = current_file.load(path) - if err == OK: - var sections = current_file.get_sections() - var filemap = [] - for section in sections: - var keys = [] - var section_keys = current_file.get_section_keys(section) - for key in section_keys: - keys.append([key,current_file.get_value(section,key)]) - - filemap.append([section,keys]) - - inieditor.open_file(filemap) - return inieditor - else: - current_ini_editor = null - return null - -func open_in_csveditor(path : String) -> Control: - var extension = path.get_file().get_extension() - if extension == "csv": - var csveditor = CsvEditor.instance() - SplitEditorContainer.add_child(csveditor) - csveditor.hide() - csveditor.connect("update_file",self,"_on_update_file") - current_csv_editor = csveditor - csveditor.current_file_path = path - csveditor.open_csv_file(path,"|") - return csveditor - else: - current_csv_editor = null - return null - -func close_file(index): - LastOpenedFiles.remove_opened_file(index,OpenFileList) - OpenFileList.remove_item(index) - OpenFileName.clear() - current_editor.queue_free() - - if index>0: - OpenFileList.select(OpenFileList.get_item_count()-1) - _on_fileitem_pressed(OpenFileList.get_item_count()-1) - -func _on_update_file(): -# current_editor.clean_editor() - var current_file : File = File.new() - current_file.open(current_file_path,File.READ) - - var current_content = current_file.get_as_text() - var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(current_file_path)) - - current_file.close() - - current_editor.new_file_open(current_content,last_modified,current_file_path) - -func delete_file(files_selected : PoolStringArray): - var dir = Directory.new() - for file in files_selected: - dir.remove(file) - - update_list() - -func open_newfiledialogue(): - NewFileDialogue.popup() - NewFileDialogue.set_position(OS.get_screen_size()/2 - NewFileDialogue.get_size()/2) - -func open_filelist(): - update_list() - FileList.popup() - FileList.set_position(OS.get_screen_size()/2 - FileList.get_size()/2) - -func create_new_file(given_path : String): - var current_file = File.new() - current_file.open(given_path,File.WRITE) - if save_as : - current_file.store_line(current_editor.get_node("TextEditor").get_text()) - current_file.close() - - open_file(given_path) - -func save_file(current_path : String): - var current_file = File.new() - current_file.open(current_path,File.WRITE) - var current_content = "" - var lines = current_editor.get_node("TextEditor").get_line_count() - for line in range(0,lines): - current_content = current_editor.get_node("TextEditor").get_text() - current_file.store_line(current_editor.get_node("TextEditor").get_line(line)) - current_file.close() - - current_file_path = current_path - - var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(current_file_path)) - - current_editor.update_lastmodified(last_modified,"save") - OpenFileList.set_item_metadata(current_file_index,[current_editor,current_ini_editor,current_csv_editor]) - print(OpenFileList.get_item_metadata(current_file_index)) - - if OpenFileList.get_item_text(current_file_index).ends_with("(*)"): - OpenFileList.set_item_text(current_file_index,OpenFileList.get_item_text(current_file_index).rstrip("(*)")) - -# OpenFileList.set_item_metadata(current_file_index,[current_editor,open_in_inieditor(current_file_path),open_in_csveditor(current_file_path)]) - - update_list() - -func clean_editor() -> void : - for inieditor in get_tree().get_nodes_in_group("ini_editor"): - inieditor.queue_free() - for vanillaeditor in get_tree().get_nodes_in_group("vanilla_editor"): - vanillaeditor.queue_free() - OpenFileName.clear() - OpenFileList.clear() - - -func csv_preview(): - var preview = Preview.instance() - get_parent().get_parent().get_parent().add_child(preview) - preview.popup() - preview.window_title += " ("+current_file_path.get_file()+")" - var lines = current_editor.get_node("TextEditor").get_line_count() - var rows = [] - for i in range(0,lines-1): - rows.append(current_editor.get_node("TextEditor").get_line(i).rsplit(",",false)) - preview.print_csv(rows) - -func bbcode_preview(): - var preview = Preview.instance() - get_parent().get_parent().get_parent().add_child(preview) - preview.popup() - preview.window_title += " ("+current_file_path.get_file()+")" - preview.print_bb(current_editor.get_node("TextEditor").get_text()) - -func markdown_preview(): - var preview = Preview.instance() - get_parent().get_parent().get_parent().add_child(preview) - preview.popup() - preview.window_title += " ("+current_file_path.get_file()+")" - preview.print_markdown(current_editor.get_node("TextEditor").get_text()) - -func html_preview(): - var preview = Preview.instance() - get_parent().get_parent().get_parent().add_child(preview) - preview.popup() - preview.window_title += " ("+current_file_path.get_file()+")" - preview.print_html(current_editor.get_node("TextEditor").get_text()) - -func xml_preview(): - pass - -func json_preview(): - pass - - -func _on_vanillaeditor_text_changed(): - if not OpenFileList.get_item_text(current_file_index).ends_with("(*)"): - OpenFileList.set_item_text(current_file_index,OpenFileList.get_item_text(current_file_index)+"(*)") - - -func update_list(): - FileList.invalidate() - -func on_wrap_button(index:int): - match index: - 0: - current_editor.set_wrap_enabled(false) - 1: - current_editor.set_wrap_enabled(true) - -func on_minimap_button(index:int): - match index: - 0: - current_editor.draw_minimap(false) - 1: - current_editor.draw_minimap(true) - -func check_file_preview(file : String): - # check whether the opened file has a corresponding preview session for its extension - pass From 1674456fbc9714b1f5c1d8712e474f2c5dc02531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:17:39 +0200 Subject: [PATCH 05/21] Delete FileEditorButton.gd --- scripts/FileEditorButton.gd | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 scripts/FileEditorButton.gd diff --git a/scripts/FileEditorButton.gd b/scripts/FileEditorButton.gd deleted file mode 100644 index 95b3ac3..0000000 --- a/scripts/FileEditorButton.gd +++ /dev/null @@ -1,19 +0,0 @@ -tool -extends ToolButton - -var fileditor_workspace -var fileditor - -func _ready(): - connect("pressed",self,"show_fileditor") - -func show_fileditor(): - fileditor_workspace.get_children()[0].hide() - fileditor_workspace.get_children()[1].hide() - fileditor_workspace.get_children()[2].hide() - fileditor_workspace.add_child(fileditor) - fileditor.show() - -func load_values(fi, fe): - fileditor_workspace = fi - fileditor = fe From 40a1c7f2ecedf276c5fc651a5894c8e3cd7a8d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:17:45 +0200 Subject: [PATCH 06/21] Delete FileScene.gd --- scripts/FileScene.gd | 198 ------------------------------------------- 1 file changed, 198 deletions(-) delete mode 100644 scripts/FileScene.gd diff --git a/scripts/FileScene.gd b/scripts/FileScene.gd deleted file mode 100644 index 7fbdc1f..0000000 --- a/scripts/FileScene.gd +++ /dev/null @@ -1,198 +0,0 @@ -tool -extends VBoxContainer - -var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() -var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() - -onready var ReadOnly = $FileInfo/Readonly - -onready var TextEditor = $TextEditor - -onready var LastModified = $FileInfo/lastmodified - -onready var FileList = get_parent().get_parent().get_parent().get_node("FileList") - -onready var ClosingFile = get_parent().get_parent().get_parent().get_node("ConfirmationDialog") - -onready var LastModifiedIcon = $FileInfo/lastmodified_icon - -onready var SearchBox = $SearchBox -onready var ReplaceBox = $ReplaceBox - -onready var c_counter = $FileInfo/c_counter - -var current_path = "" -var current_filename = "" -var Preview = load("res://addons/file-editor/scenes/Preview.tscn") - - -var search_flag = 0 - -signal text_changed() - -func _ready(): - ClosingFile.connect("confirmed",self,"queue_free") - - ReadOnly.connect("toggled",self,"_on_Readonly_toggled") - - ReadOnly.set("custom_icons/checked",IconLoader.load_icon_from_name("read")) - ReadOnly.set("custom_icons/unchecked",IconLoader.load_icon_from_name("edit")) - - add_to_group("vanilla_editor") - -func color_region(filextension : String): # -----------------------------> dal momento che voglio creare un editor per ogni file, renderĂ² questa funzione singola in base all'estensione del file - match(filextension): - "bbs": - TextEditor.add_color_region("[b]","[/b]",Color8(153,153,255,255),false) - TextEditor.add_color_region("[i]","[/i]",Color8(153,255,153,255),false) - TextEditor.add_color_region("[s]","[/s]",Color8(255,153,153,255),false) - TextEditor.add_color_region("[u]","[/u]",Color8(255,255,102,255),false) - TextEditor.add_color_region("[url","[/url]",Color8(153,204,255,255),false) - TextEditor.add_color_region("[code]","[/code]",Color8(192,192,192,255),false) - TextEditor.add_color_region("[img]","[/img]",Color8(255,204,153,255),false) - TextEditor.add_color_region("[center]","[/center]",Color8(175,238,238,255),false) - TextEditor.add_color_region("[right]","[/right]",Color8(135,206,235,255),false) - "html": - TextEditor.add_color_region("","",Color8(153,153,255,255),false) - TextEditor.add_color_region("","",Color8(153,255,153,255),false) - TextEditor.add_color_region("","",Color8(255,153,153,255),false) - TextEditor.add_color_region("","",Color8(255,255,102,255),false) - TextEditor.add_color_region("",Color8(153,204,255,255),false) - TextEditor.add_color_region("",Color8(255,204,153,255),true) - TextEditor.add_color_region("
","
",Color8(192,192,192,255),false) - TextEditor.add_color_region("
","
",Color8(175,238,238,255),false) - TextEditor.add_color_region("","",Color8(135,206,235,255),false) - "md": - TextEditor.add_color_region("**","**",Color8(153,153,255,255),false) - TextEditor.add_color_region("*","*",Color8(153,255,153,255),false) - TextEditor.add_color_region("+ ","",Color8(255,178,102,255),false) - TextEditor.add_color_region("- ","",Color8(255,178,102,255),false) - TextEditor.add_color_region("~~","~~",Color8(255,153,153,255),false) - TextEditor.add_color_region("__","__",Color8(255,255,102,255),false) - TextEditor.add_color_region("[",")",Color8(153,204,255,255),false) - TextEditor.add_color_region("`","`",Color8(192,192,192,255),false) - TextEditor.add_color_region('"*.','"',Color8(255,255,255,255),true) - TextEditor.add_color_region("# ","",Color8(105,105,105,255),true) - TextEditor.add_color_region("## ","",Color8(128,128,128,255),true) - TextEditor.add_color_region("### ","",Color8(169,169,169,255),true) - TextEditor.add_color_region("#### ","",Color8(192,192,192,255),true) - TextEditor.add_color_region("##### ","",Color8(211,211,211,255),true) - TextEditor.add_color_region("###### ","",Color8(255,255,255,255),true) - "cfg": - TextEditor.add_color_region("[","]",Color8(153,204,255,255),false) - TextEditor.add_color_region('"','"',Color8(255,255,102,255),false) - _: - pass - -func clean_editor(): - TextEditor.set_text("") - LastModifiedIcon.texture = IconLoader.load_icon_from_name("save") - LastModified.set_text("") - FileList.invalidate() - current_filename = "" - current_path = "" - -func new_file_open(file_content, last_modified , current_file_path): - current_path = current_file_path - current_filename = current_file_path.get_file() - color_region(current_filename.get_extension()) - TextEditor.set_text(file_content) - update_lastmodified(last_modified,"save") - FileList.invalidate() - count_characters() - -func update_lastmodified(last_modified : Dictionary, icon : String): - LastModified.set_text(str(last_modified.hour)+":"+str(last_modified.minute)+" "+str(last_modified.day)+"/"+str(last_modified.month)+"/"+str(last_modified.year)) - LastModifiedIcon.texture = IconLoader.load_icon_from_name(icon) - -func new_file_create(file_name): - TextEditor.set_text("") - - FileList.invalidate() - -func _on_Readonly_toggled(button_pressed): - if button_pressed: - ReadOnly.set_text("Read Only") - TextEditor.readonly = (true) - else: - ReadOnly.set_text("Can Edit") - TextEditor.readonly = (false) - -func _on_TextEditor_text_changed(): - LastModifiedIcon.texture = IconLoader.load_icon_from_name("saveas") - count_characters() - emit_signal("text_changed") - -func count_characters(): - var counted : int = 0 - for line in TextEditor.get_line_count(): - counted += TextEditor.get_line(line).length() - c_counter.set_text(str(counted)) - -func _on_LineEdit_text_changed(new_text): - var linecount = TextEditor.get_line_count() - if new_text != "": - var found - var find = false - for line in range(0,linecount): - for column in range(0,TextEditor.get_line(line).length()): - found = TextEditor.search( new_text, search_flag, line , column ) - if found.size(): - if found[1] == line: -# if not find: - TextEditor.select(line,found[0],found[1],found[0]+new_text.length()) -# find = true - else: - TextEditor.select(0,0,0,0) - else: - TextEditor.select(0,0,0,0) - -func _on_matchcase_toggled(button_pressed): - if button_pressed: - search_flag = 1 - else: - if $SearchBox/wholewords.is_pressed(): - search_flag = 2 - else: - search_flag = 0 - _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) - -func _on_wholewords_toggled(button_pressed): - if button_pressed: - search_flag = 2 - else: - if $SearchBox/matchcase.is_pressed(): - search_flag = 1 - else: - search_flag = 0 - _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) - -func _on_close_pressed(): - SearchBox.hide() - -func open_searchbox(): - if SearchBox.visible: - SearchBox.hide() - else: - SearchBox.show() - SearchBox.get_node("LineEdit").grab_focus() - -func _on_Button_pressed(): - var linecount = TextEditor.get_line_count()-1 - var old_text = $ReplaceBox/replace.get_text() - var new_text = $ReplaceBox/with.get_text() - var text = TextEditor.get_text() - TextEditor.set_text(text.replace(old_text,new_text)) - -func open_replacebox(): - if ReplaceBox.visible: - ReplaceBox.hide() - else: - ReplaceBox.show() - ReplaceBox.get_node("replace").grab_focus() - -func _on_close2_pressed(): - ReplaceBox.hide() - -func _on_LineEdit_focus_entered(): - _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) From faccdcaf5029835214cf6742d2c6a7afdba9ce83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:17:50 +0200 Subject: [PATCH 07/21] Delete IconLoader.gd --- scripts/IconLoader.gd | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 scripts/IconLoader.gd diff --git a/scripts/IconLoader.gd b/scripts/IconLoader.gd deleted file mode 100644 index a832ca2..0000000 --- a/scripts/IconLoader.gd +++ /dev/null @@ -1,20 +0,0 @@ -tool -extends Node - -var imgBuffer - -func _ready(): - pass - -func load_icon_from_name(icon_name : String) -> ImageTexture: - var file = File.new() - var image = Image.new() - var texture = ImageTexture.new() - - file.open("res://addons/file-editor/icons.pngs/"+icon_name+".png.buttonicon", File.READ) - var buffer = file.get_buffer(file.get_len()) - file.close() - - image.load_png_from_buffer(buffer) - texture.create_from_image(image) - return texture From a326ff9de92b5123c65362a49d384b95f9104fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:17:57 +0200 Subject: [PATCH 08/21] Delete IniVisualEditor.gd --- scripts/IniVisualEditor.gd | 284 ------------------------------------- 1 file changed, 284 deletions(-) delete mode 100644 scripts/IniVisualEditor.gd diff --git a/scripts/IniVisualEditor.gd b/scripts/IniVisualEditor.gd deleted file mode 100644 index 3e0d642..0000000 --- a/scripts/IniVisualEditor.gd +++ /dev/null @@ -1,284 +0,0 @@ -tool -extends Control - -var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() -var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() - -onready var Keys = $VBoxContainer/HSplitContainer/VBoxContainer2/keys -onready var Sections = $VBoxContainer/HSplitContainer/VBoxContainer/sections2 - -onready var BtnAddSection = $VBoxContainer/HSplitContainer/VBoxContainer/HBoxContainer2/btn_add_section -onready var BtnRemoveSection = $VBoxContainer/HSplitContainer/VBoxContainer/HBoxContainer2/btn_remove_section - -onready var BtnAddKey = $VBoxContainer/HSplitContainer/VBoxContainer2/HBoxContainer3/btn_add_key -onready var BtnEditKey = $VBoxContainer/HSplitContainer/VBoxContainer2/HBoxContainer3/btn_edit_key -onready var BtnRemoveKey = $VBoxContainer/HSplitContainer/VBoxContainer2/HBoxContainer3/btn_remove_key - -onready var Section = $Section -onready var Key = $Key - -var selected_key -var selected_section : int = -1 -var root : TreeItem - -var current_file_path : String = "" - -signal update_file() - -func _ready(): - create_table_names() - connect_signals() - load_icons() - clean_editor() - - add_to_group("ini_editor") - -# var metadata = [["name","Godot Engine"],["version","1.0.0"],["color","Light Blue"]] -# load_section("Engine", metadata) - -func connect_signals(): - Sections.connect("item_selected",self,"_on_section_selected") - Sections.connect("nothing_selected",self,"_on_nosection_selected") - - BtnAddSection.connect("pressed",self,"_on_addsection_pressed") - BtnRemoveSection.connect("pressed",self,"_on_removesection_pressed") - - Keys.connect("item_selected",self,"_on_key_selected") - Keys.connect("nothing_selected",self,"_on_nokey_selected") - - BtnAddKey.connect("pressed",self,"_on_addkey_pressed") - BtnRemoveKey.connect("pressed",self,"_on_removekey_pressed") - BtnEditKey.connect("pressed",self,"_on_editkey_pressed") - - connect("visibility_changed",self,"_on_visibility_changed") - -func create_table_names(): - create_root() - Keys.hide_root = true - - Keys.set_column_titles_visible(true) - Keys.set_column_title(0,"Name") - Keys.set_column_title(1,"Value") - -func load_icons(): - $VBoxContainer/HSplitContainer/VBoxContainer/HBoxContainer/sections_icon.texture = IconLoader.load_icon_from_name("sections") - $VBoxContainer/HSplitContainer/VBoxContainer2/HBoxContainer2/keys_icon.texture = IconLoader.load_icon_from_name("keys") - BtnAddSection.icon = IconLoader.load_icon_from_name("add") - BtnAddSection.hint_tooltip = "Add a new Section" - BtnRemoveSection.icon = IconLoader.load_icon_from_name("delete") - BtnRemoveSection.hint_tooltip = "Remove selected Section" - - BtnAddKey.icon = IconLoader.load_icon_from_name("add") - BtnAddKey.hint_tooltip = "Add a new Key" - BtnRemoveKey.icon = IconLoader.load_icon_from_name("delete") - BtnRemoveKey.hint_tooltip = "Remove selected Key" - BtnEditKey.icon = IconLoader.load_icon_from_name("edit_") - BtnEditKey.hint_tooltip = "Edit selected Key" - -func _on_addsection_pressed(): - Section.get_node("Container/section/_name").show() - Section.window_title = "Add a new Section" - if not Section.is_connected("confirmed",self,"new_section"): - Section.connect("confirmed",self,"new_section") - if Section.is_connected("confirmed",self,"remove_section"): - Section.disconnect("confirmed",self,"remove_section") - Section.popup() - -func _on_removesection_pressed(): - Section.get_node("Container").hide() - Section.window_title = "Remove selected Section" - Section.dialog_text = "Are you sure you want to remove this Section?" - if not Section.is_connected("confirmed",self,"remove_section"): - Section.connect("confirmed",self,"remove_section") - if Section.is_connected("confirmed",self,"new_section"): - Section.disconnect("confirmed",self,"new_section") - Section.popup() - -func _on_addkey_pressed(): - Key.get_node("data").show() - Key.get_node("data/HBoxContainer/name").editable = true - Key.get_node("data/HBoxContainer/name").set_text("") - Key.window_title = "Add a new Key" - Key.dialog_text = "" - if not Key.is_connected("confirmed",self,"new_key"): - Key.connect("confirmed",self,"new_key") - if Key.is_connected("confirmed",self,"edit_key"): - Key.disconnect("confirmed",self,"edit_key") - if Key.is_connected("confirmed",self,"remove_key"): - Key.disconnect("confirmed",self,"remove_key") - Key.popup() - -func _on_removekey_pressed(): - Key.get_node("data").hide() - Key.window_title = "Delete selected Key" - Key.dialog_text = "Are you sure you want to remove the selected Key?" - if not Key.is_connected("confirmed",self,"remove_key"): - Key.connect("confirmed",self,"remove_key") - if Key.is_connected("confirmed",self,"edit_key"): - Key.disconnect("confirmed",self,"edit_key") - if Key.is_connected("confirmed",self,"new_key"): - Key.disconnect("confirmed",self,"new_key") - Key.popup() - -func _on_editkey_pressed(): - Key.get_node("data").show() - Key.get_node("data/HBoxContainer/name").editable = false - Key.get_node("data/HBoxContainer/name").set_text(str(selected_key.get_text(0))) - Key.get_node("data/HBoxContainer2/value").set_text(str(selected_key.get_text(1))) - Key.window_title = "Edit selected Key" - Key.dialog_text = "" - if not Key.is_connected("confirmed",self,"edit_key"): - Key.connect("confirmed",self,"edit_key") - if Key.is_connected("confirmed",self,"remove_key"): - Key.disconnect("confirmed",self,"remove_key") - if Key.is_connected("confirmed",self,"new_key"): - Key.disconnect("confirmed",self,"new_key") - Key.popup() - -func clean_editor(): - Keys.clear() - Sections.clear() - selected_section = -1 - BtnAddKey.disabled = true - if current_file_path == "": - BtnAddSection.disabled = true - else: - BtnAddSection.disabled = false - BtnEditKey.disabled = true - BtnRemoveKey.disabled = true - BtnRemoveSection.disabled = true - - create_root() - -func open_file(filemap : Array): - clean_editor() - for section in filemap: - load_sections(section[0],section[1]) - -func new_section(): - var file = ConfigFile.new() - file.load(current_file_path) - - var section_name = str(Section.get_node("Container/section/_name").get_text()) - var key_name = str(Section.get_node("Container/key/_name").get_text()) - var key_value = Section.get_node("Container/value/_value").get_text() - - if section_name and key_name and key_value: - file.set_value(section_name,key_name,key_value) - file.save(current_file_path) - - load_sections(section_name,[[key_name,key_value]]) - - emit_signal("update_file") - else: - print("Section <",section_name,"> with Key name: <",key_name,"> and Key value: <",key_value,"> not valid.") - -func remove_section(): - var file = ConfigFile.new() - file.load(current_file_path) - var current_section = Sections.get_item_text(selected_section) - file.erase_section(current_section) - Sections.remove_item(selected_section) - file.save(current_file_path) - - emit_signal("update_file") - -func new_key(): - var key_name = str(Key.get_node("data/HBoxContainer/name").get_text()) - var key_value = Key.get_node("data/HBoxContainer2/value").get_text() - if key_name and key_value: - - var file = ConfigFile.new() - file.load(current_file_path) - - var current_section = Sections.get_item_text(selected_section) - - file.set_value(current_section,key_name,key_value) - file.save(current_file_path) - - load_keys_selected_section([[key_name,key_value]]) - - file.save(current_file_path) - - emit_signal("update_file") - else: - print("Key name: <",key_name,"> with Key value: <",key_value,"> not valid.") - -func remove_key(): - var section = Sections.get_item_text(selected_section) - var sectionmetadata = Sections.get_item_metadata(selected_section) - - for meta in sectionmetadata: - if meta.has(selected_key.get_text(0)): - sectionmetadata.erase(meta) - - Sections.set_item_metadata(selected_section,sectionmetadata) - - if Sections.get_item_metadata(selected_section) == []: - Sections.remove_item(selected_section) - - var file = ConfigFile.new() - file.load(current_file_path) - file.set_value(section,selected_key.get_text(0),null) - file.save(current_file_path) - - Keys.clear() - create_root() - load_keys_selected_section(sectionmetadata) - - emit_signal("update_file") - -func edit_key(): - remove_key() - new_key() - -# load a section with custom fields @section_name = name of section ; @section_metadata = keys of this section with keys' properties -func load_sections(section_name : String, section_metadata : Array): - Sections.add_item(section_name,IconLoader.load_icon_from_name("section"),true) - Sections.set_item_metadata(Sections.get_item_count()-1,section_metadata) - -# load a key of a selected section to fill the "keys" list -func load_keys_selected_section(metadata : Array): - for key in metadata: - var key_item = Keys.create_item(root) - key_item.set_text(0,key[0]) - key_item.set_text(1,key[1]) - -func _on_section_selected(index : int): - Keys.clear() - create_root() - BtnRemoveSection.disabled = false - BtnAddSection.disabled = false - BtnAddKey.disabled = false - BtnRemoveKey.disabled = true - BtnEditKey.disabled = true - - selected_section = index - if Sections.get_item_metadata(index): - load_keys_selected_section(Sections.get_item_metadata(index)) - -func _on_key_selected(): - selected_key = Keys.get_selected() - BtnRemoveKey.disabled = false - BtnEditKey.disabled = false - -func _on_nosection_selected(): - BtnRemoveKey.disabled = true - BtnAddKey.disabled = true - BtnEditKey.disabled = true - BtnRemoveSection.disabled = true - Keys.clear() - selected_section = -1 - -func _on_nokey_selected(): - BtnRemoveKey.disabled = true - BtnEditKey.disabled = true - -func create_root(): - root = Keys.create_item() - root.set_text(0,"KEY_NAME") - root.set_text(1,"KEY_VALUE") - -func _on_visibility_changed(): - if visible: - pass From 07c53928d3158d4c960bf8745e77cd0b948fe27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:18:03 +0200 Subject: [PATCH 09/21] Delete LastOpenedFiles.gd --- scripts/LastOpenedFiles.gd | 42 -------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 scripts/LastOpenedFiles.gd diff --git a/scripts/LastOpenedFiles.gd b/scripts/LastOpenedFiles.gd deleted file mode 100644 index e47f517..0000000 --- a/scripts/LastOpenedFiles.gd +++ /dev/null @@ -1,42 +0,0 @@ -tool -extends Node - -const lastopenedfile_path : String = "res://addons/file-editor/lastopenedfiles.lastcfg" - -func _ready(): - pass - -func store_opened_files(filecontainer : Control): - var file = ConfigFile.new() - file.load(lastopenedfile_path) - for child in range(0,filecontainer.get_item_count()): - var filepath = filecontainer.get_item_metadata(child)[0].current_path - file.set_value("Opened",filepath.get_file(),filepath) - - file.save(lastopenedfile_path) - -func remove_opened_file(index : int , filecontainer : Control): - var file = ConfigFile.new() - file.load(lastopenedfile_path) - var filepath = filecontainer.get_item_metadata(index)[0].current_path - file.set_value("Opened",filepath.get_file(),null) - file.save(lastopenedfile_path) - -func load_opened_files() -> Array: - var file = ConfigFile.new() - file.load(lastopenedfile_path) - var keys = [] - # Load opened files - if file.has_section("Opened"): - var openedfiles = file.get_section_keys("Opened") - for openedfile in openedfiles: - # Load each single file which was opened - # creating and returning an Array with this format [1:file name, 2:file path, 3:file font] - keys.append([openedfile, file.get_value("Opened",openedfile), file.get_value("Fonts",openedfile) if file.has_section_key("Fonts",openedfile) else "null"]) - return keys - -func store_editor_fonts(file_name : String, font_path : String): - var file = ConfigFile.new() - file.load(lastopenedfile_path) - file.set_value("Fonts",file_name,font_path) - file.save(lastopenedfile_path) From d1432dfd4fc71a8be8ecdb6b1ef0860e6dbc8d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:18:10 +0200 Subject: [PATCH 10/21] Delete Preview.gd --- scripts/Preview.gd | 160 --------------------------------------------- 1 file changed, 160 deletions(-) delete mode 100644 scripts/Preview.gd diff --git a/scripts/Preview.gd b/scripts/Preview.gd deleted file mode 100644 index 93bbcd4..0000000 --- a/scripts/Preview.gd +++ /dev/null @@ -1,160 +0,0 @@ -tool -extends WindowDialog - -var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() -var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() - -onready var TextPreview = $Container/TextPreview -onready var TablePreview = $Container/TablePreview - -signal image_downloaded() -signal image_loaded() - -var imgBuffer : Image - -func _ready(): - TextPreview.hide() - TablePreview.hide() - -func print_preview(content : String): - TextPreview.append_bbcode(content) - TextPreview.show() - -func print_bb(content : String): - TextPreview.append_bbcode(content) - TextPreview.show() - -func print_markdown(content : String): - var result = "" - var bolded = [] - var italics = [] - var striked = [] - var coded = [] - var linknames = [] - var images = [] - var links = [] - var lists = [] - var underlined = [] - - var regex = RegEx.new() - regex.compile('\\*\\*(?.*)\\*\\*') - result = regex.search_all(content) - if result: - for res in result: - bolded.append(res.get_string("boldtext")) - - regex.compile('\\_\\_(?.*)\\_\\_') - result = regex.search_all(content) - if result: - for res in result: - underlined.append(res.get_string("underlinetext")) - - regex.compile("\\*(?.*)\\*") - result = regex.search_all(content) - if result: - for res in result: - italics.append(res.get_string("italictext")) - - regex.compile("~~(?.*)~~") - result = regex.search_all(content) - if result: - for res in result: - striked.append(res.get_string("strikedtext")) - - regex.compile("`(?.*)`") - result = regex.search_all(content) - if result: - for res in result: - coded.append(res.get_string("coded")) - - regex.compile("[+-*](?\\s.*)") - result = regex.search_all(content) - if result: - for res in result: - lists.append(res.get_string("element")) - - regex.compile("(?!\\[.*?\\))") - result = regex.search_all(content) - if result: - for res in result: - images.append(res.get_string("img")) - - regex.compile("\\[(?.*?)\\]|\\((?[h\\.]\\S*?)\\)") - result = regex.search_all(content) - if result: - for res in result: - if res.get_string("link")!="": - links.append(res.get_string("link")) - if res.get_string("linkname")!="": - linknames.append(res.get_string("linkname")) - - for bold in bolded: - content = content.replace("**"+bold+"**","[b]"+bold+"[/b]") - for italic in italics: - content = content.replace("*"+italic+"*","[i]"+italic+"[/i]") - for strik in striked: - content = content.replace("~~"+strik+"~~","[s]"+strik+"[/s]") - for underline in underlined: - content = content.replace("__"+underline+"__","[u]"+underline+"[/u]") - for code in coded: - content = content.replace("`"+code+"`","[code]"+code+"[/code]") - for image in images: - var substr = image.split("(") - var imglink = substr[1].rstrip(")") - content = content.replace(image,"[img]"+imglink+"[/img]") - for i in links.size(): - content = content.replace("["+linknames[i]+"]("+links[i]+")","[url="+links[i]+"]"+linknames[i]+"[/url]") - for element in lists: - if content.find("- "+element): - content = content.replace("-"+element,"[indent]-"+element+"[/indent]") - if content.find("+ "+element): - content = content.replace("+"+element,"[indent]-"+element+"[/indent]") - if content.find("* "+element): - content = content.replace("+"+element,"[indent]-"+element+"[/indent]") - - TextPreview.append_bbcode(content) - TextPreview.show() - -func print_html(content : String): - content = content.replace("","[i]") - content = content.replace("","[/i]") - content = content.replace("","[b]") - content = content.replace("","[/b]") - content = content.replace("","[u]") - content = content.replace("","[/u]") - content = content.replace("","[u]") - content = content.replace("","[/u]") - content = content.replace("","[s]") - content = content.replace("","[/s]") - content = content.replace('',"]") - content = content.replace("","[/url]") - content = content.replace('',"[/img]") - content = content.replace('"/>',"[/img]") - content = content.replace("
","[code]")
-	content = content.replace("
","[/code]") - content = content.replace("
","[center]") - content = content.replace("
","[/center]") - content = content.replace("","[right]") - content = content.replace("","[/right]") - - TextPreview.append_bbcode(content) - TextPreview.show() - -func print_csv(rows : Array): - TablePreview.columns = rows[0].size() - for item in rows: - for string in item: - var label = Label.new() - label.text = str(string) - label.set_h_size_flags(SIZE_EXPAND) - label.set_align(1) - label.set_valign(1) - TablePreview.add_child(label) - - - TablePreview.show() - -func _on_Preview_popup_hide(): - queue_free() From a636be41158ab0b8d14a51a3184377f04dca3ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:18:16 +0200 Subject: [PATCH 11/21] Delete VanillaEditor.gd --- scripts/VanillaEditor.gd | 220 --------------------------------------- 1 file changed, 220 deletions(-) delete mode 100644 scripts/VanillaEditor.gd diff --git a/scripts/VanillaEditor.gd b/scripts/VanillaEditor.gd deleted file mode 100644 index 4068a3e..0000000 --- a/scripts/VanillaEditor.gd +++ /dev/null @@ -1,220 +0,0 @@ -tool -extends VBoxContainer - -var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() -var LastOpenedFiles = preload("res://addons/file-editor/scripts/LastOpenedFiles.gd").new() - -onready var ReadOnly = $FileInfo/Readonly - -onready var TextEditor = $TextEditor - -onready var LastModified = $FileInfo/lastmodified - -onready var FileList = get_parent().get_parent().get_parent().get_parent().get_node("FileList") - -onready var ClosingFile = get_parent().get_parent().get_parent().get_parent().get_node("ConfirmationDialog") - -onready var LastModifiedIcon = $FileInfo/lastmodified_icon - -onready var SearchBox = $SearchBox -onready var ReplaceBox = $ReplaceBox - -onready var c_counter = $FileInfo/c_counter - -var current_path = "" -var current_filename = "" -var Preview = load("res://addons/file-editor/scenes/Preview.tscn") - - -var search_flag = 0 - -signal text_changed() - -func _ready(): - ClosingFile.connect("confirmed",self,"queue_free") - - ReadOnly.connect("toggled",self,"_on_Readonly_toggled") - - ReadOnly.set("custom_icons/checked",IconLoader.load_icon_from_name("read")) - ReadOnly.set("custom_icons/unchecked",IconLoader.load_icon_from_name("edit")) - - add_to_group("vanilla_editor") - -func set_font(font_path : String) -> void: - var dynamic_font : DynamicFont = DynamicFont.new() - var dynamic_font_data : DynamicFontData = DynamicFontData.new() - dynamic_font_data.set_font_path(font_path) - dynamic_font.set_font_data(dynamic_font_data) - TextEditor.set("custom_fonts/font",dynamic_font) - -func set_wrap_enabled(enabled:bool): - TextEditor.set_wrap_enabled(enabled) - TextEditor.update() - -func draw_minimap(value:bool): - TextEditor.draw_minimap(value) - TextEditor.update() - -func color_region(filextension : String): # -----------------------------> dal momento che voglio creare un editor per ogni file, renderĂ² questa funzione singola in base all'estensione del file - match(filextension): - "bbs": - TextEditor.add_color_region("[b]","[/b]",Color8(153,153,255,255),false) - TextEditor.add_color_region("[i]","[/i]",Color8(153,255,153,255),false) - TextEditor.add_color_region("[s]","[/s]",Color8(255,153,153,255),false) - TextEditor.add_color_region("[u]","[/u]",Color8(255,255,102,255),false) - TextEditor.add_color_region("[url","[/url]",Color8(153,204,255,255),false) - TextEditor.add_color_region("[code]","[/code]",Color8(192,192,192,255),false) - TextEditor.add_color_region("[img]","[/img]",Color8(255,204,153,255),false) - TextEditor.add_color_region("[center]","[/center]",Color8(175,238,238,255),false) - TextEditor.add_color_region("[right]","[/right]",Color8(135,206,235,255),false) - "html": - TextEditor.add_color_region("","",Color8(153,153,255,255),false) - TextEditor.add_color_region("","",Color8(153,255,153,255),false) - TextEditor.add_color_region("","",Color8(255,153,153,255),false) - TextEditor.add_color_region("","",Color8(255,255,102,255),false) - TextEditor.add_color_region("",Color8(153,204,255,255),false) - TextEditor.add_color_region("",Color8(255,204,153,255),true) - TextEditor.add_color_region("
","
",Color8(192,192,192,255),false) - TextEditor.add_color_region("
","
",Color8(175,238,238,255),false) - TextEditor.add_color_region("","",Color8(135,206,235,255),false) - "md": - TextEditor.add_color_region("***","***",Color8(126,186,181,255),false) - TextEditor.add_color_region("**","**",Color8(153,153,255,255),false) - TextEditor.add_color_region("*","*",Color8(153,255,153,255),false) - TextEditor.add_color_region("+ ","",Color8(255,178,102,255),false) - TextEditor.add_color_region("- ","",Color8(255,178,102,255),false) - TextEditor.add_color_region("~~","~~",Color8(255,153,153,255),false) - TextEditor.add_color_region("__","__",Color8(255,255,102,255),false) - TextEditor.add_color_region("[",")",Color8(153,204,255,255),false) - TextEditor.add_color_region("`","`",Color8(192,192,192,255),false) - TextEditor.add_color_region('"*.','"',Color8(255,255,255,255),true) - TextEditor.add_color_region("# ","",Color8(105,105,105,255),true) - TextEditor.add_color_region("## ","",Color8(128,128,128,255),true) - TextEditor.add_color_region("### ","",Color8(169,169,169,255),true) - TextEditor.add_color_region("#### ","",Color8(192,192,192,255),true) - TextEditor.add_color_region("##### ","",Color8(211,211,211,255),true) - TextEditor.add_color_region("###### ","",Color8(255,255,255,255),true) - TextEditor.add_color_region("> ","",Color8(172,138,79,255),true) - "cfg": - TextEditor.add_color_region("[","]",Color8(153,204,255,255),false) - TextEditor.add_color_region('"','"',Color8(255,255,102,255),false) - TextEditor.add_color_region(';','',Color8(128,128,128,255),true) - "ini": - TextEditor.add_color_region("[","]",Color8(153,204,255,255),false) - TextEditor.add_color_region('"','"',Color8(255,255,102,255),false) - TextEditor.add_color_region(';','',Color8(128,128,128,255),true) - _: - pass - -func clean_editor(): - TextEditor.set_text("") - LastModifiedIcon.texture = IconLoader.load_icon_from_name("save") - LastModified.set_text("") - FileList.invalidate() - current_filename = "" - current_path = "" - -func new_file_open(file_content : String, last_modified : Dictionary, current_file_path : String): - current_path = current_file_path - current_filename = current_file_path.get_file() - color_region(current_filename.get_extension()) - TextEditor.set_text(file_content) - update_lastmodified(last_modified,"save") - FileList.invalidate() - count_characters() - -func update_lastmodified(last_modified : Dictionary, icon : String): - LastModified.set_text(str(last_modified.hour)+":"+str(last_modified.minute)+" "+str(last_modified.day)+"/"+str(last_modified.month)+"/"+str(last_modified.year)) - LastModifiedIcon.texture = IconLoader.load_icon_from_name(icon) - -func new_file_create(file_name): - TextEditor.set_text("") - - FileList.invalidate() - -func _on_Readonly_toggled(button_pressed): - if button_pressed: - ReadOnly.set_text("Read Only") - TextEditor.readonly = (true) - else: - ReadOnly.set_text("Can Edit") - TextEditor.readonly = (false) - -func _on_TextEditor_text_changed(): - LastModifiedIcon.texture = IconLoader.load_icon_from_name("saveas") - count_characters() - emit_signal("text_changed") - -func count_characters(): - var counted : int = 0 - for line in TextEditor.get_line_count(): - counted += TextEditor.get_line(line).length() - c_counter.set_text(str(counted)) - -func _on_LineEdit_text_changed(new_text): - var linecount = TextEditor.get_line_count() - if new_text != "": - var found - var find = false - for line in range(0,linecount): - for column in range(0,TextEditor.get_line(line).length()): - found = TextEditor.search( new_text, search_flag, line , column ) - if found.size(): - if found[1] == line: -# if not find: - TextEditor.select(line,found[0],found[1],found[0]+new_text.length()) -# find = true - else: - TextEditor.select(0,0,0,0) - else: - TextEditor.select(0,0,0,0) - -func _on_matchcase_toggled(button_pressed): - if button_pressed: - search_flag = 1 - else: - if $SearchBox/wholewords.is_pressed(): - search_flag = 2 - else: - search_flag = 0 - _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) - -func _on_wholewords_toggled(button_pressed): - if button_pressed: - search_flag = 2 - else: - if $SearchBox/matchcase.is_pressed(): - search_flag = 1 - else: - search_flag = 0 - _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) - -func _on_close_pressed(): - SearchBox.hide() - -func open_searchbox(): - if SearchBox.visible: - SearchBox.hide() - else: - SearchBox.show() - SearchBox.get_node("LineEdit").grab_focus() - -func _on_Button_pressed(): - var linecount = TextEditor.get_line_count()-1 - var old_text = $ReplaceBox/replace.get_text() - var new_text = $ReplaceBox/with.get_text() - var text = TextEditor.get_text() - TextEditor.set_text(text.replace(old_text,new_text)) - -func open_replacebox(): - if ReplaceBox.visible: - ReplaceBox.hide() - else: - ReplaceBox.show() - ReplaceBox.get_node("replace").grab_focus() - -func _on_close2_pressed(): - ReplaceBox.hide() - -func _on_LineEdit_focus_entered(): - _on_LineEdit_text_changed($SearchBox/LineEdit.get_text()) From 5965161df7788e1efdff51d28ef3a2172e82495d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:18:45 +0200 Subject: [PATCH 12/21] add scripts for custom font --- addons/file-editor/scripts/FileEditor.gd | 901 +++++++++--------- addons/file-editor/scripts/IniVisualEditor.gd | 412 ++++---- addons/file-editor/scripts/LastOpenedFiles.gd | 11 +- addons/file-editor/scripts/VanillaEditor.gd | 7 + 4 files changed, 684 insertions(+), 647 deletions(-) diff --git a/addons/file-editor/scripts/FileEditor.gd b/addons/file-editor/scripts/FileEditor.gd index 8c70ff1..fede799 100644 --- a/addons/file-editor/scripts/FileEditor.gd +++ b/addons/file-editor/scripts/FileEditor.gd @@ -9,9 +9,11 @@ onready var NewFileDialogue_name = $NewFileDialogue/VBoxContainer/new_filename onready var FileBTN = $FileEditorContainer/TobBar/file_btn.get_popup() onready var PreviewBTN = $FileEditorContainer/TobBar/preview_btn.get_popup() onready var EditorBTN = $FileEditorContainer/TobBar/editor_btn.get_popup() +onready var SettingsBTN : PopupMenu = $FileEditorContainer/TobBar/SettingsBtn.get_popup() onready var Version = $FileEditorContainer/TobBar/version +onready var SelectFontDialog : FileDialog = $SelectFontDialog onready var FileContainer = $FileEditorContainer/SplitContainer/FileContainer onready var OpenFileList = $FileEditorContainer/SplitContainer/FileContainer/OpenFileList @@ -62,522 +64,541 @@ var save_as = false var current_editor : Control var current_ini_editor : Control var current_csv_editor : Control - +var current_font : DynamicFont func _ready(): - - clean_editor() - update_version() - connect_signals() - create_shortcuts() - load_icons() - - var opened_files : Array = LastOpenedFiles.load_opened_files() - for open_file in opened_files: - open_file(open_file[1]) - - FileList.set_filters(EXTENSIONS) + + clean_editor() + update_version() + connect_signals() + create_shortcuts() + load_icons() + + var opened_files : Array = LastOpenedFiles.load_opened_files() + for opened_file in opened_files: + open_file(opened_file[1], opened_file[2]) + + FileList.set_filters(EXTENSIONS) func create_shortcuts(): - var hotkey - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_S - hotkey.control = true - FileBTN.set_item_accelerator(4,hotkey.get_scancode_with_modifiers()) # save file - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_N - hotkey.control = true - FileBTN.set_item_accelerator(0,hotkey.get_scancode_with_modifiers()) # new file - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_O - hotkey.control = true - FileBTN.set_item_accelerator(1,hotkey.get_scancode_with_modifiers()) # open file - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_D - hotkey.control = true - FileBTN.set_item_accelerator(6,hotkey.get_scancode_with_modifiers()) # delete file - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_S - hotkey.control = true - hotkey.alt = true - FileBTN.set_item_accelerator(5,hotkey.get_scancode_with_modifiers()) #save file as - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_C - hotkey.control = true - hotkey.alt = true - FileBTN.set_item_accelerator(2,hotkey.get_scancode_with_modifiers()) # close file - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_F - hotkey.control = true - FileBTN.set_item_accelerator(8,hotkey.get_scancode_with_modifiers()) # search - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_R - hotkey.control = true - FileBTN.set_item_accelerator(9,hotkey.get_scancode_with_modifiers()) # replace - - # vanilla editor ----------------------- - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_1 - hotkey.control = true - EditorBTN.set_item_accelerator(0,hotkey.get_scancode_with_modifiers()) # vanilla editor - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_2 - hotkey.control = true - EditorBTN.set_item_accelerator(1,hotkey.get_scancode_with_modifiers()) # csv editor - - hotkey = InputEventKey.new() - hotkey.scancode = KEY_3 - hotkey.control = true - EditorBTN.set_item_accelerator(2,hotkey.get_scancode_with_modifiers()) # inieditor editor + var hotkey + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_S + hotkey.control = true + FileBTN.set_item_accelerator(4,hotkey.get_scancode_with_modifiers()) # save file + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_N + hotkey.control = true + FileBTN.set_item_accelerator(0,hotkey.get_scancode_with_modifiers()) # new file + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_O + hotkey.control = true + FileBTN.set_item_accelerator(1,hotkey.get_scancode_with_modifiers()) # open file + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_D + hotkey.control = true + FileBTN.set_item_accelerator(6,hotkey.get_scancode_with_modifiers()) # delete file + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_S + hotkey.control = true + hotkey.alt = true + FileBTN.set_item_accelerator(5,hotkey.get_scancode_with_modifiers()) #save file as + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_C + hotkey.control = true + hotkey.alt = true + FileBTN.set_item_accelerator(2,hotkey.get_scancode_with_modifiers()) # close file + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_F + hotkey.control = true + FileBTN.set_item_accelerator(8,hotkey.get_scancode_with_modifiers()) # search + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_R + hotkey.control = true + FileBTN.set_item_accelerator(9,hotkey.get_scancode_with_modifiers()) # replace + + # vanilla editor ----------------------- + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_1 + hotkey.control = true + EditorBTN.set_item_accelerator(0,hotkey.get_scancode_with_modifiers()) # vanilla editor + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_2 + hotkey.control = true + EditorBTN.set_item_accelerator(1,hotkey.get_scancode_with_modifiers()) # csv editor + + hotkey = InputEventKey.new() + hotkey.scancode = KEY_3 + hotkey.control = true + EditorBTN.set_item_accelerator(2,hotkey.get_scancode_with_modifiers()) # inieditor editor func load_icons(): - $FileEditorContainer/TobBar/file_btn.icon = IconLoader.load_icon_from_name("file") - $FileEditorContainer/TobBar/preview_btn.icon = IconLoader.load_icon_from_name("read") - $FileEditorContainer/TobBar/editor_btn.icon = IconLoader.load_icon_from_name("edit_") + $FileEditorContainer/TobBar/file_btn.icon = IconLoader.load_icon_from_name("file") + $FileEditorContainer/TobBar/preview_btn.icon = IconLoader.load_icon_from_name("read") + $FileEditorContainer/TobBar/editor_btn.icon = IconLoader.load_icon_from_name("edit_") + $FileEditorContainer/TobBar/SettingsBtn.icon = IconLoader.load_icon_from_name("settings") func connect_signals(): - FileList.connect("confirmed",self,"update_list") - FileBTN.connect("id_pressed",self,"_on_filebtn_pressed") - PreviewBTN.connect("id_pressed",self,"_on_previewbtn_pressed") - EditorBTN.connect("id_pressed",self,"_on_editorbtn_pressed") - - OpenFileList.connect("item_selected",self,"_on_fileitem_pressed") - WrapBTN.connect("item_selected",self,"on_wrap_button") - MapBTN.connect("item_selected",self,"on_minimap_button") + FileList.connect("confirmed",self,"update_list") + FileBTN.connect("id_pressed",self,"_on_filebtn_pressed") + PreviewBTN.connect("id_pressed",self,"_on_previewbtn_pressed") + EditorBTN.connect("id_pressed",self,"_on_editorbtn_pressed") + SettingsBTN.connect("id_pressed",self,"_on_settingsbtn_pressed") + + OpenFileList.connect("item_selected",self,"_on_fileitem_pressed") + WrapBTN.connect("item_selected",self,"on_wrap_button") + MapBTN.connect("item_selected",self,"on_minimap_button") + + SelectFontDialog.connect("file_selected",self,"_on_font_selected") func update_version(): - var plugin_version = "" - var config = ConfigFile.new() - var err = config.load("res://addons/file-editor/plugin.cfg") - if err == OK: - plugin_version = config.get_value("plugin","version") - Version.set_text("v"+plugin_version) - print(plugin_version) + var plugin_version = "" + var config = ConfigFile.new() + var err = config.load("res://addons/file-editor/plugin.cfg") + if err == OK: + plugin_version = config.get_value("plugin","version") + Version.set_text("v"+plugin_version) + print(plugin_version) func create_selected_file(): - update_list() - FileList.mode = FileDialog.MODE_SAVE_FILE - FileList.set_title("Create a new File") - if FileList.is_connected("file_selected",self,"delete_file"): - FileList.disconnect("file_selected",self,"delete_file") - if FileList.is_connected("file_selected",self,"open_file"): - FileList.disconnect("file_selected",self,"open_file") - if not FileList.is_connected("file_selected",self,"create_new_file"): - FileList.connect("file_selected",self,"create_new_file") - open_filelist() + update_list() + FileList.mode = FileDialog.MODE_SAVE_FILE + FileList.set_title("Create a new File") + if FileList.is_connected("file_selected",self,"delete_file"): + FileList.disconnect("file_selected",self,"delete_file") + if FileList.is_connected("file_selected",self,"open_file"): + FileList.disconnect("file_selected",self,"open_file") + if not FileList.is_connected("file_selected",self,"create_new_file"): + FileList.connect("file_selected",self,"create_new_file") + open_filelist() func open_selected_file(): - update_list() - FileList.mode = FileDialog.MODE_OPEN_FILE - FileList.set_title("Select a File you want to edit") - if FileList.is_connected("file_selected",self,"delete_file"): - FileList.disconnect("file_selected",self,"delete_file") - if FileList.is_connected("file_selected",self,"create_new_file"): - FileList.disconnect("file_selected",self,"create_new_file") - if not FileList.is_connected("file_selected",self,"open_file"): - FileList.connect("file_selected",self,"open_file") - open_filelist() + update_list() + FileList.mode = FileDialog.MODE_OPEN_FILE + FileList.set_title("Select a File you want to edit") + if FileList.is_connected("file_selected",self,"delete_file"): + FileList.disconnect("file_selected",self,"delete_file") + if FileList.is_connected("file_selected",self,"create_new_file"): + FileList.disconnect("file_selected",self,"create_new_file") + if not FileList.is_connected("file_selected",self,"open_file"): + FileList.connect("file_selected",self,"open_file") + open_filelist() func delete_selected_file(): - update_list() - FileList.mode = FileDialog.MODE_OPEN_FILES - FileList.set_title("Select one or more Files you want to delete") - if FileList.is_connected("file_selected",self,"open_file"): - FileList.disconnect("file_selected",self,"open_file") - if FileList.is_connected("file_selected",self,"create_new_file"): - FileList.disconnect("file_selected",self,"create_new_file") - if not FileList.is_connected("files_selected",self,"delete_file"): - FileList.connect("files_selected",self,"delete_file") - open_filelist() + update_list() + FileList.mode = FileDialog.MODE_OPEN_FILES + FileList.set_title("Select one or more Files you want to delete") + if FileList.is_connected("file_selected",self,"open_file"): + FileList.disconnect("file_selected",self,"open_file") + if FileList.is_connected("file_selected",self,"create_new_file"): + FileList.disconnect("file_selected",self,"create_new_file") + if not FileList.is_connected("files_selected",self,"delete_file"): + FileList.connect("files_selected",self,"delete_file") + open_filelist() func save_current_file_as(): - update_list() - FileList.mode = FileDialog.MODE_SAVE_FILE - FileList.set_title("Save this File as...") - if FileList.is_connected("file_selected",self,"delete_file"): - FileList.disconnect("file_selected",self,"delete_file") - if FileList.is_connected("file_selected",self,"open_file"): - FileList.disconnect("file_selected",self,"open_file") - if not FileList.is_connected("file_selected",self,"create_new_file"): - FileList.connect("file_selected",self,"create_new_file") - open_filelist() + update_list() + FileList.mode = FileDialog.MODE_SAVE_FILE + FileList.set_title("Save this File as...") + if FileList.is_connected("file_selected",self,"delete_file"): + FileList.disconnect("file_selected",self,"delete_file") + if FileList.is_connected("file_selected",self,"open_file"): + FileList.disconnect("file_selected",self,"open_file") + if not FileList.is_connected("file_selected",self,"create_new_file"): + FileList.connect("file_selected",self,"create_new_file") + open_filelist() func _on_filebtn_pressed(index : int): - match index: - 0: - create_selected_file() - 1: - open_selected_file() - 2: - if current_file_index!=-1 and current_file_path != "": - close_file(current_file_index) - - 3: - if current_file_index!=-1 and current_file_path != "": - save_as = false - if current_csv_editor and current_csv_editor.visible: - current_csv_editor.save_table() - save_file(current_file_path) - 4: - if current_file_index!=-1 and current_file_path != "": - save_as = true - save_file(current_file_path) - save_current_file_as() - 5: - delete_selected_file() - 6: - current_editor.open_searchbox() - 7: - current_editor.open_replacebox() + match index: + 0: + create_selected_file() + 1: + open_selected_file() + 2: + if current_file_index!=-1 and current_file_path != "": + close_file(current_file_index) + + 3: + if current_file_index!=-1 and current_file_path != "": + save_as = false + if current_csv_editor and current_csv_editor.visible: + current_csv_editor.save_table() + save_file(current_file_path) + 4: + if current_file_index!=-1 and current_file_path != "": + save_as = true + save_file(current_file_path) + save_current_file_as() + 5: + delete_selected_file() + 6: + current_editor.open_searchbox() + 7: + current_editor.open_replacebox() func _on_previewbtn_pressed(id : int): - if id == 0: - bbcode_preview() - elif id == 1: - markdown_preview() - elif id == 2: - html_preview() - elif id == 3: - csv_preview() - elif id == 4: - xml_preview() - elif id == 5: - json_preview() + if id == 0: + bbcode_preview() + elif id == 1: + markdown_preview() + elif id == 2: + html_preview() + elif id == 3: + csv_preview() + elif id == 4: + xml_preview() + elif id == 5: + json_preview() func _on_editorbtn_pressed(index : int): - match index: - 0: - if not current_editor.visible: - current_editor.show() - if current_csv_editor: - current_csv_editor.hide() - if current_ini_editor: - current_ini_editor.hide() - 1: - if current_csv_editor and not current_csv_editor.visible: - if current_ini_editor: - current_ini_editor.hide() - current_editor.hide() - current_csv_editor = open_in_csveditor(current_file_path) - current_csv_editor.show() - 2: - if current_ini_editor and not current_ini_editor.visible: - current_editor.hide() - if current_csv_editor: - current_csv_editor.hide() - current_ini_editor = open_in_inieditor(current_file_path) - current_ini_editor.show() + match index: + 0: + if not current_editor.visible: + current_editor.show() + if current_csv_editor: + current_csv_editor.hide() + if current_ini_editor: + current_ini_editor.hide() + 1: + if current_csv_editor and not current_csv_editor.visible: + if current_ini_editor: + current_ini_editor.hide() + current_editor.hide() + current_csv_editor = open_in_csveditor(current_file_path) + current_csv_editor.show() + 2: + if current_ini_editor and not current_ini_editor.visible: + current_editor.hide() + if current_csv_editor: + current_csv_editor.hide() + current_ini_editor = open_in_inieditor(current_file_path) + current_ini_editor.show() + +func _on_settingsbtn_pressed(index : int): + match index: + 0: + SelectFontDialog.popup() + +func _on_font_selected(font_path : String): + current_editor.set_font(font_path) + LastOpenedFiles.store_editor_fonts(current_file_path.get_file(), font_path) +# Enable this part of code to apply the new font to all Vanilla Editors opened +# for file in [0,OpenFileList.get_child_count()]: +# OpenFileList.get_item_metadata(file)[0].set_font(dynamic_font) +# current_font = dynamic_font func _on_fileitem_pressed(index : int): - current_file_index = index - var selected_item_metadata = OpenFileList.get_item_metadata(current_file_index) - var extension = selected_item_metadata[0].current_path.get_file().get_extension() - - current_file_path = selected_item_metadata[0].current_path - if current_editor.visible: - current_editor.hide() - current_editor = selected_item_metadata[0] - current_editor.show() - OpenFileName.set_text(current_editor.current_path) - current_csv_editor = selected_item_metadata[2] - current_ini_editor = selected_item_metadata[1] - if WrapBTN.get_selected_id() == 1: - current_editor.set_wrap_enabled(true) - else: - current_editor.set_wrap_enabled(false) - if MapBTN.get_selected_id() == 1: - current_editor.draw_minimap(true) - else: - current_editor.draw_minimap(false) - elif current_csv_editor and current_csv_editor.visible: - if extension == "csv": - current_csv_editor.hide() - current_csv_editor = selected_item_metadata[2] - current_csv_editor.show() - OpenFileName.set_text(current_csv_editor.current_file_path) - current_editor = selected_item_metadata[0] - current_ini_editor = selected_item_metadata[1] - else: - if current_csv_editor: - current_csv_editor.hide() - current_csv_editor = selected_item_metadata[2] - if current_ini_editor: - current_ini_editor.hide() - current_ini_editor = selected_item_metadata[1] - current_editor.hide() - current_editor = selected_item_metadata[0] - current_editor.show() - OpenFileName.set_text(current_editor.current_path) - elif current_ini_editor and current_ini_editor.visible: - if extension == "cfg" or extension == "ini": - current_ini_editor.hide() - current_ini_editor = selected_item_metadata[1] - current_ini_editor.show() - OpenFileName.set_text(current_ini_editor.current_file_path) - else: - if current_ini_editor: - current_ini_editor.hide() - current_ini_editor = selected_item_metadata[1] - if current_csv_editor: - current_csv_editor.hide() - current_csv_editor = selected_item_metadata[2] - current_editor.hide() - current_editor = selected_item_metadata[0] - current_editor.show() - OpenFileName.set_text(current_editor.current_path) + current_file_index = index + var selected_item_metadata = OpenFileList.get_item_metadata(current_file_index) + var extension = selected_item_metadata[0].current_path.get_file().get_extension() + + current_file_path = selected_item_metadata[0].current_path + if current_editor.visible: + current_editor.hide() + current_editor = selected_item_metadata[0] + current_editor.show() + OpenFileName.set_text(current_editor.current_path) + current_csv_editor = selected_item_metadata[2] + current_ini_editor = selected_item_metadata[1] + if WrapBTN.get_selected_id() == 1: + current_editor.set_wrap_enabled(true) + else: + current_editor.set_wrap_enabled(false) + if MapBTN.get_selected_id() == 1: + current_editor.draw_minimap(true) + else: + current_editor.draw_minimap(false) + elif current_csv_editor and current_csv_editor.visible: + if extension == "csv": + current_csv_editor.hide() + current_csv_editor = selected_item_metadata[2] + current_csv_editor.show() + OpenFileName.set_text(current_csv_editor.current_file_path) + current_editor = selected_item_metadata[0] + current_ini_editor = selected_item_metadata[1] + else: + if current_csv_editor: + current_csv_editor.hide() + current_csv_editor = selected_item_metadata[2] + if current_ini_editor: + current_ini_editor.hide() + current_ini_editor = selected_item_metadata[1] + current_editor.hide() + current_editor = selected_item_metadata[0] + current_editor.show() + OpenFileName.set_text(current_editor.current_path) + elif current_ini_editor and current_ini_editor.visible: + if extension == "cfg" or extension == "ini": + current_ini_editor.hide() + current_ini_editor = selected_item_metadata[1] + current_ini_editor.show() + OpenFileName.set_text(current_ini_editor.current_file_path) + else: + if current_ini_editor: + current_ini_editor.hide() + current_ini_editor = selected_item_metadata[1] + if current_csv_editor: + current_csv_editor.hide() + current_csv_editor = selected_item_metadata[2] + current_editor.hide() + current_editor = selected_item_metadata[0] + current_editor.show() + OpenFileName.set_text(current_editor.current_path) -func open_file(path : String): - if current_file_path != path: - current_file_path = path - - var vanilla_editor = open_in_vanillaeditor(path) - var ini_editor = open_in_inieditor(path) - var csv_editor = open_in_csveditor(path) - - generate_file_item(path,vanilla_editor,ini_editor,csv_editor) - - LastOpenedFiles.store_opened_files(OpenFileList) - current_editor.show() +func open_file(path : String, font : String = "null"): + if current_file_path != path: + current_file_path = path + + var vanilla_editor = open_in_vanillaeditor(path) + if font != "null": + vanilla_editor.set_font(font) + var ini_editor = open_in_inieditor(path) + var csv_editor = open_in_csveditor(path) + + generate_file_item(path,vanilla_editor,ini_editor,csv_editor) + + LastOpenedFiles.store_opened_files(OpenFileList) + current_editor.show() func generate_file_item(path : String , veditor : Control , inieditor : Control, csveditor : Control): - OpenFileName.set_text(path) - OpenFileList.add_item(path.get_file(),IconLoader.load_icon_from_name("file"),true) - current_file_index = OpenFileList.get_item_count()-1 - OpenFileList.set_item_metadata(current_file_index,[veditor,inieditor,csveditor]) - OpenFileList.select(OpenFileList.get_item_count()-1) + OpenFileName.set_text(path) + OpenFileList.add_item(path.get_file(),IconLoader.load_icon_from_name("file"),true) + current_file_index = OpenFileList.get_item_count()-1 + OpenFileList.set_item_metadata(current_file_index,[veditor,inieditor,csveditor]) + OpenFileList.select(OpenFileList.get_item_count()-1) func open_in_vanillaeditor(path : String) -> Control: - var editor = VanillaEditor.instance() - SplitEditorContainer.add_child(editor,true) - - if current_editor and current_editor!=editor: - editor.show() - current_editor.hide() - if current_csv_editor and current_csv_editor.visible: - current_csv_editor.hide() - if current_ini_editor and current_ini_editor.visible: - current_ini_editor.hide() - - current_editor = editor - - - editor.connect("text_changed",self,"_on_vanillaeditor_text_changed") - - var current_file : File = File.new() - current_file.open(path,File.READ) - var current_content = "" - current_content = current_file.get_as_text() - - var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(path)) - - current_file.close() - - editor.new_file_open(current_content,last_modified,current_file_path) - - update_list() - - if WrapBTN.get_selected_id() == 1: - current_editor.set_wrap_enabled(true) - - - return editor + var editor = VanillaEditor.instance() + SplitEditorContainer.add_child(editor,true) + + if current_editor and current_editor!=editor: + editor.show() + current_editor.hide() + if current_csv_editor and current_csv_editor.visible: + current_csv_editor.hide() + if current_ini_editor and current_ini_editor.visible: + current_ini_editor.hide() + + current_editor = editor + + + editor.connect("text_changed",self,"_on_vanillaeditor_text_changed") + + var current_file : File = File.new() + current_file.open(path,File.READ) + var current_content = "" + current_content = current_file.get_as_text() + + var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(path)) + + current_file.close() + + editor.new_file_open(current_content,last_modified,current_file_path) + + update_list() + + if WrapBTN.get_selected_id() == 1: + current_editor.set_wrap_enabled(true) + + + return editor func open_in_inieditor(path : String) -> Control: - var extension = path.get_file().get_extension() - if extension == "ini" or extension == "cfg": - var inieditor = IniEditor.instance() - SplitEditorContainer.add_child(inieditor) - inieditor.hide() - inieditor.connect("update_file",self,"_on_update_file") - current_ini_editor = inieditor - inieditor.current_file_path = path - var current_file : ConfigFile = ConfigFile.new() - var err = current_file.load(path) - if err == OK: - var sections = current_file.get_sections() - var filemap = [] - for section in sections: - var keys = [] - var section_keys = current_file.get_section_keys(section) - for key in section_keys: - keys.append([key,current_file.get_value(section,key)]) - - filemap.append([section,keys]) - - inieditor.open_file(filemap) - return inieditor - else: - current_ini_editor = null - return null + var extension = path.get_file().get_extension() + if extension == "ini" or extension == "cfg": + var inieditor = IniEditor.instance() + SplitEditorContainer.add_child(inieditor) + inieditor.hide() + inieditor.connect("update_file",self,"_on_update_file") + current_ini_editor = inieditor + inieditor.current_file_path = path + var current_file : ConfigFile = ConfigFile.new() + var err = current_file.load(path) + if err == OK: + var sections = current_file.get_sections() + var filemap = [] + for section in sections: + var keys = [] + var section_keys = current_file.get_section_keys(section) + for key in section_keys: + keys.append([key,current_file.get_value(section,key)]) + + filemap.append([section,keys]) + + inieditor.open_file(filemap) + return inieditor + else: + current_ini_editor = null + return null func open_in_csveditor(path : String) -> Control: - var extension = path.get_file().get_extension() - if extension == "csv": - var csveditor = CsvEditor.instance() - SplitEditorContainer.add_child(csveditor) - csveditor.hide() - csveditor.connect("update_file",self,"_on_update_file") - current_csv_editor = csveditor - csveditor.current_file_path = path - csveditor.open_csv_file(path,"|") - return csveditor - else: - current_csv_editor = null - return null + var extension = path.get_file().get_extension() + if extension == "csv": + var csveditor = CsvEditor.instance() + SplitEditorContainer.add_child(csveditor) + csveditor.hide() + csveditor.connect("update_file",self,"_on_update_file") + current_csv_editor = csveditor + csveditor.current_file_path = path + csveditor.open_csv_file(path,"|") + return csveditor + else: + current_csv_editor = null + return null func close_file(index): - LastOpenedFiles.remove_opened_file(index,OpenFileList) - OpenFileList.remove_item(index) - OpenFileName.clear() - current_editor.queue_free() - - if index>0: - OpenFileList.select(OpenFileList.get_item_count()-1) - _on_fileitem_pressed(OpenFileList.get_item_count()-1) + LastOpenedFiles.remove_opened_file(index,OpenFileList) + OpenFileList.remove_item(index) + OpenFileName.clear() + current_editor.queue_free() + + if index>0: + OpenFileList.select(OpenFileList.get_item_count()-1) + _on_fileitem_pressed(OpenFileList.get_item_count()-1) func _on_update_file(): # current_editor.clean_editor() - var current_file : File = File.new() - current_file.open(current_file_path,File.READ) - - var current_content = current_file.get_as_text() - var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(current_file_path)) - - current_file.close() - - current_editor.new_file_open(current_content,last_modified,current_file_path) + var current_file : File = File.new() + current_file.open(current_file_path,File.READ) + + var current_content = current_file.get_as_text() + var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(current_file_path)) + + current_file.close() + + current_editor.new_file_open(current_content,last_modified,current_file_path) func delete_file(files_selected : PoolStringArray): - var dir = Directory.new() - for file in files_selected: - dir.remove(file) - - update_list() + var dir = Directory.new() + for file in files_selected: + dir.remove(file) + + update_list() func open_newfiledialogue(): - NewFileDialogue.popup() - NewFileDialogue.set_position(OS.get_screen_size()/2 - NewFileDialogue.get_size()/2) + NewFileDialogue.popup() + NewFileDialogue.set_position(OS.get_screen_size()/2 - NewFileDialogue.get_size()/2) func open_filelist(): - update_list() - FileList.popup() - FileList.set_position(OS.get_screen_size()/2 - FileList.get_size()/2) + update_list() + FileList.popup() + FileList.set_position(OS.get_screen_size()/2 - FileList.get_size()/2) func create_new_file(given_path : String): - var current_file = File.new() - current_file.open(given_path,File.WRITE) - if save_as : - current_file.store_line(current_editor.get_node("TextEditor").get_text()) - current_file.close() - - open_file(given_path) + var current_file = File.new() + current_file.open(given_path,File.WRITE) + if save_as : + current_file.store_line(current_editor.get_node("TextEditor").get_text()) + current_file.close() + + open_file(given_path) func save_file(current_path : String): - var current_file = File.new() - current_file.open(current_path,File.WRITE) - var current_content = "" - var lines = current_editor.get_node("TextEditor").get_line_count() - for line in range(0,lines): - current_content = current_editor.get_node("TextEditor").get_text() - current_file.store_line(current_editor.get_node("TextEditor").get_line(line)) - current_file.close() - - current_file_path = current_path - - var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(current_file_path)) - - current_editor.update_lastmodified(last_modified,"save") - OpenFileList.set_item_metadata(current_file_index,[current_editor,current_ini_editor,current_csv_editor]) - print(OpenFileList.get_item_metadata(current_file_index)) - - if OpenFileList.get_item_text(current_file_index).ends_with("(*)"): - OpenFileList.set_item_text(current_file_index,OpenFileList.get_item_text(current_file_index).rstrip("(*)")) - + var current_file = File.new() + current_file.open(current_path,File.WRITE) + var current_content = "" + var lines = current_editor.get_node("TextEditor").get_line_count() + for line in range(0,lines): + current_content = current_editor.get_node("TextEditor").get_text() + current_file.store_line(current_editor.get_node("TextEditor").get_line(line)) + current_file.close() + + current_file_path = current_path + + var last_modified = OS.get_datetime_from_unix_time(current_file.get_modified_time(current_file_path)) + + current_editor.update_lastmodified(last_modified,"save") + OpenFileList.set_item_metadata(current_file_index,[current_editor,current_ini_editor,current_csv_editor]) + print(OpenFileList.get_item_metadata(current_file_index)) + + if OpenFileList.get_item_text(current_file_index).ends_with("(*)"): + OpenFileList.set_item_text(current_file_index,OpenFileList.get_item_text(current_file_index).rstrip("(*)")) + # OpenFileList.set_item_metadata(current_file_index,[current_editor,open_in_inieditor(current_file_path),open_in_csveditor(current_file_path)]) - - update_list() + + update_list() func clean_editor() -> void : - for inieditor in get_tree().get_nodes_in_group("ini_editor"): - inieditor.queue_free() - for vanillaeditor in get_tree().get_nodes_in_group("vanilla_editor"): - vanillaeditor.queue_free() - OpenFileName.clear() - OpenFileList.clear() + for inieditor in get_tree().get_nodes_in_group("ini_editor"): + inieditor.queue_free() + for vanillaeditor in get_tree().get_nodes_in_group("vanilla_editor"): + vanillaeditor.queue_free() + OpenFileName.clear() + OpenFileList.clear() func csv_preview(): - var preview = Preview.instance() - get_parent().get_parent().get_parent().add_child(preview) - preview.popup() - preview.window_title += " ("+current_file_path.get_file()+")" - var lines = current_editor.get_node("TextEditor").get_line_count() - var rows = [] - for i in range(0,lines-1): - rows.append(current_editor.get_node("TextEditor").get_line(i).rsplit(",",false)) - preview.print_csv(rows) + var preview = Preview.instance() + get_parent().get_parent().get_parent().add_child(preview) + preview.popup() + preview.window_title += " ("+current_file_path.get_file()+")" + var lines = current_editor.get_node("TextEditor").get_line_count() + var rows = [] + for i in range(0,lines-1): + rows.append(current_editor.get_node("TextEditor").get_line(i).rsplit(",",false)) + preview.print_csv(rows) func bbcode_preview(): - var preview = Preview.instance() - get_parent().get_parent().get_parent().add_child(preview) - preview.popup() - preview.window_title += " ("+current_file_path.get_file()+")" - preview.print_bb(current_editor.get_node("TextEditor").get_text()) + var preview = Preview.instance() + get_parent().get_parent().get_parent().add_child(preview) + preview.popup() + preview.window_title += " ("+current_file_path.get_file()+")" + preview.print_bb(current_editor.get_node("TextEditor").get_text()) func markdown_preview(): - var preview = Preview.instance() - get_parent().get_parent().get_parent().add_child(preview) - preview.popup() - preview.window_title += " ("+current_file_path.get_file()+")" - preview.print_markdown(current_editor.get_node("TextEditor").get_text()) + var preview = Preview.instance() + get_parent().get_parent().get_parent().add_child(preview) + preview.popup() + preview.window_title += " ("+current_file_path.get_file()+")" + preview.print_markdown(current_editor.get_node("TextEditor").get_text()) func html_preview(): - var preview = Preview.instance() - get_parent().get_parent().get_parent().add_child(preview) - preview.popup() - preview.window_title += " ("+current_file_path.get_file()+")" - preview.print_html(current_editor.get_node("TextEditor").get_text()) + var preview = Preview.instance() + get_parent().get_parent().get_parent().add_child(preview) + preview.popup() + preview.window_title += " ("+current_file_path.get_file()+")" + preview.print_html(current_editor.get_node("TextEditor").get_text()) func xml_preview(): - pass + pass func json_preview(): - pass + pass func _on_vanillaeditor_text_changed(): - if not OpenFileList.get_item_text(current_file_index).ends_with("(*)"): - OpenFileList.set_item_text(current_file_index,OpenFileList.get_item_text(current_file_index)+"(*)") + if not OpenFileList.get_item_text(current_file_index).ends_with("(*)"): + OpenFileList.set_item_text(current_file_index,OpenFileList.get_item_text(current_file_index)+"(*)") func update_list(): - FileList.invalidate() + FileList.invalidate() func on_wrap_button(index:int): - match index: - 0: - current_editor.set_wrap_enabled(false) - 1: - current_editor.set_wrap_enabled(true) + match index: + 0: + current_editor.set_wrap_enabled(false) + 1: + current_editor.set_wrap_enabled(true) func on_minimap_button(index:int): - match index: - 0: - current_editor.draw_minimap(false) - 1: - current_editor.draw_minimap(true) + match index: + 0: + current_editor.draw_minimap(false) + 1: + current_editor.draw_minimap(true) func check_file_preview(file : String): - # check whether the opened file has a corresponding preview session for its extension - pass + # check whether the opened file has a corresponding preview session for its extension + pass diff --git a/addons/file-editor/scripts/IniVisualEditor.gd b/addons/file-editor/scripts/IniVisualEditor.gd index 16dca8e..3e0d642 100644 --- a/addons/file-editor/scripts/IniVisualEditor.gd +++ b/addons/file-editor/scripts/IniVisualEditor.gd @@ -26,259 +26,259 @@ var current_file_path : String = "" signal update_file() func _ready(): - create_table_names() - connect_signals() - load_icons() - clean_editor() - - add_to_group("ini_editor") - + create_table_names() + connect_signals() + load_icons() + clean_editor() + + add_to_group("ini_editor") + # var metadata = [["name","Godot Engine"],["version","1.0.0"],["color","Light Blue"]] # load_section("Engine", metadata) func connect_signals(): - Sections.connect("item_selected",self,"_on_section_selected") - Sections.connect("nothing_selected",self,"_on_nosection_selected") - - BtnAddSection.connect("pressed",self,"_on_addsection_pressed") - BtnRemoveSection.connect("pressed",self,"_on_removesection_pressed") - - Keys.connect("item_selected",self,"_on_key_selected") - Keys.connect("nothing_selected",self,"_on_nokey_selected") - - BtnAddKey.connect("pressed",self,"_on_addkey_pressed") - BtnRemoveKey.connect("pressed",self,"_on_removekey_pressed") - BtnEditKey.connect("pressed",self,"_on_editkey_pressed") - - connect("visibility_changed",self,"_on_visibility_changed") + Sections.connect("item_selected",self,"_on_section_selected") + Sections.connect("nothing_selected",self,"_on_nosection_selected") + + BtnAddSection.connect("pressed",self,"_on_addsection_pressed") + BtnRemoveSection.connect("pressed",self,"_on_removesection_pressed") + + Keys.connect("item_selected",self,"_on_key_selected") + Keys.connect("nothing_selected",self,"_on_nokey_selected") + + BtnAddKey.connect("pressed",self,"_on_addkey_pressed") + BtnRemoveKey.connect("pressed",self,"_on_removekey_pressed") + BtnEditKey.connect("pressed",self,"_on_editkey_pressed") + + connect("visibility_changed",self,"_on_visibility_changed") func create_table_names(): - create_root() - Keys.hide_root = true - - Keys.set_column_titles_visible(true) - Keys.set_column_title(0,"Name") - Keys.set_column_title(1,"Value") + create_root() + Keys.hide_root = true + + Keys.set_column_titles_visible(true) + Keys.set_column_title(0,"Name") + Keys.set_column_title(1,"Value") func load_icons(): - $VBoxContainer/HSplitContainer/VBoxContainer/HBoxContainer/sections_icon.texture = IconLoader.load_icon_from_name("sections") - $VBoxContainer/HSplitContainer/VBoxContainer2/HBoxContainer2/keys_icon.texture = IconLoader.load_icon_from_name("keys") - BtnAddSection.icon = IconLoader.load_icon_from_name("add") - BtnAddSection.hint_tooltip = "Add a new Section" - BtnRemoveSection.icon = IconLoader.load_icon_from_name("delete") - BtnRemoveSection.hint_tooltip = "Remove selected Section" - - BtnAddKey.icon = IconLoader.load_icon_from_name("add") - BtnAddKey.hint_tooltip = "Add a new Key" - BtnRemoveKey.icon = IconLoader.load_icon_from_name("delete") - BtnRemoveKey.hint_tooltip = "Remove selected Key" - BtnEditKey.icon = IconLoader.load_icon_from_name("edit_") - BtnEditKey.hint_tooltip = "Edit selected Key" + $VBoxContainer/HSplitContainer/VBoxContainer/HBoxContainer/sections_icon.texture = IconLoader.load_icon_from_name("sections") + $VBoxContainer/HSplitContainer/VBoxContainer2/HBoxContainer2/keys_icon.texture = IconLoader.load_icon_from_name("keys") + BtnAddSection.icon = IconLoader.load_icon_from_name("add") + BtnAddSection.hint_tooltip = "Add a new Section" + BtnRemoveSection.icon = IconLoader.load_icon_from_name("delete") + BtnRemoveSection.hint_tooltip = "Remove selected Section" + + BtnAddKey.icon = IconLoader.load_icon_from_name("add") + BtnAddKey.hint_tooltip = "Add a new Key" + BtnRemoveKey.icon = IconLoader.load_icon_from_name("delete") + BtnRemoveKey.hint_tooltip = "Remove selected Key" + BtnEditKey.icon = IconLoader.load_icon_from_name("edit_") + BtnEditKey.hint_tooltip = "Edit selected Key" func _on_addsection_pressed(): - Section.get_node("Container/section/_name").show() - Section.window_title = "Add a new Section" - if not Section.is_connected("confirmed",self,"new_section"): - Section.connect("confirmed",self,"new_section") - if Section.is_connected("confirmed",self,"remove_section"): - Section.disconnect("confirmed",self,"remove_section") - Section.popup() + Section.get_node("Container/section/_name").show() + Section.window_title = "Add a new Section" + if not Section.is_connected("confirmed",self,"new_section"): + Section.connect("confirmed",self,"new_section") + if Section.is_connected("confirmed",self,"remove_section"): + Section.disconnect("confirmed",self,"remove_section") + Section.popup() func _on_removesection_pressed(): - Section.get_node("Container").hide() - Section.window_title = "Remove selected Section" - Section.dialog_text = "Are you sure you want to remove this Section?" - if not Section.is_connected("confirmed",self,"remove_section"): - Section.connect("confirmed",self,"remove_section") - if Section.is_connected("confirmed",self,"new_section"): - Section.disconnect("confirmed",self,"new_section") - Section.popup() + Section.get_node("Container").hide() + Section.window_title = "Remove selected Section" + Section.dialog_text = "Are you sure you want to remove this Section?" + if not Section.is_connected("confirmed",self,"remove_section"): + Section.connect("confirmed",self,"remove_section") + if Section.is_connected("confirmed",self,"new_section"): + Section.disconnect("confirmed",self,"new_section") + Section.popup() func _on_addkey_pressed(): - Key.get_node("data").show() - Key.get_node("data/HBoxContainer/name").editable = true - Key.get_node("data/HBoxContainer/name").set_text("") - Key.window_title = "Add a new Key" - Key.dialog_text = "" - if not Key.is_connected("confirmed",self,"new_key"): - Key.connect("confirmed",self,"new_key") - if Key.is_connected("confirmed",self,"edit_key"): - Key.disconnect("confirmed",self,"edit_key") - if Key.is_connected("confirmed",self,"remove_key"): - Key.disconnect("confirmed",self,"remove_key") - Key.popup() + Key.get_node("data").show() + Key.get_node("data/HBoxContainer/name").editable = true + Key.get_node("data/HBoxContainer/name").set_text("") + Key.window_title = "Add a new Key" + Key.dialog_text = "" + if not Key.is_connected("confirmed",self,"new_key"): + Key.connect("confirmed",self,"new_key") + if Key.is_connected("confirmed",self,"edit_key"): + Key.disconnect("confirmed",self,"edit_key") + if Key.is_connected("confirmed",self,"remove_key"): + Key.disconnect("confirmed",self,"remove_key") + Key.popup() func _on_removekey_pressed(): - Key.get_node("data").hide() - Key.window_title = "Delete selected Key" - Key.dialog_text = "Are you sure you want to remove the selected Key?" - if not Key.is_connected("confirmed",self,"remove_key"): - Key.connect("confirmed",self,"remove_key") - if Key.is_connected("confirmed",self,"edit_key"): - Key.disconnect("confirmed",self,"edit_key") - if Key.is_connected("confirmed",self,"new_key"): - Key.disconnect("confirmed",self,"new_key") - Key.popup() + Key.get_node("data").hide() + Key.window_title = "Delete selected Key" + Key.dialog_text = "Are you sure you want to remove the selected Key?" + if not Key.is_connected("confirmed",self,"remove_key"): + Key.connect("confirmed",self,"remove_key") + if Key.is_connected("confirmed",self,"edit_key"): + Key.disconnect("confirmed",self,"edit_key") + if Key.is_connected("confirmed",self,"new_key"): + Key.disconnect("confirmed",self,"new_key") + Key.popup() func _on_editkey_pressed(): - Key.get_node("data").show() - Key.get_node("data/HBoxContainer/name").editable = false - Key.get_node("data/HBoxContainer/name").set_text(str(selected_key.get_text(0))) - Key.get_node("data/HBoxContainer2/value").set_text(str(selected_key.get_text(1))) - Key.window_title = "Edit selected Key" - Key.dialog_text = "" - if not Key.is_connected("confirmed",self,"edit_key"): - Key.connect("confirmed",self,"edit_key") - if Key.is_connected("confirmed",self,"remove_key"): - Key.disconnect("confirmed",self,"remove_key") - if Key.is_connected("confirmed",self,"new_key"): - Key.disconnect("confirmed",self,"new_key") - Key.popup() + Key.get_node("data").show() + Key.get_node("data/HBoxContainer/name").editable = false + Key.get_node("data/HBoxContainer/name").set_text(str(selected_key.get_text(0))) + Key.get_node("data/HBoxContainer2/value").set_text(str(selected_key.get_text(1))) + Key.window_title = "Edit selected Key" + Key.dialog_text = "" + if not Key.is_connected("confirmed",self,"edit_key"): + Key.connect("confirmed",self,"edit_key") + if Key.is_connected("confirmed",self,"remove_key"): + Key.disconnect("confirmed",self,"remove_key") + if Key.is_connected("confirmed",self,"new_key"): + Key.disconnect("confirmed",self,"new_key") + Key.popup() func clean_editor(): - Keys.clear() - Sections.clear() - selected_section = -1 - BtnAddKey.disabled = true - if current_file_path == "": - BtnAddSection.disabled = true - else: - BtnAddSection.disabled = false - BtnEditKey.disabled = true - BtnRemoveKey.disabled = true - BtnRemoveSection.disabled = true - - create_root() + Keys.clear() + Sections.clear() + selected_section = -1 + BtnAddKey.disabled = true + if current_file_path == "": + BtnAddSection.disabled = true + else: + BtnAddSection.disabled = false + BtnEditKey.disabled = true + BtnRemoveKey.disabled = true + BtnRemoveSection.disabled = true + + create_root() func open_file(filemap : Array): - clean_editor() - for section in filemap: - load_sections(section[0],section[1]) + clean_editor() + for section in filemap: + load_sections(section[0],section[1]) func new_section(): - var file = ConfigFile.new() - file.load(current_file_path) - - var section_name = str(Section.get_node("Container/section/_name").get_text()) - var key_name = str(Section.get_node("Container/key/_name").get_text()) - var key_value = Section.get_node("Container/value/_value").get_text() - - if section_name and key_name and key_value: - file.set_value(section_name,key_name,key_value) - file.save(current_file_path) - - load_sections(section_name,[[key_name,key_value]]) - - emit_signal("update_file") - else: - print("Section <",section_name,"> with Key name: <",key_name,"> and Key value: <",key_value,"> not valid.") + var file = ConfigFile.new() + file.load(current_file_path) + + var section_name = str(Section.get_node("Container/section/_name").get_text()) + var key_name = str(Section.get_node("Container/key/_name").get_text()) + var key_value = Section.get_node("Container/value/_value").get_text() + + if section_name and key_name and key_value: + file.set_value(section_name,key_name,key_value) + file.save(current_file_path) + + load_sections(section_name,[[key_name,key_value]]) + + emit_signal("update_file") + else: + print("Section <",section_name,"> with Key name: <",key_name,"> and Key value: <",key_value,"> not valid.") func remove_section(): - var file = ConfigFile.new() - file.load(current_file_path) - var current_section = Sections.get_item_text(selected_section) - file.erase_section(current_section) - Sections.remove_item(selected_section) - file.save(current_file_path) - - emit_signal("update_file") + var file = ConfigFile.new() + file.load(current_file_path) + var current_section = Sections.get_item_text(selected_section) + file.erase_section(current_section) + Sections.remove_item(selected_section) + file.save(current_file_path) + + emit_signal("update_file") func new_key(): - var key_name = str(Key.get_node("data/HBoxContainer/name").get_text()) - var key_value = Key.get_node("data/HBoxContainer2/value").get_text() - if key_name and key_value: - - var file = ConfigFile.new() - file.load(current_file_path) - - var current_section = Sections.get_item_text(selected_section) - - file.set_value(current_section,key_name,key_value) - file.save(current_file_path) - - load_keys_selected_section([[key_name,key_value]]) - - file.save(current_file_path) - - emit_signal("update_file") - else: - print("Key name: <",key_name,"> with Key value: <",key_value,"> not valid.") + var key_name = str(Key.get_node("data/HBoxContainer/name").get_text()) + var key_value = Key.get_node("data/HBoxContainer2/value").get_text() + if key_name and key_value: + + var file = ConfigFile.new() + file.load(current_file_path) + + var current_section = Sections.get_item_text(selected_section) + + file.set_value(current_section,key_name,key_value) + file.save(current_file_path) + + load_keys_selected_section([[key_name,key_value]]) + + file.save(current_file_path) + + emit_signal("update_file") + else: + print("Key name: <",key_name,"> with Key value: <",key_value,"> not valid.") func remove_key(): - var section = Sections.get_item_text(selected_section) - var sectionmetadata = Sections.get_item_metadata(selected_section) - - for meta in sectionmetadata: - if meta.has(selected_key.get_text(0)): - sectionmetadata.erase(meta) - - Sections.set_item_metadata(selected_section,sectionmetadata) - - if Sections.get_item_metadata(selected_section) == []: - Sections.remove_item(selected_section) - - var file = ConfigFile.new() - file.load(current_file_path) - file.set_value(section,selected_key.get_text(0),null) - file.save(current_file_path) - - Keys.clear() - create_root() - load_keys_selected_section(sectionmetadata) - - emit_signal("update_file") + var section = Sections.get_item_text(selected_section) + var sectionmetadata = Sections.get_item_metadata(selected_section) + + for meta in sectionmetadata: + if meta.has(selected_key.get_text(0)): + sectionmetadata.erase(meta) + + Sections.set_item_metadata(selected_section,sectionmetadata) + + if Sections.get_item_metadata(selected_section) == []: + Sections.remove_item(selected_section) + + var file = ConfigFile.new() + file.load(current_file_path) + file.set_value(section,selected_key.get_text(0),null) + file.save(current_file_path) + + Keys.clear() + create_root() + load_keys_selected_section(sectionmetadata) + + emit_signal("update_file") func edit_key(): - remove_key() - new_key() + remove_key() + new_key() # load a section with custom fields @section_name = name of section ; @section_metadata = keys of this section with keys' properties func load_sections(section_name : String, section_metadata : Array): - Sections.add_item(section_name,IconLoader.load_icon_from_name("section"),true) - Sections.set_item_metadata(Sections.get_item_count()-1,section_metadata) + Sections.add_item(section_name,IconLoader.load_icon_from_name("section"),true) + Sections.set_item_metadata(Sections.get_item_count()-1,section_metadata) # load a key of a selected section to fill the "keys" list func load_keys_selected_section(metadata : Array): - for key in metadata: - var key_item = Keys.create_item(root) - key_item.set_text(0,key[0]) - key_item.set_text(1,key[1]) + for key in metadata: + var key_item = Keys.create_item(root) + key_item.set_text(0,key[0]) + key_item.set_text(1,key[1]) func _on_section_selected(index : int): - Keys.clear() - create_root() - BtnRemoveSection.disabled = false - BtnAddSection.disabled = false - BtnAddKey.disabled = false - BtnRemoveKey.disabled = true - BtnEditKey.disabled = true - - selected_section = index - if Sections.get_item_metadata(index): - load_keys_selected_section(Sections.get_item_metadata(index)) + Keys.clear() + create_root() + BtnRemoveSection.disabled = false + BtnAddSection.disabled = false + BtnAddKey.disabled = false + BtnRemoveKey.disabled = true + BtnEditKey.disabled = true + + selected_section = index + if Sections.get_item_metadata(index): + load_keys_selected_section(Sections.get_item_metadata(index)) func _on_key_selected(): - selected_key = Keys.get_selected() - BtnRemoveKey.disabled = false - BtnEditKey.disabled = false + selected_key = Keys.get_selected() + BtnRemoveKey.disabled = false + BtnEditKey.disabled = false func _on_nosection_selected(): - BtnRemoveKey.disabled = true - BtnAddKey.disabled = true - BtnEditKey.disabled = true - BtnRemoveSection.disabled = true - Keys.clear() - selected_section = -1 + BtnRemoveKey.disabled = true + BtnAddKey.disabled = true + BtnEditKey.disabled = true + BtnRemoveSection.disabled = true + Keys.clear() + selected_section = -1 func _on_nokey_selected(): - BtnRemoveKey.disabled = true - BtnEditKey.disabled = true + BtnRemoveKey.disabled = true + BtnEditKey.disabled = true func create_root(): - root = Keys.create_item() - root.set_text(0,"KEY_NAME") - root.set_text(1,"KEY_VALUE") + root = Keys.create_item() + root.set_text(0,"KEY_NAME") + root.set_text(1,"KEY_VALUE") func _on_visibility_changed(): - if visible: - pass + if visible: + pass diff --git a/addons/file-editor/scripts/LastOpenedFiles.gd b/addons/file-editor/scripts/LastOpenedFiles.gd index 41ac87a..e47f517 100644 --- a/addons/file-editor/scripts/LastOpenedFiles.gd +++ b/addons/file-editor/scripts/LastOpenedFiles.gd @@ -26,8 +26,17 @@ func load_opened_files() -> Array: var file = ConfigFile.new() file.load(lastopenedfile_path) var keys = [] + # Load opened files if file.has_section("Opened"): var openedfiles = file.get_section_keys("Opened") for openedfile in openedfiles: - keys.append([openedfile,file.get_value("Opened",openedfile)]) + # Load each single file which was opened + # creating and returning an Array with this format [1:file name, 2:file path, 3:file font] + keys.append([openedfile, file.get_value("Opened",openedfile), file.get_value("Fonts",openedfile) if file.has_section_key("Fonts",openedfile) else "null"]) return keys + +func store_editor_fonts(file_name : String, font_path : String): + var file = ConfigFile.new() + file.load(lastopenedfile_path) + file.set_value("Fonts",file_name,font_path) + file.save(lastopenedfile_path) diff --git a/addons/file-editor/scripts/VanillaEditor.gd b/addons/file-editor/scripts/VanillaEditor.gd index 73ca287..4068a3e 100644 --- a/addons/file-editor/scripts/VanillaEditor.gd +++ b/addons/file-editor/scripts/VanillaEditor.gd @@ -40,6 +40,13 @@ func _ready(): add_to_group("vanilla_editor") +func set_font(font_path : String) -> void: + var dynamic_font : DynamicFont = DynamicFont.new() + var dynamic_font_data : DynamicFontData = DynamicFontData.new() + dynamic_font_data.set_font_path(font_path) + dynamic_font.set_font_data(dynamic_font_data) + TextEditor.set("custom_fonts/font",dynamic_font) + func set_wrap_enabled(enabled:bool): TextEditor.set_wrap_enabled(enabled) TextEditor.update() From 1cb324a67407973cdd1c4de363dcdf94cff3b2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:21:10 +0200 Subject: [PATCH 13/21] add custom font menu --- addons/file-editor/scenes/FileEditor.tscn | 120 +++++++++++++++---- addons/file-editor/scenes/VanillaEditor.tscn | 4 +- 2 files changed, 100 insertions(+), 24 deletions(-) diff --git a/addons/file-editor/scenes/FileEditor.tscn b/addons/file-editor/scenes/FileEditor.tscn index 7da3c9c..0713f17 100644 --- a/addons/file-editor/scenes/FileEditor.tscn +++ b/addons/file-editor/scenes/FileEditor.tscn @@ -1,9 +1,9 @@ -[gd_scene load_steps=19 format=2] +[gd_scene load_steps=27 format=2] [ext_resource path="res://addons/file-editor/scripts/FileEditor.gd" type="Script" id=1] [ext_resource path="res://addons/file-editor/fonts/Roboto-Black.ttf" type="DynamicFontData" id=2] -[sub_resource type="Image" id=17] +[sub_resource type="Image" id=25] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -13,10 +13,10 @@ data = { } [sub_resource type="ImageTexture" id=2] -image = SubResource( 17 ) +image = SubResource( 25 ) size = Vector2( 16, 16 ) -[sub_resource type="Image" id=18] +[sub_resource type="Image" id=26] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 175, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 175, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 16, 224, 224, 224, 239, 224, 224, 224, 239, 224, 224, 224, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 80, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -26,10 +26,10 @@ data = { } [sub_resource type="ImageTexture" id=4] -image = SubResource( 18 ) +image = SubResource( 26 ) size = Vector2( 16, 16 ) -[sub_resource type="Image" id=19] +[sub_resource type="Image" id=27] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 16, 224, 224, 224, 80, 224, 224, 224, 206, 224, 224, 224, 238, 224, 224, 224, 238, 224, 224, 224, 174, 224, 224, 224, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 48, 224, 224, 224, 206, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 206, 224, 224, 224, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 48, 224, 224, 224, 238, 224, 224, 224, 254, 224, 224, 224, 206, 224, 224, 224, 112, 224, 224, 224, 16, 224, 224, 224, 16, 224, 224, 224, 80, 224, 224, 224, 222, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 16, 224, 224, 224, 206, 224, 224, 224, 254, 224, 224, 224, 222, 224, 224, 224, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 16, 224, 224, 224, 206, 224, 224, 224, 254, 224, 224, 224, 238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 96, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 96, 0, 0, 0, 0, 224, 224, 224, 64, 224, 224, 224, 206, 224, 224, 224, 222, 224, 224, 224, 64, 0, 0, 0, 0, 224, 224, 224, 96, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 206, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 32, 0, 0, 0, 0, 224, 224, 224, 222, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 238, 0, 0, 0, 0, 224, 224, 224, 16, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 238, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 222, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 16, 0, 0, 0, 0, 224, 224, 224, 222, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 238, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 222, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 126, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 96, 0, 0, 0, 0, 224, 224, 224, 64, 224, 224, 224, 254, 224, 224, 224, 238, 224, 224, 224, 96, 0, 0, 0, 0, 224, 224, 224, 80, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 126, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 16, 224, 224, 224, 222, 224, 224, 224, 254, 224, 224, 224, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 16, 224, 224, 224, 190, 224, 224, 224, 254, 224, 224, 224, 238, 224, 224, 224, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 48, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 206, 224, 224, 224, 96, 0, 0, 0, 0, 224, 224, 224, 16, 224, 224, 224, 64, 224, 224, 224, 206, 224, 224, 224, 254, 224, 224, 224, 238, 224, 224, 224, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 48, 224, 224, 224, 222, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 254, 224, 224, 224, 238, 224, 224, 224, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 112, 224, 224, 224, 206, 224, 224, 224, 254, 224, 224, 224, 238, 224, 224, 224, 206, 224, 224, 224, 126, 224, 224, 224, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -39,14 +39,14 @@ data = { } [sub_resource type="ImageTexture" id=6] -image = SubResource( 19 ) +image = SubResource( 27 ) size = Vector2( 16, 16 ) [sub_resource type="DynamicFont" id=7] size = 13 font_data = ExtResource( 2 ) -[sub_resource type="Image" id=20] +[sub_resource type="Image" id=28] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -56,10 +56,10 @@ data = { } [sub_resource type="ImageTexture" id=9] -image = SubResource( 20 ) +image = SubResource( 28 ) size = Vector2( 16, 16 ) -[sub_resource type="Image" id=21] +[sub_resource type="Image" id=29] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -69,10 +69,10 @@ data = { } [sub_resource type="ImageTexture" id=11] -image = SubResource( 21 ) +image = SubResource( 29 ) size = Vector2( 16, 16 ) -[sub_resource type="Image" id=22] +[sub_resource type="Image" id=30] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -82,10 +82,10 @@ data = { } [sub_resource type="ImageTexture" id=13] -image = SubResource( 22 ) +image = SubResource( 30 ) size = Vector2( 16, 16 ) -[sub_resource type="Image" id=23] +[sub_resource type="Image" id=31] data = { "data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), "format": "RGBA8", @@ -95,10 +95,62 @@ data = { } [sub_resource type="ImageTexture" id=15] -image = SubResource( 23 ) +image = SubResource( 31 ) size = Vector2( 16, 16 ) -[sub_resource type="StyleBoxEmpty" id=16] +[sub_resource type="Image" id=32] +data = { +"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), +"format": "RGBA8", +"height": 16, +"mipmaps": false, +"width": 16 +} + +[sub_resource type="ImageTexture" id=17] +image = SubResource( 32 ) +size = Vector2( 16, 16 ) + +[sub_resource type="Image" id=33] +data = { +"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), +"format": "RGBA8", +"height": 16, +"mipmaps": false, +"width": 16 +} + +[sub_resource type="ImageTexture" id=19] +image = SubResource( 33 ) +size = Vector2( 16, 16 ) + +[sub_resource type="Image" id=34] +data = { +"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), +"format": "RGBA8", +"height": 16, +"mipmaps": false, +"width": 16 +} + +[sub_resource type="ImageTexture" id=21] +image = SubResource( 34 ) +size = Vector2( 16, 16 ) + +[sub_resource type="Image" id=35] +data = { +"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), +"format": "RGBA8", +"height": 16, +"mipmaps": false, +"width": 16 +} + +[sub_resource type="ImageTexture" id=23] +image = SubResource( 35 ) +size = Vector2( 16, 16 ) + +[sub_resource type="StyleBoxEmpty" id=24] [node name="FileEditor" type="Control"] anchor_right = 1.0 @@ -150,15 +202,23 @@ text = "Preview" icon = SubResource( 6 ) items = [ "BBCode Preview", null, 0, false, false, 0, 0, null, "", false, "Markdown Preview", null, 0, false, false, 1, 0, null, "", false, "HTML Preview", null, 0, false, false, 2, 0, null, "", false, "CSV Preview [coming soon]", null, 0, false, true, 3, 0, null, "", false, "XML Preview [coming soon]", null, 0, false, true, 4, 0, null, "", false, "JSON Preview [coming soon]", null, 0, false, true, 5, 0, null, "", false ] +[node name="SettingsBtn" type="MenuButton" parent="FileEditorContainer/TobBar"] +margin_left = 215.0 +margin_right = 297.0 +margin_bottom = 22.0 +text = "Settings" +icon = SubResource( 6 ) +items = [ "Change Font", null, 0, false, false, 0, 0, null, "", false ] + [node name="version" type="Label" parent="FileEditorContainer/TobBar"] -margin_left = 953.0 +margin_left = 961.0 margin_top = 2.0 margin_right = 1000.0 margin_bottom = 19.0 size_flags_horizontal = 10 custom_fonts/font = SubResource( 7 ) custom_colors/font_color = Color( 0.121569, 0.145098, 0.192157, 1 ) -text = "v1.7.11" +text = "v1.7.4" align = 1 [node name="SplitContainer" type="HSplitContainer" parent="FileEditorContainer"] @@ -177,7 +237,7 @@ margin_bottom = 574.0 margin_right = 153.0 margin_bottom = 570.0 size_flags_vertical = 3 -items = [ "README.md", SubResource( 9 ), false, "sample.cfg", SubResource( 11 ), false, "data2.csv", SubResource( 13 ), false, "text.txt", SubResource( 15 ), false ] +items = [ "sample.bbs", SubResource( 9 ), false, "sample.cfg", SubResource( 11 ), false, "sample.csv", SubResource( 13 ), false, "sample.html", SubResource( 15 ), false, "sample.ini", SubResource( 17 ), false, "sample.md", SubResource( 19 ), false, "sample.txt", SubResource( 21 ), false, "test.csv", SubResource( 23 ), false ] allow_reselect = true [node name="HSeparator" type="HSeparator" parent="FileEditorContainer/SplitContainer/FileContainer"] @@ -185,7 +245,7 @@ margin_top = 574.0 margin_right = 153.0 margin_bottom = 574.0 rect_min_size = Vector2( 2, 0 ) -custom_styles/separator = SubResource( 16 ) +custom_styles/separator = SubResource( 24 ) custom_constants/separation = 0 [node name="EditorContainer" type="VBoxContainer" parent="FileEditorContainer/SplitContainer"] @@ -209,7 +269,7 @@ margin_right = 653.0 margin_bottom = 24.0 mouse_filter = 1 size_flags_horizontal = 3 -text = "res://text.txt" +text = "res://test.csv" editable = false [node name="wrap_button" type="OptionButton" parent="FileEditorContainer/SplitContainer/EditorContainer/HBoxContainer"] @@ -236,7 +296,8 @@ size_flags_vertical = 3 popup_exclusive = true window_title = "Salva un file" dialog_hide_on_ok = true -filters = PoolStringArray( "*.txt ; Plain Text File", "*.rtf ; Rich Text Format File", "*.log ; Log File", "*.md ; MD File", "*.doc ; WordPad Document", "*.doc ; Microsoft Word Document", "*.docm ; Word Open XML Macro-Enabled Document", "*.docx ; Microsoft Word Open XML Document", "*.bbs ; Bulletin Board System Text", "*.dat ; Data File", "*.xml ; XML File", "*.sql ; SQL database file", "*.json ; JavaScript Object Notation File", "*.html ; HyperText Markup Language", "*.csv ; Comma-separated values", "*.cfg ; Configuration File", "*.ini ; Initialization File (same as .cfg Configuration File)", "*.csv ; Comma-separated values File" ) +filters = PoolStringArray( "*.txt ; Plain Text File", "*.rtf ; Rich Text Format File", "*.log ; Log File", "*.md ; MD File", "*.doc ; WordPad Document", "*.doc ; Microsoft Word Document", "*.docm ; Word Open XML Macro-Enabled Document", "*.docx ; Microsoft Word Open XML Document", "*.bbs ; Bulletin Board System Text", "*.dat ; Data File", "*.xml ; XML File", "*.sql ; SQL database file", "*.json ; JavaScript Object Notation File", "*.html ; HyperText Markup Language", "*.csv ; Comma-separated values", "*.cfg ; Configuration File", "*.ini ; Initialization File (same as .cfg Configuration File)", "*.csv ; Comma-separated values File", "*.res ; Resource File" ) +show_hidden_files = true [node name="NewFileDialogue" type="AcceptDialog" parent="."] margin_left = 348.254 @@ -284,3 +345,18 @@ margin_bottom = 37.5 window_title = "Unsaved changes" dialog_text = "There are some unsaved changes. Press \"OK\" if you want to close this tab anyway, or \"cancel\" if you want to keep on editing your file." + +[node name="SelectFontDialog" type="FileDialog" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 222.0 +margin_top = 132.0 +margin_right = -221.0 +margin_bottom = -131.0 +window_title = "Select a Font" +resizable = true +mode = 0 +access = 2 +filters = PoolStringArray( "*.TTF", "*.ttf" ) +current_dir = "/COMPUTER/GodotEngine/GDScript/[Plugin]FileEditor" +current_path = "/COMPUTER/GodotEngine/GDScript/[Plugin]FileEditor/" diff --git a/addons/file-editor/scenes/VanillaEditor.tscn b/addons/file-editor/scenes/VanillaEditor.tscn index da94598..7089862 100644 --- a/addons/file-editor/scenes/VanillaEditor.tscn +++ b/addons/file-editor/scenes/VanillaEditor.tscn @@ -70,9 +70,9 @@ caret_moving_by_right_click = false [node name="SearchBox" type="HBoxContainer" parent="."] visible = false -margin_top = 525.0 +margin_top = 553.0 margin_right = 1024.0 -margin_bottom = 549.0 +margin_bottom = 577.0 [node name="Label" type="Label" parent="SearchBox"] margin_top = 5.0 From a120ddc8f5212928ec36ebc1f62f0291edc49106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:22:04 +0200 Subject: [PATCH 14/21] updated version to 1.7.6 --- addons/file-editor/plugin.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/file-editor/plugin.cfg b/addons/file-editor/plugin.cfg index 46dba6f..89ea660 100644 --- a/addons/file-editor/plugin.cfg +++ b/addons/file-editor/plugin.cfg @@ -3,5 +3,5 @@ name="File Editor" description="An internal file editor to view and edit text files in your project folder." author="Nicolo 'fenix' Santilio" -version="1.7.3" +version="1.7.6" script="scripts/file-editor.gd" From b770696bc4859086773d382303798bd41a2777c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:22:19 +0200 Subject: [PATCH 15/21] Delete VERSION.md --- addons/file-editor/VERSION.md | 114 ---------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 addons/file-editor/VERSION.md diff --git a/addons/file-editor/VERSION.md b/addons/file-editor/VERSION.md deleted file mode 100644 index 04afa11..0000000 --- a/addons/file-editor/VERSION.md +++ /dev/null @@ -1,114 +0,0 @@ -**version 0.0.1** -*added* -- Plugin Created - ------------------------ - -**version 0.1.1** -*added* -- "Create new File" option -- "Open File" option -- "Delete File" option -- "Save File" option -- "Save File As.." option - ------------------------ - -**version 0.1.2** -*fixed* -- Repository Installation, folder order - ------------------------ - -**version 0.2.5** -*removed* -- Old layout - -*added* -- New Layout -- Last modified time and date -- Tabs - ------------------------ - -**version 0.3.1** -*added* -- Version check -- Preview support -- Context menu in editor -- BBCode converter -- Light Mardkwon converter (DEMO) - ------------------------ - -**version 1.2.1** -*removed* -- Old layout, the plugin won't appear in docs -- Icons file extensions, plugin size reduced -- Old Mardkwon preview method - -*added* -- More supported files -1. "*.dat ; Data File", -2. "*.xml ; XML File", -3. "*.sql ; SQL database file", -4. "*.json ; JavaScript Object Notation File", -5. "*.html ; HyperText Markup Language", -- New Markdown preview method ( Markdown -> BBCode converter) -- New HTML preview method ( HTML -> BBCode converter) -- New Plugin Layout: a new ButtonTool "File" in you TopBar will appear -- Error check -- Message popups for closing unsaved files - ------------------------ - -**version 1.4.3** -*removed* -- Old layout - -*added* -- More supported files: -1. "*.cfg ; Configuration File", -2. "*.ini ; Initialization File (same as .cfg Configuration File)", -- Added some sample files -- Memorize system of last opened files -- Added *Editor* button , you can now choose which editor to use: -1. Vanilla Editor (simple text editor) -2. Cfg/Ini Editor (table editor for Cfg/Ini files) - Editors are automatically updated, so if you update a cfg/ini file in the Vanilla Editor it will be updated in the Cfg/Ini Editor, and viceversa -- Added editor shorcuts: -1. *Ctrl + N* (new file) -2. *Ctrl + O* (open file) -3. *Ctrl + Alt + C* (close file) -4. *Ctrl + S* (save file) -5. *Ctrl + Alt + S* (save file as...) -6. *Ctrl + D* (delete file) -7. *Ctrl + 1* (Vanilla Editor) -8. *Ctrl + 3* (Cfg/Ini Editor) - ------------------------ - -**version 1.6.0** -*fixed* -- Each opened file now has own editor: unsaved changes are no longer erased if a new file is opened without saving the previous opened file - -*added* -- Custom Syntax Highlighting for each file type (.md, .cfg/.ini, .html, .bbs) -- Characters counter in VanillaEditor -- String searcher in VanillaEditor (with custom shortcut *Ctrl + F*) -- String replacer in VanillaEditor (with custom shortcut *Ctrl + R*) - ------------------------ - -**version 1.6.4** -*added* -- CSV VisualEditor (shortcut *Ctrl+2*): - - you can now read and edit CSV files which importing them as simple CSV files (and not translate file) -- MiniMap drawer in VanillaEditor -- SoftWrap / NoWrap in VanillaEditor -- **Version 3.2alpha2 supported** - ---------------------- - -**version 1.7.1** -- several bug fixes From da8814f09086ac10ce77282544f1dc00d0cf9751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:22:27 +0200 Subject: [PATCH 16/21] Delete README.md --- addons/file-editor/README.md | 63 ------------------------------------ 1 file changed, 63 deletions(-) delete mode 100644 addons/file-editor/README.md diff --git a/addons/file-editor/README.md b/addons/file-editor/README.md deleted file mode 100644 index 99b9c4c..0000000 --- a/addons/file-editor/README.md +++ /dev/null @@ -1,63 +0,0 @@ -Check my **[Discord](https://discord.gg/KnJGY9S)** to stay updated on this repository. -*(Recommended since the AssetLibrary is not automatically updated)* - -This plugin is now supported in [Godot Extended Library Discord](https://discord.gg/JNrcucg), check out the [Godot Extended Library Project](https://github.com/godot-extended-libraries)! - -# Godot Text Editor -A little plugin to easy-way manage your text files inside your project folder. - -Author: *"Nicolo (fenix) Santilio"* -Version: *1.7.1* -Godot Version: *3.2.1* - -**This repository was pushed directly from Godot Engine Editor thanks to [GitHub Integration](https://github.com/fenix-hub/godot-engine.github-integration)!** - -## What is this? -This is a little plugin I've made to easily edit text files in your project folder. - -## How does it work? -You can open an existing file, create a new file and delete a file. -When opening / creating a file, the editor will open and you will be able to edit it and save it. -You can just *Save* the file, or *Save file As* a new file (if it is a new file but also to make some copies). -You will also be able to see some informations about the file you are editing (time and date of last edit) and you can set your editor to *Read Only* if you don't want to make changes but still read the content of the file. -Multiple files can be opened in different tabs. -![preview1](https://i.imgur.com/BbZzKzD.png)![preview2](https://i.imgur.com/asggk4f.png) ![preview3](https://i.imgur.com/omReRZr.png) ![preview4](https://i.imgur.com/d8pMJsE.png) - -## How do I install it? -**Manual** -Just download this whole repository and put it in your `res://addons` folder inside the project you want to work on. -Then, go to `Project > Plugins > "File Editor" > Status > Activate`. - -**Automatic** -You can find this plugin in the AssetLib of Godot Engine Editor. Just download it from there and everything should be fine! -(Remember to activate this plugin) - -## Supported formats -+ "*.txt ; Plain Text File", -+ "*.rtf ; Rich Text Format File", -+ "*.log ; Log File", -+ "*.md ; MD File", -+ "*.doc ; WordPad Document", -+ "*.doc ; Microsoft Word Document", -+ "*.docm ; Word Open XML Macro-Enabled Document", -+ "*.docx ; Microsoft Word Open XML Document", -+ "*.bbs ; Bulletin Board System Text", -+ "*.dat ; Data File", -+ "*.xml ; XML File", -+ "*.sql ; SQL database file", -+ "*.json ; JavaScript Object Notation File", -+ "*.html ; HyperText Markup Language" -+ "*.cfg ; Configuration File" -+ "*.ini ; Initialization File (same as .cfg Configuration File)" -+ "*.csv ; Comma-separated values File" - -#### Current version -To check all the features included in the current version, please read the [VERSION file](./VERSION.md) - -#### Upcoming features -To check all the features I'm currently working on, please read the [TODO file](./TODO.md) - -# Disclaimer -This addon was built for a **personal use** intention. It was released as an open source plugin in the hope that it could be useful to the Godot Engine Community. -As a "work in progress" project, there is *no warranty* for any eventual issue and bug that may broke your project. -I don't assume any responsibility for possible corruptions of your project files. It is always advisable to keep a copy of your files and check any changes. From 6c5e673a889cad7e3f7d51db9faf8d14572a3478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:22:35 +0200 Subject: [PATCH 17/21] Delete TODO.md --- addons/file-editor/TODO.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 addons/file-editor/TODO.md diff --git a/addons/file-editor/TODO.md b/addons/file-editor/TODO.md deleted file mode 100644 index 01cb33c..0000000 --- a/addons/file-editor/TODO.md +++ /dev/null @@ -1,3 +0,0 @@ -### to do (v-0.x.x) -- Popup dialog when closing a tab if there is new content -- Module for markdown support/conversion From 851409ec61ac70d06df60f3733bb0cbf26aaeb3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:23:08 +0200 Subject: [PATCH 18/21] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index efcdf2e..265d551 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![version](https://img.shields.io/badge/plugin%20version-1.7.4-blue)](https://github.com/fenix-hub/godot-engine.file-editor) +[![version](https://img.shields.io/badge/plugin%20version-1.7.6-blue)](https://github.com/fenix-hub/godot-engine.file-editor) [![updates](https://img.shields.io/badge/plugin%20updates-on%20discord-purple)](https://discord.gg/JNrcucg) [![paypal](https://img.shields.io/badge/donations-PayPal-cyan)](https://paypal.me/NSantilio?locale.x=it_IT) @@ -12,9 +12,9 @@ This plugin is now supported in [Godot Extended Library Discord](https://discord # Godot File Editor A little plugin to easy-way manage your text files inside your project folder. -Author: *"Nicolo (fenix) Santilio"* -Version: *1.7.4* -Godot Version: *3.2.3rc4* +Author: *"Nicolo (fenix) Santilio"* +Version: *1.7.6* +Godot Version: *3.2.3* **This repository was pushed directly from Godot Engine Editor thanks to [GitHub Integration](https://github.com/fenix-hub/godot-engine.github-integration)!** From 8454bf5f633f715f0b3a5793404a8b2221fad464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Mon, 12 Oct 2020 18:23:23 +0200 Subject: [PATCH 19/21] updated plugin and godot version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 265d551..829dc1e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This plugin is now supported in [Godot Extended Library Discord](https://discord A little plugin to easy-way manage your text files inside your project folder. Author: *"Nicolo (fenix) Santilio"* -Version: *1.7.6* +Version: *1.7.6* Godot Version: *3.2.3* **This repository was pushed directly from Godot Engine Editor thanks to [GitHub Integration](https://github.com/fenix-hub/godot-engine.github-integration)!** From 6f483547f1a5c15121da28c5b3ecf8d83404c02d Mon Sep 17 00:00:00 2001 From: ShalokShalom Date: Tue, 13 Oct 2020 08:33:20 +0200 Subject: [PATCH 20/21] Correct spelling Nice project, dude! --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 829dc1e..ae8b5ef 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Author: *"Nicolo (fenix) Santilio"* Version: *1.7.6* Godot Version: *3.2.3* -**This repository was pushed directly from Godot Engine Editor thanks to [GitHub Integration](https://github.com/fenix-hub/godot-engine.github-integration)!** +**This repository was pushed directly from Godot Engine Editor thanks to this [GitHub Integration](https://github.com/fenix-hub/godot-engine.github-integration)!** ## What is this? This is a little plugin I've made to easily edit text files in your project folder. @@ -59,12 +59,12 @@ You can find this plugin in the AssetLib of Godot Engine Editor. Just download i + "*.res ; Resource File" #### Current version -To check all the features included in the current version, please read the [VERSION file](./VERSION.md) +To check all the features that are included in the current version, please read the [VERSION file](./VERSION.md) #### Upcoming features To check all the features I'm currently working on, please read the [TODO file](./TODO.md) # Disclaimer -This addon was built for a **personal use** intention. It was released as an open source plugin in the hope that it could be useful to the Godot Engine Community. +This addon was built for the intention of my **personal use**. It was released as an open source plugin in the hope that it could be useful to the Godot Engine Community. As a "work in progress" project, there is *no warranty* for any eventual issue and bug that may broke your project. I don't assume any responsibility for possible corruptions of your project files. It is always advisable to keep a copy of your files and check any changes. From e0e64260fe7b53282265853b84cbafa6fb466569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Tue, 13 Oct 2020 17:59:36 +0200 Subject: [PATCH 21/21] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 32 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 17 ++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..27ed342 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. Windows] + - Godot Engine Version [e.g. 3.2.3rc6] +- Plugin Version [e.g. v1.7.0] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..b1d276d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[FEATURE]" +labels: enhancement +assignees: '' + +--- + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe an implementation suggestion** +A clear and concise description of any implementation method you'd like to suggest. It may be technical or just theoretical. + +**Additional context** +Add any other context or screenshots about the feature request here.