mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-27 08:15:03 -05:00
Prompt user for clipboard directory use if present for box dump/save (#3566)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
|
||||
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
|
||||
|
||||
namespace PKHeX.Core;
|
||||
|
||||
@@ -152,6 +152,7 @@ public static class MessageStrings
|
||||
public static string MsgSaveBoxClearAll { get; set; } = "Clear ALL Boxes?!";
|
||||
public static string MsgSaveBoxClearAllFailBattle { get; set; } = "Battle Box slots prevent the clearing of all boxes.";
|
||||
public static string MsgSaveBoxClearAllSuccess { get; set; } = "Boxes cleared!";
|
||||
public static string MsgSaveBoxUseClipboard { get; set; } = "Use this folder found in your clipboard? {0}";
|
||||
|
||||
public static string MsgSaveBoxFailNone { get; set; } = "The currently loaded save file does not have boxes!";
|
||||
public static string MsgSaveBoxExportYes { get; set; } = "Yes: Export All Boxes";
|
||||
|
||||
@@ -766,6 +766,17 @@ public bool GetBulkImportSettings(out bool clearAll, out bool overwrite, out PKM
|
||||
|
||||
private static bool IsFolderPath(out string path)
|
||||
{
|
||||
if (Clipboard.ContainsText())
|
||||
{
|
||||
var directory = Clipboard.GetText();
|
||||
// Ask user if they want to use clipboard directory before showing folder browser
|
||||
if (Directory.Exists(directory) && WinFormsUtil.Prompt(MessageBoxButtons.YesNo, string.Format(MsgSaveBoxUseClipboard, directory)) == DialogResult.Yes)
|
||||
{
|
||||
path = directory;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
using var fbd = new FolderBrowserDialog();
|
||||
var result = fbd.ShowDialog() == DialogResult.OK;
|
||||
path = fbd.SelectedPath;
|
||||
|
||||
Reference in New Issue
Block a user