Fix initial cursor position for in-game UI elements#1120
Open
ayushthoren wants to merge 1 commit intosmartcmd:mainfrom
Open
Fix initial cursor position for in-game UI elements#1120ayushthoren wants to merge 1 commit intosmartcmd:mainfrom
ayushthoren wants to merge 1 commit intosmartcmd:mainfrom
Conversation
Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>
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.
Description
Fixes cursor behavior in UI containers such that the position is now deterministic depending on the type of input being used (controller vs KBM).
The cursor now defaults to the first hotbar slot on controller, and defaults to the center of the UI container on KBM.
Changes
Previous Behavior
Cursor position persisted across menu closes/reopens.
Root Cause
Cursor state was being saved (to
g_savedInventoryCursorPos.xandg_savedInventoryCursorPos.y) when containers were closed and restored, using those cached values on next open.New Behavior
Cursor position no longer persists between menu sessions.
Fix Implementation
Removed cursor persistence logic:
SavedInventoryCursorPosdeclaration/usage.Updated
UIScene_AbstractContainerMenu::PlatformInitialize():Windows64check:if iPad == 0 && g_KBMInput.IsKBMActive(), place pointer at panel center.iPad ==0ensures that KBM inputs only affect the primary player's experience on splitscreen, since additional players are guaranteed to be using controllers.AI Use Disclosure
No AI was used to implement these changes.
Related Issues