feat: setup autotap timer by text input instead of slider.

This commit is contained in:
TrueZhuanjia
2025-10-18 19:14:21 +08:00
parent 10ceac2ce3
commit cd415cc639
8 changed files with 223 additions and 85 deletions
+40 -39
View File
@@ -1360,16 +1360,16 @@
</constraints>
</stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Oyk-L5-WTt" userLabel="singleTapSensitivityStack">
<rect key="frame" x="440" y="307" width="524" height="55.5"/>
<rect key="frame" x="440" y="307" width="532" height="55.5"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Single Tap Sensitivity" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SuN-S2-8hj">
<rect key="frame" x="0.0" y="0.0" width="524" height="20.5"/>
<rect key="frame" x="0.0" y="0.0" width="532" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<slider verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="2" minValue="0.0" maxValue="5" minimumValueImage="0.square" catalog="system" maximumValueImage="5.square" translatesAutoresizingMaskIntoConstraints="NO" id="j4n-De-TRX" userLabel="Single Tap Sensitivity Slider">
<rect key="frame" x="-2" y="25.5" width="528" height="31"/>
<rect key="frame" x="-2" y="25.5" width="536" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="qOF-42-hPO"/>
</constraints>
@@ -1847,7 +1847,7 @@
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="z5Q-bW-WQ8" userLabel="widgetPanelStack" customClass="WidgetPanelStackView">
<rect key="frame" x="325" y="156" width="650" height="619"/>
<rect key="frame" x="325" y="156" width="650" height="623"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Profile:" textAlignment="center" lineBreakMode="tailTruncation" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iel-xl-xd9">
<rect key="frame" x="0.0" y="0.0" width="650" height="37"/>
@@ -1883,8 +1883,28 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e4b-0v-36Z" userLabel="autoTapStack">
<rect key="frame" x="0.0" y="202" width="650" height="34"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Auto tap" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="And-W9-9NR" userLabel="autoTapLabel">
<rect key="frame" x="0.0" y="0.0" width="105" height="34"/>
<constraints>
<constraint firstAttribute="width" constant="105" id="GyN-qS-EHz"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" alpha="0.77000000000000002" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="yLM-jp-jMl">
<rect key="frame" x="105" y="0.0" width="545" height="34"/>
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GOp-1e-oUF" userLabel="widgetSizeStack">
<rect key="frame" x="0.0" y="202" width="650" height="30"/>
<rect key="frame" x="0.0" y="241" width="650" height="30"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Size" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZuV-4A-0Zb" userLabel="widgetSizeLabel">
<rect key="frame" x="0.0" y="0.0" width="105" height="30"/>
@@ -1903,7 +1923,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Zz-kb-7Ej" userLabel="widgetHeightStack">
<rect key="frame" x="0.0" y="237" width="650" height="30"/>
<rect key="frame" x="0.0" y="276" width="650" height="30"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Height" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sbd-0j-KWS" userLabel="widgetHeightLabel">
<rect key="frame" x="0.0" y="0.0" width="105" height="30"/>
@@ -1922,7 +1942,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="9ZS-28-txW" userLabel="borderWidthAlphaStack">
<rect key="frame" x="0.0" y="272" width="650" height="30"/>
<rect key="frame" x="0.0" y="311" width="650" height="30"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Alpha" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Pwa-YK-6Q2" userLabel="widgetAlphaLabel">
<rect key="frame" x="0.0" y="0.0" width="101" height="30"/>
@@ -1957,27 +1977,8 @@
</slider>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e4b-0v-36Z" userLabel="autoTapStack">
<rect key="frame" x="0.0" y="307" width="650" height="30"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Auto tap: 100ms" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="And-W9-9NR" userLabel="autoTapLabel">
<rect key="frame" x="0.0" y="0.0" width="145" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="145" id="GyN-qS-EHz"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<slider verifyAmbiguity="off" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="200" minValue="0.0" maxValue="1000" translatesAutoresizingMaskIntoConstraints="NO" id="ksz-Dq-bUf" userLabel="autoTapSlider">
<rect key="frame" x="143" y="0.0" width="509" height="31"/>
<color key="tintColor" red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<color key="maximumTrackTintColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</slider>
</subviews>
</stackView>
<stackView contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="zfD-bd-GEN" userLabel="stickIndicatorOffsetStack">
<rect key="frame" x="0.0" y="342" width="650" height="30"/>
<rect key="frame" x="0.0" y="346" width="650" height="30"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Stick Indicator" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tG7-oX-P9b" userLabel="stickIndicatorOffsetLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -1996,7 +1997,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="80D-qe-E5D" userLabel="sensitivityFactorXStack">
<rect key="frame" x="0.0" y="377" width="650" height="30"/>
<rect key="frame" x="0.0" y="381" width="650" height="30"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SensitivityX" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vJs-pg-hHe" userLabel="sensitivityFactorLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -2015,7 +2016,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CT5-Ap-Gh0" userLabel="sensitivityFactorYStack">
<rect key="frame" x="0.0" y="412" width="650" height="30"/>
<rect key="frame" x="0.0" y="416" width="650" height="30"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SensitivityY" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NZO-BM-nef" userLabel="sensitivityFactorYLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -2034,7 +2035,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2KY-v5-YJv" userLabel="yawFactorStack">
<rect key="frame" x="0.0" y="447" width="650" height="30"/>
<rect key="frame" x="0.0" y="451" width="650" height="30"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Yaw factor" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iZc-Xt-NaK" userLabel="yawFactorLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -2053,7 +2054,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JNt-eT-HCs" userLabel="pitchFactorStack">
<rect key="frame" x="0.0" y="482" width="650" height="30"/>
<rect key="frame" x="0.0" y="486" width="650" height="30"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Pitch factor" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fq3-ie-8by" userLabel="pitchFactorLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -2072,7 +2073,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KXB-uJ-onx" userLabel="decelerationRateStack">
<rect key="frame" x="0.0" y="517" width="650" height="30"/>
<rect key="frame" x="0.0" y="521" width="650" height="30"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="DecelerationRate" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Pbt-Tw-dnV" userLabel="decelerationRateLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -2091,7 +2092,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GMQ-EQ-Hum" userLabel="mouseDownButtonStack">
<rect key="frame" x="0.0" y="552" width="650" height="31"/>
<rect key="frame" x="0.0" y="556" width="650" height="31"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Down button" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c1r-Hf-b7t" userLabel="mouseDownButtonLabel">
<rect key="frame" x="0.0" y="0.0" width="130" height="31"/>
@@ -2118,7 +2119,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LGW-oJ-5Zf" userLabel="triggerModeStack">
<rect key="frame" x="0.0" y="588" width="650" height="31"/>
<rect key="frame" x="0.0" y="592" width="650" height="31"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Button mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qNQ-fB-jhY" userLabel="uiLabel">
<rect key="frame" x="0.0" y="0.0" width="130" height="31"/>
@@ -2172,8 +2173,8 @@
<size key="freeformSize" width="1300" height="1194"/>
<connections>
<outlet property="addButton" destination="fKN-ja-TRi" id="R2n-QF-aSj"/>
<outlet property="autoTapField" destination="yLM-jp-jMl" id="t0v-tj-IZ3"/>
<outlet property="autoTapLabel" destination="And-W9-9NR" id="r5A-4a-XZP"/>
<outlet property="autoTapSlider" destination="ksz-Dq-bUf" id="nbG-ye-X7e"/>
<outlet property="autoTapStack" destination="e4b-0v-36Z" id="PZd-KE-lPb"/>
<outlet property="borderWidthAlphaStack" destination="9ZS-28-txW" id="qxV-2E-g8m"/>
<outlet property="buttonModeSelector" destination="cKS-fy-Zpg" id="uIq-60-t7E"/>
@@ -2323,7 +2324,7 @@
<image name="tray.full.fill" catalog="system" width="128" height="88"/>
<image name="video.and.waveform" catalog="system" width="128" height="94"/>
<systemColor name="linkColor">
<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 name="secondarySystemGroupedBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -2332,13 +2333,13 @@
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemBrownColor">
<color red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.63529411764705879" green="0.51764705882352946" blue="0.36862745098039218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemGray3Color">
<color red="0.78039215689999997" green="0.78039215689999997" blue="0.80000000000000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.7803921568627451" green="0.7803921568627451" blue="0.80000000000000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemTealColor">
<color red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.18823529411764706" green="0.69019607843137254" blue="0.7803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
+35 -34
View File
@@ -351,8 +351,31 @@
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xoH-wS-SS1" userLabel="widgetSizeStack">
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tDJ-cy-BYU" userLabel="autoTapStack">
<rect key="frame" x="0.0" y="307" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Autotap" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IuG-44-1Je" userLabel="autoTapLabel">
<rect key="frame" x="0.0" y="0.0" width="90" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="90" id="zBL-cf-cIx"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" alpha="0.76999998092651367" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="DOu-sG-eRq">
<rect key="frame" x="90" y="0.0" width="460" height="20"/>
<color key="backgroundColor" white="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="20" id="hW1-mw-apj"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xoH-wS-SS1" userLabel="widgetSizeStack">
<rect key="frame" x="0.0" y="334" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Size" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kva-gQ-CZh" userLabel="widgetSizeLabel">
<rect key="frame" x="0.0" y="0.0" width="105" height="20"/>
@@ -374,7 +397,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4Vo-Zh-48b" userLabel="widgetHeightStack">
<rect key="frame" x="0.0" y="334" width="550" height="20"/>
<rect key="frame" x="0.0" y="361" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Height" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Idx-O1-5dn" userLabel="widgetHeightLabel">
<rect key="frame" x="0.0" y="0.0" width="105" height="20"/>
@@ -396,7 +419,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="50p-sC-ObU" userLabel="borderWidthAlphaStack">
<rect key="frame" x="0.0" y="361" width="550" height="20"/>
<rect key="frame" x="0.0" y="388" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Alpha" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qPQ-U2-aSg" userLabel="widgetAlphaLabel">
<rect key="frame" x="0.0" y="0.0" width="101" height="20"/>
@@ -434,28 +457,6 @@
<constraint firstAttribute="height" constant="20" id="kge-ua-7K0"/>
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tDJ-cy-BYU" userLabel="autoTapStack">
<rect key="frame" x="0.0" y="388" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Autotap: 100ms" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IuG-44-1Je" userLabel="autoTapLabel">
<rect key="frame" x="0.0" y="0.0" width="135" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="135" id="zBL-cf-cIx"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<slider clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="200" minValue="0.0" maxValue="1000" translatesAutoresizingMaskIntoConstraints="NO" id="tsE-QI-xLw" userLabel="autoTapSlider">
<rect key="frame" x="133" y="0.0" width="419" height="21"/>
<color key="tintColor" red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<color key="maximumTrackTintColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</slider>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="20" id="hW1-mw-apj"/>
</constraints>
</stackView>
<stackView contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Ejp-Jq-phL" userLabel="stickIndicatorOffsetStack">
<rect key="frame" x="0.0" y="415" width="550" height="20"/>
<subviews>
@@ -704,8 +705,8 @@
</view>
<size key="freeformSize" width="1300" height="896"/>
<connections>
<outlet property="autoTapField" destination="DOu-sG-eRq" id="Ubj-og-ThW"/>
<outlet property="autoTapLabel" destination="IuG-44-1Je" id="YWb-0d-zbB"/>
<outlet property="autoTapSlider" destination="tsE-QI-xLw" id="WlR-z2-iXM"/>
<outlet property="autoTapStack" destination="tDJ-cy-BYU" id="moT-DJ-jwF"/>
<outlet property="borderWidthAlphaStack" destination="50p-sC-ObU" id="2Xq-p7-31z"/>
<outlet property="buttonModeSelector" destination="ojp-aS-m8w" id="ACc-Sd-Edq"/>
@@ -757,7 +758,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ORo-HP-JDj" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="158" y="1246"/>
<point key="canvasLocation" x="157.97101449275362" y="1245.5357142857142"/>
</scene>
<!--Profiles Table View Controller-->
<scene sceneID="C7c-yg-gQK">
@@ -1754,16 +1755,16 @@
</constraints>
</stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="N0i-z6-WgC" userLabel="singleTapSensitivityStack">
<rect key="frame" x="410" y="2455" width="520" height="55.5"/>
<rect key="frame" x="410" y="2455" width="524" height="55.5"/>
<subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Single Tap Sensitivity" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WzD-wo-Wum">
<rect key="frame" x="0.0" y="0.0" width="520" height="20.5"/>
<rect key="frame" x="0.0" y="0.0" width="524" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<slider verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="2" minValue="0.0" maxValue="5" minimumValueImage="0.square" catalog="system" maximumValueImage="5.square" translatesAutoresizingMaskIntoConstraints="NO" id="uCa-Oa-7mv" userLabel="Single Tap Sensitivity Slider">
<rect key="frame" x="-2" y="25.5" width="524" height="31"/>
<rect key="frame" x="-2" y="25.5" width="528" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="XXP-GP-uhn"/>
</constraints>
@@ -2357,19 +2358,19 @@
<image name="trash.fill" catalog="system" width="117" height="128"/>
<image name="tray.full.fill" catalog="system" width="128" height="88"/>
<systemColor name="linkColor">
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="secondarySystemGroupedBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemBrownColor">
<color red="0.63529411764705879" green="0.51764705882352946" blue="0.36862745098039218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemGray2Color">
<color red="0.68235294117647061" green="0.68235294117647061" blue="0.69803921568627447" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.68235294120000001" green="0.68235294120000001" blue="0.69803921570000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemTealColor">
<color red="0.18823529411764706" green="0.69019607843137254" blue="0.7803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
+71
View File
@@ -1975,6 +1975,77 @@ import UIKit
if self.buttonMode != ButtonMode.tapToToggle.rawValue {self.handleFingerUpOrSlideout()}
}
@objc public func setAutoTapIntervalByText(str: String){
self.autoTapInterval = self.parseTimeToMilliseconds(str)
}
private func parseTimeToMilliseconds(_ input: String) -> Int {
// 最大值:24小时对应的毫秒数
let maxMilliseconds = 24 * 60 * 60 * 1000
// 去除前后空白
let trimmed = input.trimmingCharacters(in: .whitespacesAndNewlines)
let pattern = #"^(\d+)(ms|s|m)?$"#
guard let regex = try? NSRegularExpression(pattern: pattern),
let match = regex.firstMatch(in: trimmed, range: NSRange(trimmed.startIndex..., in: trimmed)) else {
return 0
}
let valueRange = Range(match.range(at: 1), in: trimmed)!
let valueString = String(trimmed[valueRange])
guard let value = Int(valueString) else { return 0 }
var unit = "ms"
if let unitRange = Range(match.range(at: 2), in: trimmed) {
unit = String(trimmed[unitRange])
}
var milliseconds: Int
switch unit {
case "ms":
milliseconds = value
case "s":
milliseconds = value * 1000
case "m":
milliseconds = value * 60 * 1000
default:
return 0
}
// 小于 50 ms 的情况返回 0
if milliseconds < 50 {
return 0
}
// 限制最大值
if milliseconds > maxMilliseconds {
milliseconds = maxMilliseconds
}
return milliseconds
}
@objc public func getAutoTapIntervalStr() -> String {
// 边界限制:小于50ms的当作0,超过24小时的限制为24小时
let maxMilliseconds = 24 * 60 * 60 * 1000
if autoTapInterval < 50 {
return ""
}
let ms = min(autoTapInterval, maxMilliseconds)
if ms % (60 * 1000) == 0 {
// 整分钟
return "\(ms / (60 * 1000))m"
} else if ms % 1000 == 0 {
// 整秒
return "\(ms / 1000)s"
} else {
// 毫秒
return "\(ms)ms"
}
}
override func didMoveToSuperview() {
super.didMoveToSuperview()
if superview == nil {
@@ -858,6 +858,29 @@
}
}
},
"Autotap timer " : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "连点定时器 "
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "連點定時器 "
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "連點定時器 "
}
}
}
},
"Back" : {
"extractionState" : "manual",
"localizations" : {
@@ -3076,6 +3099,29 @@
}
}
},
"Minimum: 50ms. 0 to disable. ms(milliSec),s(sec),m(min). ⏎ to save" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "最低: 50ms, 输入0关闭. 单位: ms毫秒, s秒, m分钟. 按 ⏎ 保存设定值."
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "最低: 50 ms, 輸入 0 關閉. 單位:ms 秒, s秒, m分鐘. 按 ⏎ 儲存設定值."
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "最低: 50 ms, 輸入 0 關閉. 單位:ms 秒, s秒, m分鐘. 按 ⏎ 儲存設定值."
}
}
}
},
"ML_TEST_RESULT_INCONCLUSIVE" : {
"extractionState" : "manual",
"localizations" : {
@@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
This view controller provides the user interface which allows the user to position on screen controller buttons anywhere they'd like on the screen. It also provides the user with the abilities to undo a change, save the on screen controller layout for later retrieval, and load previously saved controller layouts
*/
@interface LayoutOnScreenControlsViewController : UIViewController <OnScreenWidgetGuidelineUpdateDelegate>
@interface LayoutOnScreenControlsViewController : UIViewController <OnScreenWidgetGuidelineUpdateDelegate,UITextFieldDelegate>
- (void)profileRefresh;
- (void)reloadOnScreenWidgetViews;
- (void)presentProfilesTableView;
@@ -107,8 +107,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic) IBOutlet UIStackView *autoTapStack;
@property (strong, nonatomic) IBOutlet UILabel *autoTapLabel;
@property (strong, nonatomic) IBOutlet UISlider *autoTapSlider;
// @property (strong, nonatomic) IBOutlet UISlider *autoTapSlider;
@property (strong, nonatomic) IBOutlet UITextField *autoTapField;
@property (weak, nonatomic) IBOutlet UIStackView *widgetPanelStack;
@@ -774,6 +774,9 @@
OnScreenWidgetView* widgetView = (OnScreenWidgetView* )notification.object;
self->widgetViewSelected = true;
self->controllerLayerSelected = false;
if(widgetView != selectedWidgetView) [selectedWidgetView setAutoTapIntervalByTextWithStr:_autoTapField.text];
self->selectedWidgetView = widgetView;
[self autoFitLabel:self.currentProfileLabel];
@@ -858,9 +861,17 @@
[self widgetBorderWidthSliderMoved:self.widgetBorderWidthSlider];
self.autoTapStack.hidden = !selectedWidgetView.hasAutoTap;
[self.autoTapSlider setValue:self->selectedWidgetView.autoTapInterval];
// [self.autoTapSlider setValue:self->selectedWidgetView.autoTapInterval];
[self.autoTapField setText:[self->selectedWidgetView getAutoTapIntervalStr]];
self.autoTapField.textColor = [UIColor whiteColor];
self.autoTapField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
self.autoTapField.attributedPlaceholder =
[[NSAttributedString alloc] initWithString:[LocalizationHelper localizedStringForKey:@"Minimum: 50ms. 0 to disable. ms(milliSec),s(sec),m(min). ⏎ to save"]
attributes:@{
NSForegroundColorAttributeName:[[UIColor whiteColor] colorWithAlphaComponent:0.77]
}];
[self autoFitLabel:self.autoTapLabel];
[self autoTapSliderMoved:self.autoTapSlider];
// [self autoTapSliderMoved:self.autoTapSlider];
self.decelerationRateStack.hidden = !selectedWidgetView.hasTrackBall;
[self.decelerationRateSlider setValue:selectedWidgetView.trackballDecelerationRate];
@@ -981,13 +992,14 @@
return;
}
/*
- (void)autoTapSliderMoved:(UISlider* )sender{
[self.autoTapLabel setText:(uint16_t)sender.value < 50 ? [LocalizationHelper localizedStringForKey: @"Auto tap disabled"] : [LocalizationHelper localizedStringForKey: @"Auto tap: %dms", (uint16_t)sender.value]];
if(self->selectedWidgetView != nil && self->widgetViewSelected){
selectedWidgetView.autoTapInterval = (uint16_t)sender.value;
}
return;
}
} */
- (void)mouseDownButtonChanged:(UISegmentedControl* )sender{
if(self->selectedWidgetView != nil && self->widgetViewSelected){
@@ -1169,8 +1181,9 @@
self.widgetBorderWidthLabel.text = [LocalizationHelper localizedStringForKey:@"Border width"];
self.borderWidthAlphaStack.hidden = YES;
[self.autoTapSlider addTarget:self action:@selector(autoTapSliderMoved:) forControlEvents:(UIControlEventValueChanged)];
self.autoTapLabel.text = [LocalizationHelper localizedStringForKey:@"Autotap"];
// [self.autoTapSlider addTarget:self action:@selector(autoTapSliderMoved:) forControlEvents:(UIControlEventValueChanged)];
self.autoTapLabel.text = [LocalizationHelper localizedStringForKey:@"Autotap timer "];
self.autoTapField.delegate = self;
self.autoTapStack.hidden = YES;
[self.sensitivityXSlider addTarget:self action:@selector(sensitivityXSliderMoved:) forControlEvents:(UIControlEventValueChanged)];
@@ -1256,6 +1269,12 @@
}
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder]; // 收起键盘
[selectedWidgetView setAutoTapIntervalByTextWithStr:textField.text];
return YES;
}
- (void)applyShadowForiOS13:(UIStackView* )stack {
stack.backgroundColor = [UIColor clearColor];
+2 -2
View File
@@ -914,13 +914,13 @@
}
},
"And-W9-9NR.text" : {
"comment" : "Class = \"UILabel\"; text = \"Auto tap: 100ms\"; ObjectID = \"And-W9-9NR\";",
"comment" : "Class = \"UILabel\"; text = \"Auto tap\"; ObjectID = \"And-W9-9NR\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Auto tap: 100ms"
"value" : "Auto tap"
}
}
}
+2 -2
View File
@@ -2264,13 +2264,13 @@
}
},
"IuG-44-1Je.text" : {
"comment" : "Class = \"UILabel\"; text = \"Autotap: 100ms\"; ObjectID = \"IuG-44-1Je\";",
"comment" : "Class = \"UILabel\"; text = \"Autotap\"; ObjectID = \"IuG-44-1Je\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Autotap: 100ms"
"value" : "Autotap"
}
}
}