Fix shift-modifier Extras lost on save and misapplied on load#49
Open
anagnorisis2peripeteia wants to merge 1 commit into
Open
Fix shift-modifier Extras lost on save and misapplied on load#49anagnorisis2peripeteia wants to merge 1 commit into
anagnorisis2peripeteia wants to merge 1 commit into
Conversation
MapFrom recomputed hasExtrasValue from dcs.shiftExtras but was missing the trailing add into shiftExtrasSerializer that its non-shift sibling has, so ShiftControl/Extras was never written to the profile XML and shift-mode extras silently vanished on every save (the old pre-DTO writer appended the node after the same recompute). MapTo's ShiftControl.Extras block still passed shift=false to UpdateDS4CExtra (unedited from the copied Control.Extras block; every other ShiftControl sub-block passes true), so shift extras from older profiles loaded into the normal extras slot - firing without the shift trigger and clobbering the control's normal extras. Add the missing append, pass true for the shift slot, and cover both directions with regression tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugs 3 and 4 of #46 — the two halves of the shift-modifier Extras round-trip, found while mutation-testing the profile-serialization code (#37).
Save side:
ProfileDTO.MapFromrecomputeshasExtrasValuefromdcs.shiftExtrasbut was missing the trailing add intoshiftExtrasSerializerthat its non-shift sibling has, soShiftControl/Extraswas never written to the profile XML — shift-mode extras (rumble/lightbar/mouse-sensitivity under a shift trigger) silently vanished on every save. (The old pre-DTO writer inSaveProfileOldappends the node right after the identical recompute, which is how the block lost its tail in the DTO port.)Load side:
MapTo'sShiftControl.Extrasblock still passedshift=falsetoUpdateDS4CExtra— unedited from the copiedControl.Extrasblock, while every otherShiftControlsub-block passestrue— so shift extras from older profiles loaded into the normal extras slot: firing without the shift trigger held and clobbering the control's normal extras.The change: add the missing append, pass
truefor the shift slot, and cover both directions with regression tests (CheckShiftExtrasWrittenOnSave,CheckShiftExtrasReadIntoShiftSlot).Before / After
Same command on base
ba4bdcband this branch (2cc9bb0), same machine:ShiftControl.Extrasstays null on save; on load the shift value lands inextrasandshiftExtrasstays nullCheckSettingsReaddate bug, fixed separately in #42); x64/x86 publishes cleanFull proof manifest + raw test outputs: https://gist.github.com/anagnorisis2peripeteia/3352cb2abb916edab1e6ae5ff7f882f1
Local review history: https://gist.github.com/anagnorisis2peripeteia/651881943f6c1b32d781cad8aa2cc548