Keep vocal modifier uniformity from overwriting saved selections#1517
Open
XaiaX wants to merge 1 commit into
Open
Keep vocal modifier uniformity from overwriting saved selections#1517XaiaX wants to merge 1 commit into
XaiaX wants to merge 1 commit into
Conversation
The difficulty select menu enforces uniform vocal modifiers by giving every vocal player the selecting player's modifiers at song launch. That copy (CopyModifiers) wrote the persisted modifier field, permanently erasing the other players' saved modifier selections - and they could not see it happen, since the modifier menu is hidden for non-selecting vocal players. Use the new session-scoped YargProfile.ApplySessionModifiers for the launch copy so gameplay and replay recording still see uniform modifiers while each profile's saved selection is left intact. Additionally, re-seed every player's effective modifiers from their saved selection when difficulty select opens (RestoreSavedModifiers), so modifiers imposed by a previous song do not linger on the long-lived in-memory profile and reappear in the menu. Requires the corresponding YARG.Core change.
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.
NOTE: This depends on this PR.
Summary
Two changes: the launch-time loop that gives all vocal players the selecting player's modifiers now calls
ApplySessionModifiersinstead ofCopyModifiers, so the uniformity is session-scoped instead of being written into the other players' persisted profiles; and when difficulty select opens, every player's effective modifiers are re-seeded from their saved selection (RestoreSavedModifiers), so a prior song's imposed modifiers don't linger on the long-lived in-memory profile and reappear on the next visit.Steps to reproduce
No Vocal PercussionorUnpitched Only) — e.g. sit the first profile out in difficulty select so the second becomes the modifier selector, set the modifier, play or back out.Root cause
DifficultySelectMenu.ChangePlayerenforces uniform vocal modifiers at launch (only the selector may edit them — the menu item is hidden for everyone else — and the selector's set is copied to all non-sitting-out vocal players). The enforcement is correct; the implementation (CopyModifiers) writes the persistedCurrentModifiersfield, making a session rule permanent. The affected players can't even see it happen: the modifier menu is hidden for them in exactly the sessions where the overwrite occurs.A second, subtler defect surfaced on first in-game test of the
ApplySessionModifiersswap: with the persisted value no longer overwritten, the effective value still lingered. Profiles are long-lived objects, so the modifiers a player received from the selector stayed in effect after the song, and the menu (which reads the effective value viaIsModifierActive) showed them on the next visit, looking identical to the original bug even though the saved value on disk was correct and an app restart would show it correctly.Fix
YargProfile.ApplySessionModifiers(see Core PR). Gameplay engines, score screen, and replay recording still see the uniform effective modifiers; each profile's saved selection is no longer overwritten.RestoreSavedModifierson every player so the effective value is re-seeded from the saved selection, discarding any modifiers a previous song imposed, so the menu shows (and edits) each player's own saved selection.Changes
Assets/Script/Menu/DifficultySelect/DifficultySelectMenu.csCopyModifiers→ApplySessionModifiersin the launch-time uniformity loop;RestoreSavedModifierson all players when the menu opensTesting done
RestoreSavedModifiers) reproduced the lingering-effective defect; corrected build is clean.YargProfileModifierTests(session-apply not persisted; restore discards session modifiers; explicit edits persisted; legacy profile JSON loads).