[ExpFeat] Adds “Review Save States” to fix save states associated with wrong game
This commit is contained in:
parent
a9f15144ed
commit
ca8c2cb8c5
@ -171,6 +171,7 @@
|
||||
BFFDF04623E3D3A600931B96 /* libMupen64Plus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BFFDF04523E3D3A600931B96 /* libMupen64Plus.a */; };
|
||||
D5011C48281B6E8B00A0760B /* CharacterSet+Filename.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5011C47281B6E8B00A0760B /* CharacterSet+Filename.swift */; };
|
||||
D510BC752A5CA9F500450CC0 /* Delta6ToDelta7.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = D510BC742A5CA9F500450CC0 /* Delta6ToDelta7.xcmappingmodel */; };
|
||||
D5147EC82A817B4A00D6CD64 /* ReviewSaveStatesOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5147EC72A817B4A00D6CD64 /* ReviewSaveStatesOptions.swift */; };
|
||||
D517F6BA29E730DA000D14D0 /* SettingsName.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5A9C01929DDFBDD00A8D610 /* SettingsName.swift */; };
|
||||
D517F6BE29E7535F000D14D0 /* Collection+Optionals.swift in Sources */ = {isa = PBXBuildFile; fileRef = D517F6BD29E7535F000D14D0 /* Collection+Optionals.swift */; };
|
||||
D51CB7A129EDC01400B59678 /* libDeltaFeatures.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D5D7C1F129E60DFF00663793 /* libDeltaFeatures.a */; };
|
||||
@ -439,6 +440,7 @@
|
||||
C786AF1D2DDB6223BE2063CC /* Pods-Delta.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Delta.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Delta/Pods-Delta.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
D5011C47281B6E8B00A0760B /* CharacterSet+Filename.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CharacterSet+Filename.swift"; sourceTree = "<group>"; };
|
||||
D510BC742A5CA9F500450CC0 /* Delta6ToDelta7.xcmappingmodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcmappingmodel; path = Delta6ToDelta7.xcmappingmodel; sourceTree = "<group>"; };
|
||||
D5147EC72A817B4A00D6CD64 /* ReviewSaveStatesOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewSaveStatesOptions.swift; sourceTree = "<group>"; };
|
||||
D517F6BD29E7535F000D14D0 /* Collection+Optionals.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Collection+Optionals.swift"; sourceTree = "<group>"; };
|
||||
D51CB7A529EDC15900B59678 /* ExperimentalFeatures.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExperimentalFeatures.swift; sourceTree = "<group>"; };
|
||||
D524F4A2273DE9C000D500B2 /* ProcessInfo+JIT.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ProcessInfo+JIT.swift"; sourceTree = "<group>"; };
|
||||
@ -1114,6 +1116,7 @@
|
||||
D5DF06DE29F326E6009E577C /* AirPlaySkins.swift */,
|
||||
ACF7E30C29F73D03000FE071 /* GameScreenshots.swift */,
|
||||
AC1C990F29F8B8C30020E6E4 /* ToastNotificationOptions.swift */,
|
||||
D5147EC72A817B4A00D6CD64 /* ReviewSaveStatesOptions.swift */,
|
||||
);
|
||||
path = Features;
|
||||
sourceTree = "<group>";
|
||||
@ -1543,6 +1546,7 @@
|
||||
D5011C48281B6E8B00A0760B /* CharacterSet+Filename.swift in Sources */,
|
||||
BFE593CC21F3F8C2003412A6 /* _GameSave.swift in Sources */,
|
||||
BF63A1A321A4AAAE00EE8F61 /* RecordSyncStatusViewController.swift in Sources */,
|
||||
D5147EC82A817B4A00D6CD64 /* ReviewSaveStatesOptions.swift in Sources */,
|
||||
BFAA1FED1B8AA4FA00495943 /* Settings.swift in Sources */,
|
||||
BFA0D1271D3AE1F600565894 /* GameViewController.swift in Sources */,
|
||||
BF59428A1E09BC8B0051894B /* _SaveState.swift in Sources */,
|
||||
|
||||
@ -36,6 +36,11 @@ struct ExperimentalFeatures: FeatureContainer
|
||||
options: ToastNotificationOptions())
|
||||
var toastNotifications
|
||||
|
||||
@Feature(name: "Review Save States",
|
||||
description: "Review recent Save States to make sure they are associated with the correct game.",
|
||||
options: ReviewSaveStatesOptions())
|
||||
var reviewSaveStates
|
||||
|
||||
private init()
|
||||
{
|
||||
self.prepareFeatures()
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
//
|
||||
// LinkSaveStatesOptions.swift
|
||||
// Delta
|
||||
//
|
||||
// Created by Riley Testut on 8/7/23.
|
||||
// Copyright © 2023 Riley Testut. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
import DeltaFeatures
|
||||
|
||||
struct ReviewSaveStatesView: UIViewControllerRepresentable
|
||||
{
|
||||
func makeUIViewController(context: Context) -> ReviewSaveStatesViewController
|
||||
{
|
||||
let viewController = ReviewSaveStatesViewController()
|
||||
return viewController
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: ReviewSaveStatesViewController, context: Context)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
struct ReviewSaveStatesOptions
|
||||
{
|
||||
@Option(name: "View Save States", detailView: { _ in ReviewSaveStatesView() })
|
||||
private var reviewSaveStates: String = "" // Hack until I figure out how to support Void properties...
|
||||
}
|
||||
@ -97,11 +97,7 @@ private struct OptionRow<Option: AnyOption, DetailView: View>: View where Detail
|
||||
}
|
||||
else
|
||||
{
|
||||
let wrappedDetailView = Form {
|
||||
detailView
|
||||
}
|
||||
|
||||
NavigationLink(destination: wrappedDetailView) {
|
||||
NavigationLink(destination: wrap(detailView)) {
|
||||
HStack {
|
||||
Text(name)
|
||||
Spacer()
|
||||
@ -122,4 +118,24 @@ private struct OptionRow<Option: AnyOption, DetailView: View>: View where Detail
|
||||
self.displayInline = displayInline
|
||||
}
|
||||
}
|
||||
|
||||
func wrap(_ detailView: some View) -> AnyView
|
||||
{
|
||||
let wrappedDetailView: AnyView
|
||||
|
||||
if self.detailView is any UIViewControllerRepresentable
|
||||
{
|
||||
wrappedDetailView = AnyView(detailView.ignoresSafeArea())
|
||||
}
|
||||
else
|
||||
{
|
||||
let form = Form {
|
||||
detailView
|
||||
}
|
||||
|
||||
wrappedDetailView = AnyView(form)
|
||||
}
|
||||
|
||||
return wrappedDetailView
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user