mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-26 17:17:24 -04:00
home scene
This commit is contained in:
parent
5fe170dfc6
commit
cce0bedbb1
21 changed files with 559 additions and 131 deletions
47
app/scripts/debug_log/debug_window.gd
Normal file
47
app/scripts/debug_log/debug_window.gd
Normal file
|
@ -0,0 +1,47 @@
|
|||
extends Node
|
||||
|
||||
@export var window: Window
|
||||
|
||||
var window_visible
|
||||
var mouse_mode: int = Input.MOUSE_MODE_VISIBLE
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
window_hide()
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("open_debug") and not event.is_echo():
|
||||
if window_visible:
|
||||
window_hide()
|
||||
else:
|
||||
window_show()
|
||||
|
||||
|
||||
func _on_window_window_input(event: InputEvent) -> void:
|
||||
_input(event)
|
||||
|
||||
|
||||
func _on_window_close_requested() -> void:
|
||||
window_hide()
|
||||
|
||||
|
||||
func _on_window_focus_exited() -> void:
|
||||
window_hide()
|
||||
|
||||
|
||||
func window_show() -> void:
|
||||
window.show()
|
||||
window_visible = true
|
||||
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
|
||||
mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
else:
|
||||
mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
|
||||
|
||||
func window_hide() -> void:
|
||||
window.hide()
|
||||
window_visible = false
|
||||
if mouse_mode == Input.MOUSE_MODE_CAPTURED:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
Loading…
Add table
Add a link
Reference in a new issue