godot_translation_editor/addons/zylann.translation_editor/tools/plugin.gd

39 lines
809 B
GDScript3
Raw Normal View History

2018-11-13 22:37:26 +01:00
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