-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undo in the editor can unintentionally revert tweaks to part modules #172
Comments
Yeah that's something I noticed.
|
Oh absolutely; I don't think every tweak should be saved. But I think adding a save state before attaching a new part (and possibly other actions) would solve the problem. Then undoing the attach won't also undo all the tweaks, and then the next undo will undo all the tweaks since the last state. Or the state that gets saved before attaching could replace the previous one. |
Overriding the last state before attaching feels like a good solution that wouldn't change the current behavior, every ctrl-z would still result in the last attach action being undone. The main drawback would be that this would double the hiccup lag on attaching, as 2 state save (before and after attaching) are now performed instead of one. Not sure how impactfull this would be in practice. |
Right - I also wonder if it would be feasible to then remove the save state from after the attach. We'd probably need to go through and adjust other save state behaviors though. |
Gave a look at this, and TBH, it's a bit of a mess. I initially tried what we were talking about, but that mean a lot of additional captures and I don't like that. Then I tried to move around when undo states are captured, as the whole thing is kinda implemented backwards... Edit : did a bit more fiddling around, and from the perspective of the undo/redo system, inverting the logic actually would work very well. That is, until I realized that the last serialized ship state created by the undo/redo system is what is used to check the available seats for the editor crew assignment. Yay spaghetti mess. I might have exhausted my will to work on this... |
…ork because of VesselCrewManifest side effects See #172
@gotmachine I see you made another commit that addresses the crew manifest issue - is this change ready to go? Perhaps disabled by default? Edit: Oh I see the PR mentions that change |
* BetterEditorUndoRedo : Exploratory fix for undo/redo state, doesn't work because of VesselCrewManifest side effects See #172 * BetterEditorUndoRedo : functional, obvious issues fixed, still likely to cause side effects. * disable BetterEditorUndoRedo by default --------- Co-authored-by: JonnyOThan <jonnyothan@gmail.com>
From my perspective that patch is production ready, and unless I made a mistake somewhere, it shouldn't cause issues. |
* New KSP QoL/performance patch : [**LowerMinPhysicsDTPerFrame**](#175) : Allow a min value of 0.02 instead of 0.03 for the "Max Physics Delta-Time Per Frame" main menu setting. This was already possible by manually editing the `settings.cfg` file, but changes would revert when going into the settings screen. * Add tooltip describing the "Max Physics Delta-Time Per Frame" main menu setting * merging master to dev (#181) * zh-cn localization for ManufacturerFixes.cfg (#178) * Remove ENABLE_PROFILER define that got added recently --------- Co-authored-by: zhangyuesai <zhangyuesai@live.com> * Fix #182: ModulePartInventory now accounts for changes to a part's mass or volume -for example, changing a part's variant (rcs thruster blocks, structural tube) or its resource level could change its mass, but when you store it in inventory the mass would always use the value from the prefab * oops, revert a couple changes to the csproj that made it into the last commit by accident * Fix #185: calculate the correct mass for parts when picking them up off the ground in EVA construction * Fix #104 : set dead kerbals to missing when loading a game and respawning is enabled * Standardize spaces for indent in .editorconfig and add it to the SLN (note personally I'd prefer tabs for indents, but all the existing code in here that didn't come from me uses spaces and consistency is more important) * Change tabs -> spaces in the few files that used it Whitespace-only change. (note most of these were originally authored by me, but the project as a whole uses spaces pretty consistently) * Fix #180: add ZeroCostTechNode patch * Better editor undo redo (#176) * BetterEditorUndoRedo : Exploratory fix for undo/redo state, doesn't work because of VesselCrewManifest side effects See #172 * BetterEditorUndoRedo : functional, obvious issues fixed, still likely to cause side effects. * disable BetterEditorUndoRedo by default --------- Co-authored-by: JonnyOThan <jonnyothan@gmail.com> * PAWGroupMemory is no longer per-window, but rather per-group (#186) * Fix #50: PAWGroupMemory is no longer per-PAW, but stores the expansion state for all windows and is not cleared on scene changes -possible future work: persist the collapse state to disk * collapse or expand PAW groups when the PAW is shown * Fix #179: ModulePartVariants now applies node position changes in all scenes * enable BetterEditorUndoRedo by default * Merge master -> dev (#187) * zh-cn localization for ManufacturerFixes.cfg (#178) * Remove ENABLE_PROFILER define that got added recently --------- Co-authored-by: zhangyuesai <zhangyuesai@live.com> * update readme with the new fixes --------- Co-authored-by: gotmachine <24925209+gotmachine@users.noreply.github.com> Co-authored-by: zhangyuesai <zhangyuesai@live.com>
Repro steps:
In addition to the second part being deleted, the fuel level in the first tank will be reverted to the full level. This applies to all tweaks to part modules and resources. It seems like maybe the undo state is captured right after a part is placed (i.e. after step 2 above) instead of just before the second part is placed.
The text was updated successfully, but these errors were encountered: