Skip to content

Commit

Permalink
Updated some files
Browse files Browse the repository at this point in the history
  • Loading branch information
WindowsMEMZ committed Jul 14, 2024
1 parent 7a2f940 commit 6ba09cc
Show file tree
Hide file tree
Showing 1,401 changed files with 3,378 additions and 7,968 deletions.
Binary file modified .DS_Store
Binary file not shown.
5,616 changes: 2,992 additions & 2,624 deletions BAGen.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions BAGen/BAGen.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.personal-information.photos-library</key>
<true/>
</dict>
</plist>
55 changes: 26 additions & 29 deletions BAGen/BAGenApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,32 @@ struct BAGenApp: App {
var body: some Scene {
WindowGroup {
Group {
switch nowMainScene {
case .Intro:
ContentView()
.onAppear {
Timer.scheduledTimer(withTimeInterval: 0.05, repeats: true) { timer in
nowMainScene = nowScene
isAlertPresented = isGlobalAlertPresented
alertContent = globalAlertContent
}
}
case .TypeChoose:
TypeChooseView()
case .FSEditChooser:
FSEditChooserView()
case .FSEditor:
FSEditorView()
case .MTEditChooser:
MTEditChooserView()
case .MTEditor:
MTEditorView()
case .EachCharacters:
EachCharactersView.Serika()
case .CrashReporter:
CrashReporterView()
}
// switch nowMainScene {
// case .Intro:
// ContentView()
// .onAppear {
// Timer.scheduledTimer(withTimeInterval: 0.05, repeats: true) { timer in
// nowMainScene = nowScene
// isAlertPresented = isGlobalAlertPresented
// alertContent = globalAlertContent
// }
// }
// case .TypeChoose:
// TypeChooseView()
// case .FSEditChooser:
// FSEditChooserView()
// case .FSEditor:
// FSEditorView()
// case .MTEditChooser:
// MTEditChooserView()
// case .MTEditor:
// MTEditorView()
// case .EachCharacters:
// EachCharactersView.Serika()
// case .CrashReporter:
// CrashReporterView()
// }
MTEditChooserView()
}
.overlay {
if isAlertPresented, let content = globalAlertContent {
Expand Down Expand Up @@ -156,11 +157,7 @@ func ChangeScene(to sceneName: NowScene) {
}

class AppDelegate: NSObject, UIApplicationDelegate {
public static var orientationLock = UIInterfaceOrientationMask.landscape

func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return AppDelegate.orientationLock
}
}

func CrashHander(signalStr: String, signalCode: Int32) {
Expand Down
50 changes: 50 additions & 0 deletions BAGen/CharaImgsDownloadView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// TypeChooseView.swift
// BAGen
//
// Created by WindowsMEMZ on 2023/10/2.
//

import SwiftUI
import DarockKit

struct CharaImgsDownloadView: View {
@State var downloadProgressTimer: Timer?
@State var downloadProgress = Progress(totalUnitCount: 0)
var body: some View {
NavigationStack {
NStack {
ScrollView {
VStack {
NeuText("下载角色立绘/表情差分资源")
NeuProgressView(value: Float(downloadProgress.completedUnitCount), total: Float(downloadProgress.totalUnitCount), width: UIScreen.main.bounds.width - 30)
Text("\(String(format: "%.2f", Double(downloadProgress.completedUnitCount) / 1024 / 1024))MB / \(String(format: "%.2f", Double(downloadProgress.totalUnitCount) / 1024 / 1024))MB")
}
.padding()
}
.scrollIndicators(.never)
}
}
.onAppear {
UIApplication.shared.isIdleTimerDisabled = true

let resourceRequest = NSBundleResourceRequest(tags: ["CharaImg0"])
resourceRequest.loadingPriority = NSBundleResourceRequestLoadingPriorityUrgent
downloadProgressTimer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { _ in
downloadProgress = resourceRequest.progress
}
resourceRequest.beginAccessingResources { error in
downloadProgressTimer?.invalidate()
downloadProgressTimer = nil
if let error {
print(error)
DispatchQueue.main.async {
AlertKitAPI.present(title: error.localizedDescription, style: .iOS17AppleMusic)
}
return
}

}
}
}
}
Loading

0 comments on commit 6ba09cc

Please sign in to comment.