diff --git a/assets/i18n/strings.i18n.json b/assets/i18n/strings.i18n.json index 36469478..63af9768 100755 --- a/assets/i18n/strings.i18n.json +++ b/assets/i18n/strings.i18n.json @@ -55,7 +55,8 @@ "widgetTitle": "Patcher", "patchButton": "Patch", "incompatibleArchWarningDialogText": "Patching on this architecture is not yet supported and might fail. Continue anyways?", - "removedPatchesWarningDialogText": "The following patches have been removed since the last time you used them.\n\n${patches}\n\nContinue anyways?", + "removedPatchesWarningDialogText": "Removed patches since the last time you used them:\n\n${patches}\n\n${newPatches}Continue anyways?", + "addedPatchesDialogText": "Added patches since the last time you used them:\n\n${addedPatches}\n\n", "requiredOptionDialogText": "Some patch options have to be set." }, "appSelectorCard": { diff --git a/lib/ui/views/patcher/patcher_viewmodel.dart b/lib/ui/views/patcher/patcher_viewmodel.dart index 68d86520..02d4d70f 100644 --- a/lib/ui/views/patcher/patcher_viewmodel.dart +++ b/lib/ui/views/patcher/patcher_viewmodel.dart @@ -28,6 +28,7 @@ class PatcherViewModel extends BaseViewModel { BuildContext? ctx; List selectedPatches = []; List removedPatches = []; + List newPatches = []; void navigateToAppSelector() { _navigationService.navigateTo(Routes.appSelectorView); @@ -59,6 +60,11 @@ class PatcherViewModel extends BaseViewModel { child: Text( t.patcherView.removedPatchesWarningDialogText( patches: removedPatches.join('\n'), + newPatches: newPatches.isNotEmpty + ? t.patcherView.addedPatchesDialogText( + addedPatches: newPatches.join('\n'), + ) + : '', ), ), ), @@ -188,14 +194,14 @@ class PatcherViewModel extends BaseViewModel { } if (savedPatchNames.isEmpty) { return false; - } else { - return !savedPatchNames.contains(patch.name); } + return !savedPatchNames.contains(patch.name); } Future loadLastSelectedPatches() async { this.selectedPatches.clear(); removedPatches.clear(); + newPatches.clear(); final List selectedPatches = await _managerAPI.getSelectedPatches(selectedApp!.packageName); final List patches = @@ -236,6 +242,11 @@ class PatcherViewModel extends BaseViewModel { } } } + for (final patch in patches) { + if (isPatchNew(patch)) { + newPatches.add('• ${patch.name}'); + } + } notifyListeners(); } }