Skip to content

Commit

Permalink
Fix untrimmed showdown set
Browse files Browse the repository at this point in the history
  • Loading branch information
kwsch committed Sep 5, 2015
1 parent cf94b1c commit 84586f2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Misc/PKX.cs
Expand Up @@ -2089,7 +2089,7 @@ public Set(string input, string[] species, string[] items, string[] natures, str
string[] stats = { "HP", "Atk", "Def", "SpA", "SpD", "Spe" };

string[] lines = input.Split(new[] { "\r\n", "\n" }, StringSplitOptions.None);
for (int i = 0; i < lines.Length; i++) lines[i] = lines[i].Replace("'", ""); // Sanitize apostrophes
for (int i = 0; i < lines.Length; i++) lines[i] = lines[i].Replace("'", "").Trim(); // Sanitize apostrophes

// Seek for start of set
int start = -1;
Expand Down
2 changes: 1 addition & 1 deletion Misc/Util.cs
Expand Up @@ -130,7 +130,7 @@ internal static string get3DSLocation()
string[] DriveList = Environment.GetLogicalDrives();
for (int i = 1; i < DriveList.Length; i++) // Skip first drive (some users still have floppy drives and would chew up time!)
{
string potentialPath = DriveList[i] + Path.DirectorySeparatorChar + "Nintendo 3DS";
string potentialPath = Path.Combine(DriveList[i], "Nintendo 3DS");
if (!Directory.Exists(potentialPath)) continue;

path_3DS = potentialPath; break;
Expand Down
17 changes: 16 additions & 1 deletion PKX/f1-Main.cs
Expand Up @@ -142,6 +142,8 @@ public Form1()
path3DS = Util.get3DSLocation();
if (args.Length > 1)
openQuick(args[1]);
else if (path3DS != null && File.Exists(Path.Combine(Path.GetDirectoryName(path3DS), "SaveDataBackup", "main")))
openQuick(Path.Combine(Path.GetDirectoryName(path3DS), "SaveDataBackup", "main"));
else if (pathSDF != null)
openQuick(Path.Combine(pathSDF, "main"));
else if (File.Exists(Util.NormalizePath(Path.Combine(Util.GetTempFolder(), "root" + Path.DirectorySeparatorChar + "main"))))
Expand Down Expand Up @@ -2615,6 +2617,11 @@ private void clickExportSAV(object sender, EventArgs e)
cySAV.InitialDirectory = path3DS;
cySAV.RestoreDirectory = true;
}
else if (path3DS != null && File.Exists(Path.Combine(Path.GetDirectoryName(path3DS), "SaveDataBackup", "main")))
{
cySAV.InitialDirectory = Path.Combine(Path.GetDirectoryName(path3DS), "SaveDataBackup");
cySAV.RestoreDirectory = true;
}
else if (pathSDF != null && Directory.Exists(pathSDF))
{
cySAV.InitialDirectory = pathSDF;
Expand Down Expand Up @@ -3637,8 +3644,11 @@ private void clickSaveFileName(object sender, EventArgs e)
// Get latest SaveDataFiler save location
pathSDF = Util.GetSDFLocation();
string path = null;
bool sdbPath = File.Exists(Path.Combine(Path.GetDirectoryName(path3DS), "SaveDataBackup", "main"));

if (pathSDF != null && ModifierKeys != Keys.Control) // if we have a result
if (sdbPath && ModifierKeys != Keys.Control)
path = Path.Combine(Path.GetDirectoryName(path3DS), "SaveDataBackup", "main");
else if (pathSDF != null && ModifierKeys != Keys.Shift) // if we have a result
path = Path.Combine(pathSDF, "main");
else if (File.Exists(Util.NormalizePath(Path.Combine(Util.GetTempFolder(), "root" + Path.DirectorySeparatorChar + "main")))) // else if cgse exists
path = Util.NormalizePath(Path.Combine(Util.GetTempFolder(), "root" + Path.DirectorySeparatorChar + "main"));
Expand All @@ -3656,6 +3666,11 @@ private void clickOpenTempFolder(object sender, EventArgs e)
path = Util.GetCacheFolder();
if (Directory.Exists(path)) System.Diagnostics.Process.Start("explorer.exe", @path); else Util.Alert("Can't find the cache folder.");
break;
case Keys.Shift: // SaveDataBackup
Path.Combine(Path.GetDirectoryName(path3DS), "SaveDataBackup", "main");
if (path3DS != null && File.Exists(path = Path.Combine(Path.GetDirectoryName(path3DS), "SaveDataBackup", "main")))
System.Diagnostics.Process.Start("explorer.exe", @Path.GetDirectoryName(path)); else Util.Alert("Can't find the SaveDataBackup folder.");
break;
case Keys.Alt: // SaveDataFiler
path = Util.GetSDFLocation();
if (Directory.Exists(path)) System.Diagnostics.Process.Start("explorer.exe", @path); else Util.Alert("Can't find the SDF folder.");
Expand Down
9 changes: 7 additions & 2 deletions Resources/text/changelog.txt
Expand Up @@ -534,12 +534,17 @@ http://projectpokemon.org/forums/showthread.php?36986
- Hotfix: Wondercard QRs with non-held items will no longer error out. Thanks ShinyMeganium!
- Hotfix: Prevented export of Eon Ticket Wondercards via QR because extra data has to be altered in order for it to function.

8/8/15 - New Update:
8/8/15 - New Update: (35500)
- Added: Korean Translation. Thanks cocoblue!
- Added: Can now copy current moves to Relearn Moves by clicking on the Current Moves groupBox.
- Fixed: Showdown Import made a little more flexible for non-exported sets (ie, user created with mistakes). Thanks Favna!
- Fixed: Showdown Import now recogizes even more edge cases. Thanks Odaxis!
- Fixed: Fill Dex now doesn't error out. Thanks ShaKage!
- Fixed: Characteristics should now display properly for all cases. Thanks fcugqx!
- Changed: The program now keeps track of the current box to mimic the ingame box system. Thanks codemonkey85!
- Fixed: Saving the current box will no longer cause black screens when saving on the Party / Battle Box tab. Thanks RustInPeace!
- Fixed: Saving the current box will no longer cause black screens when saving on the Party / Battle Box tab. Thanks RustInPeace!

9/5/15 - New Update:
- Added: Auto-loading of SaveDataBackup saves on program start. Click the SAV: XXXX Label to manually trigger.
- Fixed: Showdown Importing with trailing spaces will now import properly. Thanks Favna & RustInPeace!
- Fixed: Added Korean Translation file. Thanks cocoblue!

0 comments on commit 84586f2

Please sign in to comment.