- directionPad improvements
- feat: highlight alpha tweak
This commit is contained in:
1 parent
189ad76f38
commit
cdbe480863
9 files changed
+164
-34
No files matched your search
@@ -170,6 +170,7 @@
|
|||||||
180345E02E819877004AF36F /* libopus-sim.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libopus-sim.a"; sourceTree = "<group>"; };
|
180345E02E819877004AF36F /* libopus-sim.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libopus-sim.a"; sourceTree = "<group>"; };
|
||||||
180E6E362E93BFDB0067C73A /* AlertControllerUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertControllerUtil.swift; sourceTree = "<group>"; };
|
180E6E362E93BFDB0067C73A /* AlertControllerUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertControllerUtil.swift; sourceTree = "<group>"; };
|
||||||
1817B61D2E6FD04D000D938D /* SafeTimer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafeTimer.swift; sourceTree = "<group>"; };
|
1817B61D2E6FD04D000D938D /* SafeTimer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafeTimer.swift; sourceTree = "<group>"; };
|
||||||
|
182042252EFEE46700309FF6 /* touchCentered.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = touchCentered.swift; sourceTree = "<group>"; };
|
||||||
1829CE3D2E2154DF0074A99A /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = "<group>"; };
|
1829CE3D2E2154DF0074A99A /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = "<group>"; };
|
||||||
1829CE3E2E2154DF0074A99A /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = "<group>"; };
|
1829CE3E2E2154DF0074A99A /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = "<group>"; };
|
||||||
18341A022DEB65AB0094E5F2 /* FixedTintImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FixedTintImageView.h; sourceTree = "<group>"; };
|
18341A022DEB65AB0094E5F2 /* FixedTintImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FixedTintImageView.h; sourceTree = "<group>"; };
|
||||||
@@ -582,6 +583,7 @@
|
|||||||
FB1A67542132419700507771 /* Moonlight TV */,
|
FB1A67542132419700507771 /* Moonlight TV */,
|
||||||
FB290CF019B2C406004C83CF /* Frameworks */,
|
FB290CF019B2C406004C83CF /* Frameworks */,
|
||||||
FB290CEF19B2C406004C83CF /* Products */,
|
FB290CEF19B2C406004C83CF /* Products */,
|
||||||
|
182042252EFEE46700309FF6 /* touchCentered.swift */,
|
||||||
);
|
);
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -396,6 +396,7 @@ static CGRect layoutViewBounds;
|
|||||||
buttonState.backgroundAlpha = widgetView.backgroundAlpha;
|
buttonState.backgroundAlpha = widgetView.backgroundAlpha;
|
||||||
buttonState.labelAlpha = widgetView.labelAlpha;
|
buttonState.labelAlpha = widgetView.labelAlpha;
|
||||||
buttonState.borderAlpha = widgetView.borderAlpha;
|
buttonState.borderAlpha = widgetView.borderAlpha;
|
||||||
|
buttonState.highlightAlpha = widgetView.highlightAlpha;
|
||||||
buttonState.borderWidth = widgetView.borderWidth;
|
buttonState.borderWidth = widgetView.borderWidth;
|
||||||
buttonState.highlightSizeFactor = widgetView.highlightSizeFactor;
|
buttonState.highlightSizeFactor = widgetView.highlightSizeFactor;
|
||||||
buttonState.autoTapInterval = widgetView.autoTapInterval;
|
buttonState.autoTapInterval = widgetView.autoTapInterval;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic, assign) CGFloat backgroundAlpha;
|
@property (nonatomic, assign) CGFloat backgroundAlpha;
|
||||||
@property (nonatomic, assign) CGFloat labelAlpha;
|
@property (nonatomic, assign) CGFloat labelAlpha;
|
||||||
@property (nonatomic, assign) CGFloat borderAlpha;
|
@property (nonatomic, assign) CGFloat borderAlpha;
|
||||||
|
@property (nonatomic, assign) CGFloat highlightAlpha;
|
||||||
@property (nonatomic, assign) uint8_t vibrationStyle;
|
@property (nonatomic, assign) uint8_t vibrationStyle;
|
||||||
@property (nonatomic, assign) uint8_t mouseButtonAction;
|
@property (nonatomic, assign) uint8_t mouseButtonAction;
|
||||||
@property (nonatomic, assign) uint16_t autoTapInterval;
|
@property (nonatomic, assign) uint16_t autoTapInterval;
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
[encoder encodeFloat:self.backgroundAlpha forKey:@"backgroundAlpha"];
|
[encoder encodeFloat:self.backgroundAlpha forKey:@"backgroundAlpha"];
|
||||||
[encoder encodeFloat:self.labelAlpha forKey:@"labelAlpha"];
|
[encoder encodeFloat:self.labelAlpha forKey:@"labelAlpha"];
|
||||||
[encoder encodeFloat:self.borderAlpha forKey:@"borderAlpha"];
|
[encoder encodeFloat:self.borderAlpha forKey:@"borderAlpha"];
|
||||||
|
[encoder encodeFloat:self.highlightAlpha forKey:@"highlightAlpha"];
|
||||||
[encoder encodeFloat:self.borderWidth forKey:@"borderWidth"];
|
[encoder encodeFloat:self.borderWidth forKey:@"borderWidth"];
|
||||||
[encoder encodeFloat:self.highlightSizeFactor forKey:@"highlightSizeFactor"];
|
[encoder encodeFloat:self.highlightSizeFactor forKey:@"highlightSizeFactor"];
|
||||||
[encoder encodeObject:self.widgetShape forKey:@"widgetShape"];
|
[encoder encodeObject:self.widgetShape forKey:@"widgetShape"];
|
||||||
@@ -94,6 +95,7 @@
|
|||||||
self.backgroundAlpha = [decoder containsValueForKey:@"backgroundAlpha"] ? [decoder decodeFloatForKey:@"backgroundAlpha"] : 0.5;
|
self.backgroundAlpha = [decoder containsValueForKey:@"backgroundAlpha"] ? [decoder decodeFloatForKey:@"backgroundAlpha"] : 0.5;
|
||||||
self.labelAlpha = [decoder containsValueForKey:@"labelAlpha"] ? [decoder decodeFloatForKey:@"labelAlpha"] : 0.82;
|
self.labelAlpha = [decoder containsValueForKey:@"labelAlpha"] ? [decoder decodeFloatForKey:@"labelAlpha"] : 0.82;
|
||||||
self.borderAlpha = [decoder containsValueForKey:@"borderAlpha"] ? [decoder decodeFloatForKey:@"borderAlpha"] : 0.19;
|
self.borderAlpha = [decoder containsValueForKey:@"borderAlpha"] ? [decoder decodeFloatForKey:@"borderAlpha"] : 0.19;
|
||||||
|
self.highlightAlpha = [decoder containsValueForKey:@"highlightAlpha"] ? [decoder decodeFloatForKey:@"highlightAlpha"] : 0.77;
|
||||||
self.borderWidth = [decoder decodeFloatForKey:@"borderWidth"];
|
self.borderWidth = [decoder decodeFloatForKey:@"borderWidth"];
|
||||||
self.highlightSizeFactor = [decoder containsValueForKey:@"highlightSizeFactor"] ? [decoder decodeFloatForKey:@"highlightSizeFactor"] : 1.0;
|
self.highlightSizeFactor = [decoder containsValueForKey:@"highlightSizeFactor"] ? [decoder decodeFloatForKey:@"highlightSizeFactor"] : 1.0;
|
||||||
self.widgetShape = [decoder decodeObjectForKey:@"widgetShape"];
|
self.widgetShape = [decoder decodeObjectForKey:@"widgetShape"];
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ import SVGKit
|
|||||||
@objc public var componentAlpha: CGFloat = 1
|
@objc public var componentAlpha: CGFloat = 1
|
||||||
@objc public var labelAlpha: CGFloat = 0.82
|
@objc public var labelAlpha: CGFloat = 0.82
|
||||||
@objc public var borderAlpha: CGFloat = 0.1
|
@objc public var borderAlpha: CGFloat = 0.1
|
||||||
|
@objc public var highlightAlpha: CGFloat = 0.77
|
||||||
@objc public var vibrationStyle: Int = 6
|
@objc public var vibrationStyle: Int = 6
|
||||||
@objc public var latestTouchLocation: CGPoint
|
@objc public var latestTouchLocation: CGPoint
|
||||||
@objc public var selfViewOnTheRight: Bool = false
|
@objc public var selfViewOnTheRight: Bool = false
|
||||||
@@ -164,6 +165,7 @@ import SVGKit
|
|||||||
// for LSPAD, RSPAD
|
// for LSPAD, RSPAD
|
||||||
@objc public var offSetX: CGFloat
|
@objc public var offSetX: CGFloat
|
||||||
@objc public var offSetY: CGFloat
|
@objc public var offSetY: CGFloat
|
||||||
|
private var touchCenteredOffset: Bool = false
|
||||||
private let crossMarkColor: CGColor = UIColor(white: 1, alpha: 0.70).cgColor
|
private let crossMarkColor: CGColor = UIColor(white: 1, alpha: 0.70).cgColor
|
||||||
private let stickBallColor: CGColor = UIColor(white: 1, alpha: 0.75).cgColor
|
private let stickBallColor: CGColor = UIColor(white: 1, alpha: 0.75).cgColor
|
||||||
private var stickInputScale: CGFloat = 35
|
private var stickInputScale: CGFloat = 35
|
||||||
@@ -260,7 +262,7 @@ import SVGKit
|
|||||||
@objc public let buttonDownVisualEffectLayer = CAShapeLayer()
|
@objc public let buttonDownVisualEffectLayer = CAShapeLayer()
|
||||||
@objc public var buttonDownVisualEffectStandardWidth: CGFloat
|
@objc public var buttonDownVisualEffectStandardWidth: CGFloat
|
||||||
@objc public var highlightSizeFactor: CGFloat = 1.0
|
@objc public var highlightSizeFactor: CGFloat = 1.0
|
||||||
@objc static public var isTweakingHighlightSize: Bool = false
|
@objc static public var isTweakingHighlight: Bool = false
|
||||||
|
|
||||||
// discreteWheels
|
// discreteWheels
|
||||||
private var tickCycle: UInt8 = UIScreen.main.maximumFramesPerSecond > 110 ? 20 : 10
|
private var tickCycle: UInt8 = UIScreen.main.maximumFramesPerSecond > 110 ? 20 : 10
|
||||||
@@ -386,6 +388,12 @@ import SVGKit
|
|||||||
self.sensitivityFactorY = 0.42
|
self.sensitivityFactorY = 0.42
|
||||||
self.componentSizeFactor = 2.8
|
self.componentSizeFactor = 2.8
|
||||||
}
|
}
|
||||||
|
if self.isDirectionPad {
|
||||||
|
self.widthFactor = 2
|
||||||
|
self.heightFactor = 2
|
||||||
|
self.sensitivityFactorX = 0
|
||||||
|
self.sensitivityFactorY = 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.tweakBorderAlpha(alpha: self.borderAlpha) // fix default borderAlpha offset
|
self.tweakBorderAlpha(alpha: self.borderAlpha) // fix default borderAlpha offset
|
||||||
@@ -570,18 +578,29 @@ import SVGKit
|
|||||||
|
|
||||||
@objc public func tweakBorderAlpha(alpha:CGFloat){
|
@objc public func tweakBorderAlpha(alpha:CGFloat){
|
||||||
borderAlpha = alpha
|
borderAlpha = alpha
|
||||||
defaultBorderColor = UIColor(white: 0.2, alpha: borderAlpha).cgColor
|
defaultBorderColor = UIColor(white: borderAlpha>0 ? 0.1 : 0.9, alpha: abs(borderAlpha)).cgColor
|
||||||
self.layer.borderColor = defaultBorderColor
|
self.layer.borderColor = defaultBorderColor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc public func tweakHighlightAlpha(alpha:CGFloat){
|
||||||
|
highlightAlpha = alpha
|
||||||
|
self.buttonDownVisualEffectLayer.borderColor = UIColor(red: 0.5, green: 0.5, blue: 1.0, alpha: highlightAlpha).cgColor
|
||||||
|
self.l3r3Indicator.borderColor = self.buttonDownVisualEffectLayer.borderColor
|
||||||
|
self.lrudIndicatorBall.borderColor = self.buttonDownVisualEffectLayer.borderColor
|
||||||
|
self.upIndicator.borderColor = self.buttonDownVisualEffectLayer.borderColor
|
||||||
|
self.downIndicator.borderColor = self.buttonDownVisualEffectLayer.borderColor
|
||||||
|
self.leftIndicator.borderColor = self.buttonDownVisualEffectLayer.borderColor
|
||||||
|
self.rightIndicator.borderColor = self.buttonDownVisualEffectLayer.borderColor
|
||||||
|
}
|
||||||
|
|
||||||
private func tweakAlpha(tweakBorderAlpha:Bool){
|
private func tweakAlpha(tweakBorderAlpha:Bool){
|
||||||
// setup default border from self.backgroundAlpha
|
// setup default border from self.backgroundAlpha
|
||||||
let realBackgroundAlpha = self.backgroundAlpha - 0.18 // offset to be consistent with legacy onScreen controller layer opacity
|
let realBackgroundAlpha = abs(self.backgroundAlpha) - 0.18 // offset to be consistent with legacy onScreen controller layer opacity
|
||||||
self.backgroundColor = UIColor(white: 0.2, alpha: realBackgroundAlpha) // offset to be consistent with legacy onScreen controller layer opacity
|
self.backgroundColor = UIColor(white:self.backgroundAlpha>0 ? 0.1 : 0.9, alpha: realBackgroundAlpha) // offset to be consistent with legacy onScreen controller layer opacity
|
||||||
|
|
||||||
if tweakBorderAlpha {
|
if tweakBorderAlpha {
|
||||||
borderAlpha = realBackgroundAlpha * 1.01
|
borderAlpha = realBackgroundAlpha * 1.01
|
||||||
defaultBorderColor = UIColor(white: 0.2, alpha: borderAlpha).cgColor
|
defaultBorderColor = UIColor(white: self.backgroundAlpha>0 ? 0.1 : 0.9, alpha: abs(borderAlpha)).cgColor
|
||||||
self.layer.borderColor = defaultBorderColor
|
self.layer.borderColor = defaultBorderColor
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -719,8 +738,8 @@ import SVGKit
|
|||||||
let attr = NSAttributedString(
|
let attr = NSAttributedString(
|
||||||
string: text,
|
string: text,
|
||||||
attributes: [
|
attributes: [
|
||||||
.foregroundColor: UIColor(white: 1.0, alpha: labelAlpha), // 填充色
|
.foregroundColor: UIColor(white:labelAlpha>0 ? 1.0 : 0, alpha: abs(labelAlpha)), // 填充色
|
||||||
.strokeColor: UIColor.black.withAlphaComponent(labelAlpha*0.43), // 描边色
|
.strokeColor: (labelAlpha>0 ? UIColor.black : UIColor.white).withAlphaComponent(abs(labelAlpha)*0.43), // 描边色
|
||||||
.strokeWidth: containsNonLatin(text) ? -1 : -4 // 负值 = 同时填充
|
.strokeWidth: containsNonLatin(text) ? -1 : -4 // 负值 = 同时填充
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -846,7 +865,7 @@ import SVGKit
|
|||||||
l3r3Indicator.path = path.cgPath
|
l3r3Indicator.path = path.cgPath
|
||||||
l3r3Indicator.borderColor = voidlinkPurple
|
l3r3Indicator.borderColor = voidlinkPurple
|
||||||
self.l3r3Indicator.position = CGPointMake(self.bounds.width/2, self.bounds.height/2)
|
self.l3r3Indicator.position = CGPointMake(self.bounds.width/2, self.bounds.height/2)
|
||||||
if !OnScreenWidgetView.isTweakingHighlightSize {l3r3Indicator.isHidden = true}
|
if !OnScreenWidgetView.isTweakingHighlight {l3r3Indicator.isHidden = true}
|
||||||
|
|
||||||
if l3r3Indicator.superlayer == nil {
|
if l3r3Indicator.superlayer == nil {
|
||||||
self.layer.addSublayer(l3r3Indicator)
|
self.layer.addSublayer(l3r3Indicator)
|
||||||
@@ -1165,7 +1184,7 @@ import SVGKit
|
|||||||
lrudIndicatorBall.shadowRadius = 0;
|
lrudIndicatorBall.shadowRadius = 0;
|
||||||
lrudIndicatorBall.shadowOpacity = 0.8
|
lrudIndicatorBall.shadowOpacity = 0.8
|
||||||
lrudIndicatorBall.name = "lrudBall"
|
lrudIndicatorBall.name = "lrudBall"
|
||||||
if !OnScreenWidgetView.isTweakingHighlightSize {lrudIndicatorBall.isHidden = true}
|
if !OnScreenWidgetView.isTweakingHighlight {lrudIndicatorBall.isHidden = true}
|
||||||
|
|
||||||
// Set the fill color (inside of the circle)
|
// Set the fill color (inside of the circle)
|
||||||
lrudIndicatorBall.fillColor = stickBallColor // Light fill with some transparency
|
lrudIndicatorBall.fillColor = stickBallColor // Light fill with some transparency
|
||||||
@@ -1191,7 +1210,7 @@ import SVGKit
|
|||||||
|
|
||||||
private func showLrudDirectionIndicator(with indicatorLayer:CAShapeLayer){
|
private func showLrudDirectionIndicator(with indicatorLayer:CAShapeLayer){
|
||||||
// show the indicator based on the touchBeganLocation
|
// show the indicator based on the touchBeganLocation
|
||||||
indicatorLayer.position = touchBeganLocation
|
indicatorLayer.position = touchCenteredOffset ? touchBeganLocation : CGPoint(x: self.bounds.midX, y: self.bounds.midY)
|
||||||
|
|
||||||
if indicatorLayer.isHidden {
|
if indicatorLayer.isHidden {
|
||||||
indicatorLayer.isHidden = false
|
indicatorLayer.isHidden = false
|
||||||
@@ -1208,9 +1227,13 @@ import SVGKit
|
|||||||
|
|
||||||
let radians = atan2(-offSetY,offSetX)
|
let radians = atan2(-offSetY,offSetX)
|
||||||
let degrees = radians * 180 / .pi
|
let degrees = radians * 180 / .pi
|
||||||
let nearZeroPoint = abs(offSetX) < 16/sensitivityFactorX && abs(offSetY) < 16/sensitivityFactorY
|
|
||||||
|
let nearZeroPoint = sensitivityFactorX == 0 || sensitivityFactorY == 0 ? false : abs(offSetX) < 16/sensitivityFactorX && abs(offSetY) < 16/sensitivityFactorY
|
||||||
// NSLog("deltaX: %f, detalY: %f", deltaX, deltaY)
|
// NSLog("deltaX: %f, detalY: %f", deltaX, deltaY)
|
||||||
|
|
||||||
|
if self.stickWheelAxis.isHidden {
|
||||||
|
self.stickWheelAxis.isHidden = false
|
||||||
|
}
|
||||||
|
|
||||||
var pressedButtonMask = 0;
|
var pressedButtonMask = 0;
|
||||||
if abs(degrees) < triggeringAngle {
|
if abs(degrees) < triggeringAngle {
|
||||||
@@ -1426,7 +1449,7 @@ import SVGKit
|
|||||||
if OnScreenWidgetView.buttonVisualFeedbackEnabled {
|
if OnScreenWidgetView.buttonVisualFeedbackEnabled {
|
||||||
CATransaction.begin()
|
CATransaction.begin()
|
||||||
CATransaction.setDisableActions(true)
|
CATransaction.setDisableActions(true)
|
||||||
if !OnScreenWidgetView.isTweakingHighlightSize {buttonDownVisualEffectLayer.isHidden = true}
|
if !OnScreenWidgetView.isTweakingHighlight {buttonDownVisualEffectLayer.isHidden = true}
|
||||||
CATransaction.commit()
|
CATransaction.commit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1449,24 +1472,35 @@ import SVGKit
|
|||||||
CATransaction.begin()
|
CATransaction.begin()
|
||||||
CATransaction.setDisableActions(true)
|
CATransaction.setDisableActions(true)
|
||||||
|
|
||||||
self.setupLrudBall()
|
// self.setupLrudBall()
|
||||||
|
|
||||||
setupLrudDirectionLayer(directionLayer: upIndicator)
|
setupLrudDirectionLayer(directionLayer: upIndicator)
|
||||||
upIndicator.anchorPoint = CGPoint(x: 0.5, y: 1)
|
let offset = upIndicator.borderWidth/(2*upIndicator.bounds.width)
|
||||||
|
upIndicator.anchorPoint = CGPoint(x: 0.5, y: 1-offset)
|
||||||
setupLrudDirectionLayer(directionLayer: downIndicator)
|
setupLrudDirectionLayer(directionLayer: downIndicator)
|
||||||
downIndicator.anchorPoint = CGPoint(x: 0.5, y: 0)
|
downIndicator.anchorPoint = CGPoint(x: 0.5, y: 0+offset)
|
||||||
setupLrudDirectionLayer(directionLayer: leftIndicator)
|
setupLrudDirectionLayer(directionLayer: leftIndicator)
|
||||||
leftIndicator.anchorPoint = CGPoint(x: 1, y: 0.5)
|
leftIndicator.anchorPoint = CGPoint(x: 1-offset, y: 0.5)
|
||||||
setupLrudDirectionLayer(directionLayer: rightIndicator)
|
setupLrudDirectionLayer(directionLayer: rightIndicator)
|
||||||
rightIndicator.anchorPoint = CGPoint(x: 0, y: 0.5)
|
rightIndicator.anchorPoint = CGPoint(x: 0+offset, y: 0.5)
|
||||||
|
|
||||||
if !OnScreenWidgetView.isTweakingHighlightSize {
|
if !OnScreenWidgetView.isTweakingHighlight {
|
||||||
leftIndicator.isHidden = true
|
leftIndicator.isHidden = true
|
||||||
rightIndicator.isHidden = true
|
rightIndicator.isHidden = true
|
||||||
upIndicator.isHidden = true
|
upIndicator.isHidden = true
|
||||||
downIndicator.isHidden = true
|
downIndicator.isHidden = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !touchCenteredOffset {
|
||||||
|
let axisdiameter = self.getDiameter(lengthFactor: 0.35)
|
||||||
|
let axisSize = CGSize(width: axisdiameter, height: axisdiameter)
|
||||||
|
self.stickWheelAxis = GraphicUtils.makeCenteredSVGLayer(from: "StickWheelAxis-0.75.svg", in: self.layer, targetSize: axisSize)
|
||||||
|
GraphicUtils.changeColor(layer: self.stickWheelAxis, color: UIColor(white: 1, alpha: 0.6))
|
||||||
|
self.stickWheelAxis.removeFromSuperlayer()
|
||||||
|
self.layer.addSublayer(self.stickWheelAxis)
|
||||||
|
self.stickWheelAxis.isHidden = false
|
||||||
|
}
|
||||||
|
|
||||||
CATransaction.commit()
|
CATransaction.commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1511,7 +1545,7 @@ import SVGKit
|
|||||||
}
|
}
|
||||||
|
|
||||||
buttonDownVisualEffectLayer.position = CGPointMake(self.bounds.midX, self.bounds.midY)
|
buttonDownVisualEffectLayer.position = CGPointMake(self.bounds.midX, self.bounds.midY)
|
||||||
if !OnScreenWidgetView.isTweakingHighlightSize {buttonDownVisualEffectLayer.isHidden = true}
|
if !OnScreenWidgetView.isTweakingHighlight {buttonDownVisualEffectLayer.isHidden = true}
|
||||||
|
|
||||||
CATransaction.commit()
|
CATransaction.commit()
|
||||||
}
|
}
|
||||||
@@ -1714,7 +1748,16 @@ import SVGKit
|
|||||||
self.showl3r3Indicator()
|
self.showl3r3Indicator()
|
||||||
self.sendComboButtonsDownEvent(comboStrings: self.comboButtonStrings)}
|
self.sendComboButtonsDownEvent(comboStrings: self.comboButtonStrings)}
|
||||||
case "DPAD", "WASDPAD", "ARROWPAD":
|
case "DPAD", "WASDPAD", "ARROWPAD":
|
||||||
if allSpawnedTouchesCount == 1 {showLrudBall(at: touchBeganLocation)}
|
if allSpawnedTouchesCount == 1 {
|
||||||
|
// showLrudBall(at: touchBeganLocation)
|
||||||
|
CATransaction.begin()
|
||||||
|
CATransaction.setDisableActions(true)
|
||||||
|
self.stickWheelAxis.position = touchCenteredOffset ? touchBeganLocation : CGPoint(x: self.bounds.midX, y: self.bounds.midY)
|
||||||
|
self.stickWheelAxis.isHidden = false
|
||||||
|
CATransaction.commit()
|
||||||
|
self.getVector(touch: touches.first!)
|
||||||
|
self.handleLrudTouchMove()
|
||||||
|
}
|
||||||
if quickDoubleTapDetected {
|
if quickDoubleTapDetected {
|
||||||
self.sendComboButtonsDownEvent(comboStrings: self.comboButtonStrings)
|
self.sendComboButtonsDownEvent(comboStrings: self.comboButtonStrings)
|
||||||
DispatchQueue.global(qos: .userInteractive).async {
|
DispatchQueue.global(qos: .userInteractive).async {
|
||||||
@@ -1960,9 +2003,10 @@ import SVGKit
|
|||||||
self.inertialScroller.vector = UITouchUtil.vector(of: touch, in: self)
|
self.inertialScroller.vector = UITouchUtil.vector(of: touch, in: self)
|
||||||
}
|
}
|
||||||
|
|
||||||
let touchCentered = !self.isStickWheel
|
touchCenteredOffset = (!self.isStickWheel
|
||||||
self.offSetX = touchCentered ? currentTouchLocation.x - self.touchBeganLocation.x : currentTouchLocation.x - self.bounds.midX
|
&& !(self.isDirectionPad && sensitivityFactorX==0 && sensitivityFactorY==0))
|
||||||
self.offSetY = touchCentered ? currentTouchLocation.y - self.touchBeganLocation.y : currentTouchLocation.y - self.bounds.midY
|
self.offSetX = touchCenteredOffset ? currentTouchLocation.x - self.touchBeganLocation.x : currentTouchLocation.x - self.bounds.midX
|
||||||
|
self.offSetY = touchCenteredOffset ? currentTouchLocation.y - self.touchBeganLocation.y : currentTouchLocation.y - self.bounds.midY
|
||||||
}
|
}
|
||||||
|
|
||||||
private func updateTouchLocation(touch: UITouch){
|
private func updateTouchLocation(touch: UITouch){
|
||||||
@@ -2337,16 +2381,19 @@ import SVGKit
|
|||||||
case "RTPAD":
|
case "RTPAD":
|
||||||
self.onScreenControls.updateRightTrigger(0x00)
|
self.onScreenControls.updateRightTrigger(0x00)
|
||||||
case "WASDPAD":
|
case "WASDPAD":
|
||||||
|
self.stickWheelAxis.isHidden = touchCenteredOffset
|
||||||
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["W"]!,Int8(KEY_ACTION_UP), 0)
|
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["W"]!,Int8(KEY_ACTION_UP), 0)
|
||||||
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["A"]!,Int8(KEY_ACTION_UP), 0)
|
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["A"]!,Int8(KEY_ACTION_UP), 0)
|
||||||
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["S"]!,Int8(KEY_ACTION_UP), 0)
|
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["S"]!,Int8(KEY_ACTION_UP), 0)
|
||||||
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["D"]!,Int8(KEY_ACTION_UP), 0)
|
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["D"]!,Int8(KEY_ACTION_UP), 0)
|
||||||
case "ARROWPAD":
|
case "ARROWPAD":
|
||||||
|
self.stickWheelAxis.isHidden = touchCenteredOffset
|
||||||
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["LEFT_ARROW"]!,Int8(KEY_ACTION_UP), 0)
|
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["LEFT_ARROW"]!,Int8(KEY_ACTION_UP), 0)
|
||||||
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["RIGHT_ARROW"]!,Int8(KEY_ACTION_UP), 0)
|
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["RIGHT_ARROW"]!,Int8(KEY_ACTION_UP), 0)
|
||||||
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["UP_ARROW"]!,Int8(KEY_ACTION_UP), 0)
|
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["UP_ARROW"]!,Int8(KEY_ACTION_UP), 0)
|
||||||
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["DOWN_ARROW"]!,Int8(KEY_ACTION_UP), 0)
|
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["DOWN_ARROW"]!,Int8(KEY_ACTION_UP), 0)
|
||||||
case "DPAD":
|
case "DPAD":
|
||||||
|
self.stickWheelAxis.isHidden = touchCenteredOffset
|
||||||
self.onScreenControls.releaseControllerButton(LEFT_FLAG)
|
self.onScreenControls.releaseControllerButton(LEFT_FLAG)
|
||||||
self.onScreenControls.releaseControllerButton(RIGHT_FLAG)
|
self.onScreenControls.releaseControllerButton(RIGHT_FLAG)
|
||||||
self.onScreenControls.releaseControllerButton(UP_FLAG)
|
self.onScreenControls.releaseControllerButton(UP_FLAG)
|
||||||
@@ -2358,7 +2405,7 @@ import SVGKit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !OnScreenWidgetView.isTweakingHighlightSize {
|
if !OnScreenWidgetView.isTweakingHighlight {
|
||||||
if CommandManager.stickTouchPads.contains(touchPadString){
|
if CommandManager.stickTouchPads.contains(touchPadString){
|
||||||
self.l3r3Indicator.isHidden = true
|
self.l3r3Indicator.isHidden = true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
|
|
||||||
|
|
||||||
- (void) clearOnScreenWidgets{
|
- (void) clearOnScreenWidgets{
|
||||||
OnScreenWidgetView.isTweakingHighlightSize = false;
|
OnScreenWidgetView.isTweakingHighlight = false;
|
||||||
for (UIView *subview in self->streamFrameTopLayerView.subviews) {
|
for (UIView *subview in self->streamFrameTopLayerView.subviews) {
|
||||||
// 检查子视图是否是特定类型的实例
|
// 检查子视图是否是特定类型的实例
|
||||||
if ([subview isKindOfClass:[OnScreenWidgetView class]]) {
|
if ([subview isKindOfClass:[OnScreenWidgetView class]]) {
|
||||||
@@ -588,6 +588,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
[widgetView adjustBorderWithWidth:buttonState.borderWidth];
|
[widgetView adjustBorderWithWidth:buttonState.borderWidth];
|
||||||
[widgetView tweakLabelAlphaWithAlpha:buttonState.labelAlpha];
|
[widgetView tweakLabelAlphaWithAlpha:buttonState.labelAlpha];
|
||||||
[widgetView tweakBorderAlphaWithAlpha:buttonState.borderAlpha];
|
[widgetView tweakBorderAlphaWithAlpha:buttonState.borderAlpha];
|
||||||
|
[widgetView tweakHighlightAlphaWithAlpha:buttonState.highlightAlpha];
|
||||||
[widgetView setupAutoTapTimer];
|
[widgetView setupAutoTapTimer];
|
||||||
[widgetView setupInertialScroller];
|
[widgetView setupInertialScroller];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2990,6 +2990,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Highlight alpha: %.2f" : {
|
||||||
|
"extractionState" : "manual",
|
||||||
|
"localizations" : {
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "高亮透明度: %.2f"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "高亮透明度: %.2f"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-HK" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "高亮透明度: %.2f"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Highlight size: %.2f" : {
|
"Highlight size: %.2f" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<svg width="860" height="860" viewBox="0 0 860 860" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_3_30)">
|
||||||
|
<path opacity="0.75" d="M430 45.3164C642.136 45.3164 814.471 217.345 814.471 430C814.471 642.656 642.136 814.684 430 814.684C217.864 814.684 45.5294 642.656 45.5294 430C45.5294 217.345 217.864 45.3164 430 45.3164Z" stroke="white" stroke-width="90"/>
|
||||||
|
<path opacity="0.75" d="M430 122.855L508.859 213.488H351.141L430 122.855Z" fill="#D9D9D9"/>
|
||||||
|
<path opacity="0.75" d="M430 737.144L351.141 646.512H508.859L430 737.144Z" fill="#D9D9D9"/>
|
||||||
|
<path opacity="0.75" d="M738.588 430.001L647.529 508.491V351.512L738.588 430.001Z" fill="#D9D9D9"/>
|
||||||
|
<path opacity="0.75" d="M121.412 430.001L212.471 351.512V508.491L121.412 430.001Z" fill="#D9D9D9"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_3_30">
|
||||||
|
<rect width="860" height="860" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 879 B |
+48
-9
@@ -25,6 +25,7 @@ typedef NS_ENUM(NSUInteger, AlphaSliderMode) {
|
|||||||
widgetAlpha,
|
widgetAlpha,
|
||||||
labelAlpha,
|
labelAlpha,
|
||||||
borderAlpha,
|
borderAlpha,
|
||||||
|
highlightAlpha,
|
||||||
AlphaSliderModeCount
|
AlphaSliderModeCount
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
|
|
||||||
- (void) viewWillDisappear:(BOOL)animated{
|
- (void) viewWillDisappear:(BOOL)animated{
|
||||||
OnScreenWidgetView.editMode = false;
|
OnScreenWidgetView.editMode = false;
|
||||||
OnScreenWidgetView.isTweakingHighlightSize = false;
|
OnScreenWidgetView.isTweakingHighlight = false;
|
||||||
[super viewWillDisappear:animated];
|
[super viewWillDisappear:animated];
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"OscLayoutCloseNotification" object:self];
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"OscLayoutCloseNotification" object:self];
|
||||||
}
|
}
|
||||||
@@ -125,7 +126,7 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
|
|
||||||
- (void)reloadOnScreenWidgetViews{
|
- (void)reloadOnScreenWidgetViews{
|
||||||
NSLog(@"reloadOnScreenWidgets %f", CACurrentMediaTime());
|
NSLog(@"reloadOnScreenWidgets %f", CACurrentMediaTime());
|
||||||
OnScreenWidgetView.isTweakingHighlightSize = false;
|
OnScreenWidgetView.isTweakingHighlight = false;
|
||||||
OnScreenWidgetView.editMode = true;
|
OnScreenWidgetView.editMode = true;
|
||||||
[self hideStickIndicators];
|
[self hideStickIndicators];
|
||||||
|
|
||||||
@@ -180,6 +181,7 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
[widgetView adjustTransparencyWithAlpha:buttonState.backgroundAlpha tweakBorderAlpha:NO];
|
[widgetView adjustTransparencyWithAlpha:buttonState.backgroundAlpha tweakBorderAlpha:NO];
|
||||||
[widgetView tweakLabelAlphaWithAlpha:buttonState.labelAlpha];
|
[widgetView tweakLabelAlphaWithAlpha:buttonState.labelAlpha];
|
||||||
[widgetView tweakBorderAlphaWithAlpha:buttonState.borderAlpha];
|
[widgetView tweakBorderAlphaWithAlpha:buttonState.borderAlpha];
|
||||||
|
[widgetView tweakHighlightAlphaWithAlpha:buttonState.highlightAlpha];
|
||||||
[widgetView adjustBorderWithWidth:buttonState.borderWidth];
|
[widgetView adjustBorderWithWidth:buttonState.borderWidth];
|
||||||
[self.onScreenWidgetViews addObject:widgetView];
|
[self.onScreenWidgetViews addObject:widgetView];
|
||||||
}
|
}
|
||||||
@@ -366,24 +368,50 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
- (void)switchAlphaSlider:(UITapGestureRecognizer *)sender {
|
- (void)switchAlphaSlider:(UITapGestureRecognizer *)sender {
|
||||||
if(!widgetViewSelected) return;
|
if(!widgetViewSelected) return;
|
||||||
alphaSliderMode = (alphaSliderMode + 1) % AlphaSliderModeCount;
|
alphaSliderMode = (alphaSliderMode + 1) % AlphaSliderModeCount;
|
||||||
|
OnScreenWidgetView.isTweakingHighlight = alphaSliderMode == highlightAlpha || borderWidthSliderMode == hightlightSize;
|
||||||
[self loadWidgetAlphas];
|
[self loadWidgetAlphas];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setHiddenForWidgetHighlights{
|
||||||
|
selectedWidgetView.buttonDownVisualEffectLayer.hidden = !OnScreenWidgetView.isTweakingHighlight;
|
||||||
|
selectedWidgetView.l3r3Indicator.hidden = !selectedWidgetView.hasL3R3Indicator || !OnScreenWidgetView.isTweakingHighlight;
|
||||||
|
(selectedWidgetView.lrudIndicatorBall.hidden
|
||||||
|
= selectedWidgetView.upIndicator.hidden
|
||||||
|
= selectedWidgetView.downIndicator.hidden
|
||||||
|
= selectedWidgetView.leftIndicator.hidden
|
||||||
|
= selectedWidgetView.rightIndicator.hidden
|
||||||
|
= !selectedWidgetView.isDirectionPad
|
||||||
|
&& !OnScreenWidgetView.isTweakingHighlight);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)loadWidgetAlphas{
|
- (void)loadWidgetAlphas{
|
||||||
if(self->selectedWidgetView != nil && self->widgetViewSelected){
|
if(self->selectedWidgetView != nil && self->widgetViewSelected){
|
||||||
|
[self setHiddenForWidgetHighlights];
|
||||||
switch(alphaSliderMode){
|
switch(alphaSliderMode){
|
||||||
case widgetAlpha:
|
case widgetAlpha:
|
||||||
|
[self.widgetAlphaSlider setMaximumValue:1];
|
||||||
|
[self.widgetAlphaSlider setMinimumValue:-1];
|
||||||
[self.widgetAlphaSlider setValue: self->selectedWidgetView.backgroundAlpha];
|
[self.widgetAlphaSlider setValue: self->selectedWidgetView.backgroundAlpha];
|
||||||
[self.widgetAlphaLabel setText:[LocalizationHelper localizedStringForKey:@"Alpha: %.2f", _widgetAlphaSlider.value]];
|
[self.widgetAlphaLabel setText:[LocalizationHelper localizedStringForKey:@"Alpha: %.2f", _widgetAlphaSlider.value]];
|
||||||
break;
|
break;
|
||||||
case labelAlpha:
|
case labelAlpha:
|
||||||
|
[self.widgetAlphaSlider setMaximumValue:1];
|
||||||
|
[self.widgetAlphaSlider setMinimumValue:-1];
|
||||||
[self.widgetAlphaSlider setValue: self->selectedWidgetView.labelAlpha];
|
[self.widgetAlphaSlider setValue: self->selectedWidgetView.labelAlpha];
|
||||||
[self.widgetAlphaLabel setText:[LocalizationHelper localizedStringForKey:@"Label alpha: %.2f", _widgetAlphaSlider.value]];
|
[self.widgetAlphaLabel setText:[LocalizationHelper localizedStringForKey:@"Label alpha: %.2f", _widgetAlphaSlider.value]];
|
||||||
break;
|
break;
|
||||||
case borderAlpha:
|
case borderAlpha:
|
||||||
|
[self.widgetAlphaSlider setMaximumValue:1];
|
||||||
|
[self.widgetAlphaSlider setMinimumValue:-1];
|
||||||
[self.widgetAlphaSlider setValue: self->selectedWidgetView.borderAlpha];
|
[self.widgetAlphaSlider setValue: self->selectedWidgetView.borderAlpha];
|
||||||
[self.widgetAlphaLabel setText:[LocalizationHelper localizedStringForKey:@"Border alpha: %.2f", _widgetAlphaSlider.value]];
|
[self.widgetAlphaLabel setText:[LocalizationHelper localizedStringForKey:@"Border alpha: %.2f", _widgetAlphaSlider.value]];
|
||||||
break;
|
break;
|
||||||
|
case highlightAlpha:
|
||||||
|
[self.widgetAlphaSlider setMaximumValue:1];
|
||||||
|
[self.widgetAlphaSlider setMinimumValue:0];
|
||||||
|
[self.widgetAlphaSlider setValue: self->selectedWidgetView.highlightAlpha];
|
||||||
|
[self.widgetAlphaLabel setText:[LocalizationHelper localizedStringForKey:@"Highlight alpha: %.2f", _widgetAlphaSlider.value]];
|
||||||
|
break;
|
||||||
case AlphaSliderModeCount:
|
case AlphaSliderModeCount:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -400,18 +428,20 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
- (void)switchBorderWidthSlider:(UITapGestureRecognizer *)sender {
|
- (void)switchBorderWidthSlider:(UITapGestureRecognizer *)sender {
|
||||||
if(!widgetViewSelected) return;
|
if(!widgetViewSelected) return;
|
||||||
borderWidthSliderMode = (borderWidthSliderMode + 1) % BorderWidthSliderModeCount;
|
borderWidthSliderMode = (borderWidthSliderMode + 1) % BorderWidthSliderModeCount;
|
||||||
OnScreenWidgetView.isTweakingHighlightSize = borderWidthSliderMode == hightlightSize;
|
OnScreenWidgetView.isTweakingHighlight = alphaSliderMode == highlightAlpha || borderWidthSliderMode == hightlightSize;
|
||||||
[self loadWidgetWidths];
|
[self loadWidgetWidths];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)loadWidgetWidths{
|
- (void)loadWidgetWidths{
|
||||||
if(self->selectedWidgetView != nil && self->widgetViewSelected){
|
if(self->selectedWidgetView != nil && self->widgetViewSelected){
|
||||||
|
[self setHiddenForWidgetHighlights];
|
||||||
switch(borderWidthSliderMode){
|
switch(borderWidthSliderMode){
|
||||||
case widgetBorderWidth:
|
case widgetBorderWidth:
|
||||||
[self.widgetBorderWidthSlider setMinimumValue:0];
|
[self.widgetBorderWidthSlider setMinimumValue:0];
|
||||||
[self.widgetBorderWidthSlider setMaximumValue:8];
|
[self.widgetBorderWidthSlider setMaximumValue:8];
|
||||||
[self.widgetBorderWidthSlider setValue:selectedWidgetView.borderWidth animated:NO];
|
[self.widgetBorderWidthSlider setValue:selectedWidgetView.borderWidth animated:NO];
|
||||||
|
|
||||||
|
/*
|
||||||
selectedWidgetView.buttonDownVisualEffectLayer.hidden = true;
|
selectedWidgetView.buttonDownVisualEffectLayer.hidden = true;
|
||||||
selectedWidgetView.l3r3Indicator.hidden = true;
|
selectedWidgetView.l3r3Indicator.hidden = true;
|
||||||
|
|
||||||
@@ -420,7 +450,7 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
= selectedWidgetView.downIndicator.hidden
|
= selectedWidgetView.downIndicator.hidden
|
||||||
= selectedWidgetView.leftIndicator.hidden
|
= selectedWidgetView.leftIndicator.hidden
|
||||||
= selectedWidgetView.rightIndicator.hidden
|
= selectedWidgetView.rightIndicator.hidden
|
||||||
= true);
|
= true); */
|
||||||
|
|
||||||
[self.widgetBorderWidthLabel setText:[LocalizationHelper localizedStringForKey:@"Border width: %.2f", _widgetBorderWidthSlider.value]];
|
[self.widgetBorderWidthLabel setText:[LocalizationHelper localizedStringForKey:@"Border width: %.2f", _widgetBorderWidthSlider.value]];
|
||||||
break;
|
break;
|
||||||
@@ -429,15 +459,17 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
[self.widgetBorderWidthSlider setMinimumValue:0];
|
[self.widgetBorderWidthSlider setMinimumValue:0];
|
||||||
[self.widgetBorderWidthSlider setMaximumValue:2];
|
[self.widgetBorderWidthSlider setMaximumValue:2];
|
||||||
[self.widgetBorderWidthSlider setValue:selectedWidgetView.highlightSizeFactor animated:NO];
|
[self.widgetBorderWidthSlider setValue:selectedWidgetView.highlightSizeFactor animated:NO];
|
||||||
selectedWidgetView.buttonDownVisualEffectLayer.hidden = selectedWidgetView.widgetType != WidgetTypeEnumButton;
|
/*
|
||||||
selectedWidgetView.l3r3Indicator.hidden = !selectedWidgetView.hasL3R3Indicator;
|
selectedWidgetView.buttonDownVisualEffectLayer.hidden = selectedWidgetView.widgetType != WidgetTypeEnumButton && !OnScreenWidgetView.isTweakingHighlight;
|
||||||
|
selectedWidgetView.l3r3Indicator.hidden = !selectedWidgetView.hasL3R3Indicator && !OnScreenWidgetView.isTweakingHighlight;
|
||||||
|
|
||||||
(selectedWidgetView.lrudIndicatorBall.hidden
|
(selectedWidgetView.lrudIndicatorBall.hidden
|
||||||
= selectedWidgetView.upIndicator.hidden
|
= selectedWidgetView.upIndicator.hidden
|
||||||
= selectedWidgetView.downIndicator.hidden
|
= selectedWidgetView.downIndicator.hidden
|
||||||
= selectedWidgetView.leftIndicator.hidden
|
= selectedWidgetView.leftIndicator.hidden
|
||||||
= selectedWidgetView.rightIndicator.hidden
|
= selectedWidgetView.rightIndicator.hidden
|
||||||
= !selectedWidgetView.isDirectionPad);
|
= !selectedWidgetView.isDirectionPad
|
||||||
|
&& !OnScreenWidgetView.isTweakingHighlight); */
|
||||||
|
|
||||||
[self.widgetBorderWidthLabel setText:[LocalizationHelper localizedStringForKey:@"Highlight size: %.2f", _widgetBorderWidthSlider.value]];
|
[self.widgetBorderWidthLabel setText:[LocalizationHelper localizedStringForKey:@"Highlight size: %.2f", _widgetBorderWidthSlider.value]];
|
||||||
break;
|
break;
|
||||||
@@ -773,6 +805,7 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
[newWidget adjustTransparencyWithAlpha:widget.backgroundAlpha tweakBorderAlpha:NO];
|
[newWidget adjustTransparencyWithAlpha:widget.backgroundAlpha tweakBorderAlpha:NO];
|
||||||
[newWidget tweakLabelAlphaWithAlpha:widget.labelAlpha];
|
[newWidget tweakLabelAlphaWithAlpha:widget.labelAlpha];
|
||||||
[newWidget tweakBorderAlphaWithAlpha:widget.borderAlpha];
|
[newWidget tweakBorderAlphaWithAlpha:widget.borderAlpha];
|
||||||
|
[newWidget tweakHighlightAlphaWithAlpha:widget.highlightAlpha];
|
||||||
[newWidget adjustBorderWithWidth:widget.borderWidth];
|
[newWidget adjustBorderWithWidth:widget.borderWidth];
|
||||||
[self.onScreenWidgetViews addObject:newWidget];
|
[self.onScreenWidgetViews addObject:newWidget];
|
||||||
self->selectedWidgetView = newWidget;
|
self->selectedWidgetView = newWidget;
|
||||||
@@ -996,10 +1029,8 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
[self loadWidgetAlphas];
|
[self loadWidgetAlphas];
|
||||||
[self autoFitLabel:self.widgetAlphaLabel];
|
[self autoFitLabel:self.widgetAlphaLabel];
|
||||||
|
|
||||||
// [self.widgetBorderWidthSlider setValue:self->selectedWidgetView.borderWidth];
|
|
||||||
[self loadWidgetWidths];
|
[self loadWidgetWidths];
|
||||||
[self autoFitLabel:self.widgetBorderWidthLabel];
|
[self autoFitLabel:self.widgetBorderWidthLabel];
|
||||||
// [self widgetBorderWidthSliderMoved:self.widgetBorderWidthSlider];
|
|
||||||
|
|
||||||
self.autoTapStack.hidden = !selectedWidgetView.hasAutoTap;
|
self.autoTapStack.hidden = !selectedWidgetView.hasAutoTap;
|
||||||
// [self.autoTapSlider setValue:self->selectedWidgetView.autoTapInterval];
|
// [self.autoTapSlider setValue:self->selectedWidgetView.autoTapInterval];
|
||||||
@@ -1117,6 +1148,9 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
|
|
||||||
|
|
||||||
- (void)widgetAlphaSliderMoved:(UISlider* )sender{
|
- (void)widgetAlphaSliderMoved:(UISlider* )sender{
|
||||||
|
[CATransaction begin];
|
||||||
|
[CATransaction setDisableActions:YES];
|
||||||
|
|
||||||
if(self->selectedWidgetView != nil && self->widgetViewSelected){
|
if(self->selectedWidgetView != nil && self->widgetViewSelected){
|
||||||
switch(alphaSliderMode){
|
switch(alphaSliderMode){
|
||||||
case widgetAlpha:
|
case widgetAlpha:
|
||||||
@@ -1128,6 +1162,9 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
case borderAlpha:
|
case borderAlpha:
|
||||||
[self->selectedWidgetView tweakBorderAlphaWithAlpha:sender.value];
|
[self->selectedWidgetView tweakBorderAlphaWithAlpha:sender.value];
|
||||||
break;
|
break;
|
||||||
|
case highlightAlpha:
|
||||||
|
[self->selectedWidgetView tweakHighlightAlphaWithAlpha:sender.value];
|
||||||
|
break;
|
||||||
case AlphaSliderModeCount:
|
case AlphaSliderModeCount:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -1138,6 +1175,8 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) {
|
|||||||
if(self->selectedControllerLayer != nil && self->controllerLayerSelected){
|
if(self->selectedControllerLayer != nil && self->controllerLayerSelected){
|
||||||
[self.layoutOSC adjustControllerLayerOpacityWith:self->selectedControllerLayer and:sender.value];
|
[self.layoutOSC adjustControllerLayerOpacityWith:self->selectedControllerLayer and:sender.value];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CATransaction commit];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)widgetBorderWidthSliderMoved:(UISlider* )sender{
|
- (void)widgetBorderWidthSliderMoved:(UISlider* )sender{
|
||||||
|
|||||||
Reference in new issue
Block a user