Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Updates Delta to 1.1" #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cores/DeltaCore
4 changes: 0 additions & 4 deletions Delta.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1320,11 +1320,9 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 15;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "Delta/Supporting Files/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.1;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" -DDEBUG";
PRODUCT_BUNDLE_IDENTIFIER = com.rileytestut.Delta;
PROVISIONING_PROFILE = "";
Expand All @@ -1345,11 +1343,9 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 15;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "Delta/Supporting Files/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.1;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" -DIMPACTOR";
PRODUCT_BUNDLE_IDENTIFIER = com.rileytestut.Delta;
PROVISIONING_PROFILE = "";
Expand Down
29 changes: 7 additions & 22 deletions Delta/Base.lproj/PauseMenu.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Dt0-nV-isV">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Dt0-nV-isV">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -160,28 +160,13 @@
</connections>
</collectionView>
<navigationItem key="navigationItem" title="Save State" id="BoG-k2-aR2">
<rightBarButtonItems>
<barButtonItem systemItem="add" id="lKg-Ks-hWN">
<connections>
<action selector="addSaveState" destination="OOk-k7-INg" id="xY2-94-EOr"/>
</connections>
</barButtonItem>
<barButtonItem style="plain" id="has-I3-HDZ">
<button key="customView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="y2a-9f-EFz">
<rect key="frame" x="288.5" y="13" width="30" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="▼"/>
<connections>
<action selector="changeSortOrder:" destination="OOk-k7-INg" eventType="primaryActionTriggered" id="qQn-uw-SN1"/>
</connections>
</button>
</barButtonItem>
</rightBarButtonItems>
<barButtonItem key="rightBarButtonItem" systemItem="add" id="lKg-Ks-hWN">
<connections>
<action selector="addSaveState" destination="OOk-k7-INg" id="xY2-94-EOr"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" barStyle="black" prompted="NO"/>
<connections>
<outlet property="sortButton" destination="y2a-9f-EFz" id="Zbo-Q0-bVL"/>
</connections>
</collectionViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cL5-DH-K3b" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SaveStatesStoryboardSegue: UIStoryboardSegue
saveStatesViewController.loadViewIfNeeded()

let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(SaveStatesStoryboardSegue.handleDoneButton))
saveStatesViewController.navigationItem.leftBarButtonItem = doneButton
saveStatesViewController.navigationItem.rightBarButtonItem = doneButton

guard saveStatesViewController.theme == .translucent else { return }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class PhotoLibraryImportOption: NSObject, ImportOption

let imagePickerController = UIImagePickerController()
imagePickerController.delegate = self
imagePickerController.modalPresentationStyle = .fullScreen
imagePickerController.sourceType = .photoLibrary
imagePickerController.mediaTypes = [kUTTypeImage as String]
imagePickerController.view.backgroundColor = .white
Expand Down
1 change: 0 additions & 1 deletion Delta/Importing/ImportController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class ImportController: NSObject

let documentBrowserViewController = UIDocumentBrowserViewController(forOpeningFilesWithContentTypes: Array(self.documentTypes))
documentBrowserViewController.delegate = self
documentBrowserViewController.modalPresentationStyle = .fullScreen
documentBrowserViewController.browserUserInterfaceStyle = .dark
documentBrowserViewController.allowsPickingMultipleItems = true
documentBrowserViewController.allowsDocumentCreation = false
Expand Down
3 changes: 3 additions & 0 deletions Delta/Pause Menu/Cheats/CheatTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class CheatTextView: UITextView
super.init(coder: aDecoder)

self.layoutManager.delegate = self

self.textContainer.widthTracksTextView = false
self.textContainer.heightTracksTextView = false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SaveStatesCollectionHeaderView: UICollectionReusableView

self.textLabel.font = UIFont(descriptor: fontDescriptor, size: 0.0)
self.textLabel.textAlignment = .center
self.addSubview(self.textLabel)
self.vibrancyView.contentView.addSubview(self.textLabel)

// Auto Layout
self.textLabel.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 20).isActive = true
Expand Down
43 changes: 8 additions & 35 deletions Delta/Pause Menu/Save States/SaveStatesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SaveStatesViewController: UICollectionViewController
didSet {
if self.isViewLoaded
{
self.update()
self.updateTheme()
}
}
}
Expand All @@ -70,8 +70,6 @@ class SaveStatesViewController: UICollectionViewController

private var emulatorCoreSaveState: SaveStateProtocol?

@IBOutlet private var sortButton: UIButton!

required init?(coder aDecoder: NSCoder)
{
self.dataSource = RSTFetchedResultsCollectionViewPrefetchingDataSource<SaveState, UIImage>(fetchedResultsController: NSFetchedResultsController())
Expand Down Expand Up @@ -108,7 +106,7 @@ extension SaveStatesViewController
case .loading:
self.title = NSLocalizedString("Load State", comment: "")
self.placeholderView.detailTextLabel.text = NSLocalizedString("You can create a new save state by pressing the Save State option in the pause menu.", comment: "")
self.navigationItem.rightBarButtonItems?.removeFirst()
self.navigationItem.rightBarButtonItem = nil
}

