32 lines
789 B
GDScript
32 lines
789 B
GDScript
@tool
|
|
extends EditorPlugin
|
|
|
|
# Replace this value with a PascalCase autoload name, as per the GDScript style guide.
|
|
#const AUTOLOAD_NAME = "LevelEditorAutoload"
|
|
const ui = preload("res://addons/LevelEditor/wave_maker.tscn")
|
|
|
|
var main_panel_instance
|
|
|
|
func _enter_tree():
|
|
main_panel_instance = ui.instantiate()
|
|
# Add the main panel to the editor's main viewport.
|
|
EditorInterface.get_editor_main_screen().add_child(main_panel_instance)
|
|
# Hide the main panel. Very much required.
|
|
_make_visible(false)
|
|
|
|
|
|
func _has_main_screen():
|
|
return true
|
|
|
|
|
|
func _make_visible(visible):
|
|
if main_panel_instance:
|
|
main_panel_instance.visible = visible
|
|
|
|
|
|
func _get_plugin_name():
|
|
return "Level Editor"
|
|
|
|
|
|
func _get_plugin_icon():
|
|
return EditorInterface.get_editor_theme().get_icon("Node", "EditorIcons")
|