From 44171b63787555d30e606124abcc6ca7acd5f10c Mon Sep 17 00:00:00 2001 From: fenix-hub Date: Fri, 18 Oct 2019 01:22:11 +0200 Subject: [PATCH] Update v1.6..4 --- addons/file-editor/README.md | 132 ++++--- addons/file-editor/VERSION.md | 208 +++++------ addons/file-editor/file.samples/sample.bbs | 11 + addons/file-editor/file.samples/sample.cfg | 2 + addons/file-editor/file.samples/sample.csv | 6 + .../file.samples/sample.csv.import | 10 + addons/file-editor/file.samples/sample.md | 13 +- addons/file-editor/file.samples/sample.txt | 1 + .../icons.pngs/align.png.buttonicon | Bin 0 -> 195 bytes .../icons.pngs/column.png.buttonicon | Bin 0 -> 146 bytes .../file-editor/icons.pngs/row.png.buttonicon | Bin 0 -> 150 bytes .../icons.pngs/text-center.png.buttonicon | Bin 0 -> 156 bytes .../icons.pngs/text-fill.png.buttonicon | Bin 0 -> 142 bytes .../icons.pngs/text-left.png.buttonicon | Bin 0 -> 154 bytes .../icons.pngs/text-right.png.buttonicon | Bin 0 -> 154 bytes addons/file-editor/lastopenedfiles.lastcfg | 9 +- addons/file-editor/plugin.cfg | 2 +- addons/file-editor/scenes/CsvEditor.tscn | 333 ++++++++++++++++++ addons/file-editor/scenes/FileEditor.tscn | 185 ++++++---- addons/file-editor/scenes/FileEditor.tscn.tmp | 324 +++++++++++++++++ addons/file-editor/scenes/IniEditor.tscn | 38 +- addons/file-editor/scenes/Preview.tscn | 9 +- addons/file-editor/scenes/Preview.tscn.tmp | 64 ++++ addons/file-editor/scenes/Readonly.tscn | 35 ++ addons/file-editor/scenes/VanillaEditor.tscn | 8 +- addons/file-editor/scripts/CsvEditor.gd | 182 ++++++++++ addons/file-editor/scripts/FileEditor.gd | 213 +++++++---- addons/file-editor/scripts/IconLoader.gd | 3 - addons/file-editor/scripts/IniVisualEditor.gd | 5 +- addons/file-editor/scripts/LastOpenedFiles.gd | 6 +- addons/file-editor/scripts/Preview.gd | 4 +- addons/file-editor/scripts/VanillaEditor.gd | 211 +++++++++++ addons/file-editor/scripts/file-editor.gd | 8 +- 33 files changed, 1679 insertions(+), 343 deletions(-) create mode 100644 addons/file-editor/file.samples/sample.csv create mode 100644 addons/file-editor/file.samples/sample.csv.import create mode 100644 addons/file-editor/file.samples/sample.txt create mode 100644 addons/file-editor/icons.pngs/align.png.buttonicon create mode 100644 addons/file-editor/icons.pngs/column.png.buttonicon create mode 100644 addons/file-editor/icons.pngs/row.png.buttonicon create mode 100644 addons/file-editor/icons.pngs/text-center.png.buttonicon create mode 100644 addons/file-editor/icons.pngs/text-fill.png.buttonicon create mode 100644 addons/file-editor/icons.pngs/text-left.png.buttonicon create mode 100644 addons/file-editor/icons.pngs/text-right.png.buttonicon create mode 100644 addons/file-editor/scenes/CsvEditor.tscn create mode 100644 addons/file-editor/scenes/FileEditor.tscn.tmp create mode 100644 addons/file-editor/scenes/Preview.tscn.tmp create mode 100644 addons/file-editor/scenes/Readonly.tscn create mode 100644 addons/file-editor/scripts/CsvEditor.gd create mode 100644 addons/file-editor/scripts/VanillaEditor.gd diff --git a/addons/file-editor/README.md b/addons/file-editor/README.md index d1a40d8..13a1062 100644 --- a/addons/file-editor/README.md +++ b/addons/file-editor/README.md @@ -1,69 +1,63 @@ -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.6.0* -Godot Version: *3.1.1-stable* - -**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) - -## 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)" - -#### 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. - - - - - - - +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.6.4* +Godot Version: *3.2alpha2* + +**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. \ No newline at end of file diff --git a/addons/file-editor/VERSION.md b/addons/file-editor/VERSION.md index ea769ab..1ef87a4 100644 --- a/addons/file-editor/VERSION.md +++ b/addons/file-editor/VERSION.md @@ -1,99 +1,109 @@ -**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 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 + diff --git a/addons/file-editor/file.samples/sample.bbs b/addons/file-editor/file.samples/sample.bbs index 9cb4d8f..c86543f 100644 --- a/addons/file-editor/file.samples/sample.bbs +++ b/addons/file-editor/file.samples/sample.bbs @@ -8,5 +8,16 @@ [code]monospaced text[/code] left [center]center[/center] [right]right[/right] +[center][wave amp=50 freq=10]oooooondaaaaaaaaa[/wave][/center] + +[center][tornado amp=50 freq=10 radius=5]tornaaaaaadoooooo[/tornado][/center] + +[center][shake rate=15 level=10]scossa[/shake][/center] + +[center][fade start=4 length=14]Effetto fantasmaaaaaa[/fade][/center] + +[center][rainbow freq=4 sat=10 val=100]Arcobaleno![/rainbow][/center] + +[center][pulse freq=6.0 height=5.0][pulse color=#00FFAA freq=2.0]Questo è un codice custom![/pulse][/pulse][/center] *Some md text in bb file* diff --git a/addons/file-editor/file.samples/sample.cfg b/addons/file-editor/file.samples/sample.cfg index df98c2d..e16ca2f 100644 --- a/addons/file-editor/file.samples/sample.cfg +++ b/addons/file-editor/file.samples/sample.cfg @@ -21,3 +21,5 @@ SeekLongPeriod="15" Duplex="1" SWPlaythrough="0" +[AnotherSection] +SectionName="ThisNewSection" diff --git a/addons/file-editor/file.samples/sample.csv b/addons/file-editor/file.samples/sample.csv new file mode 100644 index 0000000..8c63ae2 --- /dev/null +++ b/addons/file-editor/file.samples/sample.csv @@ -0,0 +1,6 @@ +COLUMN 1| |COLUMN2|COLUMN3|COLUMN5 +this is a| |csv file with empty spaces| |- +anyway,|they are stored in| |the file|- +this|is a |new|line|- +line 5|and column 5|where created|with the editor|- +-|-|-|-|- diff --git a/addons/file-editor/file.samples/sample.csv.import b/addons/file-editor/file.samples/sample.csv.import new file mode 100644 index 0000000..66a6a5a --- /dev/null +++ b/addons/file-editor/file.samples/sample.csv.import @@ -0,0 +1,10 @@ +[remap] + +importer="csv" +type="TextFile" + +[deps] + +source_file="res://addons/file-editor/file.samples/sample.csv" +[params] + diff --git a/addons/file-editor/file.samples/sample.md b/addons/file-editor/file.samples/sample.md index c27e453..da0d1f3 100644 --- a/addons/file-editor/file.samples/sample.md +++ b/addons/file-editor/file.samples/sample.md @@ -1,6 +1,17 @@ **bolded text** *italicized text* +***bolded and italicized*** ~~strikethrough~~ -__simple__ +__underline__ +> This is a quote +`this is some code` [link](http://example.com) ![image](res://addons/file-editor/icon.png) + +# header 1 +## header 2 +### header 3 +#### header 5 +##### header 6 +###### header7 + diff --git a/addons/file-editor/file.samples/sample.txt b/addons/file-editor/file.samples/sample.txt new file mode 100644 index 0000000..8a03e0e --- /dev/null +++ b/addons/file-editor/file.samples/sample.txt @@ -0,0 +1 @@ +This is a simple text file. diff --git a/addons/file-editor/icons.pngs/align.png.buttonicon b/addons/file-editor/icons.pngs/align.png.buttonicon new file mode 100644 index 0000000000000000000000000000000000000000..558242d969feca647321db9338165bf37c525283 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFUg?1hE&W+ zPH13sb2JceFfd>gb`e@}jOCaBPeYb?o8g%SL2r0_cAPnwE6x!9oaK$XiJ?AFAA_f> KpUXO@geCw~2Stwn literal 0 HcmV?d00001 diff --git a/addons/file-editor/icons.pngs/column.png.buttonicon b/addons/file-editor/icons.pngs/column.png.buttonicon new file mode 100644 index 0000000000000000000000000000000000000000..29d760b7a06fd686ec1f3dc80c01f87665977d45 GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;V{wqX6XVU3I`u#fXMsm#F#`j) zFbFd;%$g$s6l4qV32_C||NsAAdUO6=Ad9Ia$S;`TfAmD9tw5f*r;B4q#hm1Xgai${ j;{r8Z225JX2@DLCulVoh&bpQdRKnot>gTe~DWM4fo1`Sg literal 0 HcmV?d00001 diff --git a/addons/file-editor/icons.pngs/row.png.buttonicon b/addons/file-editor/icons.pngs/row.png.buttonicon new file mode 100644 index 0000000000000000000000000000000000000000..50e2b15bfb35237198b26f36b3d72761bbc80aae GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;V{wqX6XVU3I`u#fXMsm#F#`j) zFbFd;%$g$s6l4qV32_C||NsAAdUO6=Ad9Ia$S;`TfAmD9tw5f%r;B4q#hm1XgoG9U nk3TrTqNK=hqCt5FhYurz#zLN4Q-jnFpfUzeS3j3^P6oO;4 literal 0 HcmV?d00001 diff --git a/addons/file-editor/icons.pngs/text-right.png.buttonicon b/addons/file-editor/icons.pngs/text-right.png.buttonicon new file mode 100644 index 0000000000000000000000000000000000000000..3b6f6931c586e99f7e9148755e1acd4ee486b800 GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!D3?x-;bCrM;V{wqX6XVU3I`u#fXMsm#F#`j) zFbFd;%$g$s6l4qV32_C||NsAAdUO6=Ad9Ia$S;`TfAmD9tw5f void: + self.filepath = filepath + var csv = File.new() + csv.open(filepath,File.READ) + var rows : Array = [] + var columns = -1 + while not csv.eof_reached(): + rows.append(csv.get_csv_line(csv_delimiter)) + 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) + +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 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,"|") + file.close() + + emit_signal("update_file") diff --git a/addons/file-editor/scripts/FileEditor.gd b/addons/file-editor/scripts/FileEditor.gd index 4f2fb96..f7375ac 100644 --- a/addons/file-editor/scripts/FileEditor.gd +++ b/addons/file-editor/scripts/FileEditor.gd @@ -15,11 +15,15 @@ onready var Version = $FileEditorContainer/TobBar/version onready var FileContainer = $FileEditorContainer/SplitContainer/FileContainer onready var OpenFileList = $FileEditorContainer/SplitContainer/FileContainer/OpenFileList -onready var OpenFileName = $FileEditorContainer/SplitContainer/FileContainer/OpenFileName +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 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 @@ -43,6 +47,7 @@ var EXTENSIONS : PoolStringArray = [ "*.csv ; Comma-separated values", "*.cfg ; Configuration File", "*.ini ; Initialization File (same as .cfg Configuration File)", +"*.csv ; Comma-separated values File", ] var directories = [] @@ -52,6 +57,7 @@ var current_file_path = "" var save_as = false var current_editor : Control var current_ini_editor : Control +var current_csv_editor : Control func _ready(): clean_editor() @@ -118,10 +124,15 @@ func create_shortcuts(): 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()) # vanilla editor + 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") @@ -135,12 +146,8 @@ func connect_signals(): EditorBTN.connect("id_pressed",self,"_on_editorbtn_pressed") OpenFileList.connect("item_selected",self,"_on_fileitem_pressed") - - #---------------- to update from IniEditor to VanillaEditor - - - # ---- preview buttons - + WrapBTN.connect("item_selected",self,"on_wrap_button") + MapBTN.connect("item_selected",self,"on_minimap_button") func update_version(): var plugin_version = "" @@ -231,8 +238,6 @@ func _on_previewbtn_pressed(id : int): markdown_preview() elif id == 2: html_preview() - elif id == 3: - csv_preview() elif id == 4: xml_preview() elif id == 5: @@ -243,72 +248,111 @@ func _on_editorbtn_pressed(index : int): 0: if not current_editor.visible: current_editor.show() - current_ini_editor.hide() - 2: - if not current_ini_editor.visible: + 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: + current_csv_editor.show() current_editor.hide() + if current_ini_editor: + current_ini_editor.hide() + 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.show() func _on_fileitem_pressed(index : int): current_file_index = index var selected_item_metadata = OpenFileList.get_item_metadata(index) - current_file_path = selected_item_metadata[2] + var extension = selected_item_metadata[0].current_path.get_file().get_extension() + current_file_path = selected_item_metadata[0].current_path - OpenFileName.set_text(current_file_path) - - if current_ini_editor!= null: - if not current_ini_editor.visible: - for editor in get_tree().get_nodes_in_group("vanilla_editor"): - if editor.current_path != current_file_path: - editor.hide() - else: - current_editor = editor - editor.show() + 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: - var ext = current_file_path.get_file().get_extension() - if ext == "cfg" or ext == "ini": - for editor in get_tree().get_nodes_in_group("ini_editor"): - if editor.current_file_path != current_file_path: - editor.hide() - else: - current_ini_editor = editor - editor.show() - 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() - for editor in get_tree().get_nodes_in_group("vanilla_editor"): - if editor.current_path != current_file_path: - editor.hide() - else: - current_editor = editor - editor.show() - else: - for editor in get_tree().get_nodes_in_group("vanilla_editor"): - if editor.current_path != current_file_path: - editor.hide() - else: - current_editor = editor - editor.show() - + 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 - open_in_vanillaeditor(path) - open_in_inieditor(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_in_vanillaeditor(path : String): +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() - EditorContainer.add_child(editor,true) + SplitEditorContainer.add_child(editor,true) + + if current_editor and current_editor!=editor: + editor.show() + current_editor.hide() current_editor = editor - for editor in get_tree().get_nodes_in_group("vanilla_editor"): - if editor != current_editor: - editor.hide() editor.connect("text_changed",self,"_on_vanillaeditor_text_changed") @@ -321,22 +365,20 @@ func open_in_vanillaeditor(path : String): current_file.close() - 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,[current_content,last_modified,path]) - editor.new_file_open(current_content,last_modified,current_file_path) update_list() - OpenFileList.select(OpenFileList.get_item_count()-1) + if WrapBTN.get_selected_id() == 1: + current_editor.set_wrap_enabled(true) + + return editor -func open_in_inieditor(path : String): +func open_in_inieditor(path : String) -> Control: var extension = path.get_file().get_extension() if extension == "ini" or extension == "cfg": var inieditor = IniEditor.instance() - EditorContainer.add_child(inieditor) + SplitEditorContainer.add_child(inieditor) inieditor.hide() inieditor.connect("update_file",self,"_on_update_file") current_ini_editor = inieditor @@ -355,6 +397,25 @@ func open_in_inieditor(path : String): 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) @@ -375,7 +436,7 @@ func _on_update_file(): current_file.close() - current_editor.new_file_open(current_content,last_modified) + current_editor.new_file_open(current_content,last_modified,current_file_path) func delete_file(files_selected : PoolStringArray): var dir = Directory.new() @@ -422,16 +483,18 @@ func save_file(current_path : String): 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("(*)")) - open_in_inieditor(current_file_path) + 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(): - OpenFileName.clear() - OpenFileList.clear() +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() @@ -478,4 +541,18 @@ func _on_vanillaeditor_text_changed(): func update_list(): - FileList.invalidate() \ No newline at end of file + 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) diff --git a/addons/file-editor/scripts/IconLoader.gd b/addons/file-editor/scripts/IconLoader.gd index 45a8120..69831d1 100644 --- a/addons/file-editor/scripts/IconLoader.gd +++ b/addons/file-editor/scripts/IconLoader.gd @@ -1,9 +1,6 @@ tool extends Node -signal image_downloaded() -signal image_completed() - var imgBuffer func _ready(): diff --git a/addons/file-editor/scripts/IniVisualEditor.gd b/addons/file-editor/scripts/IniVisualEditor.gd index dbe3217..24ceed8 100644 --- a/addons/file-editor/scripts/IniVisualEditor.gd +++ b/addons/file-editor/scripts/IniVisualEditor.gd @@ -1,5 +1,6 @@ -extends Control tool +extends Control + onready var Keys = $VBoxContainer/HSplitContainer/VBoxContainer2/keys onready var Sections = $VBoxContainer/HSplitContainer/VBoxContainer/sections2 @@ -271,4 +272,4 @@ func _on_nokey_selected(): func create_root(): root = Keys.create_item() root.set_text(0,"KEY_NAME") - root.set_text(1,"KEY_VALUE") \ No newline at end of file + root.set_text(1,"KEY_VALUE") diff --git a/addons/file-editor/scripts/LastOpenedFiles.gd b/addons/file-editor/scripts/LastOpenedFiles.gd index 063f0e6..41ac87a 100644 --- a/addons/file-editor/scripts/LastOpenedFiles.gd +++ b/addons/file-editor/scripts/LastOpenedFiles.gd @@ -10,7 +10,7 @@ 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)[2] + var filepath = filecontainer.get_item_metadata(child)[0].current_path file.set_value("Opened",filepath.get_file(),filepath) file.save(lastopenedfile_path) @@ -18,7 +18,7 @@ func store_opened_files(filecontainer : Control): func remove_opened_file(index : int , filecontainer : Control): var file = ConfigFile.new() file.load(lastopenedfile_path) - var filepath = filecontainer.get_item_metadata(index)[2] + var filepath = filecontainer.get_item_metadata(index)[0].current_path file.set_value("Opened",filepath.get_file(),null) file.save(lastopenedfile_path) @@ -30,4 +30,4 @@ func load_opened_files() -> Array: var openedfiles = file.get_section_keys("Opened") for openedfile in openedfiles: keys.append([openedfile,file.get_value("Opened",openedfile)]) - return keys \ No newline at end of file + return keys diff --git a/addons/file-editor/scripts/Preview.gd b/addons/file-editor/scripts/Preview.gd index c9d188a..4cd6664 100644 --- a/addons/file-editor/scripts/Preview.gd +++ b/addons/file-editor/scripts/Preview.gd @@ -133,6 +133,8 @@ func print_html(content : String): 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() @@ -152,4 +154,4 @@ func print_csv(rows : Array): TablePreview.show() func _on_Preview_popup_hide(): - queue_free() \ No newline at end of file + queue_free() diff --git a/addons/file-editor/scripts/VanillaEditor.gd b/addons/file-editor/scripts/VanillaEditor.gd new file mode 100644 index 0000000..e1fa474 --- /dev/null +++ b/addons/file-editor/scripts/VanillaEditor.gd @@ -0,0 +1,211 @@ +tool +extends VBoxContainer + + +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_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/addons/file-editor/scripts/file-editor.gd b/addons/file-editor/scripts/file-editor.gd index 444da96..5175d08 100644 --- a/addons/file-editor/scripts/file-editor.gd +++ b/addons/file-editor/scripts/file-editor.gd @@ -2,10 +2,8 @@ tool extends EditorPlugin var doc = preload("../scenes/FileEditor.tscn").instance() -var plugin_version -var toolbar -var fileditorbutton -var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd") + +var IconLoader = preload("res://addons/file-editor/scripts/IconLoader.gd").new() func _enter_tree(): add_autoload_singleton("IconLoader","res://addons/file-editor/scripts/IconLoader.gd") @@ -29,4 +27,4 @@ func get_plugin_icon(): return IconLoader.load_icon_from_name("file") func make_visible(visible): - doc.visible = visible \ No newline at end of file + doc.visible = visible