@@ -35,6 +35,7 @@ public class QAVSOperation
3535 {
3636 public QAVSOperationType type { get ; set ; } = QAVSOperationType . ModInstall ;
3737 public string name { get ; set ; } = "" ;
38+ public int operationId { get ; set ; } = 0 ;
3839 }
3940
4041 public class QAVSModManager
@@ -100,7 +101,7 @@ public static void InstallFirstModFromQueue()
100101 installingMod = true ;
101102 int operationId = operations ;
102103 operations ++ ;
103- runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . ModInstall , name = "Installing " + installQueue [ 0 ] . filename } ) ;
104+ runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . ModInstall , name = "Installing " + installQueue [ 0 ] . filename , operationId = operationId } ) ;
104105
105106 if ( ! SupportsFormat ( Path . GetExtension ( installQueue [ 0 ] . filename ) ) )
106107 {
@@ -123,7 +124,7 @@ public static void InstallFirstModFromQueue()
123124 runningOperations . Remove ( operationId ) ;
124125 operationId = operations ;
125126 operations ++ ;
126- runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . Error , name = "Error installing mod: " + e . Message + "\n \n To remove this message restart QuestAppVersionSwitcher" } ) ;
127+ runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . Error , name = "Error installing mod: " + e . Message + "\n \n To remove this message restart QuestAppVersionSwitcher" , operationId = operationId } ) ;
127128 }
128129 modManager . ForceSave ( ) ;
129130 installQueue . RemoveAt ( 0 ) ;
@@ -135,7 +136,7 @@ public static void InstallMod(string path, string fileName)
135136 {
136137 int operationId = operations ;
137138 operations ++ ;
138- runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . Other , name = "Mod install queued: " + fileName } ) ;
139+ runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . Other , name = "Mod install queued: " + fileName , operationId = operationId } ) ;
139140 installQueue . Add ( new QueuedMod ( path , fileName , operationId ) ) ;
140141 InstallFirstModFromQueue ( ) ;
141142 }
@@ -144,7 +145,7 @@ public static void UninstallMod(string id)
144145 {
145146 int operationId = operations ;
146147 operations ++ ;
147- runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . ModUninstall , name = "Unnstalling " + id } ) ;
148+ runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . ModUninstall , name = "Unnstalling " + id , operationId = operationId } ) ;
148149
149150 foreach ( IMod m in modManager . AllMods )
150151 {
@@ -164,7 +165,7 @@ public static void DeleteMod(string id)
164165 {
165166 int operationId = operations ;
166167 operations ++ ;
167- runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . ModDelete , name = "Deleting " + id } ) ;
168+ runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . ModDelete , name = "Deleting " + id , operationId = operationId } ) ;
168169 foreach ( IMod m in modManager . AllMods )
169170 {
170171 if ( m . Id == id )
@@ -186,7 +187,7 @@ public static void InstallModFromUrl(string url)
186187 DownloadManager m = new DownloadManager ( ) ;
187188 int operationId = operations ;
188189 operations ++ ;
189- runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . ModDownload , name = "Downloading mod: " + Path . GetFileName ( url . Split ( '?' ) [ 0 ] ) } ) ;
190+ runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . ModDownload , name = "Downloading mod: " + Path . GetFileName ( url . Split ( '?' ) [ 0 ] ) , operationId = operationId } ) ;
190191 m . DownloadFinishedEvent += ( manager ) =>
191192 {
192193 //CoreService.browser.EvaluateJavascript("ShowToast('Downloaded, now installing', '#FFFFFF', '#222222')", null);
@@ -210,7 +211,7 @@ public static void EnableMod(string id)
210211 {
211212 int operationId = operations ;
212213 operations ++ ;
213- runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . ModInstall , name = "Installing " + id } ) ;
214+ runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . ModInstall , name = "Installing " + id , operationId = operationId } ) ;
214215
215216 foreach ( IMod m in modManager . AllMods )
216217 {
@@ -226,7 +227,7 @@ public static void EnableMod(string id)
226227 runningOperations . Remove ( operationId ) ;
227228 operationId = operations ;
228229 operations ++ ;
229- runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . Error , name = "Error enabling mod: " + e . Message + "\n \n To remove this message restart QuestAppVersionSwitcher" } ) ;
230+ runningOperations . Add ( operationId , new QAVSOperation { type = QAVSOperationType . Error , name = "Error enabling mod: " + e . Message + "\n \n To remove this message restart QuestAppVersionSwitcher" , operationId = operationId } ) ;
230231 }
231232 break ;
232233 }
0 commit comments