Indent every script with tabs, like the Godot editor does
This commit is contained in:
1 parent
8c1987807c
commit
bad4b3ad8b
35 files changed
+1653
-1653
No files matched your search
+13
-13
@@ -11,27 +11,27 @@ extends Control
|
||||
|
||||
## Shows the popup.
|
||||
func open() -> void:
|
||||
visible = true
|
||||
visible = true
|
||||
|
||||
|
||||
## Hides the popup.
|
||||
func close() -> void:
|
||||
visible = false
|
||||
visible = false
|
||||
|
||||
|
||||
## Opens the popup if it is closed and closes it if it is open.
|
||||
func toggle() -> void:
|
||||
if visible:
|
||||
close()
|
||||
else:
|
||||
open()
|
||||
if visible:
|
||||
close()
|
||||
else:
|
||||
open()
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if !visible || !(event is InputEventMouseButton) || !event.pressed:
|
||||
return
|
||||
var click: InputEventMouseButton = panel.make_input_local(event)
|
||||
if !Rect2(Vector2.ZERO, panel.size).has_point(click.position):
|
||||
close()
|
||||
# The click only closes the popup; it must not also press what is behind it
|
||||
get_viewport().set_input_as_handled()
|
||||
if !visible || !(event is InputEventMouseButton) || !event.pressed:
|
||||
return
|
||||
var click: InputEventMouseButton = panel.make_input_local(event)
|
||||
if !Rect2(Vector2.ZERO, panel.size).has_point(click.position):
|
||||
close()
|
||||
# The click only closes the popup; it must not also press what is behind it
|
||||
get_viewport().set_input_as_handled()
|
||||
Reference in new issue
Block a user