Caeden117 / ChroMapper

GitHub repository for ChroMapper, the Unity-based map editor for Beat Saber.
https://cm.topc.at/dl
GNU General Public License v2.0
300 stars 87 forks source link

Unset custom properties when CustomData nodes are removed #449

Closed FallenCharlotte closed 1 year ago

FallenCharlotte commented 1 year ago

Right now, neither the CustomData nodes nor the Custom event properties are particularly authoritative, and the only way to fully remove them is to unset both. This PR makes the CustomData node authoritative, and will overwrite and unset properties on ParseCustom(). Going the other way would be much harder, because JSONNodes would need to be Removed and non-events don't yet have Custom properties.

Implementation note: the ternary is necessary because of JSONLazyCreator, if there was a

public JSONNode? TryGet(string key)

this could look like

CustomLerpType = CustomData?.TryGet(CustomKeyLerpType)?.Value

force push was for commit signing, don't worry about it