@@ -16,9 +16,10 @@ struct LauncherView: View {
1616 @FetchRequest ( sortDescriptors: [ SortDescriptor ( \. title) ] ) var launcherRepos : FetchedResults < LauncherRepos >
1717 @State var existingRepo = URL ( string: " " )
1818 @State var repoTitle = " "
19- @State var currentVersion = " v1.1.0 \n "
19+ @State var currentVersion = " v1.1.2 \n "
2020 @State var updateAlert = false
2121 @State var latestVersion = " "
22+ @State var repoArgs = " "
2223 @AppStorage ( " firstLaunch " ) var firstLaunch = true
2324 let sm64 : UTType = . init( filenameExtension: " f3dex2e " ) !
2425
@@ -50,19 +51,33 @@ struct LauncherView: View {
5051
5152 Button ( action: {
5253
53- for i in 0 ... launcherRepos. count - 1 {
54- launcherRepos [ i ] . isEditing = false
54+ for iEdit in 0 ... launcherRepos. count - 1 {
55+ launcherRepos [ iEdit ] . isEditing = false
5556 }
5657
5758 launcherRepos [ i] . isEditing = true
5859 } ) {
5960 Image ( systemName: " pencil " )
6061 } . popover ( isPresented: Binding . constant ( launcherRepos [ i] . isEditing) ) {
6162
62- HStack {
63+ VStack {
6364 TextField ( " Name of Repo " , text: $repoTitle)
65+ . lineLimit ( nil )
66+ . scaledToFill ( )
6467 . onChange ( of: repoTitle) { _ in
6568 launcherRepos [ i] . title = repoTitle
69+ do {
70+ try moc. save ( )
71+ }
72+ catch {
73+ print ( " Its broken \( error) " )
74+ }
75+ }
76+ TextField ( " Arguments " , text: $repoArgs)
77+ . lineLimit ( nil )
78+ . scaledToFill ( )
79+ . onChange ( of: repoArgs) { _ in
80+ launcherRepos [ i] . args = repoArgs
6681
6782 do {
6883 try moc. save ( )
@@ -71,7 +86,10 @@ struct LauncherView: View {
7186 print ( " Its broken \( error) " )
7287 }
7388 }
74- } . onAppear { repoTitle = launcherRepos [ i] . title ?? " " }
89+ } . onAppear {
90+ repoTitle = launcherRepos [ i] . title ?? " "
91+ repoArgs = launcherRepos [ i] . args ?? " "
92+ }
7593 }
7694
7795 Button ( action: {
@@ -91,7 +109,7 @@ struct LauncherView: View {
91109 }
92110
93111 Button ( action: {
94- try ? print ( shell. shell ( " \( LauncherRepo . path ?? " its broken " ) " ) )
112+ try ? print ( shell. shell ( " \( LauncherRepo . path ?? " its broken " ) \( LauncherRepo . args ?? " " ) " ) )
95113
96114 print ( LauncherRepo . path ?? " " )
97115 } ) {
@@ -131,6 +149,8 @@ struct LauncherView: View {
131149
132150 repo. title = " Repo \( launcherRepos. count) "
133151 repo. path = existingRepo? . path
152+ repo. args = " "
153+ repo. id = UUID ( )
134154
135155 do {
136156 try moc. save ( )
@@ -161,7 +181,7 @@ struct LauncherView: View {
161181 }
162182
163183 if firstLaunch {
164- try ? shell. shell ( " cd ~/ && mkdir SM64Repos " )
184+ try ? print ( shell. shell ( " cd ~/ && mkdir SM64Repos " ) )
165185 }
166186
167187 if launcherRepos. isEmpty { return }
0 commit comments