tochie-facade/scenes/shell/Input.gd

20 lines
580 B
GDScript3
Raw Normal View History

2023-09-25 07:57:50 +00:00
extends Node2D
onready var n_DetachedViews := get_parent().find_node("DetachedViews")
func _input(event):
if not event is InputEventMouseButton:
return
var stack := []
for view in n_DetachedViews.get_children():
view.get_node("WindowDialog").hide()
if view.get_node("WindowDialog").get_rect().has_point(event.position):
stack.push_back(view)
if stack.size() > 0:
var front = stack.pop_back()
for view in stack:
view.get_node("WindowDialog").popup()
front.get_node("WindowDialog").popup()