more tips for on screen widgets
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
18FCADAF2ECAC23200787A96 /* PencilHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18FCADAE2ECAC23200787A96 /* PencilHandler.swift */; };
|
||||
2A7113FD2F5A6C65001D852D /* ThemeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A7113FC2F5A6C65001D852D /* ThemeManager.swift */; };
|
||||
2AAA4E822F7666C5001E20DC /* ControllerUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A765BC2ECD51FB004784AA /* ControllerUtil.swift */; };
|
||||
2AAA4E842F7666EE001E20DC /* SwiftLocalizationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E1CDF92C4FE83400547904 /* SwiftLocalizationHelper.swift */; };
|
||||
2AAA4E842F7666EE001E20DC /* LocalizationHelperExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E1CDF92C4FE83400547904 /* LocalizationHelperExtension.swift */; };
|
||||
2AC1E3832F507D80004F76C0 /* GenericUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC1E3822F507D80004F76C0 /* GenericUtils.swift */; };
|
||||
2AC1EAFB2F92260F004EDA80 /* UIStackExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC1EAFA2F922602004EDA80 /* UIStackExtension.swift */; };
|
||||
2AC1EAFC2F922889004EDA80 /* UIStackExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC1EAFA2F922602004EDA80 /* UIStackExtension.swift */; };
|
||||
@@ -62,7 +62,7 @@
|
||||
848F456A2DDCD12500581E36 /* HostCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 848F45692DDCD12500581E36 /* HostCardView.m */; };
|
||||
84E1CDEC2C4F67D300547904 /* CommandManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E1CDEB2C4F67D300547904 /* CommandManager.swift */; };
|
||||
84E1CDEF2C4F688E00547904 /* ToolboxViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E1CDEE2C4F688E00547904 /* ToolboxViewController.swift */; };
|
||||
84E1CDFA2C4FE83400547904 /* SwiftLocalizationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E1CDF92C4FE83400547904 /* SwiftLocalizationHelper.swift */; };
|
||||
84E1CDFA2C4FE83400547904 /* LocalizationHelperExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84E1CDF92C4FE83400547904 /* LocalizationHelperExtension.swift */; };
|
||||
84FD0B512C31338D006B5BE5 /* LocalizationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 84FD0B502C31338D006B5BE5 /* LocalizationHelper.m */; };
|
||||
84FD0B542C3134A6006B5BE5 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 84FD0B532C3134A6006B5BE5 /* Localizable.xcstrings */; };
|
||||
9777AAF32E2CF7A400D7FBAF /* Shaders-Linear.metal in Sources */ = {isa = PBXBuildFile; fileRef = 9777AAF22E2CF7A400D7FBAF /* Shaders-Linear.metal */; };
|
||||
@@ -246,7 +246,7 @@
|
||||
84D8EB932C5146AD00FC10A9 /* VoidLink-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "VoidLink-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
84E1CDEB2C4F67D300547904 /* CommandManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommandManager.swift; sourceTree = "<group>"; };
|
||||
84E1CDEE2C4F688E00547904 /* ToolboxViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolboxViewController.swift; sourceTree = "<group>"; };
|
||||
84E1CDF92C4FE83400547904 /* SwiftLocalizationHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftLocalizationHelper.swift; sourceTree = "<group>"; };
|
||||
84E1CDF92C4FE83400547904 /* LocalizationHelperExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizationHelperExtension.swift; sourceTree = "<group>"; };
|
||||
84FD0B4F2C313343006B5BE5 /* LocalizationHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalizationHelper.h; sourceTree = "<group>"; };
|
||||
84FD0B502C31338D006B5BE5 /* LocalizationHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocalizationHelper.m; sourceTree = "<group>"; };
|
||||
84FD0B532C3134A6006B5BE5 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
|
||||
@@ -534,8 +534,8 @@
|
||||
children = (
|
||||
84FD0B4F2C313343006B5BE5 /* LocalizationHelper.h */,
|
||||
84FD0B502C31338D006B5BE5 /* LocalizationHelper.m */,
|
||||
84E1CDF92C4FE83400547904 /* LocalizationHelperExtension.swift */,
|
||||
84FD0B532C3134A6006B5BE5 /* Localizable.xcstrings */,
|
||||
84E1CDF92C4FE83400547904 /* SwiftLocalizationHelper.swift */,
|
||||
);
|
||||
path = Localization;
|
||||
sourceTree = "<group>";
|
||||
@@ -1114,7 +1114,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2AAA4E842F7666EE001E20DC /* SwiftLocalizationHelper.swift in Sources */,
|
||||
2AAA4E842F7666EE001E20DC /* LocalizationHelperExtension.swift in Sources */,
|
||||
2AAA4E822F7666C5001E20DC /* ControllerUtil.swift in Sources */,
|
||||
2AC1EAFB2F92260F004EDA80 /* UIStackExtension.swift in Sources */,
|
||||
);
|
||||
@@ -1211,7 +1211,7 @@
|
||||
FB9AFD371A7E02DB00872C98 /* HttpRequest.m in Sources */,
|
||||
1888C1932E24C41000108730 /* AboutView.swift in Sources */,
|
||||
FB4678ED1A50C40900377732 /* OnScreenControls.m in Sources */,
|
||||
84E1CDFA2C4FE83400547904 /* SwiftLocalizationHelper.swift in Sources */,
|
||||
84E1CDFA2C4FE83400547904 /* LocalizationHelperExtension.swift in Sources */,
|
||||
FB290D0019B2C406004C83CF /* main.m in Sources */,
|
||||
9896219723D15C7000211983 /* X1Kit.swift in Sources */,
|
||||
FBD3494319FC9C04002D2A60 /* AppAssetManager.m in Sources */,
|
||||
|
||||
@@ -53,7 +53,7 @@ public struct AboutView: View {
|
||||
}
|
||||
|
||||
// 说明文字
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "From the player community, to the player community."))
|
||||
Text(LocalizationHelper.localizedString(forKey: "From the player community, to the player community."))
|
||||
.multilineTextAlignment(.center)
|
||||
.font(Font.caption.italic())
|
||||
.lineLimit(nil)
|
||||
@@ -61,7 +61,7 @@ public struct AboutView: View {
|
||||
.padding()
|
||||
|
||||
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "VoidLink delivers better performance now!"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "VoidLink delivers better performance now!"))
|
||||
.multilineTextAlignment(.center)
|
||||
.font(Font.callout.bold())
|
||||
.lineLimit(nil)
|
||||
@@ -69,11 +69,11 @@ public struct AboutView: View {
|
||||
|
||||
// 链接按钮
|
||||
if #available(iOS 14.0, *) {
|
||||
Link(SwiftLocalizationHelper.localizedString(forKey: "Learn more & join us"), destination: URL(string: SwiftLocalizationHelper.localizedString(forKey: "supportLink"))!)
|
||||
Link(LocalizationHelper.localizedString(forKey: "Learn more & join us"), destination: URL(string: LocalizationHelper.localizedString(forKey: "supportLink"))!)
|
||||
.padding(.top, 10)
|
||||
Spacer()
|
||||
// OK 按钮
|
||||
Button(SwiftLocalizationHelper.localizedString(forKey: "OK")) {
|
||||
Button(LocalizationHelper.localizedString(forKey: "OK")) {
|
||||
aboutVC.dismiss(animated:true)
|
||||
}
|
||||
.padding()
|
||||
@@ -83,9 +83,9 @@ public struct AboutView: View {
|
||||
.cornerRadius(12)
|
||||
} else {
|
||||
HStack(spacing: 20) {
|
||||
Button(SwiftLocalizationHelper.localizedString(forKey: "Join us")) {
|
||||
Button(LocalizationHelper.localizedString(forKey: "Join us")) {
|
||||
// 打开链接
|
||||
if let url = URL(string: SwiftLocalizationHelper.localizedString(forKey: "supportLink")) {
|
||||
if let url = URL(string: LocalizationHelper.localizedString(forKey: "supportLink")) {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public struct AboutView: View {
|
||||
.frame(height: 33)
|
||||
.frame(minWidth: 100)
|
||||
/*
|
||||
Button(SwiftLocalizationHelper.localizedString(forKey: "OK")) {
|
||||
Button(LocalizationHelper.localizedString(forKey: "OK")) {
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
}
|
||||
.padding()
|
||||
@@ -105,7 +105,7 @@ public struct AboutView: View {
|
||||
.cornerRadius(12)
|
||||
.frame(height: 33)
|
||||
.frame(minWidth: 100)*/
|
||||
Button(SwiftLocalizationHelper.localizedString(forKey: "OK")) {
|
||||
Button(LocalizationHelper.localizedString(forKey: "OK")) {
|
||||
aboutVC.dismiss(animated:true)
|
||||
}
|
||||
.padding()
|
||||
|
||||
@@ -59,7 +59,7 @@ import UIKit
|
||||
cancelButtonString = "Cancel"
|
||||
}
|
||||
|
||||
let cancelAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: cancelButtonString), style: .cancel) { _ in
|
||||
let cancelAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: cancelButtonString), style: .cancel) { _ in
|
||||
isAlertDismissed = true
|
||||
actionCancelled = true
|
||||
completion?()
|
||||
|
||||
@@ -411,7 +411,7 @@ final class AbstractGamepadOverlayView: UIView {
|
||||
title: GenericUtils.gamepadOverlayFeatureTipTitle(),
|
||||
message: GenericUtils.gamepadOverlayFeatureTipMessage(),
|
||||
withCancel: false,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "This tip won't be shown again"),
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "This tip won't be shown again"),
|
||||
countdown: 6
|
||||
)
|
||||
}
|
||||
|
||||
@@ -175,10 +175,10 @@ import Foundation
|
||||
case .x: return "X"
|
||||
case .y: return "Y"
|
||||
|
||||
case .dpadUp: return SwiftLocalizationHelper.localizedString(forKey: "Up")
|
||||
case .dpadDown: return SwiftLocalizationHelper.localizedString(forKey: "Down")
|
||||
case .dpadLeft: return SwiftLocalizationHelper.localizedString(forKey: "Left")
|
||||
case .dpadRight: return SwiftLocalizationHelper.localizedString(forKey: "Right")
|
||||
case .dpadUp: return LocalizationHelper.localizedString(forKey: "Up")
|
||||
case .dpadDown: return LocalizationHelper.localizedString(forKey: "Down")
|
||||
case .dpadLeft: return LocalizationHelper.localizedString(forKey: "Left")
|
||||
case .dpadRight: return LocalizationHelper.localizedString(forKey: "Right")
|
||||
|
||||
case .leftShoulder: return "LB"
|
||||
case .rightShoulder: return "RB"
|
||||
@@ -190,17 +190,17 @@ import Foundation
|
||||
case .back: return "Back"
|
||||
case .special: return "Home"
|
||||
|
||||
case .paddle1: return SwiftLocalizationHelper.localizedString(forKey: "Paddle1")
|
||||
case .paddle2: return SwiftLocalizationHelper.localizedString(forKey: "Paddle2")
|
||||
case .paddle3: return SwiftLocalizationHelper.localizedString(forKey: "Paddle3")
|
||||
case .paddle4: return SwiftLocalizationHelper.localizedString(forKey: "Paddle4")
|
||||
case .touchpadButton: return SwiftLocalizationHelper.localizedString(forKey: "Touch button")
|
||||
case .paddle1: return LocalizationHelper.localizedString(forKey: "Paddle1")
|
||||
case .paddle2: return LocalizationHelper.localizedString(forKey: "Paddle2")
|
||||
case .paddle3: return LocalizationHelper.localizedString(forKey: "Paddle3")
|
||||
case .paddle4: return LocalizationHelper.localizedString(forKey: "Paddle4")
|
||||
case .touchpadButton: return LocalizationHelper.localizedString(forKey: "Touch button")
|
||||
case .misc: return "Misc"
|
||||
|
||||
case .leftTrigger: return "LT"
|
||||
case .rightTrigger: return "RT"
|
||||
|
||||
case .null: return SwiftLocalizationHelper.localizedString(forKey: "Null")
|
||||
case .null: return LocalizationHelper.localizedString(forKey: "Null")
|
||||
|
||||
default: return "UNKNOWN"
|
||||
}
|
||||
|
||||
@@ -275,10 +275,10 @@ private final class InputAccessoryCapsuleButton: UIButton {
|
||||
InputAccessoryBar.isFirstTap = false
|
||||
AlertControllerUtil.showAlert(
|
||||
in: self.parentViewController!,
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Soft Keyboard Toolbar"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey:"inputAccessoryBarTip"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Soft Keyboard Toolbar"),
|
||||
message: LocalizationHelper.localizedString(forKey:"inputAccessoryBarTip"),
|
||||
withCancel: false,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
countdown: 6,
|
||||
completion: {
|
||||
})
|
||||
|
||||
@@ -110,12 +110,12 @@ public class MicHandler: NSObject {
|
||||
private static func showSettingsAlert() {
|
||||
guard let topVC = topViewController() else { return }
|
||||
let alert = UIAlertController(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Microphone Permission") ,
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "micPermissionTip"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Microphone Permission") ,
|
||||
message: LocalizationHelper.localizedString(forKey: "micPermissionTip"),
|
||||
preferredStyle: .alert
|
||||
)
|
||||
alert.addAction(UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Cancel"), style: .cancel, handler: nil))
|
||||
alert.addAction(UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Go to Settings") , style: .default, handler: { _ in
|
||||
alert.addAction(UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Cancel"), style: .cancel, handler: nil))
|
||||
alert.addAction(UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Go to Settings") , style: .default, handler: { _ in
|
||||
openSettings()
|
||||
}))
|
||||
topVC.present(alert, animated: true, completion: nil)
|
||||
|
||||
@@ -235,7 +235,6 @@ import ObjectiveC.runtime
|
||||
@objc public var hasNonEditableLabel: Bool = false
|
||||
|
||||
@objc public var isMagnifier: Bool = false
|
||||
private var isFirstTappingMagnifier: Bool = true
|
||||
@objc public var animatesTransition: Bool = true
|
||||
|
||||
// for all stick pads
|
||||
@@ -300,7 +299,6 @@ import ObjectiveC.runtime
|
||||
@objc public var pitchFactor: CGFloat = 1.0
|
||||
@objc public var rollFactor: CGFloat = 1.0
|
||||
private var gyroControlPreviousStatus: NSMutableDictionary = NSMutableDictionary()
|
||||
private var isFirstTappingOnscreenGyroButton: Bool = true
|
||||
|
||||
private var superViewWidth: CGFloat = 0
|
||||
private var superViewHeight: CGFloat = 0
|
||||
@@ -965,7 +963,7 @@ import ObjectiveC.runtime
|
||||
}
|
||||
|
||||
@objc func setupAtrributedText(){
|
||||
var text = self.widgetLabel.contains("#") ? "\(self.widgetLabel.split(separator: "#").first ?? "")" : SwiftLocalizationHelper.localizedString(forKey: self.widgetLabel)
|
||||
var text = self.widgetLabel.contains("#") ? "\(self.widgetLabel.split(separator: "#").first ?? "")" : LocalizationHelper.localizedString(forKey: self.widgetLabel)
|
||||
|
||||
if !OnScreenWidgetView.editMode, self.widgetType == .touchPad {
|
||||
text = ""
|
||||
@@ -975,9 +973,9 @@ import ObjectiveC.runtime
|
||||
|
||||
switch cmdString {
|
||||
case "DISABLETOUCH":
|
||||
self.nonEditableWidgetLabel = SwiftLocalizationHelper.localizedString(forKey: touchDisabledFLag ? "=EnableTouch" : "=DisableTouch" )
|
||||
self.nonEditableWidgetLabel = LocalizationHelper.localizedString(forKey: touchDisabledFLag ? "=EnableTouch" : "=DisableTouch" )
|
||||
case "GAMEPADOVERLAY":
|
||||
self.nonEditableWidgetLabel = SwiftLocalizationHelper.localizedString(forKey: OnScreenWidgetView.gamepadOverlayFLag ? "=GamepadOverlayOn" : "=GamepadOverlayOff" )
|
||||
self.nonEditableWidgetLabel = LocalizationHelper.localizedString(forKey: OnScreenWidgetView.gamepadOverlayFLag ? "=GamepadOverlayOn" : "=GamepadOverlayOff" )
|
||||
default:
|
||||
nonEditableWidgetLabel = ""
|
||||
}
|
||||
@@ -1909,6 +1907,7 @@ import ObjectiveC.runtime
|
||||
if self.widgetType == WidgetTypeEnum.touchPad && touches.count == 1{ // don't use event?.allTouches?.count here, it will counts all touches including the ones captured by other UIViews
|
||||
switch self.touchPadString {
|
||||
case "LSWHEEL","RSWHEEL":
|
||||
GenericUtils.handleStickWheelTip(in: self.parentViewController)
|
||||
self.getVector(touch: touch)
|
||||
self.handleStickWheelMove(touch: touch)
|
||||
if quickDoubleTapDetected {
|
||||
@@ -1921,6 +1920,7 @@ import ObjectiveC.runtime
|
||||
self.showl3r3Indicator()
|
||||
self.sendComboButtonsDownEvent(comboStrings: self.comboButtonStrings)}
|
||||
case "RSVPAD":
|
||||
GenericUtils.handleVelocityBasedTouchpadTip(in: self.parentViewController)
|
||||
self.clearRightStickTouchPadFlag()
|
||||
self.inertialScroller.timer?.pause()
|
||||
if quickDoubleTapDetected {
|
||||
@@ -1954,10 +1954,7 @@ import ObjectiveC.runtime
|
||||
self.sendComboButtonsDownEvent(comboStrings: self.comboButtonStrings)
|
||||
}
|
||||
case "MAGNIFIER":
|
||||
if self.isFirstTappingMagnifier, GenericUtils.isFirstTappingMagnifier() {
|
||||
self.popMagnifierTip()
|
||||
}
|
||||
self.isFirstTappingMagnifier = false
|
||||
GenericUtils.handleMagnifierTip(in: self.parentViewController)
|
||||
if quickDoubleTapDetected && allSpawnedTouchesCount == 1 {
|
||||
OnScreenWidgetView.profileChangedDuringStreaming = true
|
||||
self.functionalWidgetDelegate?.resetMagnifierStreamView(animated: self.animatesTransition)
|
||||
@@ -2580,10 +2577,7 @@ import ObjectiveC.runtime
|
||||
}
|
||||
|
||||
private func handleMotionControlButtonDown(){
|
||||
if isFirstTappingOnscreenGyroButton, GenericUtils.isFirstTappingOnscreenGyroButton() {
|
||||
self.popGyroButtonTip()
|
||||
}
|
||||
isFirstTappingOnscreenGyroButton = false
|
||||
GenericUtils.handleGyroButtonTip(in: self.parentViewController)
|
||||
switch self.motionControlButtonString {
|
||||
case "GYRO":
|
||||
self.motionHandler?.startGyroByOnScreenButton(self, yawFactor: yawFactor, pitchFactor: pitchFactor, rollFactor: rollFactor)
|
||||
@@ -2638,6 +2632,7 @@ import ObjectiveC.runtime
|
||||
switch self.functionalButtonString {
|
||||
case "FOLDER":
|
||||
if self.buttonMode != .slideAndHold {break}
|
||||
GenericUtils.handleSlideAndHoldFolderButtonTip(in: self.parentViewController)
|
||||
self.folded = false
|
||||
OnScreenWidgetView.set(folded: false, for: self)
|
||||
case "ABSTCHDRAG":
|
||||
@@ -3168,29 +3163,7 @@ import ObjectiveC.runtime
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
private func popMagnifierTip() {
|
||||
AlertControllerUtil.showAlert(
|
||||
in: self.parentViewController,
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Magnifier"),
|
||||
message: "\n\(SwiftLocalizationHelper.localizedString(forKey: "magnifierTip"))\n\n\(SwiftLocalizationHelper.localizedString(forKey: "magnifierPersistTip"))",
|
||||
withCancel: false,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
countdown: 5,
|
||||
)
|
||||
}
|
||||
|
||||
private func popGyroButtonTip() {
|
||||
AlertControllerUtil.showAlert(
|
||||
in: self.parentViewController,
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Gyro Button"),
|
||||
message: "\n\(SwiftLocalizationHelper.localizedString(forKey: "gyroButtonTip"))",
|
||||
withCancel: false,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
countdown: 5,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Auto Dock
|
||||
private static let autoDockExposedEdgeLength: CGFloat = GenericUtils.isIPhone() ? 90 : 90
|
||||
private static let autoDockExposedThickness: CGFloat = 22
|
||||
|
||||
@@ -436,7 +436,7 @@ import UIKit
|
||||
pickerViewController.tabIdentifiers = ["keyboard"]
|
||||
pickerViewController.initialTabIdentifier = "keyboard"
|
||||
pickerViewController.shortcutIdentifier = "eraser"
|
||||
pickerViewController.shortcutPickerTipText = SwiftLocalizationHelper.localizedString(forKey: "Select eraser shortcut keys")
|
||||
pickerViewController.shortcutPickerTipText = LocalizationHelper.localizedString(forKey: "Select eraser shortcut keys")
|
||||
let nav = UINavigationController(rootViewController: pickerViewController)
|
||||
nav.modalPresentationStyle = .overFullScreen
|
||||
viewController.present(nav, animated: true)
|
||||
@@ -444,19 +444,19 @@ import UIKit
|
||||
}
|
||||
|
||||
/*
|
||||
let alert = UIAlertController(title: SwiftLocalizationHelper.localizedString(forKey: "Eraser Shortcut"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "Enter eraser keyboard shortcut:"),
|
||||
let alert = UIAlertController(title: LocalizationHelper.localizedString(forKey: "Eraser Shortcut"),
|
||||
message: LocalizationHelper.localizedString(forKey: "Enter eraser keyboard shortcut:"),
|
||||
preferredStyle: .alert)
|
||||
|
||||
alert.addTextField { textField in
|
||||
textField.placeholder = SwiftLocalizationHelper.localizedString(forKey:"Example: e, ctrl+e, alt+e ...")
|
||||
textField.placeholder = LocalizationHelper.localizedString(forKey:"Example: e, ctrl+e, alt+e ...")
|
||||
textField.keyboardType = .asciiCapable
|
||||
textField.autocorrectionType = .no
|
||||
textField.spellCheckingType = .no
|
||||
textField.text = selectedProfile.eraserShortcut
|
||||
}
|
||||
|
||||
let okAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "OK"), style: .default) { _ in
|
||||
let okAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "OK"), style: .default) { _ in
|
||||
let comboButtons = alert.textFields?[0].text ?? ""
|
||||
let keyStrings = CommandManager.shared.extractAutoReleaseButtonStrings(from: comboButtons)
|
||||
if keyStrings?.count ?? 0 > 0 || comboButtons == "" {
|
||||
@@ -465,8 +465,8 @@ import UIKit
|
||||
enterBrushShortcut(in: viewController)
|
||||
}
|
||||
|
||||
let learnMoreAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
if let url = URL(string: SwiftLocalizationHelper.localizedString(forKey: "pencilKeyboardCmdURL")) {
|
||||
let learnMoreAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
if let url = URL(string: LocalizationHelper.localizedString(forKey: "pencilKeyboardCmdURL")) {
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
}
|
||||
}
|
||||
@@ -488,26 +488,26 @@ import UIKit
|
||||
pickerViewController.tabIdentifiers = ["keyboard"]
|
||||
pickerViewController.initialTabIdentifier = "keyboard"
|
||||
pickerViewController.shortcutIdentifier = "brush"
|
||||
pickerViewController.shortcutPickerTipText = SwiftLocalizationHelper.localizedString(forKey: "Select brush shortcut keys")
|
||||
pickerViewController.shortcutPickerTipText = LocalizationHelper.localizedString(forKey: "Select brush shortcut keys")
|
||||
let nav = UINavigationController(rootViewController: pickerViewController)
|
||||
nav.modalPresentationStyle = .overFullScreen
|
||||
viewController.present(nav, animated: true)
|
||||
return
|
||||
|
||||
/*
|
||||
let alert = UIAlertController(title: SwiftLocalizationHelper.localizedString(forKey: "Brush Shortcut"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "Enter brush keyboard shortcut:"),
|
||||
let alert = UIAlertController(title: LocalizationHelper.localizedString(forKey: "Brush Shortcut"),
|
||||
message: LocalizationHelper.localizedString(forKey: "Enter brush keyboard shortcut:"),
|
||||
preferredStyle: .alert)
|
||||
|
||||
alert.addTextField { textField in
|
||||
textField.placeholder = SwiftLocalizationHelper.localizedString(forKey:"Example: b, ctrl+b, alt+b ...")
|
||||
textField.placeholder = LocalizationHelper.localizedString(forKey:"Example: b, ctrl+b, alt+b ...")
|
||||
textField.keyboardType = .asciiCapable
|
||||
textField.autocorrectionType = .no
|
||||
textField.spellCheckingType = .no
|
||||
textField.text = selectedProfile?.brushShortcut
|
||||
}
|
||||
|
||||
let okAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "OK"), style: .default) { _ in
|
||||
let okAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "OK"), style: .default) { _ in
|
||||
let comboButtons = alert.textFields?[0].text ?? ""
|
||||
let keyStrings = CommandManager.shared.extractAutoReleaseButtonStrings(from: comboButtons)
|
||||
if keyStrings?.count ?? 0 > 0 || comboButtons == "" {
|
||||
@@ -524,8 +524,8 @@ import UIKit
|
||||
}
|
||||
}
|
||||
|
||||
let learnMoreAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
if let url = URL(string: SwiftLocalizationHelper.localizedString(forKey: "pencilKeyboardCmdURL")) {
|
||||
let learnMoreAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
if let url = URL(string: LocalizationHelper.localizedString(forKey: "pencilKeyboardCmdURL")) {
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
}
|
||||
}
|
||||
@@ -550,7 +550,7 @@ import UIKit
|
||||
pickerViewController.tabIdentifiers = ["keyboard"]
|
||||
pickerViewController.initialTabIdentifier = "keyboard"
|
||||
pickerViewController.shortcutIdentifier = "squeezePress"
|
||||
pickerViewController.shortcutPickerTipText = SwiftLocalizationHelper.localizedString(forKey: "squeezePressShortcutPickerTip")
|
||||
pickerViewController.shortcutPickerTipText = LocalizationHelper.localizedString(forKey: "squeezePressShortcutPickerTip")
|
||||
let nav = UINavigationController(rootViewController: pickerViewController)
|
||||
nav.modalPresentationStyle = .overFullScreen
|
||||
viewController.present(nav, animated: true)
|
||||
@@ -560,19 +560,19 @@ import UIKit
|
||||
selectedProfile = oscProfileMan.getSelectedProfile()
|
||||
guard let selectedProfile = selectedProfile else {return}
|
||||
|
||||
let alert = UIAlertController(title: SwiftLocalizationHelper.localizedString(forKey: "Squeeze Shortcut"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "enterSqueezePressShort"),
|
||||
let alert = UIAlertController(title: LocalizationHelper.localizedString(forKey: "Squeeze Shortcut"),
|
||||
message: LocalizationHelper.localizedString(forKey: "enterSqueezePressShort"),
|
||||
preferredStyle: .alert)
|
||||
|
||||
alert.addTextField { textField in
|
||||
textField.placeholder = SwiftLocalizationHelper.localizedString(forKey:"Example: e, ctrl+e, alt+e ...")
|
||||
textField.placeholder = LocalizationHelper.localizedString(forKey:"Example: e, ctrl+e, alt+e ...")
|
||||
textField.keyboardType = .asciiCapable
|
||||
textField.autocorrectionType = .no
|
||||
textField.spellCheckingType = .no
|
||||
textField.text = selectedProfile.squeezeStartShortcut
|
||||
}
|
||||
|
||||
let okAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "OK"), style: .default) { _ in
|
||||
let okAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "OK"), style: .default) { _ in
|
||||
let comboButtons = alert.textFields?[0].text ?? ""
|
||||
let keyStrings = CommandManager.shared.extractAutoReleaseButtonStrings(from: comboButtons)
|
||||
if keyStrings?.count ?? 0 > 0 || comboButtons == "" {
|
||||
@@ -581,8 +581,8 @@ import UIKit
|
||||
enterSqueezeEndShortcut(in: viewController)
|
||||
}
|
||||
|
||||
let learnMoreAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
if let url = URL(string: SwiftLocalizationHelper.localizedString(forKey: "pencilKeyboardCmdURL")) {
|
||||
let learnMoreAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
if let url = URL(string: LocalizationHelper.localizedString(forKey: "pencilKeyboardCmdURL")) {
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
}
|
||||
}
|
||||
@@ -603,26 +603,26 @@ import UIKit
|
||||
pickerViewController.tabIdentifiers = ["keyboard"]
|
||||
pickerViewController.initialTabIdentifier = "keyboard"
|
||||
pickerViewController.shortcutIdentifier = "squeezeRelease"
|
||||
pickerViewController.shortcutPickerTipText = SwiftLocalizationHelper.localizedString(forKey: "squeezeReleaseShortcutPickerTip")
|
||||
pickerViewController.shortcutPickerTipText = LocalizationHelper.localizedString(forKey: "squeezeReleaseShortcutPickerTip")
|
||||
let nav = UINavigationController(rootViewController: pickerViewController)
|
||||
nav.modalPresentationStyle = .overFullScreen
|
||||
viewController.present(nav, animated: true)
|
||||
}
|
||||
|
||||
/*
|
||||
let alert = UIAlertController(title: SwiftLocalizationHelper.localizedString(forKey: "Squeeze Shortcut"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "enterSqueezeReleaseShort"),
|
||||
let alert = UIAlertController(title: LocalizationHelper.localizedString(forKey: "Squeeze Shortcut"),
|
||||
message: LocalizationHelper.localizedString(forKey: "enterSqueezeReleaseShort"),
|
||||
preferredStyle: .alert)
|
||||
|
||||
alert.addTextField { textField in
|
||||
textField.placeholder = SwiftLocalizationHelper.localizedString(forKey:"Example: b, ctrl+b, alt+b ...")
|
||||
textField.placeholder = LocalizationHelper.localizedString(forKey:"Example: b, ctrl+b, alt+b ...")
|
||||
textField.keyboardType = .asciiCapable
|
||||
textField.autocorrectionType = .no
|
||||
textField.spellCheckingType = .no
|
||||
textField.text = selectedProfile?.squeezeEndShortcut
|
||||
}
|
||||
|
||||
let okAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "OK"), style: .default) { _ in
|
||||
let okAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "OK"), style: .default) { _ in
|
||||
let comboButtons = alert.textFields?[0].text ?? ""
|
||||
let keyStrings = CommandManager.shared.extractAutoReleaseButtonStrings(from: comboButtons)
|
||||
if keyStrings?.count ?? 0 > 0 || comboButtons == "" {
|
||||
@@ -639,8 +639,8 @@ import UIKit
|
||||
}
|
||||
}
|
||||
|
||||
let learnMoreAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
if let url = URL(string: SwiftLocalizationHelper.localizedString(forKey: "pencilKeyboardCmdURL")) {
|
||||
let learnMoreAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
if let url = URL(string: LocalizationHelper.localizedString(forKey: "pencilKeyboardCmdURL")) {
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -590,13 +590,13 @@ class PressureCurveViewController: UIViewController, UIGestureRecognizerDelegate
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
/*
|
||||
AlertControllerUtil.cancelButtonString = SwiftLocalizationHelper.localizedString(forKey: "No")
|
||||
AlertControllerUtil.cancelButtonString = LocalizationHelper.localizedString(forKey: "No")
|
||||
AlertControllerUtil.showAlert(
|
||||
in: self,
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Pen Pressure Curve"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey:"Reset the pen pressure curve by starting from the pen pressure test?"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Pen Pressure Curve"),
|
||||
message: LocalizationHelper.localizedString(forKey:"Reset the pen pressure curve by starting from the pen pressure test?"),
|
||||
withCancel: true,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "Yes"),
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "Yes"),
|
||||
countdown: 0,
|
||||
action: {},
|
||||
completion: {
|
||||
@@ -721,7 +721,7 @@ class PressureCurveViewController: UIViewController, UIGestureRecognizerDelegate
|
||||
|
||||
@objc func hookFilterDepthSliderMoved(_ sender: UISlider) {
|
||||
phase1StrokeSampleIndexEnd = Int32(sender.value.rounded())
|
||||
hookFilterLabel.text = "\(SwiftLocalizationHelper.localizedString(forKey: "Stroke start hook filtering depth: "))\(String(format: "%d", Int32(sender.value)))";
|
||||
hookFilterLabel.text = "\(LocalizationHelper.localizedString(forKey: "Stroke start hook filtering depth: "))\(String(format: "%d", Int32(sender.value)))";
|
||||
if sender.value > strokeEqualizationDepthSlider.value {
|
||||
strokeEqualizationDepthSlider.value = sender.value
|
||||
strokeEqualizationDepthSliderMoved(strokeEqualizationDepthSlider)
|
||||
@@ -731,12 +731,12 @@ class PressureCurveViewController: UIViewController, UIGestureRecognizerDelegate
|
||||
@objc func strokeEqualizationDepthSliderMoved(_ sender: UISlider) {
|
||||
sender.value = max(sender.value, hookFilterSlider.value)
|
||||
phase2StrokeSampleIndexEnd = Int32(sender.value.rounded())
|
||||
strokeEqualizationDepthLabel.text = "\(SwiftLocalizationHelper.localizedString(forKey: "Stroke start equalization depth: "))\(String(format: "%d", Int32(sender.value)))";
|
||||
strokeEqualizationDepthLabel.text = "\(LocalizationHelper.localizedString(forKey: "Stroke start equalization depth: "))\(String(format: "%d", Int32(sender.value)))";
|
||||
}
|
||||
|
||||
@objc func strokeEqualizationStrengthSliderMoved(_ sender: UISlider) {
|
||||
// sender.value = sender.value
|
||||
strokeEqualizationStrengthLabel.text = "\(SwiftLocalizationHelper.localizedString(forKey: "Stroke start force scaling: "))\(String(format: "%.2f", sender.value))";
|
||||
strokeEqualizationStrengthLabel.text = "\(LocalizationHelper.localizedString(forKey: "Stroke start force scaling: "))\(String(format: "%.2f", sender.value))";
|
||||
}
|
||||
|
||||
|
||||
@@ -773,20 +773,20 @@ class PressureCurveViewController: UIViewController, UIGestureRecognizerDelegate
|
||||
])
|
||||
|
||||
if curveView.testStage == .curveStage {
|
||||
let resetButton = UIBarButtonItem(title: SwiftLocalizationHelper.localizedString(forKey: "Reset"), style: .plain, target: self, action: #selector(resetTapped))
|
||||
let undoButton = UIBarButtonItem(title: SwiftLocalizationHelper.localizedString(forKey: "Undo"), style: .plain, target: self, action: #selector(undoTapped))
|
||||
let rangeTestButton = UIBarButtonItem(title: SwiftLocalizationHelper.localizedString(forKey: "Pressure-range-test"), style: .plain, target: self, action: #selector(pressureRangeTest))
|
||||
// curvePhaseButton = UIBarButtonItem(title: SwiftLocalizationHelper.localizedString(forKey: "Initial-touch-curve"), style: .plain, target: self, action: #selector(curvePhaseButtonTapped))
|
||||
let resetButton = UIBarButtonItem(title: LocalizationHelper.localizedString(forKey: "Reset"), style: .plain, target: self, action: #selector(resetTapped))
|
||||
let undoButton = UIBarButtonItem(title: LocalizationHelper.localizedString(forKey: "Undo"), style: .plain, target: self, action: #selector(undoTapped))
|
||||
let rangeTestButton = UIBarButtonItem(title: LocalizationHelper.localizedString(forKey: "Pressure-range-test"), style: .plain, target: self, action: #selector(pressureRangeTest))
|
||||
// curvePhaseButton = UIBarButtonItem(title: LocalizationHelper.localizedString(forKey: "Initial-touch-curve"), style: .plain, target: self, action: #selector(curvePhaseButtonTapped))
|
||||
curvePhase = .stroke
|
||||
saveButton = UIBarButtonItem(title: SwiftLocalizationHelper.localizedString(forKey: "Save"), style: .plain, target: self, action: #selector(saveTapped))
|
||||
// let quitButton = UIBarButtonItem(title: SwiftLocalizationHelper.localizedString(forKey: "Exit"), style: .plain, target: self, action: #selector(exitTapped))
|
||||
saveButton = UIBarButtonItem(title: LocalizationHelper.localizedString(forKey: "Save"), style: .plain, target: self, action: #selector(saveTapped))
|
||||
// let quitButton = UIBarButtonItem(title: LocalizationHelper.localizedString(forKey: "Exit"), style: .plain, target: self, action: #selector(exitTapped))
|
||||
navItem.leftBarButtonItems = [resetButton, undoButton, rangeTestButton,]
|
||||
navItem.rightBarButtonItems = [saveButton]
|
||||
}
|
||||
|
||||
|
||||
if curveView.testStage == .drawingStage {
|
||||
navItem = UINavigationItem(title: SwiftLocalizationHelper.localizedString(forKey: "Pressure Range Test"))
|
||||
navItem = UINavigationItem(title: LocalizationHelper.localizedString(forKey: "Pressure Range Test"))
|
||||
}
|
||||
|
||||
if #available(iOS 26.0, *) {
|
||||
@@ -810,10 +810,10 @@ class PressureCurveViewController: UIViewController, UIGestureRecognizerDelegate
|
||||
public func showCurveStageTips() {
|
||||
AlertControllerUtil.showAlert(
|
||||
in: self,
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Pen Pressure Curve"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey:"Adjust the pressure curve by adding or dragging the purple squares."),
|
||||
title: LocalizationHelper.localizedString(forKey: "Pen Pressure Curve"),
|
||||
message: LocalizationHelper.localizedString(forKey:"Adjust the pressure curve by adding or dragging the purple squares."),
|
||||
withCancel: false,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "This tip won't be shown again"),
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "This tip won't be shown again"),
|
||||
countdown: 6
|
||||
)
|
||||
}
|
||||
@@ -840,9 +840,9 @@ class PressureCurveViewController: UIViewController, UIGestureRecognizerDelegate
|
||||
AlertControllerUtil.showAlert(
|
||||
in: self,
|
||||
title: "",
|
||||
message: SwiftLocalizationHelper.localizedString(forKey:"PencilProPackLowOSVersionTip"),
|
||||
message: LocalizationHelper.localizedString(forKey:"PencilProPackLowOSVersionTip"),
|
||||
withCancel: false,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "OK"),
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "OK"),
|
||||
countdown: 0)
|
||||
}
|
||||
}
|
||||
@@ -850,10 +850,10 @@ class PressureCurveViewController: UIViewController, UIGestureRecognizerDelegate
|
||||
@objc private func pressureRangeTest() {
|
||||
AlertControllerUtil.showAlert(
|
||||
in: self,
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Pressure Range Test"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey:"pressureRangeTestTip"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Pressure Range Test"),
|
||||
message: LocalizationHelper.localizedString(forKey:"pressureRangeTestTip"),
|
||||
withCancel: true,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "OK"),
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "OK"),
|
||||
countdown: 0,
|
||||
completion:{
|
||||
if AlertControllerUtil.actionCancelled { return }
|
||||
@@ -870,10 +870,10 @@ class PressureCurveViewController: UIViewController, UIGestureRecognizerDelegate
|
||||
switch curvePhase {
|
||||
case .initialTouch:
|
||||
// initialTouchCurvePoints = curveView.curve.polylinePoints
|
||||
curvePhaseButton.title = SwiftLocalizationHelper.localizedString(forKey:"Initial-touch-curve")
|
||||
curvePhaseButton.title = LocalizationHelper.localizedString(forKey:"Initial-touch-curve")
|
||||
case .stroke:
|
||||
strokeCurvePoints = curveView.curve.polylinePoints
|
||||
curvePhaseButton.title = SwiftLocalizationHelper.localizedString(forKey:"Stroke-curve")
|
||||
curvePhaseButton.title = LocalizationHelper.localizedString(forKey:"Stroke-curve")
|
||||
}
|
||||
curvePhase = curvePhase.next()
|
||||
displayCurve()
|
||||
@@ -908,10 +908,10 @@ class PressureCurveViewController: UIViewController, UIGestureRecognizerDelegate
|
||||
if self.isFirstLaunch {
|
||||
AlertControllerUtil.showAlert(
|
||||
in: self,
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Pen Pressure Curve"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey:"firstPressureCurvePersistTip"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Pen Pressure Curve"),
|
||||
message: LocalizationHelper.localizedString(forKey:"firstPressureCurvePersistTip"),
|
||||
withCancel: false,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "This tip won't be shown again"),
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "This tip won't be shown again"),
|
||||
countdown: 11,
|
||||
completion: {
|
||||
PencilHandler.shared?.setupPressureLUT()
|
||||
@@ -922,8 +922,8 @@ class PressureCurveViewController: UIViewController, UIGestureRecognizerDelegate
|
||||
AlertControllerUtil.autoCompletion = true
|
||||
AlertControllerUtil.showAlert(
|
||||
in: self,
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: ""),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey:"Pressure curve saved"),
|
||||
title: LocalizationHelper.localizedString(forKey: ""),
|
||||
message: LocalizationHelper.localizedString(forKey:"Pressure curve saved"),
|
||||
withCancel: false,
|
||||
buttonTitle: "",
|
||||
countdown: 1,
|
||||
|
||||
@@ -6379,25 +6379,25 @@
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Before you start, please navigate to 'Settings Menu → Motion Control Section → Map Gyro to’ to confirm whether the gyroscope output is set to mouse or controller stick."
|
||||
"value" : "This is a gyro switch button\nBefore you start, please navigate to 'Settings Menu → Motion Control Section → Map Gyro to’ to confirm whether the gyroscope output is set to mouse or controller stick."
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "开始之前,请先前往 “设置菜单 → 体感控制分区 → 陀螺仪映射为” 选项确认陀螺仪输出为鼠标还是手柄摇杆。"
|
||||
"state" : "translated",
|
||||
"value" : "这是一个陀螺仪开关按键。\n开始之前,请先前往 “设置菜单 → 体感控制分区 → 陀螺仪映射为” 选项,确认陀螺仪输出为鼠标还是手柄摇杆。"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "開始之前,請先前往「設定選單 → 體感控制分區 → 陀螺儀映射為」選項,確認陀螺儀輸出為滑鼠還是手把搖桿。"
|
||||
"state" : "translated",
|
||||
"value" : "這是一個陀螺儀開關按鍵。\n開始之前,請先前往「設定選單 → 體感控制分區 → 陀螺儀映射為」選項,確認陀螺儀輸出為滑鼠還是手把搖桿。"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "開始之前,請先前往「設定選單 → 體感控制分區 → 陀螺儀映射為」選項,確認陀螺儀輸出為滑鼠還是手把搖桿。"
|
||||
"state" : "translated",
|
||||
"value" : "這是一個陀螺儀開關按鍵。\n開始之前,請先前往「設定選單 → 體感控制分區 → 陀螺儀映射為」選項,確認陀螺儀輸出為滑鼠還是手把搖桿。"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6805,19 +6805,19 @@
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"state" : "translated",
|
||||
"value" : "长按任意按键2秒后,可拖拽调整按键顺序、删除按键"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"state" : "translated",
|
||||
"value" : "長按任意按鍵2秒後,可拖曳調整按鍵順序、刪除按鍵"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"state" : "translated",
|
||||
"value" : "長按任意按鍵2秒後,可拖曳調整按鍵順序、刪除按鍵"
|
||||
}
|
||||
}
|
||||
@@ -7664,25 +7664,25 @@
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Single touch pans stream view; two-finger pinch zooms stream view. Double tap to reset."
|
||||
"value" : "Single touch pans stream view; two-finger pinch zooms stream view. Double tap to reset.\n\nMetal rendering does not support magnifier widget."
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "单指平移/竖移串流视图,双指捏合缩放串流视图。双击复原串流视图。"
|
||||
"value" : "单指平移/竖移串流视图,双指捏合缩放串流视图。双击复原串流视图。\n\n目前 Metal 渲染模式下无法使用放大镜控件"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "單指平移/豎移串流視圖,雙指捏合縮放串流視圖。雙擊復原串流視圖。"
|
||||
"value" : "單指平移/豎移串流視圖,雙指捏合縮放串流視圖。雙擊復原串流視圖。\n\n目前 Metal 渲染模式下無法使用放大鏡控制項。"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "單指平移/豎移串流視圖,雙指捏合縮放串流視圖。雙擊復原串流視圖。"
|
||||
"value" : "單指平移/豎移串流視圖,雙指捏合縮放串流視圖。雙擊復原串流視圖。\n\n目前 Metal 渲染模式下無法使用放大鏡控制項。"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11859,6 +11859,35 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"slideHoldFolderButtonTip" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "This is a “slide-hold” folder button. During streaming, double-tap and keep holding to drag and reposition it."
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "这是一个“滑动时保持按下”的 folder 控件夹按键。 在串流过程中双击并保持长按,可拖动改变其位置。"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "這是一個「滑動時保持按下」的 Folder 控制項夾按鍵。在串流過程中雙擊並保持長按,可拖曳改變其位置。"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "這是一個「滑動時保持按下」的 Folder 控制項夾按鍵。在串流過程中雙擊並保持長按,可拖曳改變其位置。"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"slideToSettingsDistanceStackTip" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
@@ -12298,6 +12327,64 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"stickWheelLink" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "https://voidlink.yuque.com/org-wiki-voidlink-znirha/fa3tgr/pw0ok5cls8piwham"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "https://voidlink.yuque.com/org-wiki-voidlink-znirha/fa3tgr/rgbk4c7nzzf044eb"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "https://voidlink.yuque.com/org-wiki-voidlink-znirha/fa3tgr/rgbk4c7nzzf044eb"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "https://voidlink.yuque.com/org-wiki-voidlink-znirha/fa3tgr/rgbk4c7nzzf044eb"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"stickWheelTip" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "This is a left stick direction wheel. It is recommended to check the tutorial before use."
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "这是一个左摇杆方向轮。建议在使用先前查看教程。"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "這是一個左搖桿方向輪。建議在使用前先查看教學。"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "這是一個左搖桿方向輪。建議在使用前先查看教學。"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Stroke start equalization depth: " : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
@@ -13346,6 +13433,64 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"velocityBasedTouchpadLink" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "https://voidlink.yuque.com/org-wiki-voidlink-znirha/fa3tgr/zw100ykch1ut4i1m"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "https://voidlink.yuque.com/org-wiki-voidlink-znirha/fa3tgr/ot4v6dgc6s1g23os"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "https://voidlink.yuque.com/org-wiki-voidlink-znirha/fa3tgr/ot4v6dgc6s1g23os"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "https://voidlink.yuque.com/org-wiki-voidlink-znirha/fa3tgr/ot4v6dgc6s1g23os"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"velocityBasedTouchpadTip" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "This is a velocity based, transparent right stick touchpad (RsvPad). Please increase the in-game right stick sensitivity first, then adjust the RsvPad sensitivity itself."
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "这是一个透明的速度矢量型右摇杆触控板(RsvPad)。请先将游戏内的右摇杆灵敏度调大,再调整RsvPad自身灵敏度。"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "這是一個透明的速度向量型右搖桿觸控板(RsvPad)。請先將遊戲內的右搖桿靈敏度調高,再調整 RsvPad 自身的靈敏度。"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "這是一個透明的速度向量型右搖桿觸控板(RsvPad)。請先將遊戲內的右搖桿靈敏度調高,再調整 RsvPad 自身的靈敏度。"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Version %@" : {
|
||||
|
||||
},
|
||||
|
||||
+2
-5
@@ -1,15 +1,12 @@
|
||||
//
|
||||
// SwiftLocalizationHelper.swift
|
||||
// LocalizationHelper.swift
|
||||
// VoidLink
|
||||
//
|
||||
// Created by True砖家 on 2024/7/23.
|
||||
// Copyright © True砖家 on Bilibili. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class SwiftLocalizationHelper {
|
||||
|
||||
extension LocalizationHelper {
|
||||
static func localizedString(forKey key: String, _ args: CVarArg...) -> String {
|
||||
let format = NSLocalizedString(key, tableName: "Localizable", bundle: .main, value: "", comment: "")
|
||||
return String(format: format, arguments: args)
|
||||
@@ -266,7 +266,7 @@ static UIImage* noImage;
|
||||
return;
|
||||
}
|
||||
|
||||
NSLog(@"appview update loop %f", CACurrentMediaTime());
|
||||
// NSLog(@"appview update loop %f", CACurrentMediaTime());
|
||||
|
||||
// Update the app image if neccessary
|
||||
if ((_appOverlay != nil && ![_app.id isEqualToString:_app.host.currentGame]) ||
|
||||
|
||||
@@ -32,7 +32,7 @@ import UIKit
|
||||
return true
|
||||
}
|
||||
|
||||
@objc static func handleKeyboardOrMouseConnectionTip(in vc: UIViewController) {
|
||||
@objc static func handleKeyboardOrMouseConnectionTip(in vc: UIViewController?) {
|
||||
if isRunningOnMacAsiPadApp {
|
||||
return
|
||||
}
|
||||
@@ -43,10 +43,10 @@ import UIKit
|
||||
else if isFirstHardwareKeyboardOrMouseConnection() {
|
||||
AlertControllerUtil.showAlert(
|
||||
in: vc,
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Keyboard/Mouse Connected"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey:"keyboard&MouseStreamingTip"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Keyboard/Mouse Connected"),
|
||||
message: LocalizationHelper.localizedString(forKey:"keyboard&MouseStreamingTip"),
|
||||
withCancel: false,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "This tip won't be shown again"),
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "This tip won't be shown again"),
|
||||
countdown: 11,
|
||||
completion: {})
|
||||
}
|
||||
@@ -125,7 +125,10 @@ import UIKit
|
||||
return false
|
||||
}
|
||||
|
||||
@objc static var hasTappedMagnifier = false
|
||||
@objc static func isFirstTappingMagnifier() -> Bool {
|
||||
guard !hasTappedMagnifier else { return false }
|
||||
hasTappedMagnifier = true
|
||||
let key = "hasTappedMagnifier2"
|
||||
let defaults = UserDefaults.standard
|
||||
let launchedBefore = defaults.bool(forKey: key)
|
||||
@@ -135,8 +138,81 @@ import UIKit
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@objc static func handleMagnifierTip(in vc: UIViewController?) {
|
||||
if isFirstTappingMagnifier() {
|
||||
AlertControllerUtil.showAlert(
|
||||
in: vc,
|
||||
title: LocalizationHelper.localizedString(forKey: "Magnifier"),
|
||||
message: "\n\(LocalizationHelper.localizedString(forKey: "magnifierTip"))\n\n\(LocalizationHelper.localizedString(forKey: "magnifierPersistTip"))",
|
||||
withCancel: false,
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
countdown: 5,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@objc static var hasTappedVelocityBasedTouchpad = false
|
||||
@objc static func isFirstTappingVelocityBasedTouchpad() -> Bool {
|
||||
guard !hasTappedVelocityBasedTouchpad else { return false }
|
||||
hasTappedVelocityBasedTouchpad = true
|
||||
let key = "hasTappedVelocityBasedTouchpad6"
|
||||
let defaults = UserDefaults.standard
|
||||
let launchedBefore = defaults.bool(forKey: key)
|
||||
if !launchedBefore {
|
||||
defaults.set(true, forKey: key)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
@objc static func handleVelocityBasedTouchpadTip(in vc: UIViewController?) {
|
||||
if isFirstTappingVelocityBasedTouchpad() {
|
||||
AlertControllerUtil.cancelButtonString = LocalizationHelper.localizedString(forKey: "Detailed Tutorial")
|
||||
AlertControllerUtil.showAlert(
|
||||
in: vc,
|
||||
title: LocalizationHelper.localizedString(forKey: "Tips"),
|
||||
message: "\n\(LocalizationHelper.localizedString(forKey: "velocityBasedTouchpadTip"))",
|
||||
withCancel: true,
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
countdown: 5,
|
||||
completion: {
|
||||
if AlertControllerUtil.actionCancelled {
|
||||
GenericUtils.openUrl(LocalizationHelper.localizedString(forKey: "velocityBasedTouchpadLink"))
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@objc static var hasTappedSlideAndHoldFolderButton = false
|
||||
@objc static func isFirstTappingSlideAndHoldFolderButton() -> Bool {
|
||||
guard !hasTappedSlideAndHoldFolderButton else { return false }
|
||||
hasTappedSlideAndHoldFolderButton = true
|
||||
let key = "hasTappedSlideAndHoldFolderButton2"
|
||||
let defaults = UserDefaults.standard
|
||||
let launchedBefore = defaults.bool(forKey: key)
|
||||
if !launchedBefore {
|
||||
defaults.set(true, forKey: key)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
@objc static func handleSlideAndHoldFolderButtonTip(in vc: UIViewController?) {
|
||||
if isFirstTappingSlideAndHoldFolderButton() {
|
||||
AlertControllerUtil.showAlert(
|
||||
in: vc,
|
||||
title: LocalizationHelper.localizedString(forKey: "Tips"),
|
||||
message: "\n\(LocalizationHelper.localizedString(forKey: "slideHoldFolderButtonTip"))",
|
||||
withCancel: false,
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
countdown: 5,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@objc static var hasTappedOnscreenGyroButton = false
|
||||
@objc static func isFirstTappingOnscreenGyroButton() -> Bool {
|
||||
guard !hasTappedOnscreenGyroButton else { return false }
|
||||
hasTappedOnscreenGyroButton = true
|
||||
let key = "hasTappedOnscreenGyroButton"
|
||||
let defaults = UserDefaults.standard
|
||||
let launchedBefore = defaults.bool(forKey: key)
|
||||
@@ -146,6 +222,56 @@ import UIKit
|
||||
}
|
||||
return false
|
||||
}
|
||||
@objc static func handleGyroButtonTip(in vc: UIViewController?) {
|
||||
if isFirstTappingOnscreenGyroButton() {
|
||||
AlertControllerUtil.cancelButtonString = LocalizationHelper.localizedString(forKey: "Detailed Tutorial")
|
||||
AlertControllerUtil.showAlert(
|
||||
in: vc,
|
||||
title: LocalizationHelper.localizedString(forKey: "Tips"),
|
||||
message: "\n\(LocalizationHelper.localizedString(forKey: "gyroButtonTip"))",
|
||||
withCancel: true,
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
countdown: 5,
|
||||
completion: {
|
||||
if AlertControllerUtil.actionCancelled {
|
||||
GenericUtils.openUrl(LocalizationHelper.localizedString(forKey: "yourMotionControlSoution"))
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@objc static var hasTappedStickWheel = false
|
||||
@objc static func isFirstTappingStickWheel() -> Bool {
|
||||
guard !hasTappedStickWheel else { return false }
|
||||
hasTappedStickWheel = true
|
||||
let key = "hasTappedStickWheel"
|
||||
let defaults = UserDefaults.standard
|
||||
let launchedBefore = defaults.bool(forKey: key)
|
||||
if !launchedBefore {
|
||||
defaults.set(true, forKey: key)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
@objc static func handleStickWheelTip(in vc: UIViewController?) {
|
||||
if isFirstTappingStickWheel() {
|
||||
AlertControllerUtil.cancelButtonString = LocalizationHelper.localizedString(forKey: "Detailed Tutorial")
|
||||
AlertControllerUtil.showAlert(
|
||||
in: vc,
|
||||
title: LocalizationHelper.localizedString(forKey: "Tips"),
|
||||
message: "\n\(LocalizationHelper.localizedString(forKey: "stickWheelTip"))",
|
||||
withCancel: true,
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
countdown: 5,
|
||||
completion: {
|
||||
if AlertControllerUtil.actionCancelled {
|
||||
GenericUtils.openUrl(LocalizationHelper.localizedString(forKey: "stickWheelLink"))
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@objc static func isFirstTappingInputAccessoryBar() -> Bool {
|
||||
let key = "isFirstTappingInputAccessoryBar"
|
||||
@@ -172,15 +298,15 @@ import UIKit
|
||||
|
||||
|
||||
@objc static func gamepadOverlayFeatureTipTitle() -> String {
|
||||
SwiftLocalizationHelper.localizedString(forKey: "Gamepad Overlay")
|
||||
LocalizationHelper.localizedString(forKey: "Gamepad Overlay")
|
||||
}
|
||||
|
||||
@objc static func gamepadOverlayFeatureTipMessage() -> String {
|
||||
SwiftLocalizationHelper.localizedString(forKey: "gamepadOverlayFeatureTip")
|
||||
LocalizationHelper.localizedString(forKey: "gamepadOverlayFeatureTip")
|
||||
}
|
||||
|
||||
@objc static func gamepadOverlayFeatureTipButtonTitle() -> String {
|
||||
SwiftLocalizationHelper.localizedString(forKey: "Got it!")
|
||||
LocalizationHelper.localizedString(forKey: "Got it!")
|
||||
}
|
||||
|
||||
@objc static func isIPhone() -> Bool {
|
||||
|
||||
@@ -57,7 +57,7 @@ import StoreKit
|
||||
func productName() -> String {
|
||||
switch self {
|
||||
case .PencilProPack:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Drawing Toolkit")
|
||||
return LocalizationHelper.localizedString(forKey: "Drawing Toolkit")
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
@@ -66,7 +66,7 @@ import StoreKit
|
||||
func productURL() -> String {
|
||||
switch self {
|
||||
case .PencilProPack:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "PencilProPackURL")
|
||||
return LocalizationHelper.localizedString(forKey: "PencilProPackURL")
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
@@ -75,7 +75,7 @@ import StoreKit
|
||||
func productDescription() -> String {
|
||||
switch self {
|
||||
case .PencilProPack:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "PencilProPackDescription")
|
||||
return LocalizationHelper.localizedString(forKey: "PencilProPackDescription")
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
@@ -372,14 +372,14 @@ import StoreKit
|
||||
@objc static public func inAppPurchaseAction(viewController: UIViewController, product: AddOnProduct){
|
||||
|
||||
let alert = UIAlertController(title: product.productName(),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "No purchase found", product.productName()),
|
||||
message: LocalizationHelper.localizedString(forKey: "No purchase found", product.productName()),
|
||||
preferredStyle: .alert)
|
||||
|
||||
let unlockAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Purchase Now"), style: .default) { _ in
|
||||
let unlockAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Purchase Now"), style: .default) { _ in
|
||||
IAPManager.shared.purchase(product)
|
||||
}
|
||||
|
||||
let restoreAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Restore Purchase"), style: .default) { _ in
|
||||
let restoreAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Restore Purchase"), style: .default) { _ in
|
||||
if #available(iOS 13.0, *) {
|
||||
Task{
|
||||
do {
|
||||
@@ -398,7 +398,7 @@ import StoreKit
|
||||
}
|
||||
}
|
||||
|
||||
let learnMoreAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
let learnMoreAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
NotificationCenter.default.post(name: product.purchaseAbortedNotification(), object: PurchaseInterruption.learnMore, userInfo:["interruption": PurchaseInterruption.learnMore.rawValue])
|
||||
GenericUtils.openUrl(product.productURL())
|
||||
return
|
||||
|
||||
+3
-10
@@ -11,13 +11,6 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
private extension LocalizationHelper {
|
||||
static func localizedString(forKey key: String, _ args: CVarArg...) -> String {
|
||||
let format = NSLocalizedString(key, tableName: "Localizable", bundle: .main, value: "", comment: "")
|
||||
return String(format: format, arguments: args)
|
||||
}
|
||||
}
|
||||
|
||||
@objcMembers
|
||||
final class LayoutOnScreenControlsViewController: UIViewController, OnScreenWidgetView.OnScreenWidgetLayoutUpdateDelegate, UITextFieldDelegate {
|
||||
private enum AlphaSliderMode: Int {
|
||||
@@ -549,7 +542,7 @@ final class LayoutOnScreenControlsViewController: UIViewController, OnScreenWidg
|
||||
}
|
||||
|
||||
@IBAction func importFromOtherButtonTapped(_ sender: Any?) {
|
||||
// importFromOtherButton.setTitle(SwiftLocalizationHelper.localizedString(forKey: "Import"), for: .normal)
|
||||
// importFromOtherButton.setTitle(LocalizationHelper.localizedString(forKey: "Import"), for: .normal)
|
||||
presentProfilesTableView(with: .pickProfileData) { [weak self] profile in
|
||||
if profile.name == self?.profilesManager.getSelectedProfile().name {return}
|
||||
self?.loadWidgets(from: profile, to: self?.selectedWidgetView)
|
||||
@@ -1034,7 +1027,7 @@ final class LayoutOnScreenControlsViewController: UIViewController, OnScreenWidg
|
||||
title: LocalizationHelper.localizedString(forKey: "Folder Button"),
|
||||
message: LocalizationHelper.localizedString(forKey: "folderTutorialTip"),
|
||||
withCancel: true,
|
||||
buttonTitle: SwiftLocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
buttonTitle: LocalizationHelper.localizedString(forKey: "Got it!"),
|
||||
countdown: 5,
|
||||
completion: {
|
||||
if AlertControllerUtil.actionCancelled {
|
||||
@@ -1897,7 +1890,7 @@ final class LayoutOnScreenControlsViewController: UIViewController, OnScreenWidg
|
||||
}
|
||||
|
||||
private func applyTitle(_ title:String, for button: UIButton, state: UIControl.State = .normal) {
|
||||
let title = SwiftLocalizationHelper.localizedString(forKey: title)
|
||||
let title = LocalizationHelper.localizedString(forKey: title)
|
||||
let attr: [NSAttributedString.Key: Any] = [
|
||||
.foregroundColor: UIColor(red: 115/255.0, green: 224/255.0, blue: 251/255.0, alpha: 1.0),
|
||||
.font: UIFont.systemFont(ofSize: 11, weight: .medium)
|
||||
|
||||
+21
-21
@@ -182,32 +182,32 @@ final class OSCProfilesTableViewController: UIViewController, UITableViewDelegat
|
||||
|
||||
@IBAction func duplicateTapped(_ sender: Any?) {
|
||||
let inputAlert = UIAlertController(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Enter the name you want to save this profile as"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Enter the name you want to save this profile as"),
|
||||
message: "",
|
||||
preferredStyle: .alert
|
||||
)
|
||||
inputAlert.addTextField { textField in
|
||||
textField.placeholder = SwiftLocalizationHelper.localizedString(forKey: "name")
|
||||
textField.placeholder = LocalizationHelper.localizedString(forKey: "name")
|
||||
if #available(iOS 13.0, *) {
|
||||
// textField.textColor = .label
|
||||
}
|
||||
textField.clearButtonMode = .whileEditing
|
||||
textField.borderStyle = .none
|
||||
}
|
||||
inputAlert.addAction(UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Cancel"), style: .default) { _ in
|
||||
inputAlert.addAction(UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Cancel"), style: .default) { _ in
|
||||
inputAlert.dismiss(animated: false)
|
||||
})
|
||||
inputAlert.addAction(UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Save"), style: .default) { [weak self] _ in
|
||||
inputAlert.addAction(UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Save"), style: .default) { [weak self] _ in
|
||||
guard let self else { return }
|
||||
let enteredProfileName = inputAlert.textFields?.first?.text ?? ""
|
||||
|
||||
if enteredProfileName == "Default" {
|
||||
let alert = UIAlertController(
|
||||
title: "",
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "Saving over the 'Default' profile is not allowed"),
|
||||
message: LocalizationHelper.localizedString(forKey: "Saving over the 'Default' profile is not allowed"),
|
||||
preferredStyle: .alert
|
||||
)
|
||||
alert.addAction(UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Ok"), style: .default) { _ in
|
||||
alert.addAction(UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Ok"), style: .default) { _ in
|
||||
alert.dismiss(animated: false) {
|
||||
self.present(inputAlert, animated: true)
|
||||
}
|
||||
@@ -216,10 +216,10 @@ final class OSCProfilesTableViewController: UIViewController, UITableViewDelegat
|
||||
} else if enteredProfileName.isEmpty {
|
||||
let alert = UIAlertController(
|
||||
title: "",
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "Profile name cannot be blank!"),
|
||||
message: LocalizationHelper.localizedString(forKey: "Profile name cannot be blank!"),
|
||||
preferredStyle: .alert
|
||||
)
|
||||
alert.addAction(UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Ok"), style: .default) { _ in
|
||||
alert.addAction(UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Ok"), style: .default) { _ in
|
||||
alert.dismiss(animated: false) {
|
||||
self.present(inputAlert, animated: true)
|
||||
}
|
||||
@@ -228,19 +228,19 @@ final class OSCProfilesTableViewController: UIViewController, UITableViewDelegat
|
||||
} else if self.profilesManager.profileNameAlreadyExist(enteredProfileName) {
|
||||
let alert = UIAlertController(
|
||||
title: "",
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "Profile name already exists"),
|
||||
message: LocalizationHelper.localizedString(forKey: "Profile name already exists"),
|
||||
preferredStyle: .alert
|
||||
)
|
||||
alert.addAction(UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Ok"), style: .default))
|
||||
alert.addAction(UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Ok"), style: .default))
|
||||
self.present(alert, animated: true)
|
||||
} else {
|
||||
self.profilesManager.duplicateSelectedProfile(withName: enteredProfileName)
|
||||
let alert = UIAlertController(
|
||||
title: "",
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "Profile %@ duplicated from current layout", enteredProfileName),
|
||||
message: LocalizationHelper.localizedString(forKey: "Profile %@ duplicated from current layout", enteredProfileName),
|
||||
preferredStyle: .alert
|
||||
)
|
||||
alert.addAction(UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Ok"), style: .default) { _ in
|
||||
alert.addAction(UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Ok"), style: .default) { _ in
|
||||
alert.dismiss(animated: false)
|
||||
self.profileViewRefresh()
|
||||
})
|
||||
@@ -336,16 +336,16 @@ final class OSCProfilesTableViewController: UIViewController, UITableViewDelegat
|
||||
let profilesEncoded = try NSKeyedUnarchiver.unarchivedObject(ofClasses: classes, from: fileData) as? NSMutableArray
|
||||
|
||||
let restoredAlert = UIAlertController(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: ""),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "Pofiles imported"),
|
||||
title: LocalizationHelper.localizedString(forKey: ""),
|
||||
message: LocalizationHelper.localizedString(forKey: "Pofiles imported"),
|
||||
preferredStyle: .alert
|
||||
)
|
||||
let failedAlert = UIAlertController(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: ""),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "Failed to import profiles"),
|
||||
title: LocalizationHelper.localizedString(forKey: ""),
|
||||
message: LocalizationHelper.localizedString(forKey: "Failed to import profiles"),
|
||||
preferredStyle: .alert
|
||||
)
|
||||
let okAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "OK"), style: .default)
|
||||
let okAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "OK"), style: .default)
|
||||
|
||||
if restoreFailed || profilesEncoded == nil {
|
||||
failedAlert.addAction(okAction)
|
||||
@@ -361,11 +361,11 @@ final class OSCProfilesTableViewController: UIViewController, UITableViewDelegat
|
||||
} catch {
|
||||
restoreFailed = true
|
||||
let failedAlert = UIAlertController(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: ""),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "Failed to import profiles"),
|
||||
title: LocalizationHelper.localizedString(forKey: ""),
|
||||
message: LocalizationHelper.localizedString(forKey: "Failed to import profiles"),
|
||||
preferredStyle: .alert
|
||||
)
|
||||
failedAlert.addAction(UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "OK"), style: .default))
|
||||
failedAlert.addAction(UIAlertAction(title: LocalizationHelper.localizedString(forKey: "OK"), style: .default))
|
||||
present(failedAlert, animated: true)
|
||||
profileViewRefresh()
|
||||
NSLog("解码失败: \(error)")
|
||||
@@ -425,7 +425,7 @@ final class OSCProfilesTableViewController: UIViewController, UITableViewDelegat
|
||||
|
||||
if let profile = profiles.object(at: indexPath.row) as? OSCProfile, profile.name == "Default" {
|
||||
let alert = UIAlertController(title: "", message: "Deleting the 'Default' profile is not allowed", preferredStyle: .alert)
|
||||
alert.addAction(UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Ok"), style: .default) { _ in
|
||||
alert.addAction(UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Ok"), style: .default) { _ in
|
||||
alert.dismiss(animated: false)
|
||||
})
|
||||
present(alert, animated: true)
|
||||
|
||||
@@ -1661,7 +1661,6 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
showOnlineDocAction = true;
|
||||
onlineDocLink = [LocalizationHelper localizedStringForKey:@"yourMotionControlSoution"];
|
||||
}
|
||||
|
||||
|
||||
if([sender.superview.accessibilityIdentifier isEqualToString: @"renderingBackendStack"]){
|
||||
tipText = [LocalizationHelper localizedStringForKey:@"renderingBackendStackTip"];
|
||||
|
||||
@@ -34,12 +34,12 @@ import UIKit
|
||||
|
||||
@objc public var specialEntries : NSMutableArray = ["widgetSwitchTool", "widgetLayoutTool", "bringUpSoftKeyboard", "enterPip", "toggleStatsOverlay", "disconnectAndQuitApp"]
|
||||
private let specialEntryAliasDic : [String:String] = [
|
||||
"widgetSwitchTool":SwiftLocalizationHelper.localizedString(forKey: "[ Switch game profile ]"),
|
||||
"widgetLayoutTool":SwiftLocalizationHelper.localizedString(forKey: "[ Edit on-screen widget layout ]"),
|
||||
"bringUpSoftKeyboard":SwiftLocalizationHelper.localizedString(forKey: "[ Bring up soft keyboard ]"),
|
||||
"enterPip":SwiftLocalizationHelper.localizedString(forKey: "[ Enter picture-in-picture mode ]"),
|
||||
"toggleStatsOverlay":SwiftLocalizationHelper.localizedString(forKey: "[ Toggle stats overlay ]"),
|
||||
"disconnectAndQuitApp":SwiftLocalizationHelper.localizedString(forKey: "[ Disconnect & quit app ]")
|
||||
"widgetSwitchTool":LocalizationHelper.localizedString(forKey: "[ Switch game profile ]"),
|
||||
"widgetLayoutTool":LocalizationHelper.localizedString(forKey: "[ Edit on-screen widget layout ]"),
|
||||
"bringUpSoftKeyboard":LocalizationHelper.localizedString(forKey: "[ Bring up soft keyboard ]"),
|
||||
"enterPip":LocalizationHelper.localizedString(forKey: "[ Enter picture-in-picture mode ]"),
|
||||
"toggleStatsOverlay":LocalizationHelper.localizedString(forKey: "[ Toggle stats overlay ]"),
|
||||
"disconnectAndQuitApp":LocalizationHelper.localizedString(forKey: "[ Disconnect & quit app ]")
|
||||
]
|
||||
|
||||
private var viewPinned: Bool = false
|
||||
@@ -104,7 +104,7 @@ import UIKit
|
||||
contentView.layer.masksToBounds = true
|
||||
|
||||
// Set up the title label
|
||||
titleLabel.text = SwiftLocalizationHelper.localizedString(forKey: "Toolbox")
|
||||
titleLabel.text = LocalizationHelper.localizedString(forKey: "Toolbox")
|
||||
titleLabel.font = UIFont.boldSystemFont(ofSize: 20) // Adjust font size as needed
|
||||
titleLabel.textColor = UIColor.white // Adjust color as needed
|
||||
titleLabel.textAlignment = .center
|
||||
@@ -124,10 +124,10 @@ import UIKit
|
||||
|
||||
tableView.separatorInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
|
||||
// Configure buttons
|
||||
addButton.setTitle(SwiftLocalizationHelper.localizedString(forKey: "Add"), for: .normal)
|
||||
deleteButton.setTitle(SwiftLocalizationHelper.localizedString(forKey: "Delete"), for: .normal)
|
||||
editButton.setTitle(SwiftLocalizationHelper.localizedString(forKey: "Edit"), for: .normal)
|
||||
exitButton.setTitle(SwiftLocalizationHelper.localizedString(forKey: "Exit"), for: .normal)
|
||||
addButton.setTitle(LocalizationHelper.localizedString(forKey: "Add"), for: .normal)
|
||||
deleteButton.setTitle(LocalizationHelper.localizedString(forKey: "Delete"), for: .normal)
|
||||
editButton.setTitle(LocalizationHelper.localizedString(forKey: "Edit"), for: .normal)
|
||||
exitButton.setTitle(LocalizationHelper.localizedString(forKey: "Exit"), for: .normal)
|
||||
pinButton.setTitle("📌", for: .normal)
|
||||
addButton.titleLabel?.font = UIFont.systemFont(ofSize: 20) // Adjust the size as needed
|
||||
deleteButton.titleLabel?.font = UIFont.systemFont(ofSize: 20)
|
||||
@@ -244,8 +244,8 @@ import UIKit
|
||||
private func updateEditingMode() {
|
||||
addButton.isEnabled = isEditingMode
|
||||
deleteButton.isEnabled = isEditingMode
|
||||
if(isEditingMode){ editButton.setTitle(SwiftLocalizationHelper.localizedString(forKey: "Done"), for: .normal) }
|
||||
else{ editButton.setTitle(SwiftLocalizationHelper.localizedString(forKey: "Edit"), for: .normal) }
|
||||
if(isEditingMode){ editButton.setTitle(LocalizationHelper.localizedString(forKey: "Done"), for: .normal) }
|
||||
else{ editButton.setTitle(LocalizationHelper.localizedString(forKey: "Edit"), for: .normal) }
|
||||
}
|
||||
|
||||
@objc private func pinButtonTapped() {
|
||||
@@ -298,9 +298,9 @@ import UIKit
|
||||
return
|
||||
}
|
||||
else{
|
||||
let alert = UIAlertController(title: SwiftLocalizationHelper.localizedString(forKey: "New Command"), message: SwiftLocalizationHelper.localizedString(forKey: "Enter a new command and alias"), preferredStyle: .alert)
|
||||
alert.addTextField { $0.placeholder = SwiftLocalizationHelper.localizedString(forKey:"Command") }
|
||||
alert.addTextField { $0.placeholder = SwiftLocalizationHelper.localizedString(forKey: "Alias (optional)") }
|
||||
let alert = UIAlertController(title: LocalizationHelper.localizedString(forKey: "New Command"), message: LocalizationHelper.localizedString(forKey: "Enter a new command and alias"), preferredStyle: .alert)
|
||||
alert.addTextField { $0.placeholder = LocalizationHelper.localizedString(forKey:"Command") }
|
||||
alert.addTextField { $0.placeholder = LocalizationHelper.localizedString(forKey: "Alias (optional)") }
|
||||
alert.textFields?[0].keyboardType = .asciiCapable
|
||||
alert.textFields?[0].autocorrectionType = .no
|
||||
alert.textFields?[0].spellCheckingType = .no
|
||||
@@ -308,11 +308,11 @@ import UIKit
|
||||
alert.textFields?[1].autocorrectionType = .no
|
||||
alert.textFields?[1].spellCheckingType = .no
|
||||
|
||||
let submitAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Add"), style: .default) { [unowned alert] _ in
|
||||
let submitAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey: "Add"), style: .default) { [unowned alert] _ in
|
||||
self.createEntry(cmdString: alert.textFields?[0].text ?? "", alias: alert.textFields?[1].text)
|
||||
}
|
||||
|
||||
let cancelAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey:"Cancel"), style: .cancel)
|
||||
let cancelAction = UIAlertAction(title: LocalizationHelper.localizedString(forKey:"Cancel"), style: .cancel)
|
||||
alert.addAction(submitAction)
|
||||
alert.addAction(cancelAction)
|
||||
|
||||
|
||||
@@ -125,34 +125,34 @@ enum GamepadWidget: Hashable {
|
||||
|
||||
var description: String {
|
||||
switch self {
|
||||
case .a: return SwiftLocalizationHelper.localizedString(forKey: "Gamepad A")
|
||||
case .b: return SwiftLocalizationHelper.localizedString(forKey: "Gamepad B")
|
||||
case .x: return SwiftLocalizationHelper.localizedString(forKey: "Gamepad X")
|
||||
case .y: return SwiftLocalizationHelper.localizedString(forKey: "Gamepad Y")
|
||||
case .select: return SwiftLocalizationHelper.localizedString(forKey: "Select")
|
||||
case .start: return SwiftLocalizationHelper.localizedString(forKey: "Start")
|
||||
case .home: return SwiftLocalizationHelper.localizedString(forKey: "Gamepad Home")
|
||||
case .dPad: return SwiftLocalizationHelper.localizedString(forKey: "Dpad")
|
||||
case .up: return SwiftLocalizationHelper.localizedString(forKey: "Gamepad Up")
|
||||
case .down: return SwiftLocalizationHelper.localizedString(forKey: "Gamepad Down")
|
||||
case .left: return SwiftLocalizationHelper.localizedString(forKey: "Gamepad Left")
|
||||
case .right: return SwiftLocalizationHelper.localizedString(forKey: "Gamepad Right")
|
||||
case .ls: return SwiftLocalizationHelper.localizedString(forKey: "LS/L3 button")
|
||||
case .lswheel: return SwiftLocalizationHelper.localizedString(forKey: "Left stick wheel")
|
||||
case .lsPad: return SwiftLocalizationHelper.localizedString(forKey: "Displacement-based left stick pad")
|
||||
case .lsvPad: return SwiftLocalizationHelper.localizedString(forKey: "Velocity-based left stick pad")
|
||||
case .rs: return SwiftLocalizationHelper.localizedString(forKey: "RS/R3 button")
|
||||
case .rsPad: return SwiftLocalizationHelper.localizedString(forKey: "Displacement-based right stick pad")
|
||||
case .rsvPad: return SwiftLocalizationHelper.localizedString(forKey: "Velocity-based right stick pad")
|
||||
case .rsWheel: return SwiftLocalizationHelper.localizedString(forKey: "Right stick wheel")
|
||||
case .leftShoulder: return SwiftLocalizationHelper.localizedString(forKey: "LB/L1")
|
||||
case .rightShoulder: return SwiftLocalizationHelper.localizedString(forKey: "RB/R1")
|
||||
case .leftTrigger: return SwiftLocalizationHelper.localizedString(forKey: "LT/L2 button")
|
||||
case .ltPad: return SwiftLocalizationHelper.localizedString(forKey: "Left trigger pad")
|
||||
case .rightTrigger: return SwiftLocalizationHelper.localizedString(forKey: "RT/R2 button")
|
||||
case .rtPad: return SwiftLocalizationHelper.localizedString(forKey: "Right trigger pad")
|
||||
case .ds4Touchpad: return SwiftLocalizationHelper.localizedString(forKey: "DS4 touchpad")
|
||||
case .ds4TouchpadButton: return SwiftLocalizationHelper.localizedString(forKey: "DS4 touchpad button")
|
||||
case .a: return LocalizationHelper.localizedString(forKey: "Gamepad A")
|
||||
case .b: return LocalizationHelper.localizedString(forKey: "Gamepad B")
|
||||
case .x: return LocalizationHelper.localizedString(forKey: "Gamepad X")
|
||||
case .y: return LocalizationHelper.localizedString(forKey: "Gamepad Y")
|
||||
case .select: return LocalizationHelper.localizedString(forKey: "Select")
|
||||
case .start: return LocalizationHelper.localizedString(forKey: "Start")
|
||||
case .home: return LocalizationHelper.localizedString(forKey: "Gamepad Home")
|
||||
case .dPad: return LocalizationHelper.localizedString(forKey: "Dpad")
|
||||
case .up: return LocalizationHelper.localizedString(forKey: "Gamepad Up")
|
||||
case .down: return LocalizationHelper.localizedString(forKey: "Gamepad Down")
|
||||
case .left: return LocalizationHelper.localizedString(forKey: "Gamepad Left")
|
||||
case .right: return LocalizationHelper.localizedString(forKey: "Gamepad Right")
|
||||
case .ls: return LocalizationHelper.localizedString(forKey: "LS/L3 button")
|
||||
case .lswheel: return LocalizationHelper.localizedString(forKey: "Left stick wheel")
|
||||
case .lsPad: return LocalizationHelper.localizedString(forKey: "Displacement-based left stick pad")
|
||||
case .lsvPad: return LocalizationHelper.localizedString(forKey: "Velocity-based left stick pad")
|
||||
case .rs: return LocalizationHelper.localizedString(forKey: "RS/R3 button")
|
||||
case .rsPad: return LocalizationHelper.localizedString(forKey: "Displacement-based right stick pad")
|
||||
case .rsvPad: return LocalizationHelper.localizedString(forKey: "Velocity-based right stick pad")
|
||||
case .rsWheel: return LocalizationHelper.localizedString(forKey: "Right stick wheel")
|
||||
case .leftShoulder: return LocalizationHelper.localizedString(forKey: "LB/L1")
|
||||
case .rightShoulder: return LocalizationHelper.localizedString(forKey: "RB/R1")
|
||||
case .leftTrigger: return LocalizationHelper.localizedString(forKey: "LT/L2 button")
|
||||
case .ltPad: return LocalizationHelper.localizedString(forKey: "Left trigger pad")
|
||||
case .rightTrigger: return LocalizationHelper.localizedString(forKey: "RT/R2 button")
|
||||
case .rtPad: return LocalizationHelper.localizedString(forKey: "Right trigger pad")
|
||||
case .ds4Touchpad: return LocalizationHelper.localizedString(forKey: "DS4 touchpad")
|
||||
case .ds4TouchpadButton: return LocalizationHelper.localizedString(forKey: "DS4 touchpad button")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1304,7 +1304,7 @@ struct GamepadWidgetPickerOverlay: View {
|
||||
|
||||
VStack(spacing: 0) {
|
||||
VStack(spacing: cardSpacing) {
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Select Control"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Select Control"))
|
||||
.font(.system(size: titleFontSize, weight: .bold, design: .rounded))
|
||||
.foregroundColor(.white)
|
||||
|
||||
@@ -1346,7 +1346,7 @@ struct GamepadWidgetPickerOverlay: View {
|
||||
Button(action: {
|
||||
onCancel()
|
||||
}) {
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Cancel"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Cancel"))
|
||||
.font(.system(size: actionButtonFontSize, weight: .bold, design: .rounded))
|
||||
.foregroundColor(Color.white.opacity(0.9))
|
||||
.frame(maxWidth: .infinity)
|
||||
@@ -1365,7 +1365,7 @@ struct GamepadWidgetPickerOverlay: View {
|
||||
Button(action: {
|
||||
onReset()
|
||||
}) {
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Reset"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Reset"))
|
||||
.font(.system(size: actionButtonFontSize, weight: .bold, design: .rounded))
|
||||
.foregroundColor(Color.white.opacity(0.9))
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
@@ -461,7 +461,7 @@ struct VirtualKeyboardView: View {
|
||||
),
|
||||
KeyboardWidgetOption(
|
||||
command: "WASDPAD",
|
||||
description: SwiftLocalizationHelper.localizedString(forKey: "WASD direction pad"),
|
||||
description: LocalizationHelper.localizedString(forKey: "WASD direction pad"),
|
||||
highlightedLabels: ["W", "A", "S", "D"],
|
||||
family: .wasd,
|
||||
selectionState: .pad
|
||||
@@ -478,7 +478,7 @@ struct VirtualKeyboardView: View {
|
||||
),
|
||||
KeyboardWidgetOption(
|
||||
command: "ARROWPAD",
|
||||
description: SwiftLocalizationHelper.localizedString(forKey: "Arrow direction pad"),
|
||||
description: LocalizationHelper.localizedString(forKey: "Arrow direction pad"),
|
||||
highlightedLabels: ["↑", "↓", "←", "→"],
|
||||
family: .arrow,
|
||||
selectionState: .pad
|
||||
@@ -493,10 +493,10 @@ struct VirtualKeyboardView: View {
|
||||
return key.label
|
||||
case .arrow:
|
||||
switch key.label {
|
||||
case "↑": return SwiftLocalizationHelper.localizedString(forKey: "Up Arrow")
|
||||
case "↓": return SwiftLocalizationHelper.localizedString(forKey: "Down Arrow")
|
||||
case "←": return SwiftLocalizationHelper.localizedString(forKey: "Left Arrow")
|
||||
case "→": return SwiftLocalizationHelper.localizedString(forKey: "Right Arrow")
|
||||
case "↑": return LocalizationHelper.localizedString(forKey: "Up Arrow")
|
||||
case "↓": return LocalizationHelper.localizedString(forKey: "Down Arrow")
|
||||
case "←": return LocalizationHelper.localizedString(forKey: "Left Arrow")
|
||||
case "→": return LocalizationHelper.localizedString(forKey: "Right Arrow")
|
||||
default: return key.label
|
||||
}
|
||||
}
|
||||
@@ -801,8 +801,8 @@ struct VirtualKeyboardView: View {
|
||||
KeyView(
|
||||
key: Key(
|
||||
label: showsMouseWidgets
|
||||
? SwiftLocalizationHelper.localizedString(forKey: "Mouse Widgets")
|
||||
: SwiftLocalizationHelper.localizedString(forKey: "Numpad"),
|
||||
? LocalizationHelper.localizedString(forKey: "Mouse Widgets")
|
||||
: LocalizationHelper.localizedString(forKey: "Numpad"),
|
||||
width: unit * 2 + spacing,
|
||||
sfSymbolName: showsMouseWidgets
|
||||
? "computermouse.fill"
|
||||
@@ -820,8 +820,8 @@ struct VirtualKeyboardView: View {
|
||||
KeyView(
|
||||
key: Key(
|
||||
label: showsMouseWidgets
|
||||
? SwiftLocalizationHelper.localizedString(forKey: "numpad")
|
||||
: SwiftLocalizationHelper.localizedString(forKey: "mouse widgets"),
|
||||
? LocalizationHelper.localizedString(forKey: "numpad")
|
||||
: LocalizationHelper.localizedString(forKey: "mouse widgets"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "NULL",
|
||||
macCmdString: "NULL",
|
||||
@@ -908,7 +908,7 @@ struct VirtualKeyboardView: View {
|
||||
HStack(spacing: spacing) {
|
||||
KeyView(
|
||||
key: Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Left Button"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Left Button"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "MLEFT",
|
||||
macCmdString: "MLEFT",
|
||||
@@ -919,7 +919,7 @@ struct VirtualKeyboardView: View {
|
||||
keyboardType: keyboardType,
|
||||
mode: mode,
|
||||
highlightStyle: highlightStyle(for: Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Left Button"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Left Button"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "MLEFT",
|
||||
macCmdString: "MLEFT",
|
||||
@@ -928,7 +928,7 @@ struct VirtualKeyboardView: View {
|
||||
)),
|
||||
action: {
|
||||
handleKeyTap(Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Left Button"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Left Button"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "MLEFT",
|
||||
macCmdString: "MLEFT",
|
||||
@@ -940,7 +940,7 @@ struct VirtualKeyboardView: View {
|
||||
|
||||
KeyView(
|
||||
key: Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Right Button"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Right Button"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "MRIGHT",
|
||||
macCmdString: "MRIGHT",
|
||||
@@ -951,7 +951,7 @@ struct VirtualKeyboardView: View {
|
||||
keyboardType: keyboardType,
|
||||
mode: mode,
|
||||
highlightStyle: highlightStyle(for: Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Right Button"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Right Button"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "MRIGHT",
|
||||
macCmdString: "MRIGHT",
|
||||
@@ -960,7 +960,7 @@ struct VirtualKeyboardView: View {
|
||||
)),
|
||||
action: {
|
||||
handleKeyTap(Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Right Button"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Right Button"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "MRIGHT",
|
||||
macCmdString: "MRIGHT",
|
||||
@@ -974,7 +974,7 @@ struct VirtualKeyboardView: View {
|
||||
HStack(spacing: spacing) {
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Middle Button"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Middle Button"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "MMIDDLE",
|
||||
macCmdString: "MMIDDLE",
|
||||
@@ -985,7 +985,7 @@ struct VirtualKeyboardView: View {
|
||||
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "X1"),
|
||||
label: LocalizationHelper.localizedString(forKey: "X1"),
|
||||
width: unit,
|
||||
winCmdString: "MX1",
|
||||
macCmdString: "MX1",
|
||||
@@ -996,7 +996,7 @@ struct VirtualKeyboardView: View {
|
||||
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "X2"),
|
||||
label: LocalizationHelper.localizedString(forKey: "X2"),
|
||||
width: unit,
|
||||
winCmdString: "MX2",
|
||||
macCmdString: "MX2",
|
||||
@@ -1010,7 +1010,7 @@ struct VirtualKeyboardView: View {
|
||||
HStack(spacing: spacing) {
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Wheel\nUp"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Wheel\nUp"),
|
||||
width: unit,
|
||||
winCmdString: "WHEELDOWN",
|
||||
macCmdString: "WHEELDOWN",
|
||||
@@ -1021,7 +1021,7 @@ struct VirtualKeyboardView: View {
|
||||
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Wheel\nDown"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Wheel\nDown"),
|
||||
width: unit,
|
||||
winCmdString: "WHEELUP",
|
||||
macCmdString: "WHEELUP",
|
||||
@@ -1034,7 +1034,7 @@ struct VirtualKeyboardView: View {
|
||||
HStack(spacing: spacing) {
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Wheel\nUp"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Wheel\nUp"),
|
||||
width: unit,
|
||||
winCmdString: "WHEELDOWN",
|
||||
macCmdString: "WHEELDOWN",
|
||||
@@ -1045,7 +1045,7 @@ struct VirtualKeyboardView: View {
|
||||
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Wheel\nDown"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Wheel\nDown"),
|
||||
width: unit,
|
||||
winCmdString: "WHEELUP",
|
||||
macCmdString: "WHEELUP",
|
||||
@@ -1056,7 +1056,7 @@ struct VirtualKeyboardView: View {
|
||||
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "WheelPad"),
|
||||
label: LocalizationHelper.localizedString(forKey: "WheelPad"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "WHEEL",
|
||||
macCmdString: "WHEEL",
|
||||
@@ -1071,7 +1071,7 @@ struct VirtualKeyboardView: View {
|
||||
HStack(spacing: spacing) {
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "MousePad"),
|
||||
label: LocalizationHelper.localizedString(forKey: "MousePad"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "MOUSEPAD",
|
||||
macCmdString: "MOUSEPAD",
|
||||
@@ -1083,7 +1083,7 @@ struct VirtualKeyboardView: View {
|
||||
VStack(spacing: spacing) {
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Absolute MousePad"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Absolute MousePad"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "ABSMOUSEPAD",
|
||||
macCmdString: "ABSMOUSEPAD",
|
||||
@@ -1093,7 +1093,7 @@ struct VirtualKeyboardView: View {
|
||||
)
|
||||
keyboardKeyView(
|
||||
Key(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Trackball"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Trackball"),
|
||||
width: unit * 2 + spacing,
|
||||
winCmdString: "TRACKBALL",
|
||||
macCmdString: "TRACKBALL",
|
||||
@@ -1275,17 +1275,17 @@ struct VirtualKeyboardView: View {
|
||||
|
||||
private var mouseWidgetKeys: [Key] {
|
||||
var keys = [
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "Left Button"), width: unit * 2 + spacing, winCmdString: "MLEFT", macCmdString: "MLEFT", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "Right Button"), width: unit * 2 + spacing, winCmdString: "MRIGHT", macCmdString: "MRIGHT", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "Middle Button"), width: unit * 2 + spacing, winCmdString: "MMIDDLE", macCmdString: "MMIDDLE", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "X1"), width: unit, winCmdString: "MX1", macCmdString: "MX1", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "X2"), width: unit, winCmdString: "MX2", macCmdString: "MX2", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "Wheel\nUp"), width: unit, winCmdString: "WHEELDOWN", macCmdString: "WHEELDOWN", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "Wheel\nDown"), width: unit, winCmdString: "WHEELUP", macCmdString: "WHEELUP", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "WheelPad"), width: unit * 2 + spacing, winCmdString: "WHEEL", macCmdString: "WHEEL", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "MousePad"), width: unit * 2 + spacing, winCmdString: "MOUSEPAD", macCmdString: "MOUSEPAD", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "Absolute MousePad"), width: unit * 2 + spacing, winCmdString: "ABSMOUSEPAD", macCmdString: "ABSMOUSEPAD", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: SwiftLocalizationHelper.localizedString(forKey: "Trackball"), width: unit * 2 + spacing, winCmdString: "TRACKBALL", macCmdString: "TRACKBALL", winKeyCode: 0xFF, macKeyCode: 0xFF)
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "Left Button"), width: unit * 2 + spacing, winCmdString: "MLEFT", macCmdString: "MLEFT", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "Right Button"), width: unit * 2 + spacing, winCmdString: "MRIGHT", macCmdString: "MRIGHT", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "Middle Button"), width: unit * 2 + spacing, winCmdString: "MMIDDLE", macCmdString: "MMIDDLE", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "X1"), width: unit, winCmdString: "MX1", macCmdString: "MX1", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "X2"), width: unit, winCmdString: "MX2", macCmdString: "MX2", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "Wheel\nUp"), width: unit, winCmdString: "WHEELDOWN", macCmdString: "WHEELDOWN", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "Wheel\nDown"), width: unit, winCmdString: "WHEELUP", macCmdString: "WHEELUP", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "WheelPad"), width: unit * 2 + spacing, winCmdString: "WHEEL", macCmdString: "WHEEL", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "MousePad"), width: unit * 2 + spacing, winCmdString: "MOUSEPAD", macCmdString: "MOUSEPAD", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "Absolute MousePad"), width: unit * 2 + spacing, winCmdString: "ABSMOUSEPAD", macCmdString: "ABSMOUSEPAD", winKeyCode: 0xFF, macKeyCode: 0xFF),
|
||||
Key(label: LocalizationHelper.localizedString(forKey: "Trackball"), width: unit * 2 + spacing, winCmdString: "TRACKBALL", macCmdString: "TRACKBALL", winKeyCode: 0xFF, macKeyCode: 0xFF)
|
||||
]
|
||||
if mode == .shortcutPicker {
|
||||
keys.removeAll { key in
|
||||
@@ -1505,7 +1505,7 @@ struct KeyboardWidgetPickerOverlay: View {
|
||||
}
|
||||
|
||||
VStack(spacing: 14) {
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Select Control"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Select Control"))
|
||||
.font(.system(size: 18, weight: .bold, design: .rounded))
|
||||
.foregroundColor(.white)
|
||||
|
||||
@@ -1544,7 +1544,7 @@ struct KeyboardWidgetPickerOverlay: View {
|
||||
Button(action: {
|
||||
onCancel()
|
||||
}) {
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Cancel"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Cancel"))
|
||||
.font(.system(size: 15, weight: .bold, design: .rounded))
|
||||
.foregroundColor(Color.white.opacity(0.9))
|
||||
.frame(maxWidth: .infinity)
|
||||
@@ -1563,7 +1563,7 @@ struct KeyboardWidgetPickerOverlay: View {
|
||||
Button(action: {
|
||||
onReset()
|
||||
}) {
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Reset"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Reset"))
|
||||
.font(.system(size: 15, weight: .bold, design: .rounded))
|
||||
.foregroundColor(Color.white.opacity(0.9))
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
@@ -36,11 +36,11 @@ enum WidgetPickerTab: String, CaseIterable, Identifiable, Equatable {
|
||||
var title: String {
|
||||
switch self {
|
||||
case .gamepad:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Gamepad")
|
||||
return LocalizationHelper.localizedString(forKey: "Gamepad")
|
||||
case .keyboard:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Keyboard / Mouse")
|
||||
return LocalizationHelper.localizedString(forKey: "Keyboard / Mouse")
|
||||
case .functional:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Functional Widgets")
|
||||
return LocalizationHelper.localizedString(forKey: "Functional Widgets")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,18 +138,18 @@ private enum WidgetPickerSubmissionAction: String {
|
||||
var confirmationTitle: String {
|
||||
switch self {
|
||||
case .create:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Create New")
|
||||
return LocalizationHelper.localizedString(forKey: "Create New")
|
||||
case .modify:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Modify")
|
||||
return LocalizationHelper.localizedString(forKey: "Modify")
|
||||
}
|
||||
}
|
||||
|
||||
var poolActionTitle: String {
|
||||
switch self {
|
||||
case .create:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Create New")
|
||||
return LocalizationHelper.localizedString(forKey: "Create New")
|
||||
case .modify:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Modify")
|
||||
return LocalizationHelper.localizedString(forKey: "Modify")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,9 +164,9 @@ enum WidgetCreateComboMode: String, CaseIterable, Identifiable {
|
||||
var title: String {
|
||||
switch self {
|
||||
case .skill:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Skill combo")
|
||||
return LocalizationHelper.localizedString(forKey: "Skill combo")
|
||||
case .shortcut:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Shortcut combo")
|
||||
return LocalizationHelper.localizedString(forKey: "Shortcut combo")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,9 +181,9 @@ private enum ShortcutPickerButtonMode: String, CaseIterable, Identifiable {
|
||||
var title: String {
|
||||
switch self {
|
||||
case .normal:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Normal")
|
||||
return LocalizationHelper.localizedString(forKey: "Normal")
|
||||
case .tapToToggle:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Tap to toggle")
|
||||
return LocalizationHelper.localizedString(forKey: "Tap to toggle")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,9 +198,9 @@ private enum WidgetCreateShape: String, CaseIterable, Identifiable {
|
||||
var title: String {
|
||||
switch self {
|
||||
case .round:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Circle")
|
||||
return LocalizationHelper.localizedString(forKey: "Circle")
|
||||
case .square:
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Square")
|
||||
return LocalizationHelper.localizedString(forKey: "Square")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -473,15 +473,15 @@ struct WidgetPickerView: View {
|
||||
_tipMessage = SwiftUI.State(
|
||||
initialValue: (keyboardPickerMode == .shortcutPicker && !(shortcutPickerTipText ?? "").isEmpty)
|
||||
? (shortcutPickerTipText ?? "")
|
||||
: SwiftLocalizationHelper.localizedString(forKey: "Tap any control to add it")
|
||||
: LocalizationHelper.localizedString(forKey: "Tap any control to add it")
|
||||
)
|
||||
}
|
||||
|
||||
private let functionalButtonOptions: [FunctionalButtonOption] = [
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Settings"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Settings"),
|
||||
cmd: "SETTINGS",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Expands setting menu during streaming"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Expands setting menu during streaming"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -489,9 +489,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Disconnect"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Disconnect"),
|
||||
cmd: "DISCONNECT",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Disconnect current connection"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Disconnect current connection"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -499,9 +499,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Quit app"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Quit app"),
|
||||
cmd: "QUITAPP",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Disconnect and quit current app"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Disconnect and quit current app"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -509,9 +509,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Enter PiP"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Enter PiP"),
|
||||
cmd: "PIP",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Enter picture-in-picture mode"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Enter picture-in-picture mode"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -519,9 +519,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Folder"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Folder"),
|
||||
cmd: "FOLDER",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Collect other widgets or subfolders. Button-combo available."),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Collect other widgets or subfolders. Button-combo available."),
|
||||
allowsKeyboardCombination: true,
|
||||
allowsGamepadCombination: true,
|
||||
allowsSkillCombo: true,
|
||||
@@ -529,9 +529,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Toolbox"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Toolbox"),
|
||||
cmd: "TOOLBOX",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Activate toolbox menu during streaming"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Activate toolbox menu during streaming"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -539,9 +539,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Edit layout"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Edit layout"),
|
||||
cmd: "WIDGETTOOL",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Open on-screen widget layout tool"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Open on-screen widget layout tool"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -549,9 +549,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Pick profile"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Pick profile"),
|
||||
cmd: "PICKPRFL",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Pick a game/on-screen-widget profile"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Pick a game/on-screen-widget profile"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -559,9 +559,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Profiles"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Profiles"),
|
||||
cmd: "PROFILES",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Select a game/on-screen-widget profile"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Select a game/on-screen-widget profile"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -569,9 +569,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "SoftKeyboard"),
|
||||
label: LocalizationHelper.localizedString(forKey: "SoftKeyboard"),
|
||||
cmd: "SOFTKEYBOARD",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Bring up softkeyboard"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Bring up softkeyboard"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -580,9 +580,9 @@ struct WidgetPickerView: View {
|
||||
),
|
||||
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Disable touch"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Disable touch"),
|
||||
cmd: "DISABLETOUCH",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Temporarily disable touch input for stream view"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Temporarily disable touch input for stream view"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -590,9 +590,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "🎮 overlay switch"),
|
||||
label: LocalizationHelper.localizedString(forKey: "🎮 overlay switch"),
|
||||
cmd: "GAMEPADOVERLAY",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Switch on/off a floating gamepad overlay with live input feedback"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Switch on/off a floating gamepad overlay with live input feedback"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -600,9 +600,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Pressure curve"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Pressure curve"),
|
||||
cmd: "PRESSURECURVE",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Opens pencil pressure curve tool"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Opens pencil pressure curve tool"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -610,9 +610,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Pencil hover"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Pencil hover"),
|
||||
cmd: "PENCILHOVER",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Force pencil entering hovering on host"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Force pencil entering hovering on host"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -620,9 +620,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Brush shortcut"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Brush shortcut"),
|
||||
cmd: "BRUSH",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Combine this with a brush keyboard shortcut for PC software"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Combine this with a brush keyboard shortcut for PC software"),
|
||||
allowsKeyboardCombination: true,
|
||||
allowsGamepadCombination: true,
|
||||
allowsSkillCombo: false,
|
||||
@@ -630,9 +630,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: .shortcut
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Eraser shortcut"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Eraser shortcut"),
|
||||
cmd: "ERASER",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Combine this with a eraser keyboard shortcut for PC software"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Combine this with a eraser keyboard shortcut for PC software"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -640,9 +640,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: .shortcut
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Disable single point touch"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Disable single point touch"),
|
||||
cmd: "NOSINGLETOUCH",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Disable single finger touch for stream view"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Disable single finger touch for stream view"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -650,9 +650,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: nil
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Absolute touch drag"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Absolute touch drag"),
|
||||
cmd: "ABSTCHDRAG",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "Replace mouse button action in single point touch mode with another button temporarily"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "Replace mouse button action in single point touch mode with another button temporarily"),
|
||||
allowsKeyboardCombination: true,
|
||||
allowsGamepadCombination: true,
|
||||
allowsSkillCombo: true,
|
||||
@@ -660,9 +660,9 @@ struct WidgetPickerView: View {
|
||||
forcedComboMode: .skill
|
||||
),
|
||||
FunctionalButtonOption(
|
||||
label: SwiftLocalizationHelper.localizedString(forKey: "Magnifier"),
|
||||
label: LocalizationHelper.localizedString(forKey: "Magnifier"),
|
||||
cmd: "MAGNIFIER",
|
||||
tip: SwiftLocalizationHelper.localizedString(forKey: "magnifierTip"),
|
||||
tip: LocalizationHelper.localizedString(forKey: "magnifierTip"),
|
||||
allowsKeyboardCombination: false,
|
||||
allowsGamepadCombination: false,
|
||||
allowsSkillCombo: false,
|
||||
@@ -675,7 +675,7 @@ struct WidgetPickerView: View {
|
||||
if isShortcutPickerMode, let shortcutPickerTipText, !shortcutPickerTipText.isEmpty {
|
||||
return shortcutPickerTipText
|
||||
}
|
||||
return SwiftLocalizationHelper.localizedString(forKey: "Tap any control to add it")
|
||||
return LocalizationHelper.localizedString(forKey: "Tap any control to add it")
|
||||
}
|
||||
|
||||
private var tipMessageColor: Color {
|
||||
@@ -744,19 +744,19 @@ struct WidgetPickerView: View {
|
||||
if poolItems.isEmpty {
|
||||
resetTipMessage()
|
||||
} else if movementPadNeedsWalkKeyTip {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Please select a sprint key"))
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Please select a sprint key"))
|
||||
} else if movementPadNeedsSprintKeyTip {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Sprint key set. Select a walk key (optional, you can skip and create)"))
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Sprint key set. Select a walk key (optional, you can skip and create)"))
|
||||
} else if movementPadHasReachedSingleKeyLimit {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Sprint and walk keys are set"))
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Sprint and walk keys are set"))
|
||||
} else if hasButtonThenPadCombination {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "A button with touchpad functionality will be created"))
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "A button with touchpad functionality will be created"))
|
||||
} else if hasPadThenButtonCombination {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "A touchpad with double-tap button triggering will be created"))
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "A touchpad with double-tap button triggering will be created"))
|
||||
} else if let selectedFunctionalButtonOption {
|
||||
setTipMessage(selectedFunctionalButtonOption.tip)
|
||||
} else if hasAnySingleItem || hasMultipleButtonItemsOnly {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "You can continue adding controls to this combination"))
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "You can continue adding controls to this combination"))
|
||||
} else {
|
||||
resetTipMessage()
|
||||
}
|
||||
@@ -866,7 +866,7 @@ struct WidgetPickerView: View {
|
||||
return ZStack(alignment: .topTrailing) {
|
||||
VStack(alignment: .leading, spacing: pickerSectionSpacing) {
|
||||
HStack(alignment: .center, spacing: 10) {
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Widget Picker"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Widget Picker"))
|
||||
.font(.system(size: pickerTitleFontSize, weight: .bold, design: .rounded))
|
||||
.foregroundColor(Color.black.opacity(0.82))
|
||||
.lineLimit(1)
|
||||
@@ -1053,14 +1053,14 @@ struct WidgetPickerView: View {
|
||||
|
||||
return VStack(alignment: .leading, spacing: metrics.poolSectionSpacing) {
|
||||
VStack(alignment: .leading, spacing: poolHeaderSpacing) {
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Widget Pool"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Widget Pool"))
|
||||
.font(.system(size: poolTitleFontSize, weight: .bold, design: .rounded))
|
||||
.foregroundColor(Color.black.opacity(0.82))
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.8)
|
||||
|
||||
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Selected widgets are queued here in tap order."))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Selected widgets are queued here in tap order."))
|
||||
.font(.system(size: poolSubtitleFontSize, weight: .medium, design: .rounded))
|
||||
.foregroundColor(Color.black.opacity(0.48))
|
||||
.lineLimit(metrics.isPhone ? 1 : 2)
|
||||
@@ -1081,7 +1081,7 @@ struct WidgetPickerView: View {
|
||||
|
||||
if keyboardPickerMode != .shortcutPicker {
|
||||
PoolActionChip(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Gyro switch button"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Gyro switch button"),
|
||||
isPrimary: false,
|
||||
height: poolChipHeight,
|
||||
fontSize: poolChipFontSize,
|
||||
@@ -1117,10 +1117,10 @@ struct WidgetPickerView: View {
|
||||
HStack(spacing: metrics.isPhone ? 8 : 12) {
|
||||
PoolActionChip(
|
||||
title: isShortcutPickerMode
|
||||
? SwiftLocalizationHelper.localizedString(forKey: "Create shortcut")
|
||||
? LocalizationHelper.localizedString(forKey: "Create shortcut")
|
||||
: (isEditMode
|
||||
? WidgetPickerSubmissionAction.create.poolActionTitle
|
||||
: SwiftLocalizationHelper.localizedString(forKey: "Create widget")),
|
||||
: LocalizationHelper.localizedString(forKey: "Create widget")),
|
||||
isPrimary: true,
|
||||
height: poolChipHeight,
|
||||
fontSize: poolChipFontSize,
|
||||
@@ -1142,7 +1142,7 @@ struct WidgetPickerView: View {
|
||||
}
|
||||
|
||||
PoolActionChip(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Reset"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Reset"),
|
||||
isPrimary: false,
|
||||
height: poolChipHeight,
|
||||
fontSize: poolChipFontSize,
|
||||
@@ -1475,7 +1475,7 @@ struct WidgetPickerView: View {
|
||||
|
||||
if movementPadHasReachedSingleKeyLimit {
|
||||
setTipMessage(
|
||||
SwiftLocalizationHelper.localizedString(forKey: "Walk and sprint keys are already set. No more keys can be added"),
|
||||
LocalizationHelper.localizedString(forKey: "Walk and sprint keys are already set. No more keys can be added"),
|
||||
type: .error
|
||||
)
|
||||
return false
|
||||
@@ -1490,12 +1490,12 @@ struct WidgetPickerView: View {
|
||||
)
|
||||
|
||||
if occupiedSlots + candidate.span > maxPoolSlots {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Widget pool is full"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Widget pool is full"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if isPad(candidate), poolItems.contains(where: isPad) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Cannot select two touchpad controls at the same time"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Cannot select two touchpad controls at the same time"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -1507,7 +1507,7 @@ struct WidgetPickerView: View {
|
||||
|| (isDirectionPadSingleCommand(cmd) && isDirectionPadContainerCommand(existing.cmd))
|
||||
)
|
||||
}) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Direction pad cannot be combined with their inner button"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Direction pad cannot be combined with their inner button"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -1515,37 +1515,37 @@ struct WidgetPickerView: View {
|
||||
poolItems.contains(where: { existing in
|
||||
triggerGroup(for: existing.cmd) == candidateTriggerGroup && existing.cmd != cmd
|
||||
}) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Trigger button cannot be combined with trigger pad"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Trigger button cannot be combined with trigger pad"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if directionPadPriorityCommands.contains(cmd), poolItems.contains(where: { gyroCommands.contains($0.cmd) }) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Direction pad cannot be combined with gyro button"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Direction pad cannot be combined with gyro button"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if gyroCommands.contains(cmd), poolItems.contains(where: { directionPadPriorityCommands.contains($0.cmd) }) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Gyro widgets cannot be combined with direction pad"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Gyro widgets cannot be combined with direction pad"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if cmd == "LSWHEEL", !poolItems.isEmpty {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "LS wheel must be placed alone"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "LS wheel must be placed alone"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if !poolItems.isEmpty, poolItems.contains(where: { $0.cmd == "LSWHEEL" }) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "LsWheel cannot be combined with other widgets"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "LsWheel cannot be combined with other widgets"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if cmd == "RSWHEEL", !poolItems.isEmpty {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "RS wheel must be placed alone"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "RS wheel must be placed alone"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if !poolItems.isEmpty, poolItems.contains(where: { $0.cmd == "RSWHEEL" }) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "RsWheel cannot be combined with other widgets"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "RsWheel cannot be combined with other widgets"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -1556,50 +1556,50 @@ struct WidgetPickerView: View {
|
||||
}
|
||||
|
||||
if poolItems.contains(where: isPad) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Functional widgets cannot be combined with touchpad controls"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Functional widgets cannot be combined with touchpad controls"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if poolItems.contains(where: { $0.source == .functional }) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Functional widgets cannot be combined with other functional widgets"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Functional widgets cannot be combined with other functional widgets"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if !option.allowsKeyboardCombination,
|
||||
poolItems.contains(where: { $0.source == .keyboard && !isPad($0) }) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "This functional widget cannot be combined with keyboard or mouse buttons"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "This functional widget cannot be combined with keyboard or mouse buttons"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if !option.allowsGamepadCombination,
|
||||
poolItems.contains(where: { $0.source == .gamepad && !isPad($0) }) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "This functional widget cannot be combined with gamepad buttons"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "This functional widget cannot be combined with gamepad buttons"), type: .error)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if source == .keyboard || source == .gamepad {
|
||||
if poolItems.contains(where: isPad) && poolItems.contains(where: { $0.source == .functional && !gyroCommands.contains($0.cmd) }) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Functional widgets cannot be combined with touchpad controls"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Functional widgets cannot be combined with touchpad controls"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if let existingFunctionalItem = poolItems.first(where: { $0.source == .functional && !gyroCommands.contains($0.cmd) }),
|
||||
let option = functionalButtonOption(for: existingFunctionalItem.cmd) {
|
||||
if source == .keyboard && !option.allowsKeyboardCombination {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "This functional widget cannot be combined with keyboard or mouse buttons"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "This functional widget cannot be combined with keyboard or mouse buttons"), type: .error)
|
||||
return false
|
||||
}
|
||||
|
||||
if source == .gamepad && !option.allowsGamepadCombination {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "This functional widget cannot be combined with gamepad buttons"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "This functional widget cannot be combined with gamepad buttons"), type: .error)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if isPad(candidate),
|
||||
poolItems.contains(where: { $0.source == .functional && !gyroCommands.contains($0.cmd) }) {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Functional widgets cannot be combined with touchpad controls"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Functional widgets cannot be combined with touchpad controls"), type: .error)
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -1620,11 +1620,11 @@ struct WidgetPickerView: View {
|
||||
[
|
||||
GyroButtonOption(
|
||||
cmd: "GYRO",
|
||||
description: SwiftLocalizationHelper.localizedString(forKey: "Gyro on while activated")
|
||||
description: LocalizationHelper.localizedString(forKey: "Gyro on while activated")
|
||||
),
|
||||
GyroButtonOption(
|
||||
cmd: "GYROPAUSE",
|
||||
description: SwiftLocalizationHelper.localizedString(forKey: "Gyro off while activated")
|
||||
description: LocalizationHelper.localizedString(forKey: "Gyro off while activated")
|
||||
)
|
||||
]
|
||||
}
|
||||
@@ -1679,9 +1679,9 @@ struct WidgetPickerView: View {
|
||||
VStack(alignment: .leading, spacing: sectionSpacing) {
|
||||
if targetWidgetKind == .button {
|
||||
if showsButtonLabelField {
|
||||
createWidgetSection(title: SwiftLocalizationHelper.localizedString(forKey: "Button label")) {
|
||||
createWidgetSection(title: LocalizationHelper.localizedString(forKey: "Button label")) {
|
||||
InteractiveTextField(
|
||||
placeholder: SwiftLocalizationHelper.localizedString(forKey: "Enter label(optional)"),
|
||||
placeholder: LocalizationHelper.localizedString(forKey: "Enter label(optional)"),
|
||||
text: $widgetButtonLabel
|
||||
)
|
||||
.frame(height: fieldHeight)
|
||||
@@ -1691,7 +1691,7 @@ struct WidgetPickerView: View {
|
||||
|
||||
if showsComboModeControl {
|
||||
createInteractiveControlSection(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Combination mode"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Combination mode"),
|
||||
controlHeight: segmentedControlHeight
|
||||
) {
|
||||
Picker("", selection: widgetComboModeBinding) {
|
||||
@@ -1710,7 +1710,7 @@ struct WidgetPickerView: View {
|
||||
|
||||
if showsShortcutButtonModeControl {
|
||||
createInteractiveControlSection(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Button mode"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Button mode"),
|
||||
controlHeight: segmentedControlHeight
|
||||
) {
|
||||
Picker("", selection: $shortcutPickerButtonMode) {
|
||||
@@ -1727,7 +1727,7 @@ struct WidgetPickerView: View {
|
||||
|
||||
if showsIntervalSlider {
|
||||
createInteractiveControlSection(
|
||||
title: "\(SwiftLocalizationHelper.localizedString(forKey: "Trigger interval")): \(effectiveTriggerIntervalValue) ms",
|
||||
title: "\(LocalizationHelper.localizedString(forKey: "Trigger interval")): \(effectiveTriggerIntervalValue) ms",
|
||||
controlHeight: fieldHeight
|
||||
) {
|
||||
Slider(
|
||||
@@ -1745,7 +1745,7 @@ struct WidgetPickerView: View {
|
||||
|
||||
if targetWidgetKind == .button, showsShapeControl {
|
||||
createInteractiveControlSection(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Shape"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Shape"),
|
||||
controlHeight: segmentedControlHeight
|
||||
) {
|
||||
Picker("", selection: $widgetShape) {
|
||||
@@ -1763,7 +1763,7 @@ struct WidgetPickerView: View {
|
||||
|
||||
HStack(spacing: actionSpacing) {
|
||||
PoolActionChip(
|
||||
title: SwiftLocalizationHelper.localizedString(forKey: "Cancel"),
|
||||
title: LocalizationHelper.localizedString(forKey: "Cancel"),
|
||||
isPrimary: false,
|
||||
height: actionHeight,
|
||||
fontSize: actionFontSize,
|
||||
@@ -2031,7 +2031,7 @@ struct WidgetPickerView: View {
|
||||
widgetButtonLabel = initialButtonLabel
|
||||
} else if targetWidgetKind == .button,
|
||||
let selectedFunctionalButtonOption {
|
||||
widgetButtonLabel = selectedFunctionalButtonOption.cmd == "FOLDER" ? SwiftLocalizationHelper.localizedString(forKey: "=Folder") : selectedFunctionalButtonOption.label
|
||||
widgetButtonLabel = selectedFunctionalButtonOption.cmd == "FOLDER" ? LocalizationHelper.localizedString(forKey: "=Folder") : selectedFunctionalButtonOption.label
|
||||
} else {
|
||||
widgetButtonLabel = ""
|
||||
}
|
||||
@@ -2050,7 +2050,7 @@ struct WidgetPickerView: View {
|
||||
|
||||
private func presentCreateWidgetSheet(for submissionAction: WidgetPickerSubmissionAction) {
|
||||
guard isShortcutPickerMode || !poolItems.isEmpty else {
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Select at least one command before creating a widget"), type: .error)
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Select at least one command before creating a widget"), type: .error)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2068,7 +2068,7 @@ struct WidgetPickerView: View {
|
||||
let payload = makeWidgetPayload()
|
||||
persistCurrentTabSelection()
|
||||
lastCreatedWidgetPayload = payload
|
||||
setTipMessage(SwiftLocalizationHelper.localizedString(forKey: "Widget config generated"))
|
||||
setTipMessage(LocalizationHelper.localizedString(forKey: "Widget config generated"))
|
||||
onWidgetCreated?(payload)
|
||||
print("widgetPicker payload =", payload as NSDictionary)
|
||||
setCreateWidgetSheetVisible(false)
|
||||
@@ -2117,7 +2117,7 @@ struct WidgetPickerView: View {
|
||||
private func defaultWidgetButtonLabel() -> String {
|
||||
if let selectedFunctionalButtonOption {
|
||||
return selectedFunctionalButtonOption.cmd == "FOLDER"
|
||||
? SwiftLocalizationHelper.localizedString(forKey: "=Folder")
|
||||
? LocalizationHelper.localizedString(forKey: "=Folder")
|
||||
: selectedFunctionalButtonOption.label
|
||||
}
|
||||
|
||||
@@ -2140,7 +2140,7 @@ struct WidgetPickerView: View {
|
||||
case .functional:
|
||||
if let option = functionalButtonOption(for: item.cmd) {
|
||||
return option.cmd == "FOLDER"
|
||||
? SwiftLocalizationHelper.localizedString(forKey: "=Folder")
|
||||
? LocalizationHelper.localizedString(forKey: "=Folder")
|
||||
: option.label
|
||||
}
|
||||
let label = item.displayCmd.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
@@ -2585,11 +2585,11 @@ struct GyroButtonPickerOverlay: View {
|
||||
}
|
||||
|
||||
VStack(spacing: 14) {
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Select Gyro Button"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Select Gyro Button"))
|
||||
.font(.system(size: 18, weight: .bold, design: .rounded))
|
||||
.foregroundColor(.white)
|
||||
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Choose a gyro control style"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Choose a gyro control style"))
|
||||
.font(.system(size: 13, weight: .medium, design: .rounded))
|
||||
.foregroundColor(Color.white.opacity(0.78))
|
||||
.multilineTextAlignment(.center)
|
||||
@@ -2628,7 +2628,7 @@ struct GyroButtonPickerOverlay: View {
|
||||
Button(action: {
|
||||
onCancel()
|
||||
}) {
|
||||
Text(SwiftLocalizationHelper.localizedString(forKey: "Cancel"))
|
||||
Text(LocalizationHelper.localizedString(forKey: "Cancel"))
|
||||
.font(.system(size: 15, weight: .bold, design: .rounded))
|
||||
.foregroundColor(Color.white.opacity(0.9))
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
Reference in New Issue
Block a user