* Adds extension to handle interactions with Photos app - isAuthorized to check/ask for authorization - saveUIImage to save a UIImage to Photos * Adds a Pause Menu button for taking game screenshots * Adds @Feature and @Options for Game Screenshots * Implements Game Screenshots feature in GameViewController * Updates project settings * Passes call to save to Photos as a closure into authorization prompt - Ensures that the screenshot is saved when the user is first prompted for access to Photos - More elegant extension code --------- Co-authored-by: Riley Testut <riley@rileytestut.com>
34 lines
1.1 KiB
Swift
34 lines
1.1 KiB
Swift
//
|
|
// ExperimentalFeatures.swift
|
|
// Delta
|
|
//
|
|
// Created by Riley Testut on 4/6/23.
|
|
// Copyright © 2023 Riley Testut. All rights reserved.
|
|
//
|
|
|
|
import DeltaFeatures
|
|
|
|
struct ExperimentalFeatures: FeatureContainer
|
|
{
|
|
static let shared = ExperimentalFeatures()
|
|
|
|
@Feature(name: "Variable Fast Forward",
|
|
description: "Change the preferred Fast Foward speed per-system. You can also change it by long-pressing the Fast Forward button from the Pause Menu.",
|
|
options: VariableFastForwardOptions())
|
|
var variableFastForward
|
|
|
|
@Feature(name: "Show Status Bar",
|
|
description: "Enable to show the Status Bar during gameplay.")
|
|
var showStatusBar
|
|
|
|
@Feature(name: "Game Screenshots",
|
|
description: "When enabled, a Screenshot button will appear in the Pause Menu, allowing you to save a screenshot of your game. You can choose to save the screenshot to Photos or Files.",
|
|
options: GameScreenshotsOptions())
|
|
var gameScreenshots
|
|
|
|
private init()
|
|
{
|
|
self.prepareFeatures()
|
|
}
|
|
}
|