From e058839fafd20ed9e9cefe9d72e175808ab06336 Mon Sep 17 00:00:00 2001 From: TrueZhuanjia Date: Wed, 19 Nov 2025 14:50:39 +0800 Subject: [PATCH] separated controller section in settings menu --- VoidLink/Localization/Localizable.xcstrings | 31 ++++++++-- .../ViewControllers/SettingsViewController.m | 60 +++++++++++-------- 2 files changed, 62 insertions(+), 29 deletions(-) diff --git a/VoidLink/Localization/Localizable.xcstrings b/VoidLink/Localization/Localizable.xcstrings index 4e375a2b..52ee70e5 100644 --- a/VoidLink/Localization/Localizable.xcstrings +++ b/VoidLink/Localization/Localizable.xcstrings @@ -1399,6 +1399,29 @@ } } }, + "Controller" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "手柄" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "控制器" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "控制器" + } + } + } + }, "Create New" : { "extractionState" : "manual", "localizations" : { @@ -5889,25 +5912,25 @@ } } }, - "Touch & Controller" : { + "Touch Control" : { "extractionState" : "manual", "localizations" : { "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "触屏与手柄" + "value" : "触控" } }, "zh-Hant" : { "stringUnit" : { "state" : "translated", - "value" : "觸控與控制器" + "value" : "触控" } }, "zh-HK" : { "stringUnit" : { "state" : "translated", - "value" : "觸控與控制器" + "value" : "触控" } } } diff --git a/VoidLink/ViewControllers/SettingsViewController.m b/VoidLink/ViewControllers/SettingsViewController.m index e58d97de..2829f8eb 100644 --- a/VoidLink/ViewControllers/SettingsViewController.m +++ b/VoidLink/ViewControllers/SettingsViewController.m @@ -48,7 +48,8 @@ CADisplayLink *_autoScrollDisplayLink; CGFloat _scrollSpeed; CGFloat _currentRefreshRate; - MenuSectionView *touchAndControlSection; + MenuSectionView *touchControlSection; + MenuSectionView *controllerSection; MenuSectionView *motionControlSection; MenuSectionView *videoSection; MenuSectionView *otherSection; @@ -724,34 +725,43 @@ BOOL isCustomResolution(int resolutionSelected) { [videoSection addToParentStack:_parentStack]; // [videoSection setExpanded:NO]; - touchAndControlSection = [[MenuSectionView alloc] init]; - touchAndControlSection.delegate = self; - touchAndControlSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Touch & Controller"]; - touchAndControlSection.identifier = @"SettingsSectionTouch&Controller"; + touchControlSection = [[MenuSectionView alloc] init]; + touchControlSection.delegate = self; + touchControlSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Touch Control"]; + touchControlSection.identifier = @"SettingsSectionTouch&Controller"; if (@available(iOS 13.0, *)) { - [touchAndControlSection setSectionWithIcon:[UIImage imageNamed:@"arcade.stick.console"] andSize:20.5]; + [touchControlSection setSectionWithIcon:[UIImage imageNamed:@"arcade.stick.console"] andSize:20.5]; } - [self addSetting:self.touchModeStack ofId:@"touchModeStack" withInfoTag:YES withDynamicLabel:NO to:touchAndControlSection]; - [self addSetting:self.mousePointerVelocityStack ofId:@"mousePointerVelocityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection]; - [self addSetting:self.pointerVelocityDividerStack ofId:@"pointerVelocityDividerStack" withInfoTag:YES withDynamicLabel:YES to:touchAndControlSection]; - [self addSetting:self.pointerVelocityFactorStack ofId:@"pointerVelocityFactorStack" withInfoTag:YES withDynamicLabel:YES to:touchAndControlSection]; - [self addSetting:self.delayLeftClickStack ofId:@"delayLeftClickStack" withInfoTag:YES withDynamicLabel:NO to:touchAndControlSection]; - [self addSetting:self.passthroughGesturesStack ofId:@"passthroughGesturesStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection]; - [self addSetting:self.pinchGestureStack ofId:@"pinchGestureStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection]; - [self addSetting:self.ctrlDownForPinchStack ofId:@"ctrlDownForPinchStack" withInfoTag:YES withDynamicLabel:NO to:touchAndControlSection]; - [self addSetting:self.scrollSensitivityStack ofId:@"scrollSensitivityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection]; - [self addSetting:self.pinchSensitivityStack ofId:@"pinchSensitivityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection]; - [self addSetting:self.mousePointerVelocityStack ofId:@"mousePointerVelocityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection]; - [self addSetting:self.onScreenWidgetStack ofId:@"onScreenWidgetStack" withInfoTag:YES withDynamicLabel:YES to:touchAndControlSection]; - [self addSetting:self.buttonVisualFeedbackStack ofId:@"buttonVisualFeedbackStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection]; - [self addSetting:self.swapAbxyStack ofId:@"swapAbaxyStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection]; - [self addSetting:self.hapticEngineStack ofId:@"hapticEngineStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection]; - [self addSetting:self.emulatedControllerTypeStack ofId:@"emulatedControllerTypeStack" withInfoTag:YES withDynamicLabel:NO to:touchAndControlSection]; - [self addSetting:self.gyroModeStack ofId:@"gyroModeStack" withInfoTag:YES withDynamicLabel:YES to:touchAndControlSection]; - [self addSetting:self.gyroSensitivityStack ofId:@"gyroSensitivityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection]; - [touchAndControlSection addToParentStack:_parentStack]; + [self addSetting:self.touchModeStack ofId:@"touchModeStack" withInfoTag:YES withDynamicLabel:NO to:touchControlSection]; + [self addSetting:self.mousePointerVelocityStack ofId:@"mousePointerVelocityStack" withInfoTag:NO withDynamicLabel:YES to:touchControlSection]; + [self addSetting:self.pointerVelocityDividerStack ofId:@"pointerVelocityDividerStack" withInfoTag:YES withDynamicLabel:YES to:touchControlSection]; + [self addSetting:self.pointerVelocityFactorStack ofId:@"pointerVelocityFactorStack" withInfoTag:YES withDynamicLabel:YES to:touchControlSection]; + [self addSetting:self.delayLeftClickStack ofId:@"delayLeftClickStack" withInfoTag:YES withDynamicLabel:NO to:touchControlSection]; + [self addSetting:self.passthroughGesturesStack ofId:@"passthroughGesturesStack" withInfoTag:NO withDynamicLabel:NO to:touchControlSection]; + [self addSetting:self.pinchGestureStack ofId:@"pinchGestureStack" withInfoTag:NO withDynamicLabel:NO to:touchControlSection]; + [self addSetting:self.ctrlDownForPinchStack ofId:@"ctrlDownForPinchStack" withInfoTag:YES withDynamicLabel:NO to:touchControlSection]; + [self addSetting:self.scrollSensitivityStack ofId:@"scrollSensitivityStack" withInfoTag:NO withDynamicLabel:YES to:touchControlSection]; + [self addSetting:self.pinchSensitivityStack ofId:@"pinchSensitivityStack" withInfoTag:NO withDynamicLabel:YES to:touchControlSection]; + [self addSetting:self.mousePointerVelocityStack ofId:@"mousePointerVelocityStack" withInfoTag:NO withDynamicLabel:YES to:touchControlSection]; + [self addSetting:self.onScreenWidgetStack ofId:@"onScreenWidgetStack" withInfoTag:YES withDynamicLabel:YES to:touchControlSection]; + [self addSetting:self.buttonVisualFeedbackStack ofId:@"buttonVisualFeedbackStack" withInfoTag:NO withDynamicLabel:NO to:touchControlSection]; + [touchControlSection addToParentStack:_parentStack]; // [touchAndControlSection setExpanded:NO]; + controllerSection = [[MenuSectionView alloc] init]; + controllerSection.delegate = self; + controllerSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Controller"]; + controllerSection.identifier = @"SettingsSectionController"; + if (@available(iOS 13.0, *)) { + [controllerSection setSectionWithIcon:[UIImage systemImageNamed:@"gamecontroller"] andSize:26]; + } + [self addSetting:self.swapAbxyStack ofId:@"swapAbaxyStack" withInfoTag:NO withDynamicLabel:NO to:controllerSection]; + [self addSetting:self.hapticEngineStack ofId:@"hapticEngineStack" withInfoTag:NO withDynamicLabel:NO to:controllerSection]; + [self addSetting:self.emulatedControllerTypeStack ofId:@"emulatedControllerTypeStack" withInfoTag:YES withDynamicLabel:NO to:controllerSection]; + [self addSetting:self.gyroModeStack ofId:@"gyroModeStack" withInfoTag:YES withDynamicLabel:YES to:controllerSection]; + [self addSetting:self.gyroSensitivityStack ofId:@"gyroSensitivityStack" withInfoTag:NO withDynamicLabel:YES to:controllerSection]; + [controllerSection addToParentStack:_parentStack]; + motionControlSection = [[MenuSectionView alloc] init]; motionControlSection.delegate = self; motionControlSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Motion Control"];