- feat: gyro-off on-screen button, the opposite of "gyro" button
- fixed: auto tap slider disappeared for regular on-screen buttons
This commit is contained in:
1 parent
dd0c36bb20
commit
3f2a011d7b
2 files changed
+8
-3
No files matched your search
@@ -122,7 +122,7 @@ import UIKit
|
|||||||
@objc public static let verticalTouchPads: [String] = ["LTPAD", "RTPAD", "MOUSEWHEEL", "WHEEL"]
|
@objc public static let verticalTouchPads: [String] = ["LTPAD", "RTPAD", "MOUSEWHEEL", "WHEEL"]
|
||||||
@objc public static let bidirectionalVerticalTouchPads: [String] = ["LTPAD", "RTPAD", "MOUSEWHEEL", "WHEEL"]
|
@objc public static let bidirectionalVerticalTouchPads: [String] = ["LTPAD", "RTPAD", "MOUSEWHEEL", "WHEEL"]
|
||||||
@objc public static let functionalButtonCmds: [String] = ["SETTINGS"]
|
@objc public static let functionalButtonCmds: [String] = ["SETTINGS"]
|
||||||
@objc public static let motionControlButtonCmds: [String] = ["GYRO","ACCEL","MOTION"]
|
@objc public static let motionControlButtonCmds: [String] = ["GYRO","GYROOFF","ACCEL","MOTION"]
|
||||||
|
|
||||||
// @objc public static let specialGameWidgets: [String] = ["YSRSV", "YSLT", "YSRT", "YSRB", "YSB", "YSRT2", "YSRB2", "YSB2", "YSEM", "YSML", "YSMR", "YSWASD"]
|
// @objc public static let specialGameWidgets: [String] = ["YSRSV", "YSLT", "YSRT", "YSRB", "YSB", "YSRT2", "YSRB2", "YSB2", "YSEM", "YSML", "YSMR", "YSWASD"]
|
||||||
|
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ import UIKit
|
|||||||
self.sensitivityYMin = -4
|
self.sensitivityYMin = -4
|
||||||
self.sensitivityYMAX = 4
|
self.sensitivityYMAX = 4
|
||||||
}
|
}
|
||||||
self.hasAutoTap = self.widgetType == WidgetTypeEnum.button && self.functionalButtonString != ""
|
self.hasAutoTap = self.widgetType == WidgetTypeEnum.button && self.functionalButtonString == "" && self.motionControlButtonString == ""
|
||||||
self.isMousePad = self.touchPadString == "MOUSEPAD" && widgetType == WidgetTypeEnum.touchPad
|
self.isMousePad = self.touchPadString == "MOUSEPAD" && widgetType == WidgetTypeEnum.touchPad
|
||||||
self.hasTrackBall = self.touchPadString == "TRACKBALL"
|
self.hasTrackBall = self.touchPadString == "TRACKBALL"
|
||||||
self.isFuncationalButton = self.functionalButtonString != ""
|
self.isFuncationalButton = self.functionalButtonString != ""
|
||||||
@@ -1175,6 +1175,8 @@ import UIKit
|
|||||||
else {self.buttonDownVisualEffectWidth = 9}
|
else {self.buttonDownVisualEffectWidth = 9}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.motionControlButtonString != "" {self.buttonDownVisualEffectWidth = 4}
|
||||||
|
|
||||||
// Set the frame to be larger than the view to expand outward
|
// Set the frame to be larger than the view to expand outward
|
||||||
buttonDownVisualEffectLayer.borderWidth = 0 // set this 0 to hide the visual effect first
|
buttonDownVisualEffectLayer.borderWidth = 0 // set this 0 to hide the visual effect first
|
||||||
buttonDownVisualEffectLayer.frame = self.bounds.insetBy(dx: -self.buttonDownVisualEffectWidth, dy: -self.buttonDownVisualEffectWidth) // Adjust the inset as needed
|
buttonDownVisualEffectLayer.frame = self.bounds.insetBy(dx: -self.buttonDownVisualEffectWidth, dy: -self.buttonDownVisualEffectWidth) // Adjust the inset as needed
|
||||||
@@ -1690,6 +1692,8 @@ import UIKit
|
|||||||
switch self.motionControlButtonString {
|
switch self.motionControlButtonString {
|
||||||
case "GYRO":
|
case "GYRO":
|
||||||
self.functionalButtonDelegate?.startGyroUpdate()
|
self.functionalButtonDelegate?.startGyroUpdate()
|
||||||
|
case "GYROOFF":
|
||||||
|
self.functionalButtonDelegate?.stopGyroUpdate(interruption:false)
|
||||||
case "ACCEL":
|
case "ACCEL":
|
||||||
self.functionalButtonDelegate?.startAccelUpdate()
|
self.functionalButtonDelegate?.startAccelUpdate()
|
||||||
case "MOTION":
|
case "MOTION":
|
||||||
@@ -1701,10 +1705,11 @@ import UIKit
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func handleMotionControlButtonUp(){
|
private func handleMotionControlButtonUp(){
|
||||||
let longPressed = CACurrentMediaTime() - self.touchTapTimeStamp > 0.3
|
|
||||||
switch self.motionControlButtonString {
|
switch self.motionControlButtonString {
|
||||||
case "GYRO":
|
case "GYRO":
|
||||||
self.functionalButtonDelegate?.stopGyroUpdate(interruption: false)
|
self.functionalButtonDelegate?.stopGyroUpdate(interruption: false)
|
||||||
|
case "GYROOFF":
|
||||||
|
self.functionalButtonDelegate?.startGyroUpdate()
|
||||||
case "ACCEL":
|
case "ACCEL":
|
||||||
self.functionalButtonDelegate?.stopAccelUpdate(interruption: false)
|
self.functionalButtonDelegate?.stopAccelUpdate(interruption: false)
|
||||||
case "MOTION":
|
case "MOTION":
|
||||||
|
|||||||
Reference in new issue
Block a user