@@ -15,14 +15,16 @@ use godot::builtin::{
1515} ;
1616use godot:: classes:: { Node , Resource } ;
1717use godot:: global:: PropertyHint ;
18- use godot:: meta:: { ArrayElement , FromGodot , GodotConvert , GodotType , ToGodot } ;
19- use godot:: obj:: { EngineEnum , Gd } ;
18+ use godot:: meta:: { ArrayElement , GodotConvert , GodotType } ;
19+ use godot:: obj:: { EngineEnum , Gd , OnEditor } ;
2020use godot:: prelude:: GodotClass ;
2121use godot:: sys:: GodotFfi ;
2222
23+ use crate :: { GetScriptProperty , SetScriptProperty } ;
24+
2325use super :: { GodotScript , RsRef } ;
2426
25- pub trait GodotScriptExport : GodotConvert + FromGodot + ToGodot {
27+ pub trait GodotScriptExport : GodotConvert + GetScriptProperty + SetScriptProperty {
2628 fn hint_string ( custom_hint : Option < PropertyHint > , custom_string : Option < String > ) -> String ;
2729
2830 fn hint ( custom : Option < PropertyHint > ) -> PropertyHint ;
@@ -78,11 +80,7 @@ impl<T: GodotScript> GodotScriptExport for RsRef<T> {
7880
7981impl < T : GodotScriptExport > GodotScriptExport for Option < T >
8082where
81- for < ' v > T : ' v ,
82- for < ' v > <<T as ToGodot >:: ToVia < ' v > as GodotType >:: Ffi : godot:: sys:: GodotNullableFfi ,
83- for < ' f > <<T as GodotConvert >:: Via as GodotType >:: ToFfi < ' f > : godot:: sys:: GodotNullableFfi ,
84- <<T as GodotConvert >:: Via as GodotType >:: Ffi : godot:: sys:: GodotNullableFfi ,
85- for < ' v , ' f > <<T as ToGodot >:: ToVia < ' v > as GodotType >:: ToFfi < ' f > : godot:: sys:: GodotNullableFfi ,
83+ Self : GodotConvert ,
8684{
8785 fn hint_string ( custom_hint : Option < PropertyHint > , custom_string : Option < String > ) -> String {
8886 T :: hint_string ( custom_hint, custom_string)
@@ -113,6 +111,19 @@ impl<T: ArrayElement + GodotScriptExport + GodotType> GodotScriptExport for Arra
113111 }
114112}
115113
114+ impl < T : GodotScriptExport > GodotScriptExport for OnEditor < T >
115+ where
116+ Self : GodotConvert ,
117+ {
118+ fn hint_string ( custom_hint : Option < PropertyHint > , custom_string : Option < String > ) -> String {
119+ T :: hint_string ( custom_hint, custom_string)
120+ }
121+
122+ fn hint ( custom : Option < PropertyHint > ) -> PropertyHint {
123+ T :: hint ( custom)
124+ }
125+ }
126+
116127macro_rules! default_export {
117128 ( $ty: ty) => {
118129 impl GodotScriptExport for $ty {
0 commit comments