fix overlays spawning with wrong target until updated, fix add overlay button staying on after use

This commit is contained in:
Crispy 2021-06-26 22:53:23 +02:00
parent d05880187a
commit a0e6e932e4
4 changed files with 8 additions and 0 deletions

View file

@ -57,6 +57,7 @@ func _ready() -> void:
container.add_child(overlay_scene.instance()) container.add_child(overlay_scene.instance())
update_tracker_id() update_tracker_id()
update_offset()
func add_cursor(): func add_cursor():

View file

@ -40,3 +40,7 @@ func _on_QuitToggle_toggled(state: bool) -> void:
func _on_Quit_pressed() -> void: func _on_Quit_pressed() -> void:
Settings.force_save() Settings.force_save()
get_tree().quit() get_tree().quit()
func _on_add_menu_closed() -> void:
$MarginContainer/VSplitContainer/MainBar/AddOverlay.pressed = false

View file

@ -112,6 +112,7 @@ __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[connection signal="add_menu_closed" from="MarginContainer/VSplitContainer/Control/AddMenu" to="." method="_on_add_menu_closed"]
[connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/ShowOverlays" to="." method="_on_ShowOverlays_toggled"] [connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/ShowOverlays" to="." method="_on_ShowOverlays_toggled"]
[connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/AddOverlay" to="." method="_on_AddOverlay_toggled"] [connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/AddOverlay" to="." method="_on_AddOverlay_toggled"]
[connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/GrabMode" to="." method="_on_GrabMode_toggled"] [connection signal="toggled" from="MarginContainer/VSplitContainer/MainBar/GrabMode" to="." method="_on_GrabMode_toggled"]

View file

@ -1,5 +1,6 @@
extends Control extends Control
signal add_menu_closed
var types: Array var types: Array
@ -16,6 +17,7 @@ func _ready() -> void:
func add_overlay(type): func add_overlay(type):
OverlayManager.add_overlay(type, type + " " + str(randi()%1000)) OverlayManager.add_overlay(type, type + " " + str(randi()%1000))
visible = false visible = false
emit_signal("add_menu_closed")
func get_overlay_types(path := "res://overlays/"): func get_overlay_types(path := "res://overlays/"):