mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 06:01:13 +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
|
// Yay, iOS 12.1 now supports analog stick buttons
|
||||||
if (@available(iOS 12.1, tvOS 12.1, *)) {
|
if (@available(iOS 12.1, tvOS 12.1, *)) {
|
||||||
UPDATE_BUTTON_FLAG(limeController, LS_CLK_FLAG, gamepad.leftThumbstickButton.pressed);
|
if (gamepad.leftThumbstickButton != nil) {
|
||||||
UPDATE_BUTTON_FLAG(limeController, RS_CLK_FLAG, gamepad.rightThumbstickButton.pressed);
|
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;
|
leftStickX = gamepad.leftThumbstick.xAxis.value * 0x7FFE;
|
||||||
@@ -276,6 +280,12 @@
|
|||||||
if (controller != NULL) {
|
if (controller != NULL) {
|
||||||
if (controller.extendedGamepad != NULL) {
|
if (controller.extendedGamepad != NULL) {
|
||||||
level = OnScreenControlsLevelAutoGCExtendedGamepad;
|
level = OnScreenControlsLevelAutoGCExtendedGamepad;
|
||||||
|
if (@available(iOS 12.1, tvOS 12.1, *)) {
|
||||||
|
if (controller.extendedGamepad.leftThumbstickButton != nil &&
|
||||||
|
controller.extendedGamepad.rightThumbstickButton != nil) {
|
||||||
|
level = OnScreenControlsLevelAutoGCExtendedGamepadWithStickButtons;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (controller.gamepad != NULL) {
|
else if (controller.gamepad != NULL) {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ typedef NS_ENUM(NSInteger, OnScreenControlsLevel) {
|
|||||||
// Internal levels selected by ControllerSupport
|
// Internal levels selected by ControllerSupport
|
||||||
OnScreenControlsLevelAutoGCGamepad,
|
OnScreenControlsLevelAutoGCGamepad,
|
||||||
OnScreenControlsLevelAutoGCExtendedGamepad,
|
OnScreenControlsLevelAutoGCExtendedGamepad,
|
||||||
|
OnScreenControlsLevelAutoGCExtendedGamepadWithStickButtons
|
||||||
};
|
};
|
||||||
|
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
|
|||||||
@@ -202,6 +202,18 @@ static float L3_Y;
|
|||||||
[self hideSticks];
|
[self hideSticks];
|
||||||
[self drawL3R3];
|
[self drawL3R3];
|
||||||
break;
|
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:
|
case OnScreenControlsLevelSimple:
|
||||||
[self setupSimpleControls];
|
[self setupSimpleControls];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user