From d6560585244be69333dfdbaf32e9177ad8c36ed1 Mon Sep 17 00:00:00 2001 From: "Spanti Nicola (RyDroid)" Date: Tue, 21 Jul 2015 00:26:14 +0200 Subject: [PATCH] Minor changes --- Misc/CodeGenerator.cs | 58 +++++++++++++++++++++++++++++++++++-------- Misc/Util.cs | 4 +-- app.config | 6 +++-- 3 files changed, 53 insertions(+), 15 deletions(-) diff --git a/Misc/CodeGenerator.cs b/Misc/CodeGenerator.cs index 71434968f..21d8bcfed 100644 --- a/Misc/CodeGenerator.cs +++ b/Misc/CodeGenerator.cs @@ -42,7 +42,8 @@ namespace PKHeX newdata = new byte[232]; Array.Copy(PKX.encryptArray(pkx), newdata, 232); } - else return false; + else + return false; } else if (CB_Source.SelectedIndex == 1) @@ -218,10 +219,17 @@ namespace PKHeX try { Clipboard.SetText(RTB_Code.Text); - Util.Alert("Code generated and copied to clipboard!", "Next time click [Create Diff] first."); + Util.Alert( + "Code generated and copied to clipboard!", + "Next time click [Create Diff] first."); } catch - { Util.Alert("No code created!", "Click [Create Diff], then make sure that data appears in the Text Box below. If no code appears, then you didn't save your changes.", "Be sure to Set the Pokemon you edited back into a Box/Party slot!"); } + { + Util.Alert( + "No code created!", + "Click [Create Diff], then make sure that data appears in the Text Box below. If no code appears, then you didn't save your changes.", + "Be sure to Set the Pokemon you edited back into a Box/Party slot!"); + } } } private void B_Diff_Click(object sender, EventArgs e) @@ -236,7 +244,11 @@ namespace PKHeX int boxoffset = 0x22600; if (m_parent.savegame_oras) boxoffset = 0x33000; - if (!m_parent.cybergadget) Array.Copy(editedsav, m_parent.savindex * 0x7F000 + 0x5400, newcyber, 0, newcyber.Length); + if (!m_parent.cybergadget) + { + Array.Copy(editedsav, m_parent.savindex * 0x7F000 + 0x5400, + newcyber, 0, newcyber.Length); + } int lines = 0; // 65400 for (int i = 0; i < newcyber.Length - 0x200; i += 4) @@ -251,7 +263,12 @@ namespace PKHeX lines++; if ((lines % 128 == 0) && CHK_Break.Checked) - { result += (Environment.NewLine + "--- Segment " + (lines / 128 + 1) + " ---" + Environment.NewLine + Environment.NewLine); } + { + result += + (Environment.NewLine + + "--- Segment " + (lines / 128 + 1) + " ---" + + Environment.NewLine + Environment.NewLine); + } if (lines > 10000) goto toomany; } @@ -269,7 +286,12 @@ namespace PKHeX lines++; if ((lines % 128 == 0) && CHK_Break.Checked) - { result += (Environment.NewLine + "--- Segment " + (lines / 128 + 1) + " ---" + Environment.NewLine + Environment.NewLine); } + { + result += + (Environment.NewLine + + "--- Segment " + (lines / 128 + 1) + " ---" + + Environment.NewLine + Environment.NewLine); + } if (lines > 10000) goto toomany; } } @@ -282,7 +304,12 @@ namespace PKHeX lines++; if ((lines % 128 == 0) && CHK_Break.Checked) - { result += (Environment.NewLine + "--- Segment " + (lines / 128 + 1) + " ---" + Environment.NewLine + Environment.NewLine); } + { + result += + (Environment.NewLine + + "--- Segment " + (lines / 128 + 1) + " ---" + + Environment.NewLine + Environment.NewLine); + } if (lines > 10000) goto toomany; } @@ -300,20 +327,29 @@ namespace PKHeX lines++; if ((lines % 128 == 0) && CHK_Break.Checked) - { result += (Environment.NewLine + "--- Segment " + (lines / 128 + 1) + " ---" + Environment.NewLine + Environment.NewLine); } + { + result += + (Environment.NewLine + + "--- Segment " + (lines / 128 + 1) + " ---" + + Environment.NewLine + Environment.NewLine); + } if (lines > 10000) goto toomany; } } if ((lines / 128 > 0) && CHK_Break.Checked) { - Util.Alert(String.Format("{0} Code Segments.", (1 + (lines / 128))), String.Format("{0} Lines.", lines)); + Util.Alert(String.Format("{0} Code Segments.", + (1 + (lines / 128))), + String.Format("{0} Lines.", lines)); } - RTB_Code.Text = result; return; + RTB_Code.Text = result; + return; toomany: { - Util.Alert("Too many differences detected.", "Export your save instead."); + Util.Alert("Too many differences detected.", + "Export your save instead."); } } diff --git a/Misc/Util.cs b/Misc/Util.cs index 93e10d05c..a9dcaa1f2 100644 --- a/Misc/Util.cs +++ b/Misc/Util.cs @@ -563,7 +563,7 @@ namespace PKHeX catch { Alert("No text (url) in clipboard."); return null; } try { if (address.Length < 4 || address.Substring(0, 3) != "htt") { Alert("Clipboard text is not a valid URL:", address); return null; } } catch { Alert("Clipboard text is not a valid URL:", address); return null; } - string webURL = "http://api.qrserver.com/v1/read-qr-code/?fileurl=" + System.Web.HttpUtility.UrlEncode(address); + string webURL = "https://api.qrserver.com/v1/read-qr-code/?fileurl=" + System.Web.HttpUtility.UrlEncode(address); try { System.Net.HttpWebRequest httpWebRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(webURL); @@ -587,7 +587,7 @@ namespace PKHeX { string qrdata = Convert.ToBase64String(data); string message = server + qrdata; - string webURL = "http://chart.apis.google.com/chart?chs=365x365&cht=qr&chl=" + System.Web.HttpUtility.UrlEncode(message); + string webURL = "https://chart.apis.google.com/chart?chs=365x365&cht=qr&chl=" + System.Web.HttpUtility.UrlEncode(message); try { diff --git a/app.config b/app.config index 2de2fffe2..b5dac54d7 100644 --- a/app.config +++ b/app.config @@ -1,6 +1,8 @@ - + - + + +