Open
Conversation
Contributor
|
This is actually a great fix! @ugackMiner53 , pls review this. (idk how I didn't notice this pull request till now lol) |
Author
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.
Fix: Duplicate settings injection and view pane scroll truncation
Summary
This PR fixes two bugs in the Prop Hunt settings system:
Duplicate settings on room re-entry — Every time a player entered a room,
GameManagerCreatorPatchwould unconditionally append a new Prop HuntRulesCategorytoHideAndSeekManagerPrefab.gameSettingsList.AllCategories. BecausegameSettingsListis aScriptableObject(reference type), it is shared acrossInstantiatecalls and accumulates duplicate entries across scene reloads.Prop Hunt category cut off in the view-only settings pane — The lobby "View" settings pane (
LobbyViewSettingsPane) was not scrollable far enough to reveal the Prop Hunt category.DrawNormalTabcomputes the scroll bound viaCalculateAndSetYBounds, which treats all entries at a uniform0.85fspacing — it does not account for the taller category headers (1.05feach). This meant the scroll range was consistently undersized by the height of the injected category.Changes
PropHunt/Settings/PropHuntSettings.csAdded a
static bool settingsInjectedguard flag toGameManagerCreatorPatch. The category is now injected exactly once per process lifetime, regardless of how many times the scene reloads or the player re-enters a room.Added a
[HarmonyPostfix]onLobbyViewSettingsPane.ChangeTabthat extends the scrollbar'sContentYBounds.maxby the exact pixel height of the Prop Hunt category afterDrawNormalTabfinishes:SetYBoundsMaxis used instead of re-callingCalculateAndSetYBoundsto preserve the base game's own calculation and only append the missing height.Testing
Verified in a local lobby (Hide & Seek mode) that: