diff --git a/source/Reloaded.Mod.Launcher.Lib/Commands/Mod/DeleteModCommand.cs b/source/Reloaded.Mod.Launcher.Lib/Commands/Mod/DeleteModCommand.cs index f30b3976..af3a85b2 100644 --- a/source/Reloaded.Mod.Launcher.Lib/Commands/Mod/DeleteModCommand.cs +++ b/source/Reloaded.Mod.Launcher.Lib/Commands/Mod/DeleteModCommand.cs @@ -20,7 +20,15 @@ public DeleteModCommand(PathTuple? modTuple) /// public void Execute(object? parameter) { - // Delete folder contents. + var deleteConfirm = Actions.DisplayMessagebox.Invoke(Resources.DeleteModDialogTitle.Get(), string.Format(Resources.DeleteModDialogDescription.Get(), _modTuple.Config.ModName), new Actions.DisplayMessageBoxParams() + { + StartupLocation = Actions.WindowStartupLocation.CenterScreen, + Type = Actions.MessageBoxType.OkCancel + }); + + if (!deleteConfirm) + return; + var directory = Path.GetDirectoryName(_modTuple!.Path) ?? throw new InvalidOperationException(Resources.ErrorFailedToGetDirectoryOfMod.Get()); Directory.Delete(directory, true); } diff --git a/source/Reloaded.Mod.Launcher.Lib/Static/Resources.cs b/source/Reloaded.Mod.Launcher.Lib/Static/Resources.cs index 8748cdbb..5a4d0d36 100644 --- a/source/Reloaded.Mod.Launcher.Lib/Static/Resources.cs +++ b/source/Reloaded.Mod.Launcher.Lib/Static/Resources.cs @@ -204,4 +204,8 @@ public static void Init(IDictionaryResourceProvider provider) // Update 1.26.0: Drag & Drop Mods public static IDictionaryResource DragDropInstalledModsTitle { get; set; } public static IDictionaryResource DragDropInstalledModsDescription { get; set; } + + // Update 1.28.4: Delete Mod Dialog + public static IDictionaryResource DeleteModDialogTitle { get; set; } + public static IDictionaryResource DeleteModDialogDescription { get; set; } } \ No newline at end of file diff --git a/source/Reloaded.Mod.Launcher/Assets/Languages/en-GB.xaml b/source/Reloaded.Mod.Launcher/Assets/Languages/en-GB.xaml index f7f97af5..92d4fa58 100644 --- a/source/Reloaded.Mod.Launcher/Assets/Languages/en-GB.xaml +++ b/source/Reloaded.Mod.Launcher/Assets/Languages/en-GB.xaml @@ -716,4 +716,8 @@ For more info, refer to the tutorial. Don't forget to set correct Publish target Previous Next + + Delete Mod + {0} will be deleted. + \ No newline at end of file