diff --git a/src/rust-base/src/lib.rs b/src/rust-base/src/lib.rs index 5ecc69e..0d71360 100644 --- a/src/rust-base/src/lib.rs +++ b/src/rust-base/src/lib.rs @@ -97,6 +97,8 @@ peg::parser! { } } +// Book is a collection of pages and utilities + pub struct Book { pages: HashMap, current_page: Option @@ -437,3 +439,4 @@ THE END assert_eq!(book.current_page, Some(String::from("START"))); } } + diff --git a/src/rust-base/storybook-godot/src/lib.rs b/src/rust-base/storybook-godot/src/lib.rs index f05ee22..1e3b7bd 100644 --- a/src/rust-base/storybook-godot/src/lib.rs +++ b/src/rust-base/storybook-godot/src/lib.rs @@ -9,7 +9,6 @@ godot_init!(init); #[derive(NativeClass)] #[inherit(Reference)] -#[register_with(Self::register_properties)] pub struct Book { _book: Option, } @@ -46,12 +45,6 @@ pub struct StatChange { #[methods] impl Book { - fn register_properties(builder: &ClassBuilder) { - builder - .add_property::("body") - .with_getter(Self::body_getter) - .done(); - } fn new(_owner: &Reference) -> Self { Book { _book: None, @@ -75,13 +68,14 @@ impl Book { None => (), } } - - fn body_getter(&self, _owner: TRef) -> String { + #[export] + fn get_body(&self, _owner: &Reference) -> String { match &self._book{ Some(b) => b.get_current().body.clone(), None => String::new(), } } + #[export] fn get_footer(&self, _owner: &Reference) -> Footer { match &self._book {