mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-12-08 08:15:57 +00:00
Simplify screen reader detection code to use Tts
APIs.
This commit is contained in:
parent
2dba6d0a55
commit
d83b3689f5
|
@ -10,7 +10,4 @@ crate-type = ["staticlib", "cdylib"]
|
|||
[dependencies]
|
||||
env_logger = "0.10"
|
||||
gdnative = "0.11"
|
||||
tts = { version = "0.25", features = ["tolk"] }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
tolk = { version = "0.5", optional = true }
|
||||
tts = { version = "0.25", features = ["tolk"] }
|
12
src/lib.rs
12
src/lib.rs
|
@ -127,19 +127,11 @@ impl TTS {
|
|||
.done();
|
||||
builder
|
||||
.property("can_detect_screen_reader")
|
||||
.with_getter(|_: &TTS, _| cfg!(all(windows, features = "tolk")))
|
||||
.with_getter(|_: &TTS, _| cfg!(windows))
|
||||
.done();
|
||||
#[allow(unreachable_code)]
|
||||
builder
|
||||
.property("has_screen_reader")
|
||||
.with_getter(|_: &TTS, _| {
|
||||
#[cfg(all(windows, features = "tolk"))]
|
||||
{
|
||||
let tolk = tolk::Tolk::new();
|
||||
return tolk.detect_screen_reader().is_some();
|
||||
}
|
||||
false
|
||||
})
|
||||
.with_getter(|_, _| Tts::screen_reader_available())
|
||||
.done();
|
||||
builder
|
||||
.property("can_detect_is_speaking")
|
||||
|
|
Loading…
Reference in New Issue
Block a user