mirror of
https://github.com/Relintai/draw_gd.git
synced 2025-04-15 18:36:04 +02:00
Implement main screen.
This commit is contained in:
parent
86531273df
commit
ae86290530
@ -2,6 +2,9 @@ tool
|
||||
extends EditorPlugin
|
||||
|
||||
const _icon : Texture = preload("res://addons/draw_gd/icons/icon_copy.png")
|
||||
const _scene : PackedScene = preload("res://addons/draw_gd/src/Main.tscn")
|
||||
|
||||
var main_node : Node = null
|
||||
|
||||
func has_main_screen():
|
||||
return true
|
||||
@ -16,10 +19,27 @@ func get_plugin_name():
|
||||
func _enter_tree():
|
||||
#add_autoload_singleton("DrawGD", "res://addons/draw_gd/src/Autoload/DrawGD.gd")
|
||||
|
||||
pass
|
||||
main_node = _scene.instance()
|
||||
|
||||
get_editor_interface().get_editor_viewport().add_child(main_node)
|
||||
|
||||
make_visible(false)
|
||||
|
||||
|
||||
func _exit_tree():
|
||||
#remove_autoload_singleton("DrawGD")
|
||||
|
||||
if main_node:
|
||||
main_node.queue_free()
|
||||
|
||||
|
||||
func make_visible(visible):
|
||||
if !main_node:
|
||||
return
|
||||
|
||||
if visible:
|
||||
main_node.show()
|
||||
else:
|
||||
main_node.hide()
|
||||
|
||||
|
||||
pass
|
||||
|
@ -16,6 +16,8 @@
|
||||
[node name="DrawGDControl" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_horizontal_guides_": [ ],
|
||||
|
Loading…
Reference in New Issue
Block a user