Godot-TextEditor/addons/text_editor/TE_MetaInfo.gd

30 lines
670 B
GDScript3
Raw Normal View History

2021-10-11 18:41:26 +02:00
tool
2021-10-11 05:10:22 +02:00
extends TE_RichTextLabel
onready var editor:TextEditor = owner
func _ready():
var _e
_e = editor.connect("file_selected", self, "_file_selected")
_e = editor.connect("file_saved", self, "_file_saved")
2021-10-14 20:49:03 +02:00
_e = connect("resized", self, "_resized")
func _resized():
add_constant_override("table_hseparation", int(rect_size.x / 6.0))
2021-10-11 05:10:22 +02:00
func _unhandled_key_input(e):
if e.scancode == KEY_M and e.pressed:
visible = not visible
func _file_selected(_file_path:String):
yield(get_tree(), "idle_frame")
_redraw()
func _file_saved(_file_path:String):
_redraw()
func _redraw():
var tab = editor.get_selected_tab()
2021-10-11 23:01:39 +02:00
if tab:
tab.helper.generate_meta(tab, self)