Adds “Respect Silent Mode” setting to configure whether Delta plays game audio in Silent Mode
Delta will also now automatically mute game audio if another app is playing audio. [Missed] Mutes game audio correctly
This commit is contained in:
parent
6aee8c84cd
commit
77983e73dd
@ -1 +1 @@
|
|||||||
Subproject commit 62e30af00e4e67ad1d5f786c21beba749c50aa61
|
Subproject commit 81362dd5def310f4dd908513574c7e2fd10c7d75
|
||||||
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18121" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="ssH-mM-uG6">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="ssH-mM-uG6">
|
||||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18092"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
|
||||||
<capability name="Named colors" minToolsVersion="9.0"/>
|
<capability name="Named colors" minToolsVersion="9.0"/>
|
||||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||||
@ -279,26 +279,26 @@
|
|||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
</cells>
|
</cells>
|
||||||
</tableViewSection>
|
</tableViewSection>
|
||||||
<tableViewSection headerTitle="Haptic Feedback" footerTitle="When enabled, your device will vibrate in response to touch screen controls." id="aJ4-xT-aZL">
|
<tableViewSection headerTitle="Game Audio" footerTitle="When enabled, Delta will only play game audio if your device isn't silenced." id="aJ4-xT-aZL">
|
||||||
<cells>
|
<cells>
|
||||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="SwitchCell" id="mRV-Bi-pZ8" customClass="SwitchTableViewCell">
|
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="SwitchCell" id="mRV-Bi-pZ8" customClass="SwitchTableViewCell">
|
||||||
<rect key="frame" x="0.0" y="765" width="375" height="44"/>
|
<rect key="frame" x="0.0" y="794.5" width="375" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="mRV-Bi-pZ8" id="RtM-ok-LGu">
|
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="mRV-Bi-pZ8" id="RtM-ok-LGu">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Buttons" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mue-uO-1xE">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Respect Silent Mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mue-uO-1xE">
|
||||||
<rect key="frame" x="8" y="11.5" width="302" height="21"/>
|
<rect key="frame" x="16" y="11.5" width="286" height="21"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
<nil key="textColor"/>
|
<nil key="textColor"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mlO-iy-zU2">
|
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mlO-iy-zU2">
|
||||||
<rect key="frame" x="318" y="6.5" width="51" height="31"/>
|
<rect key="frame" x="310" y="6.5" width="51" height="31"/>
|
||||||
<color key="onTintColor" name="Purple"/>
|
<color key="onTintColor" name="Purple"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="toggleButtonHapticFeedbackEnabled:" destination="eHi-aO-uGS" eventType="primaryActionTriggered" id="au3-JT-77n"/>
|
<action selector="toggleRespectSilentMode:" destination="eHi-aO-uGS" eventType="primaryActionTriggered" id="dyA-el-uRa"/>
|
||||||
</connections>
|
</connections>
|
||||||
</switch>
|
</switch>
|
||||||
</subviews>
|
</subviews>
|
||||||
@ -311,33 +311,67 @@
|
|||||||
</constraints>
|
</constraints>
|
||||||
</tableViewCellContentView>
|
</tableViewCellContentView>
|
||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="SwitchCell" id="2Kn-Xu-sTo" customClass="SwitchTableViewCell">
|
</cells>
|
||||||
<rect key="frame" x="0.0" y="809" width="375" height="44"/>
|
</tableViewSection>
|
||||||
|
<tableViewSection headerTitle="Haptic Feedback" footerTitle="When enabled, your device will vibrate in response to touch screen controls." id="avK-bg-nm6">
|
||||||
|
<cells>
|
||||||
|
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="SwitchCell" id="ZUx-5m-gPq" customClass="SwitchTableViewCell">
|
||||||
|
<rect key="frame" x="0.0" y="930" width="375" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2Kn-Xu-sTo" id="2pb-gv-gY2">
|
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ZUx-5m-gPq" id="7fY-cO-dht">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
||||||
<autoresizingMask key="autoresizingMask"/>
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Control Sticks" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UoA-qC-cKc">
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Buttons" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XPP-qe-q75">
|
||||||
<rect key="frame" x="8" y="11.5" width="302" height="21"/>
|
<rect key="frame" x="16" y="11.5" width="286" height="21"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
<nil key="textColor"/>
|
<nil key="textColor"/>
|
||||||
<nil key="highlightedColor"/>
|
<nil key="highlightedColor"/>
|
||||||
</label>
|
</label>
|
||||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="s5f-Uz-GpH">
|
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="g7m-wj-ueP">
|
||||||
<rect key="frame" x="318" y="6.5" width="51" height="31"/>
|
<rect key="frame" x="310" y="6.5" width="51" height="31"/>
|
||||||
<color key="onTintColor" name="Purple"/>
|
<color key="onTintColor" name="Purple"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="toggleThumbstickHapticFeedbackEnabled:" destination="eHi-aO-uGS" eventType="primaryActionTriggered" id="ELm-nK-kTr"/>
|
<action selector="toggleButtonHapticFeedbackEnabled:" destination="eHi-aO-uGS" eventType="primaryActionTriggered" id="JkH-Ha-NqO"/>
|
||||||
</connections>
|
</connections>
|
||||||
</switch>
|
</switch>
|
||||||
</subviews>
|
</subviews>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="s5f-Uz-GpH" firstAttribute="centerY" secondItem="2pb-gv-gY2" secondAttribute="centerY" id="1yP-Wt-XbP"/>
|
<constraint firstItem="XPP-qe-q75" firstAttribute="centerY" secondItem="7fY-cO-dht" secondAttribute="centerY" id="ML4-2L-ivB"/>
|
||||||
<constraint firstAttribute="trailingMargin" secondItem="s5f-Uz-GpH" secondAttribute="trailing" id="3XM-jj-6TV"/>
|
<constraint firstItem="XPP-qe-q75" firstAttribute="leading" secondItem="7fY-cO-dht" secondAttribute="leadingMargin" id="RcM-9w-cj3"/>
|
||||||
<constraint firstItem="UoA-qC-cKc" firstAttribute="centerY" secondItem="2pb-gv-gY2" secondAttribute="centerY" id="AMH-D3-llc"/>
|
<constraint firstItem="g7m-wj-ueP" firstAttribute="leading" secondItem="XPP-qe-q75" secondAttribute="trailing" constant="8" symbolic="YES" id="U9Z-lS-tZm"/>
|
||||||
<constraint firstItem="UoA-qC-cKc" firstAttribute="leading" secondItem="2pb-gv-gY2" secondAttribute="leadingMargin" id="Fi5-Td-wMi"/>
|
<constraint firstAttribute="trailingMargin" secondItem="g7m-wj-ueP" secondAttribute="trailing" id="W92-fx-sPH"/>
|
||||||
<constraint firstItem="s5f-Uz-GpH" firstAttribute="leading" secondItem="UoA-qC-cKc" secondAttribute="trailing" constant="8" symbolic="YES" id="L7N-F1-Maf"/>
|
<constraint firstItem="g7m-wj-ueP" firstAttribute="centerY" secondItem="7fY-cO-dht" secondAttribute="centerY" id="mKM-Rs-8FG"/>
|
||||||
|
</constraints>
|
||||||
|
</tableViewCellContentView>
|
||||||
|
</tableViewCell>
|
||||||
|
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="SwitchCell" id="p47-ru-O9r" customClass="SwitchTableViewCell">
|
||||||
|
<rect key="frame" x="0.0" y="974" width="375" height="44"/>
|
||||||
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
|
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="p47-ru-O9r" id="o9R-cP-Tge">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
|
||||||
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
|
<subviews>
|
||||||
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Control Sticks" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MDR-bb-TYm">
|
||||||
|
<rect key="frame" x="16" y="11.5" width="286" height="21"/>
|
||||||
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
|
<nil key="textColor"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="19A-ef-F3V">
|
||||||
|
<rect key="frame" x="310" y="6.5" width="51" height="31"/>
|
||||||
|
<color key="onTintColor" name="Purple"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="toggleThumbstickHapticFeedbackEnabled:" destination="eHi-aO-uGS" eventType="primaryActionTriggered" id="pHq-hK-bcL"/>
|
||||||
|
</connections>
|
||||||
|
</switch>
|
||||||
|
</subviews>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="19A-ef-F3V" firstAttribute="centerY" secondItem="o9R-cP-Tge" secondAttribute="centerY" id="7S9-gQ-Elk"/>
|
||||||
|
<constraint firstAttribute="trailingMargin" secondItem="19A-ef-F3V" secondAttribute="trailing" id="IVw-V1-wRU"/>
|
||||||
|
<constraint firstItem="19A-ef-F3V" firstAttribute="leading" secondItem="MDR-bb-TYm" secondAttribute="trailing" constant="8" symbolic="YES" id="hPx-zJ-0qA"/>
|
||||||
|
<constraint firstItem="MDR-bb-TYm" firstAttribute="centerY" secondItem="o9R-cP-Tge" secondAttribute="centerY" id="m0V-TQ-ajv"/>
|
||||||
|
<constraint firstItem="MDR-bb-TYm" firstAttribute="leading" secondItem="o9R-cP-Tge" secondAttribute="leadingMargin" id="pSi-wU-tje"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</tableViewCellContentView>
|
</tableViewCellContentView>
|
||||||
</tableViewCell>
|
</tableViewCell>
|
||||||
@ -621,12 +655,13 @@
|
|||||||
</barButtonItem>
|
</barButtonItem>
|
||||||
</navigationItem>
|
</navigationItem>
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="buttonHapticFeedbackEnabledSwitch" destination="mlO-iy-zU2" id="ObD-uL-Si0"/>
|
<outlet property="buttonHapticFeedbackEnabledSwitch" destination="g7m-wj-ueP" id="nOj-sc-foi"/>
|
||||||
<outlet property="controllerOpacityLabel" destination="zaz-yD-CYG" id="eUW-u9-xxx"/>
|
<outlet property="controllerOpacityLabel" destination="zaz-yD-CYG" id="eUW-u9-xxx"/>
|
||||||
<outlet property="controllerOpacitySlider" destination="whi-If-wFf" id="6Cx-HY-xLG"/>
|
<outlet property="controllerOpacitySlider" destination="whi-If-wFf" id="6Cx-HY-xLG"/>
|
||||||
<outlet property="previewsEnabledSwitch" destination="OJE-9e-9i3" id="Ndg-eN-PPs"/>
|
<outlet property="previewsEnabledSwitch" destination="OJE-9e-9i3" id="Ndg-eN-PPs"/>
|
||||||
|
<outlet property="respectSilentModeSwitch" destination="mlO-iy-zU2" id="TDT-cx-kCf"/>
|
||||||
<outlet property="syncingServiceLabel" destination="kLY-5g-v8n" id="zzx-qM-q1g"/>
|
<outlet property="syncingServiceLabel" destination="kLY-5g-v8n" id="zzx-qM-q1g"/>
|
||||||
<outlet property="thumbstickHapticFeedbackEnabledSwitch" destination="s5f-Uz-GpH" id="ffp-3M-FDL"/>
|
<outlet property="thumbstickHapticFeedbackEnabledSwitch" destination="19A-ef-F3V" id="K03-kQ-lv3"/>
|
||||||
<outlet property="versionLabel" destination="Str-BY-agW" id="gU2-L0-pYt"/>
|
<outlet property="versionLabel" destination="Str-BY-agW" id="gU2-L0-pYt"/>
|
||||||
<segue destination="uBz-mm-mXr" kind="show" identifier="controllersSegue" id="MLY-hF-UB8"/>
|
<segue destination="uBz-mm-mXr" kind="show" identifier="controllersSegue" id="MLY-hF-UB8"/>
|
||||||
<segue destination="56e-ul-z6v" kind="show" identifier="controllerSkinsSegue" id="GNM-Gt-YFf"/>
|
<segue destination="56e-ul-z6v" kind="show" identifier="controllerSkinsSegue" id="GNM-Gt-YFf"/>
|
||||||
|
|||||||
@ -112,6 +112,7 @@ class GameViewController: DeltaCore.GameViewController
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.updateControllers()
|
self.updateControllers()
|
||||||
|
self.updateAudio()
|
||||||
|
|
||||||
self.presentedGyroAlert = false
|
self.presentedGyroAlert = false
|
||||||
}
|
}
|
||||||
@ -935,6 +936,16 @@ extension GameViewController: CheatsViewControllerDelegate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - Audio -
|
||||||
|
/// Audio
|
||||||
|
private extension GameViewController
|
||||||
|
{
|
||||||
|
func updateAudio()
|
||||||
|
{
|
||||||
|
self.emulatorCore?.audioManager.respectsSilentMode = Settings.respectSilentMode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - Sustain Buttons -
|
//MARK: - Sustain Buttons -
|
||||||
private extension GameViewController
|
private extension GameViewController
|
||||||
{
|
{
|
||||||
@ -1194,8 +1205,12 @@ private extension GameViewController
|
|||||||
self.updateControllerSkin()
|
self.updateControllerSkin()
|
||||||
}
|
}
|
||||||
|
|
||||||
case .translucentControllerSkinOpacity: self.controllerView.translucentControllerSkinOpacity = Settings.translucentControllerSkinOpacity
|
case .translucentControllerSkinOpacity:
|
||||||
|
self.controllerView.translucentControllerSkinOpacity = Settings.translucentControllerSkinOpacity
|
||||||
|
|
||||||
|
case .respectSilentMode:
|
||||||
|
self.updateAudio()
|
||||||
|
|
||||||
case .syncingService, .isAltJITEnabled: break
|
case .syncingService, .isAltJITEnabled: break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,6 +39,7 @@ extension Settings
|
|||||||
case isButtonHapticFeedbackEnabled
|
case isButtonHapticFeedbackEnabled
|
||||||
case isThumbstickHapticFeedbackEnabled
|
case isThumbstickHapticFeedbackEnabled
|
||||||
case isAltJITEnabled
|
case isAltJITEnabled
|
||||||
|
case respectSilentMode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,6 +63,7 @@ struct Settings
|
|||||||
#keyPath(UserDefaults.sortSaveStatesByOldestFirst): true,
|
#keyPath(UserDefaults.sortSaveStatesByOldestFirst): true,
|
||||||
#keyPath(UserDefaults.isPreviewsEnabled): true,
|
#keyPath(UserDefaults.isPreviewsEnabled): true,
|
||||||
#keyPath(UserDefaults.isAltJITEnabled): false,
|
#keyPath(UserDefaults.isAltJITEnabled): false,
|
||||||
|
#keyPath(UserDefaults.respectSilentMode): true,
|
||||||
Settings.preferredCoreSettingsKey(for: .ds): MelonDS.core.identifier] as [String : Any]
|
Settings.preferredCoreSettingsKey(for: .ds): MelonDS.core.identifier] as [String : Any]
|
||||||
UserDefaults.standard.register(defaults: defaults)
|
UserDefaults.standard.register(defaults: defaults)
|
||||||
|
|
||||||
@ -208,6 +210,17 @@ extension Settings
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static var respectSilentMode: Bool {
|
||||||
|
get {
|
||||||
|
let respectSilentMode = UserDefaults.standard.respectSilentMode
|
||||||
|
return respectSilentMode
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
UserDefaults.standard.respectSilentMode = newValue
|
||||||
|
NotificationCenter.default.post(name: .settingsDidChange, object: nil, userInfo: [NotificationUserInfoKey.name: Name.respectSilentMode])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static func preferredCore(for gameType: GameType) -> DeltaCoreProtocol?
|
static func preferredCore(for gameType: GameType) -> DeltaCoreProtocol?
|
||||||
{
|
{
|
||||||
let key = self.preferredCoreSettingsKey(for: gameType)
|
let key = self.preferredCoreSettingsKey(for: gameType)
|
||||||
@ -405,4 +418,6 @@ private extension UserDefaults
|
|||||||
@NSManaged var isPreviewsEnabled: Bool
|
@NSManaged var isPreviewsEnabled: Bool
|
||||||
|
|
||||||
@NSManaged var isAltJITEnabled: Bool
|
@NSManaged var isAltJITEnabled: Bool
|
||||||
|
|
||||||
|
@NSManaged var respectSilentMode: Bool
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ private extension SettingsViewController
|
|||||||
case controllers
|
case controllers
|
||||||
case controllerSkins
|
case controllerSkins
|
||||||
case controllerOpacity
|
case controllerOpacity
|
||||||
|
case gameAudio
|
||||||
case hapticFeedback
|
case hapticFeedback
|
||||||
case syncing
|
case syncing
|
||||||
case hapticTouch
|
case hapticTouch
|
||||||
@ -56,6 +57,7 @@ class SettingsViewController: UITableViewController
|
|||||||
@IBOutlet private var controllerOpacityLabel: UILabel!
|
@IBOutlet private var controllerOpacityLabel: UILabel!
|
||||||
@IBOutlet private var controllerOpacitySlider: UISlider!
|
@IBOutlet private var controllerOpacitySlider: UISlider!
|
||||||
|
|
||||||
|
@IBOutlet private var respectSilentModeSwitch: UISwitch!
|
||||||
@IBOutlet private var buttonHapticFeedbackEnabledSwitch: UISwitch!
|
@IBOutlet private var buttonHapticFeedbackEnabledSwitch: UISwitch!
|
||||||
@IBOutlet private var thumbstickHapticFeedbackEnabledSwitch: UISwitch!
|
@IBOutlet private var thumbstickHapticFeedbackEnabledSwitch: UISwitch!
|
||||||
@IBOutlet private var previewsEnabledSwitch: UISwitch!
|
@IBOutlet private var previewsEnabledSwitch: UISwitch!
|
||||||
@ -160,6 +162,8 @@ private extension SettingsViewController
|
|||||||
self.controllerOpacitySlider.value = Float(Settings.translucentControllerSkinOpacity)
|
self.controllerOpacitySlider.value = Float(Settings.translucentControllerSkinOpacity)
|
||||||
self.updateControllerOpacityLabel()
|
self.updateControllerOpacityLabel()
|
||||||
|
|
||||||
|
self.respectSilentModeSwitch.isOn = Settings.respectSilentMode
|
||||||
|
|
||||||
self.syncingServiceLabel.text = Settings.syncingService?.localizedName
|
self.syncingServiceLabel.text = Settings.syncingService?.localizedName
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -248,6 +252,11 @@ private extension SettingsViewController
|
|||||||
Settings.isPreviewsEnabled = sender.isOn
|
Settings.isPreviewsEnabled = sender.isOn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@IBAction func toggleRespectSilentMode(_ sender: UISwitch)
|
||||||
|
{
|
||||||
|
Settings.respectSilentMode = sender.isOn
|
||||||
|
}
|
||||||
|
|
||||||
func openTwitter(username: String)
|
func openTwitter(username: String)
|
||||||
{
|
{
|
||||||
let twitterAppURL = URL(string: "twitter://user?screen_name=" + username)!
|
let twitterAppURL = URL(string: "twitter://user?screen_name=" + username)!
|
||||||
@ -290,7 +299,7 @@ private extension SettingsViewController
|
|||||||
self.tableView.selectRow(at: selectedIndexPath, animated: true, scrollPosition: .none)
|
self.tableView.selectRow(at: selectedIndexPath, animated: true, scrollPosition: .none)
|
||||||
}
|
}
|
||||||
|
|
||||||
case .localControllerPlayerIndex, .preferredControllerSkin, .translucentControllerSkinOpacity, .isButtonHapticFeedbackEnabled, .isThumbstickHapticFeedbackEnabled, .isAltJITEnabled: break
|
case .localControllerPlayerIndex, .preferredControllerSkin, .translucentControllerSkinOpacity, .respectSilentMode, .isButtonHapticFeedbackEnabled, .isThumbstickHapticFeedbackEnabled, .isAltJITEnabled: break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,7 +376,7 @@ extension SettingsViewController
|
|||||||
let preferredCore = Settings.preferredCore(for: .ds)
|
let preferredCore = Settings.preferredCore(for: .ds)
|
||||||
cell.detailTextLabel?.text = preferredCore?.metadata?.name.value ?? preferredCore?.name ?? NSLocalizedString("Unknown", comment: "")
|
cell.detailTextLabel?.text = preferredCore?.metadata?.name.value ?? preferredCore?.name ?? NSLocalizedString("Unknown", comment: "")
|
||||||
|
|
||||||
case .controllerOpacity, .hapticFeedback, .hapticTouch, .patreon, .credits: break
|
case .controllerOpacity, .gameAudio, .hapticFeedback, .hapticTouch, .patreon, .credits: break
|
||||||
}
|
}
|
||||||
|
|
||||||
return cell
|
return cell
|
||||||
@ -383,7 +392,7 @@ extension SettingsViewController
|
|||||||
case .controllers: self.performSegue(withIdentifier: Segue.controllers.rawValue, sender: cell)
|
case .controllers: self.performSegue(withIdentifier: Segue.controllers.rawValue, sender: cell)
|
||||||
case .controllerSkins: self.performSegue(withIdentifier: Segue.controllerSkins.rawValue, sender: cell)
|
case .controllerSkins: self.performSegue(withIdentifier: Segue.controllerSkins.rawValue, sender: cell)
|
||||||
case .cores: self.performSegue(withIdentifier: Segue.dsSettings.rawValue, sender: cell)
|
case .cores: self.performSegue(withIdentifier: Segue.dsSettings.rawValue, sender: cell)
|
||||||
case .controllerOpacity, .hapticFeedback, .hapticTouch, .syncing: break
|
case .controllerOpacity, .gameAudio, .hapticFeedback, .hapticTouch, .syncing: break
|
||||||
case .patreon:
|
case .patreon:
|
||||||
let patreonURL = URL(string: "altstore://patreon")!
|
let patreonURL = URL(string: "altstore://patreon")!
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user