minor fixes
This commit is contained in:
@@ -331,7 +331,7 @@ static void ApplyAdaptiveTriggerEffect(GCDualSenseAdaptiveTrigger* trigger,
|
||||
deviceAccelSample.x += voidController.motionManager.deviceMotion.gravity.x;
|
||||
deviceAccelSample.y += voidController.motionManager.deviceMotion.gravity.y;
|
||||
deviceAccelSample.z += voidController.motionManager.deviceMotion.gravity.z;
|
||||
NSLog(@"sending device accel %f", CACurrentMediaTime());
|
||||
// NSLog(@"sending device accel %f", CACurrentMediaTime());
|
||||
|
||||
UIInterfaceOrientation interfaceOrientation = [self currentInterfaceOrientation];
|
||||
CMAcceleration mappedDeviceAccelSample = {};
|
||||
@@ -486,10 +486,10 @@ static void ApplyAdaptiveTriggerEffect(GCDualSenseAdaptiveTrigger* trigger,
|
||||
block:^(NSTimer *timer) {
|
||||
GCAcceleration lastAccelSample = voidController.lastAccelSample;
|
||||
GCAcceleration accelSample = voidController.gamepad.motion.acceleration;
|
||||
|
||||
if (memcmp(&accelSample, &lastAccelSample, sizeof(accelSample)) == 0) {
|
||||
return;
|
||||
}
|
||||
// NSLog(@"sending controller accel %f", CACurrentMediaTime());
|
||||
|
||||
voidController.lastAccelSample = accelSample;
|
||||
|
||||
@@ -1345,7 +1345,8 @@ double rc_expo(double x, double expo) {
|
||||
|
||||
|
||||
- (bool)useMotionHandler{
|
||||
return true;
|
||||
return tempSettings.gyroMode.intValue == GyroModeOff
|
||||
|| tempSettings.gyroMode.intValue == AlwaysDevice;
|
||||
}
|
||||
|
||||
- (void)switchMotionControlOnOffByControllerButton{
|
||||
|
||||
@@ -20225,6 +20225,35 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"emulatedGyroModeDisablesBuiltinMotionControlTip" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Turning this option on will disable VoidLink's built-in motion control. If you need the app to convert gyroscope input directly into mouse or controller-stick signals, remember to turn this option off."
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "打开该选项,将导致 VoidLink 内置的体感控制功能失效。如果您需要在 App 内部直接将陀螺仪转换为鼠标或手柄摇杆信号,请记得关闭该选项。"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "開啟該選項,將導致 VoidLink 內建的體感控制功能失效。如果您需要在 App 內部直接將陀螺儀轉換為滑鼠或手把搖桿訊號,請記得關閉該選項。"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "開啟該選項,將導致 VoidLink 內置的體感控制功能失效。如果您需要在 App 內部直接將陀螺儀轉換為滑鼠或手掣搖桿訊號,請記得關閉該選項。"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"yuv444StackTip" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
|
||||
@@ -638,6 +638,32 @@ import UIKit
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@objc public static func isFirstEnablingEmulatedGyroMode() -> Bool {
|
||||
let key = "hasEnabledEmulatedGyroMode20260825"
|
||||
let defaults = UserDefaults.standard
|
||||
let launchedBefore = defaults.bool(forKey: key)
|
||||
if !launchedBefore {
|
||||
defaults.set(true, forKey: key)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@objc public static func handleEmulatedGyroModeTip(in vc: UIViewController?) {
|
||||
if isFirstEnablingEmulatedGyroMode() {
|
||||
AlertControllerUtil.showAlert(
|
||||
in: vc,
|
||||
title: LocalizationHelper.localizedString(forKey: "Tips"),
|
||||
message: "\n\(LocalizationHelper.localizedString(forKey: "emulatedGyroModeDisablesBuiltinMotionControlTip"))",
|
||||
withCancel: false,
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "This tip won't be shown again"),
|
||||
countdown: 7
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@objc public static func gamepadOverlayFeatureTipTitle() -> String {
|
||||
LocalizationHelper.localizedString(forKey: "Gamepad Overlay")
|
||||
|
||||
@@ -2347,6 +2347,8 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[self.dualSenseTransientSlider addTarget:self action:@selector(dualSenseTransientSliderMoved:) forControlEvents:UIControlEventValueChanged];
|
||||
|
||||
self.gyroModeSelector.selectedSegmentIndex = self->tempSettings.gyroMode.intValue;
|
||||
[self.gyroModeSelector addTarget:self action:@selector(emulatedGyroModeChanged:) forControlEvents:(UIControlEventValueChanged)]; // Update label display when slider is being moved.
|
||||
|
||||
[self.gyroSensitivitySlider setValue: (uint16_t)(self->tempSettings.gyroSensitivity.floatValue * 100) animated:NO]; // Load old setting.
|
||||
[self.gyroSensitivitySlider addTarget:self action:@selector(gyroSensitivitySliderMoved:) forControlEvents:(UIControlEventValueChanged)]; // Update label display when slider is being moved.
|
||||
[self.gyroSensitivitySlider sendActionsForControlEvents:UIControlEventValueChanged]; // Load old setting.
|
||||
@@ -3458,6 +3460,11 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[self findDynamicLabelFromStack:(UIStackView*)sender.superview].text = [NSString stringWithFormat:@" %d%% ", (uint16_t)sender.value]; // Update label display
|
||||
}
|
||||
|
||||
- (void)emulatedGyroModeChanged:(UISegmentedControl* )sender {
|
||||
if(sender.selectedSegmentIndex == GyroModeOff) return;
|
||||
[GenericUtils handleEmulatedGyroModeTipIn:self];
|
||||
}
|
||||
|
||||
- (void) localVolumeSliderMoved:(UISlider* )sender {
|
||||
[self findDynamicLabelFromStack:(UIStackView*)sender.superview].text = [NSString stringWithFormat:@" %d%% ", (uint16_t)sender.value]; // Update label display
|
||||
if(_mainFrameViewController.settingsExpandedInStreamView) [Connection setVolume:sender.value/100];
|
||||
|
||||
Reference in New Issue
Block a user