swift reworks

This commit is contained in:
lizzie 2026-04-30 15:55:43 +00:00
parent 8b514d39fe
commit ccbcc9958c
7 changed files with 154 additions and 303 deletions

View file

@ -349,7 +349,7 @@ class Haptics {
struct ButtonView: View {
var button: VirtualControllerButtonType
@StateObject private var viewModel: EmulationViewModel = EmulationViewModel(game: nil)
@StateObject private var viewModel: EmulationViewModel = EmulationViewModel()
let appui = AppUI.shared
@State var mtkView: MTKView?
@State var width: CGFloat = 45
@ -446,7 +446,7 @@ struct EmulationView: View {
@Environment(\.scenePhase) var scenePhase
init(game: EmulationGame?) {
_viewModel = StateObject(wrappedValue: EmulationViewModel(game: game))
_viewModel = StateObject(wrappedValue: EmulationViewModel())
}
var body: some View {
@ -555,4 +555,4 @@ struct SizePreferenceKey: PreferenceKey {
static func reduce(value: inout CGSize, nextValue: () -> CGSize) {
value = nextValue()
}
}
}