- update default Templates
- make RsWheel available
This commit is contained in:
1 parent
55a2bb7576
commit
fcecae3a87
8 files changed
+95
-11
No files matched your search
@@ -396,7 +396,7 @@ import ObjectiveC.runtime
|
|||||||
self.activePointerIds = []
|
self.activePointerIds = []
|
||||||
self.oscProfile = profile
|
self.oscProfile = profile
|
||||||
self.inertialScroller = InertialScroller()
|
self.inertialScroller = InertialScroller()
|
||||||
dWheelWalkModeThreshold = stickMaxOffset*0.5
|
dWheelWalkModeThreshold = stickMaxOffset*0.2
|
||||||
// self.motionHandler = MotionHandler.shared(profile: profile)
|
// self.motionHandler = MotionHandler.shared(profile: profile)
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
|
|
||||||
|
|||||||
@@ -6398,19 +6398,19 @@
|
|||||||
"zh-Hans" : {
|
"zh-Hans" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"state" : "translated",
|
||||||
"value" : "LS 滚轮必须单独放置"
|
"value" : "LS 方向轮必须单独放置"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zh-Hant" : {
|
"zh-Hant" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"state" : "translated",
|
||||||
"value" : "LS 滾輪必須單獨放置"
|
"value" : "LS 方向輪必須單獨放置"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zh-HK" : {
|
"zh-HK" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"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" : {
|
"Right trigger pad" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"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" : {
|
"RS/R3 button" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"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" : {
|
"RT/R2 button" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -84,7 +84,7 @@ enum GamepadWidget: Hashable {
|
|||||||
case a, b, x, y
|
case a, b, x, y
|
||||||
case select, start, home
|
case select, start, home
|
||||||
case dPad, up, down, left, right
|
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 leftShoulder, rightShoulder
|
||||||
case leftTrigger, ltPad, rightTrigger, rtPad
|
case leftTrigger, ltPad, rightTrigger, rtPad
|
||||||
case ds4Touchpad
|
case ds4Touchpad
|
||||||
@@ -110,6 +110,7 @@ enum GamepadWidget: Hashable {
|
|||||||
case .rs: return "RS"
|
case .rs: return "RS"
|
||||||
case .rsPad: return "RSPAD"
|
case .rsPad: return "RSPAD"
|
||||||
case .rsvPad: return "RSVPAD"
|
case .rsvPad: return "RSVPAD"
|
||||||
|
case .rsWheel: return "RSWHEEL"
|
||||||
case .leftShoulder: return "LB"
|
case .leftShoulder: return "LB"
|
||||||
case .rightShoulder: return "RB"
|
case .rightShoulder: return "RB"
|
||||||
case .leftTrigger: return "LT"
|
case .leftTrigger: return "LT"
|
||||||
@@ -141,6 +142,7 @@ enum GamepadWidget: Hashable {
|
|||||||
case .rs: return SwiftLocalizationHelper.localizedString(forKey: "RS/R3 button")
|
case .rs: return SwiftLocalizationHelper.localizedString(forKey: "RS/R3 button")
|
||||||
case .rsPad: return SwiftLocalizationHelper.localizedString(forKey: "Displacement-based right stick pad")
|
case .rsPad: return SwiftLocalizationHelper.localizedString(forKey: "Displacement-based right stick pad")
|
||||||
case .rsvPad: return SwiftLocalizationHelper.localizedString(forKey: "Velocity-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 .leftShoulder: return SwiftLocalizationHelper.localizedString(forKey: "LB/L1")
|
||||||
case .rightShoulder: return SwiftLocalizationHelper.localizedString(forKey: "RB/R1")
|
case .rightShoulder: return SwiftLocalizationHelper.localizedString(forKey: "RB/R1")
|
||||||
case .leftTrigger: return SwiftLocalizationHelper.localizedString(forKey: "LT/L2 button")
|
case .leftTrigger: return SwiftLocalizationHelper.localizedString(forKey: "LT/L2 button")
|
||||||
@@ -466,12 +468,12 @@ struct AbstractGamepadView: View {
|
|||||||
thumbWidgets: [.lsPad, .lswheel]
|
thumbWidgets: [.lsPad, .lswheel]
|
||||||
)
|
)
|
||||||
|
|
||||||
case .rs, .rsPad, .rsvPad:
|
case .rs, .rsPad, .rsvPad, .rsWheel:
|
||||||
rightStickHighlight = nextStickHighlightMode(
|
rightStickHighlight = nextStickHighlightMode(
|
||||||
current: rightStickHighlight,
|
current: rightStickHighlight,
|
||||||
selected: widget,
|
selected: widget,
|
||||||
outerWidget: .rs,
|
outerWidget: .rs,
|
||||||
thumbWidgets: [.rsPad, .rsvPad]
|
thumbWidgets: [.rsPad, .rsvPad, .rsWheel]
|
||||||
)
|
)
|
||||||
if widget == .rs,
|
if widget == .rs,
|
||||||
isCommandSelected?(GamepadWidget.rsPad.cmd) == true || isCommandSelected?(GamepadWidget.rsvPad.cmd) == true {
|
isCommandSelected?(GamepadWidget.rsPad.cmd) == true || isCommandSelected?(GamepadWidget.rsvPad.cmd) == true {
|
||||||
@@ -1050,7 +1052,7 @@ struct AbstractGamepadView: View {
|
|||||||
.frame(width: rightStickSize, height: rightStickSize)
|
.frame(width: rightStickSize, height: rightStickSize)
|
||||||
.offset(x: rightStickCenterX, y: sharedLowerControlCenterY)
|
.offset(x: rightStickCenterX, y: sharedLowerControlCenterY)
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
handleTappedWidgets([.rs, .rsPad, .rsvPad], sourceIsDPad: false)
|
handleTappedWidgets([.rs, .rsPad, .rsvPad, .rsWheel], sourceIsDPad: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
HomeButtonView(
|
HomeButtonView(
|
||||||
@@ -1160,7 +1162,8 @@ struct AbstractGamepadView: View {
|
|||||||
if isCommandSelected(GamepadWidget.rs.cmd) {
|
if isCommandSelected(GamepadWidget.rs.cmd) {
|
||||||
rightStickHighlight = .outerOnly
|
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
|
rightStickHighlight = rightStickHighlight == .outerOnly ? .both : .thumbOnly
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1223,7 +1226,7 @@ struct AbstractGamepadView: View {
|
|||||||
} else if rightStickHighlight == .outerOnly {
|
} else if rightStickHighlight == .outerOnly {
|
||||||
rightStickHighlight = .none
|
rightStickHighlight = .none
|
||||||
}
|
}
|
||||||
case GamepadWidget.rsPad.cmd, GamepadWidget.rsvPad.cmd:
|
case GamepadWidget.rsPad.cmd, GamepadWidget.rsvPad.cmd, GamepadWidget.rsWheel.cmd:
|
||||||
if rightStickHighlight == .both {
|
if rightStickHighlight == .both {
|
||||||
rightStickHighlight = .outerOnly
|
rightStickHighlight = .outerOnly
|
||||||
} else if rightStickHighlight == .thumbOnly {
|
} else if rightStickHighlight == .thumbOnly {
|
||||||
|
|||||||
@@ -1073,6 +1073,7 @@ struct WidgetPickerView: View {
|
|||||||
"LSPAD",
|
"LSPAD",
|
||||||
"RSPAD",
|
"RSPAD",
|
||||||
"RSVPAD",
|
"RSVPAD",
|
||||||
|
"RSWHEEL",
|
||||||
"LTPAD",
|
"LTPAD",
|
||||||
"RTPAD",
|
"RTPAD",
|
||||||
"DS4TOUCH"
|
"DS4TOUCH"
|
||||||
@@ -1146,6 +1147,7 @@ struct WidgetPickerView: View {
|
|||||||
guard isPad(item) else { return false }
|
guard isPad(item) else { return false }
|
||||||
if directionPadPriorityCommands.contains(item.cmd) { return false }
|
if directionPadPriorityCommands.contains(item.cmd) { return false }
|
||||||
if item.cmd == "LSWHEEL" { return false }
|
if item.cmd == "LSWHEEL" { return false }
|
||||||
|
if item.cmd == "RSWHEEL" { return false }
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1318,6 +1320,16 @@ struct WidgetPickerView: View {
|
|||||||
return false
|
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) {
|
if source == .functional, !gyroCommands.contains(cmd) {
|
||||||
guard let option = functionalButtonOption(for: cmd) else {
|
guard let option = functionalButtonOption(for: cmd) else {
|
||||||
resetTipMessage()
|
resetTipMessage()
|
||||||
@@ -1925,7 +1937,7 @@ struct WidgetPickerView: View {
|
|||||||
"DPAD",
|
"DPAD",
|
||||||
"OSCUP", "OSCDOWN", "OSCLEFT", "OSCRIGHT",
|
"OSCUP", "OSCDOWN", "OSCLEFT", "OSCRIGHT",
|
||||||
"LS", "LSWHEEL", "LSPAD",
|
"LS", "LSWHEEL", "LSPAD",
|
||||||
"RS", "RSPAD", "RSVPAD",
|
"RS", "RSPAD", "RSVPAD", "RSWHEEL",
|
||||||
"LB", "RB",
|
"LB", "RB",
|
||||||
"LT", "LTPAD",
|
"LT", "LTPAD",
|
||||||
"RT", "RTPAD",
|
"RT", "RTPAD",
|
||||||
|
|||||||
Reference in new issue
Block a user