Skip to content

fix: apply menu item origin as an offset - #917

Merged
Laupetin merged 1 commit into
Laupetin:mainfrom
michaeloliverx:fix-menu-parser
Jul 19, 2026
Merged

fix: apply menu item origin as an offset#917
Laupetin merged 1 commit into
Laupetin:mainfrom
michaeloliverx:fix-menu-parser

Conversation

@michaeloliverx

Copy link
Copy Markdown
Contributor

Add origin values to the existing item rectangle instead of replacing its coordinates.

Fixes #78.

image

Add `origin` values to the existing item rectangle instead of replacing its coordinates.
@Laupetin

Copy link
Copy Markdown
Owner

awesome :D yep that was definitely a mistake. The thing now is that what the game does is pretty weird, no? 🤔
If you specify origin twice it will keep adding to the coordinates instead of replacing the origin.
But i guess minor detail and mistake of the game devs.

Also I am wondering how this interacts with exp rect x. When optimizing menus is enabled (default), it will inline any constant rect x into item->window.rectClient.x. That will override any value that was previously set by origin? But i guess that's the same for the vanilla behaviour?

Two things i'd usually not do but i guess the vanilla game does them so OAT should as well?

@Laupetin

Copy link
Copy Markdown
Owner

Also now that i see it: Optimizing the exp rect x to be constant only writes in the rectClient and not rect as well? Also seems to be wrong to me 😬 But i guess that should maybe be fixed in another PR.

@Laupetin Laupetin left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much ❤️ Messed that up 😅 IW4x menus seem to be perfect to my eyes at least? Pretty cool!

@Laupetin
Laupetin merged commit 9c56a28 into Laupetin:main Jul 19, 2026
8 checks passed
@michaeloliverx
michaeloliverx deleted the fix-menu-parser branch July 19, 2026 19:32
@Laupetin

Copy link
Copy Markdown
Owner

Also now that i see it: Optimizing the exp rect x to be constant only writes in the rectClient and not rect as well? Also seems to be wrong to me 😬 But i guess that should maybe be fixed in another PR.

addressed that in #920

@Laupetin Laupetin added the bug Something isn't working label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Menus] Custom menus of IW4x don't have the same result as the basegame

2 participants