Closed StonesmileGit closed 3 years ago
Thanks, I didn't expect KSP to have a problem with nullable values
MassOverride
seems a bit unnecessary now as both the getter and setter are so simple. Would the code be more clear if it was removed?
MassOverride
seems a bit unnecessary now as both the getter and setter are so simple. Would the code be more clear if it was removed?
The setter needs to modify field visibility so it has to stay but the modifications are still missing.
The setter no longer modifies the fields; it only sets the value to value
or null
The setter needs to have
Fields[nameof(curWingMass)].guiActiveEditor = value is not null;
Fields[nameof(massMultiplier)].guiActiveEditor = value is not null;
to maintain correctness
Oh, so the Field modifications should be in both the setter and in Initialization
?
Yeah, and it may be easier to call setter in Initialization
to update field visibility.
Thanks
Glad I could help!
@dkavolis Do note that I did not push recompiled .dll's
Found a way to make massOverride work, but since KSP doesn't like a value being null (the default with the previous
float? massOverride
), I usedfloat.MinValue
instead.There is likely a much better way to do this.