Add support for clickable joysticks on game controllers, L3 and R3. #274
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mark the type contribution you are making:
Description
This pull request, along with pull request 45 in DeltaCore, adds support for clickable joysticks, referred to as L3 and R3. The DeltaCore PR adds the enum cases and value changed handler. This pull request adds the strings that appear controller remapping UI.
References issue #266.
Finally, let me know if I should merge this to a different branch. The only way I could both get the code to compile and use a recent revision of DeltaCore was to clone the 1.5rc_wip branch (cloning
main
ordevelop
pinned DeltaCore to a sufficiently old version thatMFiGameController
had merge conflicts). I can recreate the pull request to a different branch if desired.Testing
List all iOS versions and devices you've tested this change on.
Checklist
General (All PRs)
Experimental Feature-specific
I couldn't find a (simple) way to gate this behind an experimental feature flag. The actual implementation changes are in the DeltaCore PR, which does not have access to
ExperimentalFeatures
. There's no way to disable it from Delta itself. I tried following the stack trace throughControllerInputsViewController
, but there doesn't seem to be a way to determine what input got pressed or to reject an input. If you want, I can hardcode a type checkgameController(_,didActivate:value:)
, and if it's.leftThumbstickButton
or.rightThumbstickButton
, return early. I believe that would prevent the user from mapping the L3 and R3 buttons. However, it doesn't actually preventMFiGameController
from recognizing them. I believe this satisfies the "When a feature is disabled, it should have no noticeable impact on the rest of the app" guideline.ExperimentalFeatures
struct annotated with@Feature
: see above.@Option
's to persist all feature-related data: Not needed.ExperimentalFeatures.shared.[feature].isEnabled
runtime check: see above.