Closed gotmachine closed 5 months ago
Reverted to draft, as I forgot that we need to keep the firing of the GameEvents.onEditorShipModified
from SetBackup()
at the original point (ie, after the action took place). So more work is needed on those patches...
@JonnyOThan feel free to merge and push to a release
We need to move calls to
EditorLogic.SetBackup()
before the actions take place (instead of after), see issue #206OnMoveEnd
/OnRotateEnd
methods, triggered when the gizmo is released. The gizmos do have aOn*Start
method, but unfortunately they aren't hooked to a callback, and those are generic components that can potentially be used elsewhere. We can still patch those methods, and compare the gizmo instance to theEditorLogic.gizmo*
fields.SetBackup()
call at the beginning of theModulePartVariants.onVariantChanged
method~ Doesn't work because the field is already set whenModulePartVariants.onVariantChanged
, so the changes will be saved to the backup anyway. Alternatively, we patchUIPartActionVariantSelector.SelectVariant()
SetBackup()
call at the beginning of thePart.RemoveFromSymmetry
methodSetBackup()
call at the beginning of theEditorActionGroups
ResetPart
,AddActionToGroup
andRemoveActionFromGroup
methodsSetBackup()
call at the beginning of theStageManager.Reset
method~ Actually after further testing, it seems the backup is already created before the action, so nothing to fix here