sensitivity & stick indicator settings in touchPad profile config
This commit is contained in:
1 parent
18fe545533
commit
b7d8889180
8 files changed
+134
-23
No files matched your search
@@ -870,24 +870,30 @@ ICAgICAgICAgICAgIA
|
|||||||
<action selector="closeTapped:" destination="ZYS-Zm-PJs" eventType="touchUpInside" id="U8V-Ry-ym9"/>
|
<action selector="closeTapped:" destination="ZYS-Zm-PJs" eventType="touchUpInside" id="U8V-Ry-ym9"/>
|
||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.59999999999999998" maxValue="3.8999999999999999" id="DGw-22-vUn" userLabel="Button Size Slider">
|
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.59999999999999998" maxValue="3.8999999999999999" id="DGw-22-vUn" userLabel="Slider">
|
||||||
<rect key="frame" x="39" y="82" width="337" height="31"/>
|
<rect key="frame" x="39" y="82" width="337" height="31"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<color key="backgroundColor" systemColor="secondaryLabelColor"/>
|
<color key="backgroundColor" systemColor="secondaryLabelColor"/>
|
||||||
<color key="tintColor" red="0.6716768742" green="0.61711704730000005" blue="0.99902987480000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="tintColor" red="0.6716768742" green="0.61711704730000005" blue="0.99902987480000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</slider>
|
</slider>
|
||||||
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.59999999999999998" maxValue="3.8999999999999999" id="VLi-Mk-ESg" userLabel="Button Size Slider">
|
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.59999999999999998" maxValue="3.8999999999999999" id="VLi-Mk-ESg" userLabel="Slider">
|
||||||
<rect key="frame" x="39" y="117" width="337" height="31"/>
|
<rect key="frame" x="39" y="117" width="337" height="31"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<color key="backgroundColor" systemColor="secondaryLabelColor"/>
|
<color key="backgroundColor" systemColor="secondaryLabelColor"/>
|
||||||
<color key="tintColor" red="0.6716768742" green="0.61711704730000005" blue="0.99902987480000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="tintColor" red="0.6716768742" green="0.61711704730000005" blue="0.99902987480000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</slider>
|
</slider>
|
||||||
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.83299999999999996" minValue="0.23000000000000001" maxValue="0.999" id="P6S-oW-Ewb" userLabel="Button Size Slider">
|
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.83299999999999996" minValue="0.23000000000000001" maxValue="0.999" id="P6S-oW-Ewb" userLabel="Slider">
|
||||||
<rect key="frame" x="39" y="152" width="337" height="31"/>
|
<rect key="frame" x="39" y="152" width="337" height="31"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
<color key="backgroundColor" systemColor="secondaryLabelColor"/>
|
<color key="backgroundColor" systemColor="secondaryLabelColor"/>
|
||||||
<color key="tintColor" red="0.6716768742" green="0.61711704730000005" blue="0.99902987480000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="tintColor" red="0.6716768742" green="0.61711704730000005" blue="0.99902987480000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</slider>
|
</slider>
|
||||||
|
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.83300000429153442" minValue="0.23000000417232513" maxValue="0.99900001287460327" id="QXI-Ex-JNV" userLabel="Slider">
|
||||||
|
<rect key="frame" x="39" y="187" width="337" height="31"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
|
<color key="backgroundColor" systemColor="secondaryLabelColor"/>
|
||||||
|
<color key="tintColor" red="0.6716768742" green="0.61711704730000005" blue="0.99902987480000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
</slider>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Profile:" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yJC-bq-EOU">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Profile:" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yJC-bq-EOU">
|
||||||
<rect key="frame" x="247" y="82" width="147" height="100"/>
|
<rect key="frame" x="247" y="82" width="147" height="100"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
@@ -896,6 +902,12 @@ ICAgICAgICAgICAgIA
|
|||||||
<color key="textColor" red="0.95132106540000005" green="0.97490358349999995" blue="0.99987185000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="textColor" red="0.95132106540000005" green="0.97490358349999995" blue="0.99987185000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
|
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.83300000429153442" minValue="0.23000000417232513" maxValue="0.99900001287460327" id="OaL-Ph-J4n" userLabel="Slider">
|
||||||
|
<rect key="frame" x="39" y="222" width="337" height="31"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
|
<color key="backgroundColor" systemColor="secondaryLabelColor"/>
|
||||||
|
<color key="tintColor" red="0.6716768742" green="0.61711704730000005" blue="0.99902987480000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
</slider>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
@@ -910,6 +922,8 @@ ICAgICAgICAgICAgIA
|
|||||||
<outlet property="chevronImageView" destination="76O-3K-aa8" id="yGv-fM-Ohf"/>
|
<outlet property="chevronImageView" destination="76O-3K-aa8" id="yGv-fM-Ohf"/>
|
||||||
<outlet property="chevronView" destination="Zll-IP-PFt" id="MGR-C0-h57"/>
|
<outlet property="chevronView" destination="Zll-IP-PFt" id="MGR-C0-h57"/>
|
||||||
<outlet property="currentProfileLabel" destination="yJC-bq-EOU" id="6Sn-El-zPG"/>
|
<outlet property="currentProfileLabel" destination="yJC-bq-EOU" id="6Sn-El-zPG"/>
|
||||||
|
<outlet property="sensitivityFactorSlider" destination="QXI-Ex-JNV" id="cH9-Ir-LIZ"/>
|
||||||
|
<outlet property="stickIndicatorOffsetSlider" destination="OaL-Ph-J4n" id="uF3-7W-mdG"/>
|
||||||
<outlet property="toolbarRootView" destination="Jnu-63-bcf" id="Y17-e2-18R"/>
|
<outlet property="toolbarRootView" destination="Jnu-63-bcf" id="Y17-e2-18R"/>
|
||||||
<outlet property="toolbarStackView" destination="4he-pe-kYB" id="eVm-jM-dcv"/>
|
<outlet property="toolbarStackView" destination="4he-pe-kYB" id="eVm-jM-dcv"/>
|
||||||
<outlet property="toolbarTopConstraintiPhone" destination="wNr-7F-S0i" id="iXe-d3-R7i"/>
|
<outlet property="toolbarTopConstraintiPhone" destination="wNr-7F-S0i" id="iXe-d3-R7i"/>
|
||||||
@@ -997,13 +1011,13 @@ ICAgICAgICAgICAgIA
|
|||||||
<image name="SquaresArrowUp" width="40" height="40"/>
|
<image name="SquaresArrowUp" width="40" height="40"/>
|
||||||
<image name="Trash" width="40" height="40"/>
|
<image name="Trash" width="40" height="40"/>
|
||||||
<systemColor name="secondaryLabelColor">
|
<systemColor name="secondaryLabelColor">
|
||||||
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
|
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</systemColor>
|
</systemColor>
|
||||||
<systemColor name="systemBackgroundColor">
|
<systemColor name="systemBackgroundColor">
|
||||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
</systemColor>
|
</systemColor>
|
||||||
<systemColor name="tintColor">
|
<systemColor name="tintColor">
|
||||||
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</systemColor>
|
</systemColor>
|
||||||
</resources>
|
</resources>
|
||||||
</document>
|
</document>
|
||||||
@@ -290,6 +290,9 @@ static NSMutableDictionary *onScreenButtonViewsDict;
|
|||||||
buttonState.widthFactor = buttonView.widthFactor;
|
buttonState.widthFactor = buttonView.widthFactor;
|
||||||
buttonState.heightFactor = buttonView.heightFactor;
|
buttonState.heightFactor = buttonView.heightFactor;
|
||||||
buttonState.backgroundAlpha = buttonView.backgroundAlpha;
|
buttonState.backgroundAlpha = buttonView.backgroundAlpha;
|
||||||
|
buttonState.sensitivityFactor = buttonView.sensitivityFactor;
|
||||||
|
buttonState.stickIndicatorXOffset = buttonView.stickIndicatorXOffset;
|
||||||
|
|
||||||
NSData *buttonStateEncoded = [NSKeyedArchiver archivedDataWithRootObject:buttonState requiringSecureCoding:YES error:nil];
|
NSData *buttonStateEncoded = [NSKeyedArchiver archivedDataWithRootObject:buttonState requiringSecureCoding:YES error:nil];
|
||||||
[buttonStatesEncoded addObject: buttonStateEncoded];
|
[buttonStatesEncoded addObject: buttonStateEncoded];
|
||||||
}];
|
}];
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic, assign) NSTimeInterval timestamp;
|
@property (nonatomic, assign) NSTimeInterval timestamp;
|
||||||
@property (nonatomic, assign) CGFloat widthFactor; // for OnScreenButtonView
|
@property (nonatomic, assign) CGFloat widthFactor; // for OnScreenButtonView
|
||||||
@property (nonatomic, assign) CGFloat heightFactor; // for OnScreenButtonView
|
@property (nonatomic, assign) CGFloat heightFactor; // for OnScreenButtonView
|
||||||
@property (nonatomic, assign) CGFloat velocityFactor; // for OnScreenButtonView
|
@property (nonatomic, assign) CGFloat sensitivityFactor; // for OnScreenButtonView
|
||||||
|
@property (nonatomic, assign) CGFloat stickIndicatorXOffset; // for OnScreenButtonView
|
||||||
|
|
||||||
@property (nonatomic, assign) CGFloat oscLayerSizeFactor; // for OnScreenController CALayer
|
@property (nonatomic, assign) CGFloat oscLayerSizeFactor; // for OnScreenController CALayer
|
||||||
@property (nonatomic, assign) CGFloat backgroundAlpha; // for OnScreenController CALayer
|
@property (nonatomic, assign) CGFloat backgroundAlpha; // for OnScreenController CALayer
|
||||||
|
|||||||
@@ -35,7 +35,8 @@
|
|||||||
[encoder encodeBool:self.isHidden forKey:@"isHidden"];
|
[encoder encodeBool:self.isHidden forKey:@"isHidden"];
|
||||||
[encoder encodeFloat:self.widthFactor forKey:@"widthFactor"];
|
[encoder encodeFloat:self.widthFactor forKey:@"widthFactor"];
|
||||||
[encoder encodeFloat:self.heightFactor forKey:@"heightFactor"];
|
[encoder encodeFloat:self.heightFactor forKey:@"heightFactor"];
|
||||||
[encoder encodeFloat:self.velocityFactor forKey:@"velocityFactor"];
|
[encoder encodeFloat:self.sensitivityFactor forKey:@"velocityFactor"];
|
||||||
|
[encoder encodeFloat:self.stickIndicatorXOffset forKey:@"stickIndicatorOffset"];
|
||||||
[encoder encodeFloat:self.oscLayerSizeFactor forKey:@"oscLayerSizeFactor"];
|
[encoder encodeFloat:self.oscLayerSizeFactor forKey:@"oscLayerSizeFactor"];
|
||||||
[encoder encodeFloat:self.backgroundAlpha forKey:@"backgroundAlpha"];
|
[encoder encodeFloat:self.backgroundAlpha forKey:@"backgroundAlpha"];
|
||||||
}
|
}
|
||||||
@@ -50,7 +51,8 @@
|
|||||||
self.isHidden = [decoder decodeBoolForKey:@"isHidden"];
|
self.isHidden = [decoder decodeBoolForKey:@"isHidden"];
|
||||||
self.widthFactor = [decoder decodeFloatForKey:@"widthFactor"];
|
self.widthFactor = [decoder decodeFloatForKey:@"widthFactor"];
|
||||||
self.heightFactor = [decoder decodeFloatForKey:@"heightFactor"];
|
self.heightFactor = [decoder decodeFloatForKey:@"heightFactor"];
|
||||||
self.velocityFactor = [decoder decodeFloatForKey:@"velocityFactor"];
|
self.sensitivityFactor = [decoder decodeFloatForKey:@"velocityFactor"];
|
||||||
|
self.stickIndicatorXOffset = [decoder decodeFloatForKey:@"stickIndicatorOffset"];
|
||||||
self.oscLayerSizeFactor = [decoder decodeFloatForKey:@"oscLayerSizeFactor"];
|
self.oscLayerSizeFactor = [decoder decodeFloatForKey:@"oscLayerSizeFactor"];
|
||||||
self.backgroundAlpha = [decoder decodeFloatForKey:@"backgroundAlpha"];
|
self.backgroundAlpha = [decoder decodeFloatForKey:@"backgroundAlpha"];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,8 @@ import UIKit
|
|||||||
self.mousePointerMoved = false
|
self.mousePointerMoved = false
|
||||||
self.touchLockedForMoveEvent = UITouch()
|
self.touchLockedForMoveEvent = UITouch()
|
||||||
self.twoTouchesDetected = false
|
self.twoTouchesDetected = false
|
||||||
|
self.stickIndicatorXOffset = 120
|
||||||
|
self.sensitivityFactor = 1.0
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
|
|
||||||
upIndicator = createLrudDirectionLayer()
|
upIndicator = createLrudDirectionLayer()
|
||||||
@@ -305,7 +307,7 @@ import UIKit
|
|||||||
// create stick indicator: the crossMark & stickBall:
|
// create stick indicator: the crossMark & stickBall:
|
||||||
@objc public func showStickIndicator(){
|
@objc public func showStickIndicator(){
|
||||||
// tell if the self button is located on the left or right
|
// tell if the self button is located on the left or right
|
||||||
self.selfViewOnTheRight = (self.storedLocation.x + self.frame.width/2 > self.appWindow.frame.width*0.5)
|
self.selfViewOnTheRight = (self.storedLocation.x > self.appWindow.frame.width*0.5)
|
||||||
let offsetSign = selfViewOnTheRight ? -1 : 1
|
let offsetSign = selfViewOnTheRight ? -1 : 1
|
||||||
let stickMarkerRelativeLocation:CGPoint
|
let stickMarkerRelativeLocation:CGPoint
|
||||||
if !OnScreenButtonView.editMode {
|
if !OnScreenButtonView.editMode {
|
||||||
@@ -356,7 +358,7 @@ import UIKit
|
|||||||
let stickBallLayer = CAShapeLayer()
|
let stickBallLayer = CAShapeLayer()
|
||||||
stickBallLayer.path = path.cgPath // Assign the circular path to the shape layer
|
stickBallLayer.path = path.cgPath // Assign the circular path to the shape layer
|
||||||
self.layer.superlayer?.addSublayer(stickBallLayer)
|
self.layer.superlayer?.addSublayer(stickBallLayer)
|
||||||
stickBallLayer.position = CGPointMake(CGRectGetMidX(self.crossMarkLayer.frame), CGRectGetMinY(self.crossMarkLayer.frame))
|
stickBallLayer.position = CGPointMake(CGRectGetMidX(self.crossMarkLayer.frame), CGRectGetMidY(self.crossMarkLayer.frame))
|
||||||
|
|
||||||
// stickBallLayer.position = CG
|
// stickBallLayer.position = CG
|
||||||
|
|
||||||
@@ -373,18 +375,18 @@ import UIKit
|
|||||||
return stickBallLayer
|
return stickBallLayer
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc public func updateStickBallPosition(){
|
@objc public func updateStickIndicator(){
|
||||||
CATransaction.begin()
|
CATransaction.begin()
|
||||||
CATransaction.setDisableActions(true)
|
CATransaction.setDisableActions(true)
|
||||||
self.stickBallLayer.removeAllAnimations()
|
self.stickBallLayer.removeAllAnimations()
|
||||||
if !OnScreenButtonView.editMode {
|
if !OnScreenButtonView.editMode {
|
||||||
self.stickBallLayer.position = CGPointMake(CGRectGetMidX(self.crossMarkLayer.frame) + touchInputToStickBallCoord(input: offSetX), CGRectGetMinY(self.crossMarkLayer.frame) + touchInputToStickBallCoord(input: offSetY))
|
self.stickBallLayer.position = CGPointMake(CGRectGetMidX(self.crossMarkLayer.frame) + touchInputToStickBallCoord(input: offSetX*sensitivityFactor), CGRectGetMidY(self.crossMarkLayer.frame) + touchInputToStickBallCoord(input: offSetY*sensitivityFactor))
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// illustrate offset distance in edit mode
|
// illustrate offset distance in edit mode
|
||||||
let offsetSign = self.selfViewOnTheRight ? -1 : 1
|
let offsetSign = self.selfViewOnTheRight ? -1 : 1
|
||||||
let illlustrationPoint = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMaxY(self.frame)/4)
|
// let illlustrationPoint = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMaxY(self.frame)/4)
|
||||||
self.stickBallLayer.position = CGPointMake(CGRectGetMidX(self.crossMarkLayer.frame) + CGFloat(offsetSign) * stickIndicatorXOffset, CGRectGetMinY(self.crossMarkLayer.frame))
|
self.crossMarkLayer.position = CGPointMake(CGRectGetMidX(self.stickBallLayer.frame) + CGFloat(offsetSign) * stickIndicatorXOffset, CGRectGetMidY(self.stickBallLayer.frame))
|
||||||
}
|
}
|
||||||
CATransaction.commit()
|
CATransaction.commit()
|
||||||
}
|
}
|
||||||
@@ -816,10 +818,10 @@ import UIKit
|
|||||||
break
|
break
|
||||||
case "LSPAD":
|
case "LSPAD":
|
||||||
self.sendLeftStickTouchPadEvent(inputX: offSetX * sensitivityFactor, inputY: offSetY*sensitivityFactor)
|
self.sendLeftStickTouchPadEvent(inputX: offSetX * sensitivityFactor, inputY: offSetY*sensitivityFactor)
|
||||||
updateStickBallPosition()
|
updateStickIndicator()
|
||||||
case "RSPAD":
|
case "RSPAD":
|
||||||
self.sendRightStickTouchPadEvent(inputX: offSetX * sensitivityFactor, inputY: offSetY * sensitivityFactor);
|
self.sendRightStickTouchPadEvent(inputX: offSetX * sensitivityFactor, inputY: offSetY * sensitivityFactor);
|
||||||
updateStickBallPosition()
|
updateStickIndicator()
|
||||||
case "LSVPAD":
|
case "LSVPAD":
|
||||||
self.sendLeftStickTouchPadEvent(inputX: deltaX*1.5167*sensitivityFactor, inputY: deltaY*1.5167*sensitivityFactor)
|
self.sendLeftStickTouchPadEvent(inputX: deltaX*1.5167*sensitivityFactor, inputY: deltaY*1.5167*sensitivityFactor)
|
||||||
case "RSVPAD":
|
case "RSVPAD":
|
||||||
@@ -942,7 +944,9 @@ import UIKit
|
|||||||
if CommandManager.nonVectorStickPads.contains(self.keyString) {
|
if CommandManager.nonVectorStickPads.contains(self.keyString) {
|
||||||
self.crossMarkLayer.removeFromSuperlayer()
|
self.crossMarkLayer.removeFromSuperlayer()
|
||||||
self.stickBallLayer.removeFromSuperlayer()
|
self.stickBallLayer.removeFromSuperlayer()
|
||||||
self.showStickIndicator()}
|
self.showStickIndicator()
|
||||||
|
self.updateStickIndicator()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -401,6 +401,8 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
buttonView.translatesAutoresizingMaskIntoConstraints = NO; // weird but this is mandatory, or you will find no key views added to the right place
|
buttonView.translatesAutoresizingMaskIntoConstraints = NO; // weird but this is mandatory, or you will find no key views added to the right place
|
||||||
buttonView.widthFactor = buttonState.widthFactor;
|
buttonView.widthFactor = buttonState.widthFactor;
|
||||||
buttonView.heightFactor = buttonState.heightFactor;
|
buttonView.heightFactor = buttonState.heightFactor;
|
||||||
|
buttonView.sensitivityFactor = buttonState.sensitivityFactor;
|
||||||
|
buttonView.stickIndicatorXOffset = buttonState.stickIndicatorXOffset;
|
||||||
// Add the buttonView to the view controller's view
|
// Add the buttonView to the view controller's view
|
||||||
[self->streamFrameTopLayerView addSubview:buttonView]; // add keyboard button to the stream frame view. must add it to the target view before setting location.
|
[self->streamFrameTopLayerView addSubview:buttonView]; // add keyboard button to the stream frame view. must add it to the target view before setting location.
|
||||||
[buttonView setLocationWithXOffset:buttonState.position.x yOffset:buttonState.position.y];
|
[buttonView setLocationWithXOffset:buttonState.position.x yOffset:buttonState.position.y];
|
||||||
|
|||||||
@@ -191,6 +191,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Ball: assumed touch point. Cross: indicator location" : {
|
||||||
|
"extractionState" : "manual",
|
||||||
|
"localizations" : {
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "小球: 假定的触点 十字: 指示器偏离位置"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "灵敏度: %.2f"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-HK" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "小球: 假定的触点 十字: 指示器偏离位置"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Bitrate: %.1f Mbps" : {
|
"Bitrate: %.1f Mbps" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
@@ -962,6 +985,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Indicator Offset: %.2f" : {
|
||||||
|
"extractionState" : "manual",
|
||||||
|
"localizations" : {
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "指示器偏离: %.2f"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "小球: 假定的触点 十字: 指示器偏离位置"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-HK" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "指示器偏离: %.2f"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Key label (optional)" : {
|
"Key label (optional)" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
@@ -2102,6 +2148,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Sensitivity: %.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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Set PC/Game resolution:" : {
|
"Set PC/Game resolution:" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|||||||
+22
-6
@@ -47,6 +47,10 @@
|
|||||||
|
|
||||||
- (void) viewWillDisappear:(BOOL)animated{
|
- (void) viewWillDisappear:(BOOL)animated{
|
||||||
OnScreenButtonView.editMode = false;
|
OnScreenButtonView.editMode = false;
|
||||||
|
for (OnScreenButtonView* buttonView in self.onScreenButtonViewsDict.allValues){
|
||||||
|
[buttonView.stickBallLayer removeFromSuperlayer];
|
||||||
|
[buttonView.crossMarkLayer removeFromSuperlayer];
|
||||||
|
}
|
||||||
[super viewWillDisappear:animated];
|
[super viewWillDisappear:animated];
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"OscLayoutCloseNotification" object:self];
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"OscLayoutCloseNotification" object:self];
|
||||||
}
|
}
|
||||||
@@ -74,6 +78,8 @@
|
|||||||
buttonView.timestamp = buttonState.timestamp; // will be set as key in in the dict.
|
buttonView.timestamp = buttonState.timestamp; // will be set as key in in the dict.
|
||||||
buttonView.widthFactor = buttonState.widthFactor;
|
buttonView.widthFactor = buttonState.widthFactor;
|
||||||
buttonView.heightFactor = buttonState.heightFactor;
|
buttonView.heightFactor = buttonState.heightFactor;
|
||||||
|
buttonView.sensitivityFactor = buttonState.sensitivityFactor;
|
||||||
|
buttonView.stickIndicatorXOffset = buttonState.stickIndicatorXOffset;
|
||||||
// buttonView.backgroundAlpha = buttonState.backgroundAlpha;
|
// buttonView.backgroundAlpha = buttonState.backgroundAlpha;
|
||||||
// Add the buttonView to the view controller's view
|
// Add the buttonView to the view controller's view
|
||||||
[self.view addSubview:buttonView];
|
[self.view addSubview:buttonView];
|
||||||
@@ -143,7 +149,7 @@
|
|||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
selector:@selector(buttonViewSelected:)
|
selector:@selector(buttonViewTapped:)
|
||||||
name:@"OnScreenButtonViewSelected"
|
name:@"OnScreenButtonViewSelected"
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
@@ -380,7 +386,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)buttonViewSelected: (NSNotification *)notification{
|
- (void)buttonViewTapped: (NSNotification *)notification{
|
||||||
// receive the selected buttonView obj passed from the notification
|
// receive the selected buttonView obj passed from the notification
|
||||||
OnScreenButtonView* buttonView = (OnScreenButtonView* )notification.object;
|
OnScreenButtonView* buttonView = (OnScreenButtonView* )notification.object;
|
||||||
self->buttonViewSelected = true;
|
self->buttonViewSelected = true;
|
||||||
@@ -406,7 +412,9 @@
|
|||||||
[selectedButtonView.crossMarkLayer removeFromSuperlayer];
|
[selectedButtonView.crossMarkLayer removeFromSuperlayer];
|
||||||
selectedButtonView.touchBeganLocation = CGPointMake(CGRectGetWidth(selectedButtonView.frame)/2, CGRectGetHeight(selectedButtonView.frame)/4);
|
selectedButtonView.touchBeganLocation = CGPointMake(CGRectGetWidth(selectedButtonView.frame)/2, CGRectGetHeight(selectedButtonView.frame)/4);
|
||||||
[selectedButtonView showStickIndicator];// this will create the indicator CAShapeLayers
|
[selectedButtonView showStickIndicator];// this will create the indicator CAShapeLayers
|
||||||
[stickIndicatorOffsetSliderLabel setText:[LocalizationHelper localizedStringForKey:@"Indicator Offset: %.2f \n", self->selectedButtonView.stickIndicatorXOffset]];
|
[self.stickIndicatorOffsetSlider setValue:self->selectedButtonView.stickIndicatorXOffset];
|
||||||
|
[stickIndicatorOffsetSliderLabel setText:[LocalizationHelper localizedStringForKey:@"Indicator Offset: %.2f", self->selectedButtonView.stickIndicatorXOffset]];
|
||||||
|
[self->selectedButtonView updateStickIndicator];
|
||||||
}
|
}
|
||||||
[widgetSizeSliderLabel setText:[LocalizationHelper localizedStringForKey:@"Widget Size: %.2f", self->selectedButtonView.widthFactor]];
|
[widgetSizeSliderLabel setText:[LocalizationHelper localizedStringForKey:@"Widget Size: %.2f", self->selectedButtonView.widthFactor]];
|
||||||
[widgetHeightSliderLabel setText:[LocalizationHelper localizedStringForKey:@"Widget Height: %.2f", self->selectedButtonView.heightFactor]];
|
[widgetHeightSliderLabel setText:[LocalizationHelper localizedStringForKey:@"Widget Height: %.2f", self->selectedButtonView.heightFactor]];
|
||||||
@@ -417,6 +425,12 @@
|
|||||||
// receive the selected buttonView obj passed from the notification
|
// receive the selected buttonView obj passed from the notification
|
||||||
CALayer* controllerLayer = (CALayer* )notification.object;
|
CALayer* controllerLayer = (CALayer* )notification.object;
|
||||||
self->buttonViewSelected = false;
|
self->buttonViewSelected = false;
|
||||||
|
self->stickIndicatorOffsetExplain.hidden = true;
|
||||||
|
self->stickIndicatorOffsetSliderLabel.hidden = true;
|
||||||
|
self.stickIndicatorOffsetSlider.hidden = true;
|
||||||
|
self->sensitivitySliderLabel.hidden = true;
|
||||||
|
self.sensitivityFactorSlider.hidden = true;
|
||||||
|
|
||||||
self->controllerLayerSelected = true;
|
self->controllerLayerSelected = true;
|
||||||
self->selectedControllerLayer = controllerLayer;
|
self->selectedControllerLayer = controllerLayer;
|
||||||
self->controllerLoadedBounds = controllerLayer.bounds;
|
self->controllerLoadedBounds = controllerLayer.bounds;
|
||||||
@@ -480,7 +494,7 @@
|
|||||||
[stickIndicatorOffsetSliderLabel setText:[LocalizationHelper localizedStringForKey:@"Indicator Offset: %.2f", self.stickIndicatorOffsetSlider.value]];
|
[stickIndicatorOffsetSliderLabel setText:[LocalizationHelper localizedStringForKey:@"Indicator Offset: %.2f", self.stickIndicatorOffsetSlider.value]];
|
||||||
if(self->selectedButtonView != nil && self->buttonViewSelected){
|
if(self->selectedButtonView != nil && self->buttonViewSelected){
|
||||||
self->selectedButtonView.stickIndicatorXOffset = self.stickIndicatorOffsetSlider.value;
|
self->selectedButtonView.stickIndicatorXOffset = self.stickIndicatorOffsetSlider.value;
|
||||||
[self->selectedButtonView updateStickBallPosition];
|
[self->selectedButtonView updateStickIndicator];
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -569,7 +583,7 @@
|
|||||||
widgetAlphaSliderLabel.hidden = NO;
|
widgetAlphaSliderLabel.hidden = NO;
|
||||||
|
|
||||||
|
|
||||||
// sensivity slider
|
// sensitivity slider
|
||||||
self.sensitivityFactorSlider.hidden = YES;
|
self.sensitivityFactorSlider.hidden = YES;
|
||||||
self.sensitivityFactorSlider.frame = CGRectMake(sliderXPosition, self.sensitivityFactorSlider.frame.origin.y, self.sensitivityFactorSlider.frame.size.width, self.sensitivityFactorSlider.frame.size.height);
|
self.sensitivityFactorSlider.frame = CGRectMake(sliderXPosition, self.sensitivityFactorSlider.frame.origin.y, self.sensitivityFactorSlider.frame.size.width, self.sensitivityFactorSlider.frame.size.height);
|
||||||
[self.sensitivityFactorSlider addTarget:self action:@selector(sensitivitySliderMoved) forControlEvents:(UIControlEventValueChanged)];
|
[self.sensitivityFactorSlider addTarget:self action:@selector(sensitivitySliderMoved) forControlEvents:(UIControlEventValueChanged)];
|
||||||
@@ -599,7 +613,7 @@
|
|||||||
stickIndicatorOffsetSliderLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
|
stickIndicatorOffsetSliderLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
|
||||||
stickIndicatorOffsetSliderLabel.translatesAutoresizingMaskIntoConstraints = NO; // Disable autoresizing mask for Auto Layout
|
stickIndicatorOffsetSliderLabel.translatesAutoresizingMaskIntoConstraints = NO; // Disable autoresizing mask for Auto Layout
|
||||||
// tips for stick indicator
|
// tips for stick indicator
|
||||||
stickIndicatorOffsetExplain.text = [LocalizationHelper localizedStringForKey:@"Cross: assumed touch point. Ball: indicator location"];
|
stickIndicatorOffsetExplain.text = [LocalizationHelper localizedStringForKey:@"Ball: assumed touch point. Cross: indicator location"];
|
||||||
//stickIndicatorOffsetExplain.frame = CGRectMake(sliderXPosition, self.stickIndicatorOffsetSlider.frame.origin.y + self.stickIndicatorOffsetSlider.frame.size.height, self.stickIndicatorOffsetSlider.frame.size.width, self.stickIndicatorOffsetSlider.frame.size.height); // label bigger show some tips
|
//stickIndicatorOffsetExplain.frame = CGRectMake(sliderXPosition, self.stickIndicatorOffsetSlider.frame.origin.y + self.stickIndicatorOffsetSlider.frame.size.height, self.stickIndicatorOffsetSlider.frame.size.width, self.stickIndicatorOffsetSlider.frame.size.height); // label bigger show some tips
|
||||||
stickIndicatorOffsetExplain.font = [UIFont systemFontOfSize:18];
|
stickIndicatorOffsetExplain.font = [UIFont systemFontOfSize:18];
|
||||||
stickIndicatorOffsetExplain.textColor = [UIColor whiteColor];
|
stickIndicatorOffsetExplain.textColor = [UIColor whiteColor];
|
||||||
@@ -750,6 +764,8 @@
|
|||||||
if([self touchWithinTashcanButton:touch]){
|
if([self touchWithinTashcanButton:touch]){
|
||||||
[self.onScreenButtonViewsDict[@(OnScreenButtonView.timestampOfButtonBeingDragged)] removeFromSuperview];
|
[self.onScreenButtonViewsDict[@(OnScreenButtonView.timestampOfButtonBeingDragged)] removeFromSuperview];
|
||||||
[self.onScreenButtonViewsDict removeObjectForKey:@(OnScreenButtonView.timestampOfButtonBeingDragged)];
|
[self.onScreenButtonViewsDict removeObjectForKey:@(OnScreenButtonView.timestampOfButtonBeingDragged)];
|
||||||
|
[selectedButtonView.stickBallLayer removeFromSuperlayer];
|
||||||
|
[selectedButtonView.crossMarkLayer removeFromSuperlayer];
|
||||||
OnScreenButtonView.timestampOfButtonBeingDragged = 0; //reset thie timestamp
|
OnScreenButtonView.timestampOfButtonBeingDragged = 0; //reset thie timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user