diff --git a/src/lib.rs b/src/lib.rs index 9f172fe..47f111b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,5 @@ -use gdnative::prelude::*; +use gdnative::init::*; +use gdnative::*; use tts::{Features, TTS as Tts}; #[derive(NativeClass)] @@ -8,7 +9,7 @@ struct TTS(Tts); #[methods] impl TTS { - fn new(_owner: &Node) -> Self { + fn _init(_owner: gdnative::Node) -> Self { let tts = Tts::default().unwrap(); Self(tts) } @@ -121,18 +122,18 @@ impl TTS { } #[export] - fn speak(&mut self, _owner: &Node, message: GodotString, interrupt: bool) { + fn speak(&mut self, _owner: Node, message: GodotString, interrupt: bool) { let message = message.to_string(); self.0.speak(message, interrupt).unwrap(); } #[export] - fn stop(&mut self, _owner: &Node) { + fn stop(&mut self, _owner: Node) { self.0.stop().unwrap(); } #[export] - fn is_rate_supported(&mut self, _owner: &Node) -> bool { + fn is_rate_supported(&mut self, _owner: Node) -> bool { let Features { rate: rate_supported, .. @@ -141,7 +142,7 @@ impl TTS { } } -fn init(handle: InitHandle) { +fn init(handle: gdnative::init::InitHandle) { env_logger::init(); handle.add_class::(); }