mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-03-21 17:48:28 -05:00
Misc clean
no functional change
This commit is contained in:
parent
9c521919e5
commit
d1f6a5a3ff
|
|
@ -1,6 +1,6 @@
|
|||
namespace PKHeX.Core
|
||||
{
|
||||
public enum RegionID
|
||||
public enum RegionID : byte
|
||||
{
|
||||
None = 0,
|
||||
Japan = 1,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
|
||||
namespace PKHeX.Core
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Object that can be fed to a <see cref="IEncounterable"/> converter to ensure that the resulting <see cref="PKM"/> meets rough specifications.
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ public static int GetFormatHeldItemID(int item, int srcFormat, int destFormat)
|
|||
if (destFormat != srcFormat && srcFormat <= 3) // past gen items
|
||||
{
|
||||
if (destFormat > 3) // try remapping
|
||||
return item = srcFormat == 2 ? GetG4Item((byte)item) : GetG4Item((ushort)item);
|
||||
return srcFormat == 2 ? GetG4Item((byte)item) : GetG4Item((ushort)item);
|
||||
|
||||
if (destFormat > srcFormat) // can't set past gen items
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace PKHeX.Core
|
||||
namespace PKHeX.Core
|
||||
{
|
||||
public enum RotateDirection
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
|
|
|
|||
|
|
@ -276,11 +276,11 @@ private string CreateDragDropPKM(PictureBox pb, bool encrypt, out bool external)
|
|||
Array.Resize(ref dragdata, SAV.SIZE_STORED);
|
||||
|
||||
// Make File
|
||||
PKM pkx = SAV.GetPKM(dragdata);
|
||||
string newfile = FileUtil.GetPKMTempFileName(pkx, encrypt);
|
||||
PKM pk = SAV.GetPKM(dragdata);
|
||||
string newfile = FileUtil.GetPKMTempFileName(pk, encrypt);
|
||||
try
|
||||
{
|
||||
TryMakeDragDropPKM(pb, encrypt, pkx, newfile, out external);
|
||||
TryMakeDragDropPKM(pb, encrypt, pk, newfile, out external);
|
||||
}
|
||||
catch (Exception x)
|
||||
{
|
||||
|
|
@ -291,9 +291,9 @@ private string CreateDragDropPKM(PictureBox pb, bool encrypt, out bool external)
|
|||
return newfile;
|
||||
}
|
||||
|
||||
private bool TryMakeDragDropPKM(PictureBox pb, bool encrypt, PKM pkx, string newfile, out bool external)
|
||||
private bool TryMakeDragDropPKM(PictureBox pb, bool encrypt, PKM pk, string newfile, out bool external)
|
||||
{
|
||||
File.WriteAllBytes(newfile, encrypt ? pkx.EncryptedBoxData : pkx.DecryptedBoxData);
|
||||
File.WriteAllBytes(newfile, encrypt ? pk.EncryptedBoxData : pk.DecryptedBoxData);
|
||||
var img = (Bitmap)pb.Image;
|
||||
SetCursor(new Cursor(img.GetHicon()), pb);
|
||||
HoverCancel();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public static class PluginLoader
|
|||
{
|
||||
public static IEnumerable<T> LoadPlugins<T>(string pluginPath)
|
||||
{
|
||||
IEnumerable<string> dllFileNames = !Directory.Exists(pluginPath)
|
||||
var dllFileNames = !Directory.Exists(pluginPath)
|
||||
? Enumerable.Empty<string>()
|
||||
: Directory.EnumerateFiles(pluginPath, "*.dll", SearchOption.AllDirectories);
|
||||
var assemblies = GetAssemblies(dllFileNames);
|
||||
|
|
|
|||
|
|
@ -48,13 +48,13 @@ public void EncodesNicknameCorrectly()
|
|||
|
||||
private static void CheckStringGetSet(string check, string instr, string outstr, byte[] indata, byte[] outdata)
|
||||
{
|
||||
Assert.Equal(instr, outstr);
|
||||
|
||||
outdata = outdata.Take(indata.Length).ToArray();
|
||||
|
||||
Assert.True(indata.SequenceEqual(outdata),
|
||||
$"{check} did not set properly."
|
||||
+ Environment.NewLine + string.Join(", ", outdata.Select(z => $"{z:X2}")));
|
||||
|
||||
Assert.Equal(instr, outstr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user