mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-22 03:45:56 +00:00
Better dialog presentation, and make message labels non-focusable.
This commit is contained in:
parent
fe19717640
commit
fc5b591fe3
|
@ -29,6 +29,8 @@ func guess_label():
|
||||||
var tokens = PoolStringArray([])
|
var tokens = PoolStringArray([])
|
||||||
var to_check = node
|
var to_check = node
|
||||||
while to_check:
|
while to_check:
|
||||||
|
if to_check.is_class("AcceptDialog"):
|
||||||
|
return
|
||||||
if to_check.is_class("EditorProperty") and to_check.label:
|
if to_check.is_class("EditorProperty") and to_check.label:
|
||||||
tokens.append(to_check.label)
|
tokens.append(to_check.label)
|
||||||
if (to_check.is_class("EditorProperty") or to_check.is_class("EditorInspectorCategory")) and to_check.get_tooltip_text():
|
if (to_check.is_class("EditorProperty") or to_check.is_class("EditorInspectorCategory")) and to_check.get_tooltip_text():
|
||||||
|
@ -43,7 +45,7 @@ func guess_label():
|
||||||
|
|
||||||
func _accept_dialog_speak():
|
func _accept_dialog_speak():
|
||||||
if node.dialog_text != "":
|
if node.dialog_text != "":
|
||||||
TTS.speak(node.dialog_text)
|
TTS.speak("%s: dialog" % node.dialog_text)
|
||||||
|
|
||||||
func accept_dialog_focused():
|
func accept_dialog_focused():
|
||||||
_accept_dialog_speak()
|
_accept_dialog_speak()
|
||||||
|
@ -579,6 +581,8 @@ func is_focusable(node):
|
||||||
return true
|
return true
|
||||||
if node is AcceptDialog:
|
if node is AcceptDialog:
|
||||||
return true
|
return true
|
||||||
|
if node is Label and node.get_parent() and node.get_parent() is AcceptDialog:
|
||||||
|
return false
|
||||||
if node is Container or node is Separator or node is ScrollBar or node is Popup or node.get_class() == "Control":
|
if node is Container or node is Separator or node is ScrollBar or node is Popup or node.get_class() == "Control":
|
||||||
return false
|
return false
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue
Block a user