PlayCover / PlayCover/PlayTools

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

Open
#163 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
111
Forks
145
Avg merge
12d 8h
Merged PRs (30d)
3

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Swift code around the window-size and resolution settings, then trace when UIScreen.main is updated after the game launches or when full-screen is triggered from the shortcut or menu bar. Compare the existing behavior with the reported CGRect update and verify the window size and aspect ratio on the listed native-screen and external-display environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.