- update default Templates
- make RsWheel available
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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" : {
|
||||
|
||||
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 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 {
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user