In case anybody finds writing all those properties with backing fields too verbose, specially when it comes to tool classes, here is a Rightand.GodotPropertyChangedGenerator that will generate much of the code for you.
From readme, instead of
private int _simpleExportedWithDefault = 5;
public int SimpleExportedWithDefault
{
get => _simpleExportedWithDefault;
set
{
if (_simpleExportedWithDefault != value)
{
_simpleExportedWithDefault = value;
UpdateState(nameof(SimpleExportedWithDefault));
}
}
}
private void UpdateState(string? propertyName)
{
QueueRedraw();
}
you’d write
[Export, DefaultValue(5)] public partial int SimpleExportedWithDefault { get; set; }
private void UpdateState(string? propertyName)
{
QueueRedraw();
}
And much more.