mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-02-16 10:31:02 +00:00
Fix handling of missing L3 and R3 buttons and adjust on-screen controls based on L3/R3 presence
This commit is contained in:
@@ -216,8 +216,12 @@
|
||||
|
||||
// Yay, iOS 12.1 now supports analog stick buttons
|
||||
if (@available(iOS 12.1, tvOS 12.1, *)) {
|
||||
UPDATE_BUTTON_FLAG(limeController, LS_CLK_FLAG, gamepad.leftThumbstickButton.pressed);
|
||||
UPDATE_BUTTON_FLAG(limeController, RS_CLK_FLAG, gamepad.rightThumbstickButton.pressed);
|
||||
if (gamepad.leftThumbstickButton != nil) {
|
||||
UPDATE_BUTTON_FLAG(limeController, LS_CLK_FLAG, gamepad.leftThumbstickButton.pressed);
|
||||
}
|
||||
if (gamepad.rightThumbstickButton != nil) {
|
||||
UPDATE_BUTTON_FLAG(limeController, RS_CLK_FLAG, gamepad.rightThumbstickButton.pressed);
|
||||
}
|
||||
}
|
||||
|
||||
leftStickX = gamepad.leftThumbstick.xAxis.value * 0x7FFE;
|
||||
@@ -276,6 +280,12 @@
|
||||
if (controller != NULL) {
|
||||
if (controller.extendedGamepad != NULL) {
|
||||
level = OnScreenControlsLevelAutoGCExtendedGamepad;
|
||||
if (@available(iOS 12.1, tvOS 12.1, *)) {
|
||||
if (controller.extendedGamepad.leftThumbstickButton != nil &&
|
||||
controller.extendedGamepad.rightThumbstickButton != nil) {
|
||||
level = OnScreenControlsLevelAutoGCExtendedGamepadWithStickButtons;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (controller.gamepad != NULL) {
|
||||
|
||||
@@ -22,6 +22,7 @@ typedef NS_ENUM(NSInteger, OnScreenControlsLevel) {
|
||||
// Internal levels selected by ControllerSupport
|
||||
OnScreenControlsLevelAutoGCGamepad,
|
||||
OnScreenControlsLevelAutoGCExtendedGamepad,
|
||||
OnScreenControlsLevelAutoGCExtendedGamepadWithStickButtons
|
||||
};
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
|
||||
@@ -202,6 +202,18 @@ static float L3_Y;
|
||||
[self hideSticks];
|
||||
[self drawL3R3];
|
||||
break;
|
||||
case OnScreenControlsLevelAutoGCExtendedGamepadWithStickButtons:
|
||||
// This variant of GCExtendedGamepad has L3 and R3 but
|
||||
// is still missing Select
|
||||
[self setupExtendedGamepadControls];
|
||||
|
||||
[self hideButtons];
|
||||
[self hideBumpers];
|
||||
[self hideTriggers];
|
||||
[self hideL3R3];
|
||||
[self drawStartSelect];
|
||||
[self hideSticks];
|
||||
break;
|
||||
case OnScreenControlsLevelSimple:
|
||||
[self setupSimpleControls];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user