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