@@ -7,11 +7,10 @@ namespace GDExtensionBindgen;
77
88public class LuaError
99{
10- public static readonly StringName ClassName = "LuaError" ;
11-
10+ // Engine object used for calling engine methods
1211 protected RefCounted _object ;
1312
14- public LuaError ( ) : this ( ClassName )
13+ public LuaError ( ) : this ( NativeName )
1514 {
1615 }
1716 protected LuaError ( StringName @class ) : this ( ClassDB . Instantiate ( @class ) )
@@ -29,6 +28,27 @@ protected LuaError([NotNull] RefCounted @object)
2928 public static implicit operator Variant ( LuaError self ) => self ? . _object ;
3029 public static explicit operator LuaError ( Variant variant ) => variant . AsGodotObject ( ) != null ? new ( variant ) : null ;
3130
31+ public class PropertyName : RefCounted . PropertyName
32+ {
33+ public static readonly StringName Message = "message" ;
34+ public static readonly StringName Status = "status" ;
35+ }
36+
37+ public class MethodName : RefCounted . MethodName
38+ {
39+ public static readonly StringName GetMessage = "get_message" ;
40+ public static readonly StringName SetMessage = "set_message" ;
41+ public static readonly StringName GetStatus = "get_status" ;
42+ public static readonly StringName SetStatus = "set_status" ;
43+ }
44+
45+ public class SignalName : RefCounted . SignalName
46+ {
47+
48+ }
49+
50+ private static readonly StringName NativeName = "LuaError" ;
51+
3252 #region Enums
3353
3454 public enum StatusEnum
@@ -49,14 +69,14 @@ public enum StatusEnum
4969
5070 public string Message
5171 {
52- get => ( string ) _object . Get ( "message" ) ;
53- set => _object . Set ( "message" , value ) ;
72+ get => ( string ) _object . Get ( PropertyName . Message ) ;
73+ set => _object . Set ( PropertyName . Message , value ) ;
5474 }
5575
5676 public string Status
5777 {
58- get => ( string ) _object . Get ( "status" ) ;
59- set => _object . Set ( "status" , value ) ;
78+ get => ( string ) _object . Get ( PropertyName . Status ) ;
79+ set => _object . Set ( PropertyName . Status , value ) ;
6080 }
6181
6282 #endregion
@@ -65,22 +85,22 @@ public string Status
6585
6686 public string GetMessage ( )
6787 {
68- return ( string ) _object . Call ( "get_message" ) ;
88+ return ( string ) _object . Call ( MethodName . GetMessage ) ;
6989 }
7090
7191 public void SetMessage ( string @message )
7292 {
73- _object . Call ( "set_message" , @message ) ;
93+ _object . Call ( MethodName . SetMessage , @message ) ;
7494 }
7595
7696 public LuaError . StatusEnum GetStatus ( )
7797 {
78- return ( LuaError . StatusEnum ) ( int ) _object . Call ( "get_status" ) ;
98+ return ( LuaError . StatusEnum ) ( int ) _object . Call ( MethodName . GetStatus ) ;
7999 }
80100
81101 public void SetStatus ( LuaError . StatusEnum @status )
82102 {
83- _object . Call ( "set_status" , ( int ) @status ) ;
103+ _object . Call ( MethodName . SetStatus , ( int ) @status ) ;
84104 }
85105
86106 #endregion
@@ -368,23 +388,23 @@ public event Action ScriptChanged
368388 {
369389 add
370390 {
371- Connect ( "script_changed" , Callable . From ( value ) ) ;
391+ Connect ( SignalName . ScriptChanged , Callable . From ( value ) ) ;
372392 }
373393 remove
374394 {
375- Disconnect ( "script_changed" , Callable . From ( value ) ) ;
395+ Disconnect ( SignalName . ScriptChanged , Callable . From ( value ) ) ;
376396 }
377397 }
378398
379399 public event Action PropertyListChanged
380400 {
381401 add
382402 {
383- Connect ( "property_list_changed" , Callable . From ( value ) ) ;
403+ Connect ( SignalName . PropertyListChanged , Callable . From ( value ) ) ;
384404 }
385405 remove
386406 {
387- Disconnect ( "property_list_changed" , Callable . From ( value ) ) ;
407+ Disconnect ( SignalName . PropertyListChanged , Callable . From ( value ) ) ;
388408 }
389409 }
390410
0 commit comments