25 lines
438 B
GDScript3
Raw Normal View History

2024-02-25 18:47:13 +00:00
class_name UI
2024-02-17 18:43:47 +00:00
extends Node
2024-01-25 11:10:29 +00:00
2024-02-25 18:47:13 +00:00
static var focus: Control
2024-02-25 22:01:17 +00:00
var chat: Chat
var reconnect: Panel
var network: NetworkUI
2024-01-25 11:10:29 +00:00
func _enter_tree():
2024-02-25 22:01:17 +00:00
chat = %Chat
reconnect = %Reconnect
network = %Network
2024-02-25 18:47:13 +00:00
2024-02-27 22:21:44 +00:00
func _process(_delta: float):
2024-02-25 18:47:13 +00:00
var new_focus := get_viewport().gui_get_focus_owner()
if new_focus && new_focus.name != "Unfocus":
UI.focus = new_focus
else:
UI.focus = null
2024-02-06 14:51:48 +00:00
2024-02-25 18:47:13 +00:00
static func unfocus():
if UI.focus:
UI.focus.release_focus()