2021-10-18 21:20:19 +02:00
|
|
|
tool
|
|
|
|
extends TabContainer
|
|
|
|
|
2021-10-19 01:50:21 +02:00
|
|
|
onready var editor:TE_Editor = owner
|
2021-10-18 21:20:19 +02:00
|
|
|
|
|
|
|
func _ready():
|
|
|
|
if not editor.is_plugin_active():
|
|
|
|
return
|
|
|
|
|
2022-02-03 13:34:34 +01:00
|
|
|
set_visible(false)
|
2021-10-18 21:20:19 +02:00
|
|
|
add_font_override("font", editor.FONT_R)
|
|
|
|
|
|
|
|
func _unhandled_key_input(e):
|
|
|
|
if not editor.is_plugin_active():
|
|
|
|
return
|
|
|
|
|
2021-11-27 11:35:18 +01:00
|
|
|
if e.control and e.pressed:
|
|
|
|
match e.scancode:
|
|
|
|
# show this menu
|
|
|
|
KEY_M:
|
|
|
|
set_visible(not get_parent().visible)
|
|
|
|
get_tree().set_input_as_handled()
|
|
|
|
|
|
|
|
# find menu
|
|
|
|
KEY_F:
|
|
|
|
set_visible(true)
|
|
|
|
select_tab($search)
|
|
|
|
$search/rte.select()
|
|
|
|
|
|
|
|
func set_visible(v:bool):
|
|
|
|
get_parent().visible = v
|
|
|
|
|
|
|
|
func select_tab(tab:Node):
|
|
|
|
current_tab = tab.get_index()
|
2021-11-24 17:09:48 +01:00
|
|
|
|
|
|
|
func show_image(file_path:String):
|
|
|
|
get_parent().visible = true
|
2021-11-27 11:35:18 +01:00
|
|
|
select_tab($image)
|
2021-11-24 17:09:48 +01:00
|
|
|
$image/image.texture = TE_Util.load_image(file_path)
|