MrCrayfish / Controllable

Adds in the ability to use a controller to play Minecraft Java Edition
https://mrcrayfish.com/mods?id=controllable
GNU General Public License v3.0
271 stars 78 forks source link

Fixed incorrect mouse cursor scaling, which breaks hover/tooltips/inventory #447

Open michaeltyson opened 1 year ago

michaeltyson commented 1 year ago

The mouse cursor coordinate conversion was using “getScreenWidth()” rather than “getWidth()” (i.e. using the screen size, rather than the window size), which was resulting in an incorrect scaling factor. This fixes it, in all the places it’s used.

This should fix:

440 - Inventory Items are far off screen to the right when selected

425 - Inventory Movement Issues

336 - Items and cursor turn invisible when trying to re-order items in inventory

214 - MacOS Distortion [Unplayable] on ALL Mod Versions

37 - Bug: Mouse icon moves to other Minecraft screen, or vanishes when in inventory

This issue is a show-stopper on macOS, and possibly on Windows with a Hi-DPI display, so I believe it’s quite high priority.

michaeltyson commented 1 year ago

In case it's a while before this is merged (or isn't merged at all), here's a build with the fix:

https://d.atastypixel.com/1694149137/controllable-fabric-1.20.1-0.20.3-release.jar https://d.atastypixel.com/1694295109/controllable-forge-1.20.1-0.20.3-release.jar

PaneerPanda commented 11 months ago

Hello, This issue is still persisting with me. Im using the latest version of MacOS, with a PS5 controller. I hope I'm not annoying anyone. Thanks

michaeltyson commented 11 months ago

Hello, This issue is still persisting with me. Im using the latest version of MacOS, with a PS5 controller. I hope I'm not annoying anyone. Thanks

Oh that’s surprising! You’re definitely using the build from the links above?

Assuming so, some follow up questions: What specifically are you still seeing? Are we talking about a messed-up cursor position in the inventory screen? Are you on Forge or Fabric?

PaneerPanda commented 11 months ago

Hello there, Um about the issue, I've started playing on the next day now and the issue seems to e resolved. Im sorry if I wasted anyone's time Thank you

michaeltyson commented 11 months ago

Yep, I just tried it here and it's working perfectly on Forge. @MrCrayfish, I think we're good to go

NathanVss commented 11 months ago

I can confirm that it works well on my side with this build :)