[.NET] Disallow [ExportToolButton] on members thay may store the Callable
Ensures the user doesn't store the Callable so the .NET assembly can be reloaded.
This commit is contained in:
parent
36d90c73a8
commit
f4094b554d
14 changed files with 263 additions and 38 deletions
|
|
@ -4,5 +4,5 @@ using Godot.Collections;
|
|||
public partial class ExportDiagnostics_GD0108 : Node
|
||||
{
|
||||
[ExportToolButton("")]
|
||||
public Callable {|GD0108:MyButton|};
|
||||
public Callable {|GD0108:MyButton|} => new Callable();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ using Godot.Collections;
|
|||
public partial class ExportDiagnostics_GD0109 : Node
|
||||
{
|
||||
[Export, ExportToolButton("")]
|
||||
public Callable {|GD0109:MyButton|};
|
||||
public Callable {|GD0109:MyButton|} => new Callable();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ using Godot.Collections;
|
|||
public partial class ExportDiagnostics_GD0110 : Node
|
||||
{
|
||||
[ExportToolButton("")]
|
||||
public string {|GD0110:MyButton|};
|
||||
public int {|GD0110:MyButton|} => new();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
[Tool]
|
||||
public partial class ExportDiagnostics_GD0111 : Node
|
||||
{
|
||||
private Callable _backingField;
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable {|GD0111:MyButtonGet|} { get; }
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable {|GD0111:MyButtonGetSet|} { get; set; }
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable {|GD0111:MyButtonGetWithBackingField|} { get => _backingField; }
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable {|GD0111:MyButtonGetSetWithBackingField|} { get => _backingField; set => _backingField = value; }
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable MyButtonOkWithCallableCreationExpression => new Callable(this, "");
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable MyButtonOkWithImplicitCallableCreationExpression => new(this, "");
|
||||
|
||||
[ExportToolButton("")]
|
||||
public Callable MyButtonOkWithCallableFromExpression => Callable.From(null);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue