File tree 3 files changed +13
-6
lines changed
3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ config_version=5
12
12
13
13
config/name ="hot-reload"
14
14
run/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
9
9
[lib ]
10
10
crate-type = [" cdylib" ]
11
11
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 {
22
22
23
23
// ----------------------------------------------------------------------------------------------------------------------------------------------
24
24
25
+ /// A RustDoc comment appearing under the editor help docs.
25
26
#[ derive( GodotClass ) ]
26
27
#[ class( base=Node ) ]
27
28
struct Reloadable {
29
+ /// A planet!
28
30
#[ export]
29
31
favorite_planet : Planet ,
30
32
//
@@ -46,11 +48,14 @@ impl INode for Reloadable {
46
48
47
49
#[ godot_api]
48
50
impl Reloadable {
49
- # [ rustfmt :: skip ] // easier replacement by test .
51
+ /// A function to return a number .
50
52
#[ 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
+ }
53
57
58
+ /// Constructor from a string.
54
59
#[ func]
55
60
fn from_string ( s : GString ) -> Gd < Self > {
56
61
Gd :: from_object ( Reloadable {
@@ -61,6 +66,7 @@ impl Reloadable {
61
66
62
67
// ----------------------------------------------------------------------------------------------------------------------------------------------
63
68
69
+ /// A planet enum.
64
70
#[ derive( GodotConvert , Var , Export ) ]
65
71
#[ godot( via = GString ) ]
66
72
enum Planet {
You can’t perform that action at this time.
0 commit comments