From 7326a09e6955f74265fe22fee167cf8f3c781068 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 28 Nov 2014 13:18:44 -0800 Subject: [PATCH] More Fixes --- Misc/Util.cs | 59 ++++++++++++---------- PKHeX.csproj | 1 + PKX/f1-Main.cs | 11 ++++- Properties/Resources.Designer.cs | 82 +++++++++++++------------------ Properties/Resources.resx | 3 ++ Resources/img/item/item_571.png | Bin 0 -> 280 bytes 6 files changed, 81 insertions(+), 75 deletions(-) create mode 100644 Resources/img/item/item_571.png diff --git a/Misc/Util.cs b/Misc/Util.cs index 89afea766..a90b265fc 100644 --- a/Misc/Util.cs +++ b/Misc/Util.cs @@ -123,36 +123,43 @@ namespace PKHeX } internal static string GetSDFLocation() { - // start by checking if the 3DS file path exists or not. - string path_SDF = null; - string[] DriveList = Environment.GetLogicalDrives(); - for (int i = 1; i < DriveList.Length; i++) + try { - path_SDF = DriveList[i] + "filer\\UserSaveData\\"; - if (Directory.Exists(path_SDF)) - break; - } - if (path_SDF == null) - return null; - else - { - // 3DS data found in SD card reader. Let's get the title folder location! - string[] folders = Directory.GetDirectories(path_SDF, "*", System.IO.SearchOption.TopDirectoryOnly); - - // Loop through all the folders in the Nintendo 3DS folder to see if any of them contain 'title'. - for (int i = folders.Length - 1; i > 0; i--) + // start by checking if the 3DS file path exists or not. + string path_SDF = null; + string[] DriveList = Environment.GetLogicalDrives(); + for (int i = 1; i < DriveList.Length; i++) { - if (File.Exists(Path.Combine(folders[i], "000011c4\\main"))) return Path.Combine(folders[i], "000011c4"); // OR - if (File.Exists(Path.Combine(folders[i], "000011c5\\main"))) return Path.Combine(folders[i], "000011c5"); // AS - if (File.Exists(Path.Combine(folders[i], "0000055d\\main"))) return Path.Combine(folders[i], "0000055d"); // X - if (File.Exists(Path.Combine(folders[i], "0000055e\\main"))) return Path.Combine(folders[i], "0000055e"); // Y - - // I don't know - if (File.Exists(Path.Combine(folders[i], "00055d00\\main"))) return Path.Combine(folders[i], "00055d00"); // X - if (File.Exists(Path.Combine(folders[i], "00055e00\\main"))) return Path.Combine(folders[i], "00055e00"); // Y + string potentialPath_SDF = Path.Combine(DriveList[i], "filer\\UserSaveData\\"); + if (Directory.Exists(potentialPath_SDF)) + { + path_SDF = potentialPath_SDF; + break; + } + } + if (path_SDF == null) + return null; + else + { + // 3DS data found in SD card reader. Let's get the title folder location! + string[] folders = Directory.GetDirectories(path_SDF, "*", System.IO.SearchOption.TopDirectoryOnly); + + // Loop through all the folders in the Nintendo 3DS folder to see if any of them contain 'title'. + for (int i = folders.Length - 1; i > 0; i--) + { + if (File.Exists(Path.Combine(folders[i], "000011c4\\main"))) return Path.Combine(folders[i], "000011c4"); // OR + if (File.Exists(Path.Combine(folders[i], "000011c5\\main"))) return Path.Combine(folders[i], "000011c5"); // AS + if (File.Exists(Path.Combine(folders[i], "0000055d\\main"))) return Path.Combine(folders[i], "0000055d"); // X + if (File.Exists(Path.Combine(folders[i], "0000055e\\main"))) return Path.Combine(folders[i], "0000055e"); // Y + + // I don't know + if (File.Exists(Path.Combine(folders[i], "00055d00\\main"))) return Path.Combine(folders[i], "00055d00"); // X + if (File.Exists(Path.Combine(folders[i], "00055e00\\main"))) return Path.Combine(folders[i], "00055e00"); // Y + } + return null; } - return null; } + catch { return null; } } internal static string CleanFileName(string fileName) { diff --git a/PKHeX.csproj b/PKHeX.csproj index 649553664..24beac3e4 100644 --- a/PKHeX.csproj +++ b/PKHeX.csproj @@ -328,6 +328,7 @@ + diff --git a/PKX/f1-Main.cs b/PKX/f1-Main.cs index 88839f280..3290bf9ab 100644 --- a/PKX/f1-Main.cs +++ b/PKX/f1-Main.cs @@ -3605,15 +3605,24 @@ namespace PKHeX private void mainmenuOpen(object sender, EventArgs e) { string cyberpath = Util.GetTempFolder(); - if (Directory.Exists(cyberpath + "\\root\\")) + SDFLoc = Util.GetSDFLocation(); + if (SDFLoc != null) + { + OpenPKX.InitialDirectory = SDFLoc; + OpenPKX.RestoreDirectory = true; + OpenPKX.FilterIndex = 4; + } + else if (Directory.Exists(cyberpath + "\\root\\")) { OpenPKX.InitialDirectory = cyberpath + "\\root\\"; OpenPKX.RestoreDirectory = true; + OpenPKX.FilterIndex = 4; } else if (Directory.Exists(cyberpath)) { OpenPKX.InitialDirectory = cyberpath; OpenPKX.RestoreDirectory = true; + OpenPKX.FilterIndex = 4; } DialogResult result = OpenPKX.ShowDialog(); diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index ff8f2f95b..97ce5ea9d 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -13319,6 +13319,16 @@ namespace PKHeX.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap item_571 { + get { + object obj = ResourceManager.GetObject("item_571", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -21309,8 +21319,7 @@ namespace PKHeX.Properties { ///Medizin ///TM & VM ///Beeren - ///Basis-Items - ///. + ///Basis-Items. /// internal static string text_ItemPouch_de { get { @@ -21323,8 +21332,7 @@ namespace PKHeX.Properties { ///MEDICINE ///TMs & HMs ///BERRIES - ///KEY ITEMS - ///. + ///KEY ITEMS. /// internal static string text_ItemPouch_en { get { @@ -21337,8 +21345,7 @@ namespace PKHeX.Properties { ///Botiquín ///MT/MO ///Bayas - ///Objetos Clave - ///. + ///Objetos Clave. /// internal static string text_ItemPouch_es { get { @@ -21351,8 +21358,7 @@ namespace PKHeX.Properties { ///PV/PP ///CT & CS ///BAIES - ///OBJETS RARES - ///. + ///OBJETS RARES. /// internal static string text_ItemPouch_fr { get { @@ -21365,8 +21371,7 @@ namespace PKHeX.Properties { ///Rimedi ///MT e MN ///Bacche - ///Strumenti Base - ///. + ///Strumenti Base. /// internal static string text_ItemPouch_it { get { @@ -21379,8 +21384,7 @@ namespace PKHeX.Properties { ///かいふく ///わざマシン ///きのみ - ///たいせつなもの - ///. + ///たいせつなもの. /// internal static string text_ItemPouch_ja { get { @@ -21393,8 +21397,7 @@ namespace PKHeX.Properties { ///회복 ///기술머신 ///나무열매 - ///중요한 물건 - ///. + ///중요한 물건. /// internal static string text_ItemPouch_ko { get { @@ -22897,8 +22900,7 @@ namespace PKHeX.Properties { ///Frühlingsdeko-Pofflé ///Sommerdeko-Pofflé ///Herbstdeko-Pofflé - ///Winterdeko-Pofflé - ///. + ///Winterdeko-Pofflé. /// internal static string text_Puff_de { get { @@ -23059,8 +23061,7 @@ namespace PKHeX.Properties { ///フルデコはるポフレ ///フルデコなつポフレ ///フルデコあきポフレ - ///フルデコふゆポフレ - ///. + ///フルデコふゆポフレ. /// internal static string text_Puff_ja { get { @@ -23094,8 +23095,7 @@ namespace PKHeX.Properties { ///풀데코봄포플레 ///풀데코여름포플레 ///풀데코가을포플레 - ///풀데코겨울포플레 - ///. + ///풀데코겨울포플레. /// internal static string text_Puff_ko { get { @@ -23924,8 +23924,7 @@ namespace PKHeX.Properties { ///Dopplungs-Sack ///Flare-Sack ///Tabula Ra-Sack - ///Relax-Sack - ///. + ///Relax-Sack. /// internal static string text_TrainingBag_de { get { @@ -23960,8 +23959,7 @@ namespace PKHeX.Properties { ///Double-Up Bag ///Team Flare Bag ///Reset Bag - ///Soothing Bag - ///. + ///Soothing Bag. /// internal static string text_TrainingBag_en { get { @@ -23996,8 +23994,7 @@ namespace PKHeX.Properties { ///Saco Mejora x2 ///Saco Team Flare ///Saco Reinicio - ///Saco Relax - ///. + ///Saco Relax. /// internal static string text_TrainingBag_es { get { @@ -24032,8 +24029,7 @@ namespace PKHeX.Properties { ///Sac Gain↑ ///Sac Team Flare ///Sac Renouveau - ///Sac Relax - ///. + ///Sac Relax. /// internal static string text_TrainingBag_fr { get { @@ -24068,8 +24064,7 @@ namespace PKHeX.Properties { ///Sacco Raddoppio ///Sacco Team Flare ///Sacco Ripristino - ///Sacco Relax - ///. + ///Sacco Relax. /// internal static string text_TrainingBag_it { get { @@ -24104,8 +24099,7 @@ namespace PKHeX.Properties { ///ダブルUPバッグ ///フレアだんバッグ ///まっさらバッグ - ///リラックスバッグ - ///. + ///リラックスバッグ. /// internal static string text_TrainingBag_ja { get { @@ -24140,8 +24134,7 @@ namespace PKHeX.Properties { ///더블UP백 ///플레어단백 ///신품백 - ///릴랙스백 - ///. + ///릴랙스백. /// internal static string text_TrainingBag_ko { get { @@ -25098,8 +25091,7 @@ namespace PKHeX.Properties { ///---------- ///Einall-Region ///Kalos-Region - ///Pokémon-Link - ///. + ///Pokémon-Link. /// internal static string text_xy_30000_de { get { @@ -25118,8 +25110,7 @@ namespace PKHeX.Properties { ///---------- ///the Unova region ///the Kalos region - ///Pokémon Link - ///. + ///Pokémon Link. /// internal static string text_xy_30000_en { get { @@ -25138,8 +25129,7 @@ namespace PKHeX.Properties { ///---------- ///Teselia ///Kalos - ///Nexo Pokémon - ///. + ///Nexo Pokémon. /// internal static string text_xy_30000_es { get { @@ -25158,8 +25148,7 @@ namespace PKHeX.Properties { ///---------- ///Unys ///Kalos - ///Poké Lien - ///. + ///Poké Lien. /// internal static string text_xy_30000_fr { get { @@ -25178,8 +25167,7 @@ namespace PKHeX.Properties { ///---------- ///Unima ///Kalos - ///Pokémon Link - ///. + ///Pokémon Link. /// internal static string text_xy_30000_it { get { @@ -25198,8 +25186,7 @@ namespace PKHeX.Properties { ///---------- ///イッシュちほう ///カロスちほう - ///ポケモンリンク - ///. + ///ポケモンリンク. /// internal static string text_xy_30000_ja { get { @@ -25218,8 +25205,7 @@ namespace PKHeX.Properties { ///---------- ///하나지방 ///칼로스지방 - ///포켓몬링크 - ///. + ///포켓몬링크. /// internal static string text_xy_30000_ko { get { diff --git a/Properties/Resources.resx b/Properties/Resources.resx index f10c58cd6..eba8bbcb6 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -5146,4 +5146,7 @@ ..\Resources\img\badges\badge_08.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\img\item\item_571.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Resources/img/item/item_571.png b/Resources/img/item/item_571.png new file mode 100644 index 0000000000000000000000000000000000000000..d32b2388060f248cc0148cb180fd0dfa1a518c76 GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*bKn;gMnDKc2iWH!rREcXuNpOBzNqJ&XDnmeGW?qS&pKFLhnX#U! zo}q!km!gG0RqdWGjv*HQQzz}_Z7|?***xia3agh_*g_x~W*~D(QTR`zMxfI3xN}{1 zqYPbK-md!6`zSTs_W9NVH=CA1%XPPPw=e01*U SwQ``77(8A5T-G@yGywqgrDBi( literal 0 HcmV?d00001