Skip to content

Dynamically resolve co-op left and right panel UI addresses across index shifts - #5

Open
AlexanderHel wants to merge 1 commit into
Gordin:mainfrom
AlexanderHel:fix/coop-panel-resolution
Open

Dynamically resolve co-op left and right panel UI addresses across index shifts#5
AlexanderHel wants to merge 1 commit into
Gordin:mainfrom
AlexanderHel:fix/coop-panel-resolution

Conversation

@AlexanderHel

Copy link
Copy Markdown

Problem

In local co-op mode, the left and right panel paths were previously set to static indices { 22 }\ and { 23 }. However, when temporary or conditional UI elements (such as notification toasts, quest log popups, party overlays, buff bars, or controller HUD elements) load or unload before index 22 in \GameUi.ChildrensPtr, the array positions of the co-op left and right panels shift dynamically to { 21, 22 }\ or { 23, 24 }, breaking panel pointer resolution.

Solution

  • Dynamic Window Scanning: Added \UpdateCoopPanelAddresses()\ in \ImportantUiElements.cs\ to scan candidate indices (\20..25) of \GameUi.ChildrensPtr.
  • Side Differentiation: Uses \ValidUiElementOrZero\ to validate element self-pointers and compares \RelativePosition.X\ coordinates (where Left Panel X < Right Panel X).
  • Fallback Protection: Falls back gracefully to { 22, 23 }\ if dynamic candidate scanning yields no match during UI transitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants