2023-03-09 21:54:22 +00:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
|
|
var screen_reader:bool = false
|
|
|
|
|
var disable_rendering: bool = false
|
|
|
|
|
var simplified_navigation:bool = false
|
|
|
|
|
var enable_subtitles: bool = false
|
|
|
|
|
var reduce_motion: bool = false
|
|
|
|
|
var show_content_notes: bool = false
|
2023-04-15 14:01:22 +00:00
|
|
|
var provide_summaries: bool = false
|
|
|
|
|
var allow_skipping: bool = false
|
|
|
|
|
|
|
|
|
|
var current_focus: Node
|
|
|
|
|
|
|
|
|
|
func request_focus(new_focus: Node, yoink:bool = false) -> bool:
|
|
|
|
|
if (current_focus == null or yoink) and new_focus != null:
|
|
|
|
|
current_focus = new_focus
|
|
|
|
|
return true
|
|
|
|
|
else: return false
|
|
|
|
|
|
|
|
|
|
func pass_focus_to(to: Node) -> bool:
|
|
|
|
|
if "has_focus" in to:
|
|
|
|
|
if not current_focus == null:
|
|
|
|
|
drop_focus_of(current_focus)
|
|
|
|
|
to.has_focus = true
|
|
|
|
|
return true
|
|
|
|
|
else: return false
|
|
|
|
|
|
|
|
|
|
func drop_own_focus(node: Node):
|
|
|
|
|
if current_focus == node:
|
|
|
|
|
current_focus = null
|
|
|
|
|
else:
|
|
|
|
|
push_error(node.name + " attempted to drop focus while not owning it!")
|
|
|
|
|
|
|
|
|
|
func drop_focus_of(node: Node):
|
|
|
|
|
if current_focus == node:
|
|
|
|
|
current_focus = null
|
|
|
|
|
if node.has_focus: node.has_focus = false
|
|
|
|
|
else:
|
|
|
|
|
node.has_focus = false
|
|
|
|
|
push_warning("Attempted to drop Focus for " + node.name + " while it wasn't focused!")
|
|
|
|
|
|