From fee1bc2b919766e0e9aea795deefa77f677cc76a Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Fri, 11 Sep 2020 10:44:24 -0500 Subject: [PATCH] Minor cleanup. * Reformat. * Prepend some method names with `_`. GDScript convention is that private methods begin with `_`, and I'm slowly changing them over time. * Speak that the user is focused on a button, not a texture button. That the button is a texture button is an implementation detail, and shouldn't change how they accessibly interact with or perceive it. --- Accessible.gd | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Accessible.gd b/Accessible.gd index 68c01f7..3e819a4 100644 --- a/Accessible.gd +++ b/Accessible.gd @@ -116,7 +116,7 @@ func _button_focused(): spoke_hint_tooltip = true tokens.append(node.hint_tooltip) else: - tokens.append(get_graphical_button_text(node.icon)) + tokens.append(_get_graphical_button_text(node.icon)) tokens.append("button") if node.disabled: tokens.append("disabled") @@ -136,7 +136,7 @@ func try_to_get_text_in_theme(theme, texture): return "" -func get_graphical_button_text(texture): +func _get_graphical_button_text(texture): var default_theme_copy = Theme.new() default_theme_copy.copy_default_theme() var current = node @@ -147,10 +147,11 @@ func get_graphical_button_text(texture): current = current.get_parent_control() return try_to_get_text_in_theme(default_theme_copy, texture) -func texturebutton_focused(): + +func _texturebutton_focused(): var tokens = PoolStringArray([]) - tokens.append(get_graphical_button_text(node.texture_normal)) - tokens.append("texture button") + tokens.append(_get_graphical_button_text(node.texture_normal)) + tokens.append("button") TTS.speak(tokens.join(": ")) @@ -612,7 +613,7 @@ func focused(): elif node is TextEdit: text_edit_focus() elif node is TextureButton: - texturebutton_focused() + _texturebutton_focused() elif node is Tree: tree_focused() else: