mirror of
https://github.com/Relintai/godot_translation_editor.git
synced 2024-11-11 16:25:00 +01:00
39 lines
809 B
GDScript3
39 lines
809 B
GDScript3
|
tool
|
||
|
extends EditorPlugin
|
||
|
|
||
|
var TranslationEditor = load("res://addons/zylann.translation_editor/tools/translation_editor.tscn")
|
||
|
|
||
|
var _main_control = null
|
||
|
|
||
|
|
||
|
func _enter_tree():
|
||
|
print("Translation editor plugin Enter tree")
|
||
|
|
||
|
var editor_interface = get_editor_interface()
|
||
|
var base_control = editor_interface.get_base_control()
|
||
|
|
||
|
_main_control = TranslationEditor.instance()
|
||
|
_main_control.configure_for_godot_integration(base_control)
|
||
|
_main_control.hide()
|
||
|
editor_interface.get_editor_viewport().add_child(_main_control)
|
||
|
|
||
|
|
||
|
func _exit_tree():
|
||
|
# The main control is not freed when the plugin is disabled
|
||
|
_main_control.queue_free()
|
||
|
_main_control = null
|
||
|
|
||
|
|
||
|
func has_main_screen():
|
||
|
return true
|
||
|
|
||
|
|
||
|
func get_plugin_name():
|
||
|
return "Localization"
|
||
|
|
||
|
|
||
|
func make_visible(visible):
|
||
|
_main_control.visible = visible
|
||
|
|
||
|
|