2022-08-23 15:54:28 +02:00
|
|
|
tool
|
|
|
|
extends EditorPlugin
|
|
|
|
|
2022-08-25 01:51:27 +02:00
|
|
|
var web_pages_editor : Control = null
|
2022-08-23 20:44:39 +02:00
|
|
|
|
2022-08-23 16:21:12 +02:00
|
|
|
func _enter_tree():
|
2022-08-25 02:07:31 +02:00
|
|
|
var wbes : PackedScene = ResourceLoader.load("res://addons/web_pages/editor/PageEditor.tscn")
|
2022-08-25 01:51:27 +02:00
|
|
|
web_pages_editor = wbes.instance()
|
|
|
|
web_pages_editor.undo_redo = get_undo_redo()
|
2022-08-23 20:44:39 +02:00
|
|
|
|
|
|
|
var wne : Control = Engine.get_global("WebNodeEditor")
|
|
|
|
if wne:
|
2022-08-25 01:51:27 +02:00
|
|
|
wne.add_main_screen_tab(web_pages_editor)
|
2022-08-23 15:54:28 +02:00
|
|
|
|
2022-08-23 16:21:12 +02:00
|
|
|
func _exit_tree():
|
2022-08-23 20:44:39 +02:00
|
|
|
var wne : Control = Engine.get_global("WebNodeEditor")
|
|
|
|
if wne:
|
2022-08-25 01:51:27 +02:00
|
|
|
wne.remove_main_screen_tab(web_pages_editor)
|
2022-08-23 16:21:12 +02:00
|
|
|
|
2022-08-23 15:54:28 +02:00
|
|
|
func get_plugin_name() -> String:
|
2022-08-25 02:07:31 +02:00
|
|
|
return "WebPageEditorPlugin"
|