Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PlayScreen] Minecraft is not getting right window size or aspect ratio. #163

Open
LeaveNhA opened this issue Jul 20, 2024 · 0 comments
Open

Comments

@LeaveNhA
Copy link

I am using PlayTools externally since Minecraft (at least my version of ipa) is not working on PlayCover.

My method is starting with compiling PlayTools by signing it locally and externally adding it to ipa while installing with Sideloadly. (I don't know if I can mention this method or any of them)
Then, I be sure it get's the settings right. Disabled all of them except the window size and resolution related ones.
But whatever I do, it doesn't work the way I wanted, in terms of window size.
I tried to reverse-engineer it and found a monkey-patch, applied it to the swift code and bind it to the short-cut with menu controller.

Now, with the following patch, it works perfectly in my test environments, including: M1 16" native screen, external 16:9 TV, m1 Pro 13".

I am sorry that I cannot create a PR now, at this point, I don't even know my solution is persistent or qualified enough to go into your code-base.

Patch:

// you can call it after the game launches and try to full-screen with a short-cut or with menu bar.
let address = Unmanaged<AnyObject>.passUnretained(UIScreen.main as AnyObject).toOpaque()
address.advanced(by: 0x28).storeBytes(of: CGRectMake(0.0, 0.0, PlaySettings.shared.windowSizeHeight, PlaySettings.shared.windowSizeWidth), toByteOffset: 0, as: CGRect.self)

If you guys let me know what do you think about it, and want me to create a PR, I can continue with your comments and inputs.

Thanks for all of your hard work fellas! It is nice to collaborate with you all.

PS: I have couple of theories why this works and why our first method fails but I really hated to reverse-engineer/debug this game.

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

No branches or pull requests

1 participant