// Manually update prototype cell properties
Expand All @@ -125,7 +123,7 @@ extension SaveStatesViewController
self.navigationController?.navigationBar.barStyle = .blackTranslucent
self.navigationController?.toolbar.barStyle = .blackTranslucent

self.update()
self.updateTheme()
}

override func viewWillDisappear(_ animated: Bool)
Expand Down Expand Up @@ -197,12 +195,12 @@ private extension SaveStatesViewController
let fetchRequest: NSFetchRequest<SaveState> = SaveState.fetchRequest()
fetchRequest.returnsObjectsAsFaults = false
fetchRequest.predicate = NSPredicate(format: "%K == %@", #keyPath(SaveState.game), self.game)
fetchRequest.sortDescriptors = [NSSortDescriptor(key: #keyPath(SaveState.type), ascending: true), NSSortDescriptor(key: #keyPath(SaveState.creationDate), ascending: Settings.sortSaveStatesByOldestFirst)]
fetchRequest.sortDescriptors = [NSSortDescriptor(key: #keyPath(SaveState.type), ascending: true), NSSortDescriptor(key: #keyPath(SaveState.creationDate), ascending: true)]

self.dataSource.fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: DatabaseManager.shared.viewContext, sectionNameKeyPath: #keyPath(SaveState.type), cacheName: nil)
}

func update()
func updateTheme()
{
switch self.theme
{
Expand All @@ -222,8 +220,6 @@ private extension SaveStatesViewController
self.placeholderView.textLabel.textColor = UIColor.white
self.placeholderView.detailTextLabel.textColor = UIColor.white
}

self.sortButton.transform = CGAffineTransform.identity.rotated(by: Settings.sortSaveStatesByOldestFirst ? 0 : .pi)
}

//MARK: - Configure Views -
Expand Down Expand Up @@ -271,16 +267,12 @@ private extension SaveStatesViewController
}

headerView.textLabel.text = title
headerView.textLabel.textColor = UIColor.white

switch self.theme
{
case .opaque:
headerView.textLabel.textColor = UIColor.lightGray
headerView.isTextLabelVibrancyEnabled = false

case .translucent:
headerView.textLabel.textColor = UIColor.white
headerView.isTextLabelVibrancyEnabled = true
case .opaque: headerView.isTextLabelVibrancyEnabled = false
case .translucent: headerView.isTextLabelVibrancyEnabled = true
}
}

Expand Down Expand Up @@ -437,25 +429,6 @@ private extension SaveStatesViewController
}
}

@IBAction func changeSortOrder(_ sender: UIButton)
{
Settings.sortSaveStatesByOldestFirst.toggle()

UIView.transition(with: self.collectionView, duration: 0.4, options: .transitionCrossDissolve, animations: {
self.updateDataSource()
}, completion: nil)

UIView.animate(withDuration: 0.4) {
self.update()
}

let toastView = RSTToastView()
toastView.textLabel.text = Settings.sortSaveStatesByOldestFirst ? NSLocalizedString("Oldest First", comment: "") : NSLocalizedString("Newest First", comment: "")
toastView.presentationEdge = .top
toastView.tintColor = UIColor.deltaPurple
toastView.show(in: self.view, duration: 2.0)
}

//MARK: - Convenience Methods -

func correctedSectionForSectionIndex(_ section: Int) -> Section
Expand Down
13 changes: 1 addition & 12 deletions Delta/Settings/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ struct Settings
let defaults = [#keyPath(UserDefaults.translucentControllerSkinOpacity): 0.7,
#keyPath(UserDefaults.gameShortcutsMode): GameShortcutsMode.recent.rawValue,
#keyPath(UserDefaults.isButtonHapticFeedbackEnabled): true,
#keyPath(UserDefaults.isThumbstickHapticFeedbackEnabled): true,
#keyPath(UserDefaults.sortSaveStatesByOldestFirst): true] as [String : Any]
#keyPath(UserDefaults.isThumbstickHapticFeedbackEnabled): true] as [String : Any]
UserDefaults.standard.register(defaults: defaults)
}
}
Expand Down Expand Up @@ -169,14 +168,6 @@ extension Settings
}
}

static var sortSaveStatesByOldestFirst: Bool {
set { UserDefaults.standard.sortSaveStatesByOldestFirst = newValue }
get {
let sortByOldestFirst = UserDefaults.standard.sortSaveStatesByOldestFirst
return sortByOldestFirst
}
}

static func preferredControllerSkin(for system: System, traits: DeltaCore.ControllerSkin.Traits) -> ControllerSkin?
{
guard let userDefaultsKey = self.preferredControllerSkinKey(for: system, traits: traits) else { return nil }
Expand Down Expand Up @@ -279,6 +270,4 @@ private extension UserDefaults

@NSManaged var isButtonHapticFeedbackEnabled: Bool
@NSManaged var isThumbstickHapticFeedbackEnabled: Bool

@NSManaged var sortSaveStatesByOldestFirst: Bool
}
8 changes: 4 additions & 4 deletions Delta/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<string>1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down Expand Up @@ -161,7 +161,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<string>14</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down Expand Up @@ -222,8 +222,6 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
Expand Down Expand Up @@ -371,5 +369,7 @@
</dict>
</dict>
</array>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
</dict>
</plist>