File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ config_version=5
1212
1313config/name ="hot-reload"
1414run/main_scene ="uid://da7eiv1notj7j"
15- config/features =PackedStringArray ("4.4 " , "Forward Plus" )
15+ config/features =PackedStringArray ("4.5 " , "Forward Plus" )
Original file line number Diff line number Diff line change @@ -9,5 +9,6 @@ publish = false
99[lib ]
1010crate-type = [" cdylib" ]
1111
12- [dependencies ]
13- godot = { git = " https://github.com/godot-rust/gdext.git" }
12+ [dependencies .godot ]
13+ git = " https://github.com/godot-rust/gdext.git"
14+ features = [" register-docs" ] # Registers RustDoc comments, so they appear in editor docs.
Original file line number Diff line number Diff line change @@ -22,9 +22,11 @@ unsafe impl ExtensionLibrary for HotReload {
2222
2323// ----------------------------------------------------------------------------------------------------------------------------------------------
2424
25+ /// A RustDoc comment appearing under the editor help docs.
2526#[ derive( GodotClass ) ]
2627#[ class( base=Node ) ]
2728struct Reloadable {
29+ /// A planet!
2830 #[ export]
2931 favorite_planet : Planet ,
3032 //
@@ -46,11 +48,14 @@ impl INode for Reloadable {
4648
4749#[ godot_api]
4850impl Reloadable {
49- # [ rustfmt :: skip ] // easier replacement by test .
51+ /// A function to return a number .
5052 #[ func]
51- // HOT-RELOAD: change returned value for dynamic code change.
52- fn get_number ( & self ) -> i64 { 100 }
53+ fn get_number ( & self ) -> i64 {
54+ // HOT-RELOAD: change returned value for dynamic code change.
55+ 100
56+ }
5357
58+ /// Constructor from a string.
5459 #[ func]
5560 fn from_string ( s : GString ) -> Gd < Self > {
5661 Gd :: from_object ( Reloadable {
@@ -61,6 +66,7 @@ impl Reloadable {
6166
6267// ----------------------------------------------------------------------------------------------------------------------------------------------
6368
69+ /// A planet enum.
6470#[ derive( GodotConvert , Var , Export ) ]
6571#[ godot( via = GString ) ]
6672enum Planet {
You can’t perform that action at this time.
0 commit comments