diff --git a/VoidLink/Input/OnScreenWidgetView.swift b/VoidLink/Input/OnScreenWidgetView.swift index 5e7f7c99..19d39b56 100644 --- a/VoidLink/Input/OnScreenWidgetView.swift +++ b/VoidLink/Input/OnScreenWidgetView.swift @@ -396,7 +396,7 @@ import ObjectiveC.runtime self.activePointerIds = [] self.oscProfile = profile self.inertialScroller = InertialScroller() - dWheelWalkModeThreshold = stickMaxOffset*0.5 + dWheelWalkModeThreshold = stickMaxOffset*0.2 // self.motionHandler = MotionHandler.shared(profile: profile) super.init(frame: .zero) diff --git a/VoidLink/Localization/Localizable.xcstrings b/VoidLink/Localization/Localizable.xcstrings index a2b0a020..035ab742 100644 --- a/VoidLink/Localization/Localizable.xcstrings +++ b/VoidLink/Localization/Localizable.xcstrings @@ -6398,19 +6398,19 @@ "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "LS 滚轮必须单独放置" + "value" : "LS 方向轮必须单独放置" } }, "zh-Hant" : { "stringUnit" : { "state" : "translated", - "value" : "LS 滾輪必須單獨放置" + "value" : "LS 方向輪必須單獨放置" } }, "zh-HK" : { "stringUnit" : { "state" : "translated", - "value" : "LS 滾輪必須單獨放置" + "value" : "LS 方向輪必須單獨放置" } } } @@ -9697,6 +9697,29 @@ } } }, + "Right stick wheel" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "右摇杆方向轮" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "右搖桿方向輪" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "右搖桿方向輪" + } + } + } + }, "Right trigger pad" : { "extractionState" : "manual", "localizations" : { @@ -9743,6 +9766,29 @@ } } }, + "RS wheel must be placed alone" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "RS 方向轮必须单独放置" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "RS 方向輪必須單獨放置" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "RS 方向輪必須單獨放置" + } + } + } + }, "RS/R3 button" : { "extractionState" : "manual", "localizations" : { @@ -9766,6 +9812,29 @@ } } }, + "RsWheel cannot be combined with other widgets" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "RsWheel 不能与其他控件组合" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "RsWheel 不能與其他控制項組合" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "RsWheel 不能與其他控制項組合" + } + } + } + }, "RT/R2 button" : { "extractionState" : "manual", "localizations" : { diff --git a/VoidLink/PresetConfigs/whiteGamepadButtons/widgetTemplates.bin b/VoidLink/PresetConfigs/whiteGamepadButtons/widgetTemplates.bin new file mode 100644 index 00000000..ba0fa2d4 Binary files /dev/null and b/VoidLink/PresetConfigs/whiteGamepadButtons/widgetTemplates.bin differ diff --git a/VoidLink/PresetConfigs/whiteGamepadButtons/widgetTemplatesIPhone.bin b/VoidLink/PresetConfigs/whiteGamepadButtons/widgetTemplatesIPhone.bin new file mode 100644 index 00000000..50a1b49e Binary files /dev/null and b/VoidLink/PresetConfigs/whiteGamepadButtons/widgetTemplatesIPhone.bin differ diff --git a/VoidLink/PresetConfigs/widgetTemplates.bin b/VoidLink/PresetConfigs/widgetTemplates.bin index ba0fa2d4..6dd8828f 100644 Binary files a/VoidLink/PresetConfigs/widgetTemplates.bin and b/VoidLink/PresetConfigs/widgetTemplates.bin differ diff --git a/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin b/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin index 50a1b49e..21904333 100644 Binary files a/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin and b/VoidLink/PresetConfigs/widgetTemplatesIPhone.bin differ diff --git a/VoidLinkSwiftUI/AbstractGamepadView.swift b/VoidLinkSwiftUI/AbstractGamepadView.swift index 3423b8db..4610aea4 100644 --- a/VoidLinkSwiftUI/AbstractGamepadView.swift +++ b/VoidLinkSwiftUI/AbstractGamepadView.swift @@ -84,7 +84,7 @@ enum GamepadWidget: Hashable { case a, b, x, y case select, start, home case dPad, up, down, left, right - case ls, lsPad, lswheel, rs, rsPad, rsvPad + case ls, lsPad, lswheel, rs, rsPad, rsvPad, rsWheel case leftShoulder, rightShoulder case leftTrigger, ltPad, rightTrigger, rtPad case ds4Touchpad @@ -110,6 +110,7 @@ enum GamepadWidget: Hashable { case .rs: return "RS" case .rsPad: return "RSPAD" case .rsvPad: return "RSVPAD" + case .rsWheel: return "RSWHEEL" case .leftShoulder: return "LB" case .rightShoulder: return "RB" case .leftTrigger: return "LT" @@ -141,6 +142,7 @@ enum GamepadWidget: Hashable { case .rs: return SwiftLocalizationHelper.localizedString(forKey: "RS/R3 button") case .rsPad: return SwiftLocalizationHelper.localizedString(forKey: "Displacement-based right stick pad") case .rsvPad: return SwiftLocalizationHelper.localizedString(forKey: "Velocity-based right stick pad") + case .rsWheel: return SwiftLocalizationHelper.localizedString(forKey: "Right stick wheel") case .leftShoulder: return SwiftLocalizationHelper.localizedString(forKey: "LB/L1") case .rightShoulder: return SwiftLocalizationHelper.localizedString(forKey: "RB/R1") case .leftTrigger: return SwiftLocalizationHelper.localizedString(forKey: "LT/L2 button") @@ -466,12 +468,12 @@ struct AbstractGamepadView: View { thumbWidgets: [.lsPad, .lswheel] ) - case .rs, .rsPad, .rsvPad: + case .rs, .rsPad, .rsvPad, .rsWheel: rightStickHighlight = nextStickHighlightMode( current: rightStickHighlight, selected: widget, outerWidget: .rs, - thumbWidgets: [.rsPad, .rsvPad] + thumbWidgets: [.rsPad, .rsvPad, .rsWheel] ) if widget == .rs, isCommandSelected?(GamepadWidget.rsPad.cmd) == true || isCommandSelected?(GamepadWidget.rsvPad.cmd) == true { @@ -1050,7 +1052,7 @@ struct AbstractGamepadView: View { .frame(width: rightStickSize, height: rightStickSize) .offset(x: rightStickCenterX, y: sharedLowerControlCenterY) .onTapGesture { - handleTappedWidgets([.rs, .rsPad, .rsvPad], sourceIsDPad: false) + handleTappedWidgets([.rs, .rsPad, .rsvPad, .rsWheel], sourceIsDPad: false) } HomeButtonView( @@ -1160,7 +1162,8 @@ struct AbstractGamepadView: View { if isCommandSelected(GamepadWidget.rs.cmd) { rightStickHighlight = .outerOnly } - if isCommandSelected(GamepadWidget.rsPad.cmd) || isCommandSelected(GamepadWidget.rsvPad.cmd) { + if isCommandSelected(GamepadWidget.rsPad.cmd) || isCommandSelected(GamepadWidget.rsvPad.cmd) || + isCommandSelected(GamepadWidget.rsWheel.cmd) { rightStickHighlight = rightStickHighlight == .outerOnly ? .both : .thumbOnly } @@ -1223,7 +1226,7 @@ struct AbstractGamepadView: View { } else if rightStickHighlight == .outerOnly { rightStickHighlight = .none } - case GamepadWidget.rsPad.cmd, GamepadWidget.rsvPad.cmd: + case GamepadWidget.rsPad.cmd, GamepadWidget.rsvPad.cmd, GamepadWidget.rsWheel.cmd: if rightStickHighlight == .both { rightStickHighlight = .outerOnly } else if rightStickHighlight == .thumbOnly { diff --git a/VoidLinkSwiftUI/WidgetPickerView.swift b/VoidLinkSwiftUI/WidgetPickerView.swift index 114c78d6..091010ec 100644 --- a/VoidLinkSwiftUI/WidgetPickerView.swift +++ b/VoidLinkSwiftUI/WidgetPickerView.swift @@ -1073,6 +1073,7 @@ struct WidgetPickerView: View { "LSPAD", "RSPAD", "RSVPAD", + "RSWHEEL", "LTPAD", "RTPAD", "DS4TOUCH" @@ -1146,6 +1147,7 @@ struct WidgetPickerView: View { guard isPad(item) else { return false } if directionPadPriorityCommands.contains(item.cmd) { return false } if item.cmd == "LSWHEEL" { return false } + if item.cmd == "RSWHEEL" { return false } return true } @@ -1317,6 +1319,16 @@ struct WidgetPickerView: View { setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "LsWheel cannot be combined with other widgets"), type: .error) return false } + + if cmd == "RSWHEEL", !poolItems.isEmpty { + setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "RS wheel must be placed alone"), type: .error) + return false + } + + if !poolItems.isEmpty, poolItems.contains(where: { $0.cmd == "RSWHEEL" }) { + setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "RsWheel cannot be combined with other widgets"), type: .error) + return false + } if source == .functional, !gyroCommands.contains(cmd) { guard let option = functionalButtonOption(for: cmd) else { @@ -1925,7 +1937,7 @@ struct WidgetPickerView: View { "DPAD", "OSCUP", "OSCDOWN", "OSCLEFT", "OSCRIGHT", "LS", "LSWHEEL", "LSPAD", - "RS", "RSPAD", "RSVPAD", + "RS", "RSPAD", "RSVPAD", "RSWHEEL", "LB", "RB", "LT", "LTPAD", "RT", "RTPAD",