@tool
extends EditorPlugin

var _dock: Control

func _enter_tree() -> void:
	var script: Script = load("res://addons/mpq_extractor/ui/mpq_tool.gd")
	if script == null:
		push_error("MPQ Extractor: не удалось загрузить mpq_tool.gd")
		return
	_dock = VBoxContainer.new()
	_dock.name = "MPQExtractorDock"
	_dock.set_script(script)
	add_control_to_bottom_panel(_dock, "MPQ Extractor")
	make_bottom_panel_item_visible(_dock)

func _exit_tree() -> void:
	if _dock:
		remove_control_from_bottom_panel(_dock)
		_dock.queue_free()
		_dock = null
