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

Add a button to switch between fixed and floating joystick modes #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

viatearz
Copy link

@viatearz viatearz commented Jan 17, 2025

Summary

Some games only support floating joystick (also called dynamic joystick or free joystick), but PlayTools currently defaults to a fixed joystick, causing it to not work properly in certain games.
Although increasing the size of joystick element in the keymapping editor can make it work, many users don't know this workaround.

Explanation

File Changes
Elements.swift Added a mode field in struct Joystick, use Optional type to ensure compatibility with older keymapping configuration files.
PlayAction.swift Simulate touches for both fixed and floating joystick modes.
EditorController.swift Joystick.swift JoystickElement.swift Added a button UI in the mapping editor to switch joystick modes. To prevent accidental clicks, the button only appears when the joystick element is focused.
PlayTools.strings Added keys keymappingEditor.joystickMode.fixed and keymappingEditor.joystickMode.floating.

Screenshot

1 2 3 4

Related Links

@TheMoonThatRises
Copy link
Member

Since this change updates the structure of keymappings, can you also make a PR that reflects the changes in the PlayCover app too? If not, thats fine, I can do it.

@viatearz
Copy link
Author

Since this change updates the structure of keymappings, can you also make a PR that reflects the changes in the PlayCover app too? If not, thats fine, I can do it.

Alright, I have done it. Please take a look.

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.

[Bug]: The key mapping does not work in the game with joystick following the finger
2 participants