mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-22 11:55:56 +00:00
Separate out editor accessibility from addition of the ScreenReader
node.
This commit is contained in:
parent
b4acee6dea
commit
b413961c52
|
@ -6,15 +6,15 @@ var ScreenReader = preload("ScreenReader.gd")
|
||||||
var screen_reader
|
var screen_reader
|
||||||
|
|
||||||
func _enter_tree():
|
func _enter_tree():
|
||||||
var enabled = true
|
var editor_accessibility_enabled = true
|
||||||
var rate = 50
|
var rate = 50
|
||||||
var config = ConfigFile.new()
|
var config = ConfigFile.new()
|
||||||
var err = config.load("res://.godot-accessibility-editor-settings.ini")
|
var err = config.load("res://.godot-accessibility-editor-settings.ini")
|
||||||
if not err:
|
if not err:
|
||||||
enabled = config.get_value("global", "enabled", true)
|
editor_accessibility_enabled = config.get_value("global", "editor_accessibility_enabled", true)
|
||||||
rate = config.get_value("speech", "rate", 50)
|
rate = config.get_value("speech", "rate", 50)
|
||||||
if enabled:
|
|
||||||
add_autoload_singleton("TTS", "res://addons/godot-tts/TTS.gd")
|
add_autoload_singleton("TTS", "res://addons/godot-tts/TTS.gd")
|
||||||
|
if editor_accessibility_enabled:
|
||||||
TTS.call_deferred("set_rate", rate)
|
TTS.call_deferred("set_rate", rate)
|
||||||
screen_reader = ScreenReader.new()
|
screen_reader = ScreenReader.new()
|
||||||
get_tree().root.call_deferred("add_child", screen_reader)
|
get_tree().root.call_deferred("add_child", screen_reader)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user