From 54222b1fcbbb3ee5a7bcb2f1d3ccb52d8c88c22b Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 2 Sep 2020 14:55:20 -0500 Subject: [PATCH] Ugh, off my game today. For some reason, the previous revert was impartial. --- src/lib.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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::(); }