private void L_QR_Click(object sender, EventArgs e) { if (ModifierKeys == Keys.Alt) { byte[] data = Util.getQRData(); if (data == null) { return; } if (data.Length != WC6.Size) { Util.Alert("Decoded data not 0x108 bytes.", $"QR Data Size: 0x{data.Length.ToString("X")}"); } else { try { wc6 = new WC6(data); loadwcdata(); } catch { Util.Alert("Error loading wondercard data."); } } } else { if (wc6.Data.SequenceEqual(new byte[wc6.Data.Length])) { Util.Alert("No wondercard data found in loaded slot!"); return; } if (wc6.Item == 726 && wc6.IsItem) { Util.Alert("Eon Ticket Wonder Cards will not function properly", "Inject to the save file instead."); return; } // Prep data byte[] wcdata = wc6.Data; // Ensure size Array.Resize(ref wcdata, WC6.Size); // Setup QR const string server = "http://lunarcookies.github.io/wc.html#"; Image qr = Util.getQRImage(wcdata, server); if (qr == null) { return; } string desc = wc6.Description; new QR(qr, PB_Preview.Image, desc, "", "", "PKHeX Wonder Card @ ProjectPokemon.org").ShowDialog(); } }
private void L_QR_Click(object sender, EventArgs e) { if (ModifierKeys == Keys.Alt) { byte[] wc = Util.getQRData(); if (wc.Length != WC6.Size) { Util.Alert("Decoded data not 0x108 bytes.", String.Format("QR Data Size: 0x{0}", wc.Length.ToString("X"))); } else { try { Array.Copy(wc, wondercard_data, wc.Length); loadwcdata(); } catch { Util.Alert("Error loading wondercard data."); } } } else { if (wondercard_data.SequenceEqual((new byte[wondercard_data.Length]))) { Util.Alert("No wondercard data found in loaded slot!"); return; } if (BitConverter.ToUInt16(wondercard_data, 0x68) == 726 && wondercard_data[0x51] == 1) { Util.Alert("Eon Ticket Wonder Cards will not function properly", "Inject to the save file instead."); return; } // Prep data byte[] wcdata = wondercard_data; // Ensure size Array.Resize(ref wcdata, WC6.Size); // Setup QR const string server = "http://lunarcookies.github.io/wc.html#"; Image qr = Util.getQRImage(wcdata, server); if (qr == null) { return; } string desc = getWCDescriptionString(wondercard_data); new QR(qr, PB_Preview.Image, desc, "", "", "PKHeX Wonder Card @ ProjectPokemon.org").ShowDialog(); } }