mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-26 05:50:22 +00:00
Misc tweaks
This commit is contained in:
parent
0693825f96
commit
994c063537
18 changed files with 103 additions and 109 deletions
|
@ -118,12 +118,12 @@ public sealed class PGF(byte[] Data) : DataMysteryGift(Data), IRibbonSetEvent3,
|
|||
}
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
Year = (ushort)value.Value.Year;
|
||||
Month = (byte)value.Value.Month;
|
||||
Day = (byte)value.Value.Day;
|
||||
Year = (ushort)dt.Year;
|
||||
Month = (byte)dt.Month;
|
||||
Day = (byte)dt.Day;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -88,12 +88,12 @@ public sealed class WB7(byte[] Data)
|
|||
}
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
Year = (ushort)value.Value.Year;
|
||||
Month = (byte)value.Value.Month;
|
||||
Day = (byte)value.Value.Day;
|
||||
Year = (ushort)dt.Year;
|
||||
Month = (byte)dt.Month;
|
||||
Day = (byte)dt.Day;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -87,12 +87,12 @@ public sealed class WC6(byte[] Data) : DataMysteryGift(Data), IRibbonSetEvent3,
|
|||
}
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
Year = (ushort)value.Value.Year;
|
||||
Month = (byte)value.Value.Month;
|
||||
Day = (byte)value.Value.Day;
|
||||
Year = (ushort)dt.Year;
|
||||
Month = (byte)dt.Month;
|
||||
Day = (byte)dt.Day;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -87,12 +87,12 @@ public sealed class WC7(byte[] Data) : DataMysteryGift(Data), IRibbonSetEvent3,
|
|||
}
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
Year = (ushort)value.Value.Year;
|
||||
Month = (byte)value.Value.Month;
|
||||
Day = (byte)value.Value.Day;
|
||||
Year = (ushort)dt.Year;
|
||||
Month = (byte)dt.Month;
|
||||
Day = (byte)dt.Day;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -169,12 +169,12 @@ public abstract class PKM : ISpeciesForm, ITrainerID32, IGeneration, IShiny, ILa
|
|||
}
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
MetYear = (byte)(value.Value.Year - 2000);
|
||||
MetMonth = (byte)value.Value.Month;
|
||||
MetDay = (byte)value.Value.Day;
|
||||
MetYear = (byte)(dt.Year - 2000);
|
||||
MetMonth = (byte)dt.Month;
|
||||
MetDay = (byte)dt.Day;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -212,12 +212,12 @@ public abstract class PKM : ISpeciesForm, ITrainerID32, IGeneration, IShiny, ILa
|
|||
}
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
EggYear = (byte)(value.Value.Year - 2000);
|
||||
EggMonth = (byte)value.Value.Month;
|
||||
EggDay = (byte)value.Value.Day;
|
||||
EggYear = (byte)(dt.Year - 2000);
|
||||
EggMonth = (byte)dt.Month;
|
||||
EggDay = (byte)dt.Day;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -143,14 +143,14 @@ public sealed class BattleVideo6(byte[] Data) : IBattleVideo
|
|||
}
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
MatchYear = value.Value.Year;
|
||||
MatchDay = value.Value.Day;
|
||||
MatchMonth = value.Value.Month;
|
||||
MatchHour = value.Value.Hour;
|
||||
MatchMinute = value.Value.Minute;
|
||||
MatchSecond = value.Value.Second;
|
||||
MatchYear = dt.Year;
|
||||
MatchDay = dt.Day;
|
||||
MatchMonth = dt.Month;
|
||||
MatchHour = dt.Hour;
|
||||
MatchMinute = dt.Minute;
|
||||
MatchSecond = dt.Second;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -169,14 +169,14 @@ public sealed class BattleVideo6(byte[] Data) : IBattleVideo
|
|||
}
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
UploadYear = value.Value.Year;
|
||||
UploadDay = value.Value.Day;
|
||||
UploadMonth = value.Value.Month;
|
||||
UploadHour = value.Value.Hour;
|
||||
UploadMinute = value.Value.Minute;
|
||||
UploadSecond = value.Value.Second;
|
||||
UploadYear = dt.Year;
|
||||
UploadDay = dt.Day;
|
||||
UploadMonth = dt.Month;
|
||||
UploadHour = dt.Hour;
|
||||
UploadMinute = dt.Minute;
|
||||
UploadSecond = dt.Second;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -101,14 +101,14 @@ public sealed class BattleVideo7(byte[] data) : IBattleVideo
|
|||
}
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
MatchYear = value.Value.Year;
|
||||
MatchDay = value.Value.Day;
|
||||
MatchMonth = value.Value.Month;
|
||||
MatchHour = value.Value.Hour;
|
||||
MatchMinute = value.Value.Minute;
|
||||
MatchSecond = value.Value.Second;
|
||||
MatchYear = dt.Year;
|
||||
MatchDay = dt.Day;
|
||||
MatchMonth = dt.Month;
|
||||
MatchHour = dt.Hour;
|
||||
MatchMinute = dt.Minute;
|
||||
MatchSecond = dt.Second;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -42,9 +42,8 @@ public sealed class PlayTime6 : SaveBlock<SaveFile>
|
|||
set
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
var dt = value.Value;
|
||||
LastSavedYear = dt.Year;
|
||||
LastSavedMonth = dt.Month;
|
||||
LastSavedDay = dt.Day;
|
||||
|
|
|
@ -78,9 +78,8 @@ public sealed class JoinFesta7(SAV7 sav, Memory<byte> raw) : SaveBlock<SAV7>(sav
|
|||
: null;
|
||||
set
|
||||
{
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
DateTime dt = value.Value;
|
||||
FestaYear = dt.Year;
|
||||
FestaMonth = dt.Month;
|
||||
FestaDay = dt.Day;
|
||||
|
|
|
@ -34,9 +34,8 @@ public sealed class PlayTime7b(SAV7b sav, Memory<byte> raw) : SaveBlock<SAV7b>(s
|
|||
set
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
var dt = value.Value;
|
||||
LastSaved.Year = dt.Year;
|
||||
LastSaved.Month = dt.Month;
|
||||
LastSaved.Day = dt.Day;
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace PKHeX.Core;
|
|||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public sealed class LastSaved8a(SAV8LA sav, SCBlock block) : SaveBlock<SAV8LA>(sav, block.Data)
|
||||
{
|
||||
private uint LastSaved { get => ReadUInt32LittleEndian(Data.Slice(0x0)); set => WriteUInt32LittleEndian(Data.Slice(0x0), value); }
|
||||
private uint LastSaved { get => ReadUInt32LittleEndian(Data); set => WriteUInt32LittleEndian(Data, value); }
|
||||
private int LastSavedYear { get => (int)(LastSaved & 0xFFF); set => LastSaved = (LastSaved & 0xFFFFF000) | (uint)value; }
|
||||
private int LastSavedMonth { get => (int)((LastSaved >> 12) & 0xF); set => LastSaved = (LastSaved & 0xFFFF0FFF) | (((uint)value & 0xF) << 12); }
|
||||
private int LastSavedDay { get => (int)((LastSaved >> 16) & 0x1F); set => LastSaved = (LastSaved & 0xFFE0FFFF) | (((uint)value & 0x1F) << 16); }
|
||||
|
@ -30,9 +30,8 @@ public sealed class LastSaved8a(SAV8LA sav, SCBlock block) : SaveBlock<SAV8LA>(s
|
|||
set
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
var dt = value.Value;
|
||||
LastSavedYear = dt.Year - 1900;
|
||||
LastSavedMonth = dt.Month - 1;
|
||||
LastSavedDay = dt.Day;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using static System.Buffers.Binary.BinaryPrimitives;
|
||||
|
||||
|
@ -10,16 +9,16 @@ namespace PKHeX.Core;
|
|||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public sealed class PlayerFashion8a(SAV8LA sav, SCBlock block) : SaveBlock<SAV8LA>(sav, block.Data)
|
||||
{
|
||||
public ulong Hair { get => ReadUInt64LittleEndian(Data.Slice(0x00)); set => WriteUInt64LittleEndian(Data.Slice(0x00), value); }
|
||||
public ulong Contacts { get => ReadUInt64LittleEndian(Data.Slice(0x08)); set => WriteUInt64LittleEndian(Data.Slice(0x08), value); }
|
||||
public ulong Eyebrows { get => ReadUInt64LittleEndian(Data.Slice(0x10)); set => WriteUInt64LittleEndian(Data.Slice(0x10), value); }
|
||||
public ulong Glasses { get => ReadUInt64LittleEndian(Data.Slice(0x18)); set => WriteUInt64LittleEndian(Data.Slice(0x18), value); }
|
||||
public ulong Hat { get => ReadUInt64LittleEndian(Data.Slice(0x20)); set => WriteUInt64LittleEndian(Data.Slice(0x20), value); }
|
||||
public ulong Top { get => ReadUInt64LittleEndian(Data.Slice(0x28)); set => WriteUInt64LittleEndian(Data.Slice(0x28), value); }
|
||||
public ulong Bottoms { get => ReadUInt64LittleEndian(Data.Slice(0x30)); set => WriteUInt64LittleEndian(Data.Slice(0x30), value); }
|
||||
public ulong _38 { get => ReadUInt64LittleEndian(Data.Slice(0x38)); set => WriteUInt64LittleEndian(Data.Slice(0x38), value); }
|
||||
public ulong Shoes { get => ReadUInt64LittleEndian(Data.Slice(0x40)); set => WriteUInt64LittleEndian(Data.Slice(0x40), value); }
|
||||
public ulong _48 { get => ReadUInt64LittleEndian(Data.Slice(0x48)); set => WriteUInt64LittleEndian(Data.Slice(0x48), value); }
|
||||
public ulong _50 { get => ReadUInt64LittleEndian(Data.Slice(0x50)); set => WriteUInt64LittleEndian(Data.Slice(0x50), value); }
|
||||
public ulong Skin { get => ReadUInt64LittleEndian(Data.Slice(0x58)); set => WriteUInt64LittleEndian(Data.Slice(0x58), value); }
|
||||
public ulong Hair { get => ReadUInt64LittleEndian(Data); set => WriteUInt64LittleEndian(Data, value); }
|
||||
public ulong Contacts { get => ReadUInt64LittleEndian(Data[0x08..]); set => WriteUInt64LittleEndian(Data[0x08..], value); }
|
||||
public ulong Eyebrows { get => ReadUInt64LittleEndian(Data[0x10..]); set => WriteUInt64LittleEndian(Data[0x10..], value); }
|
||||
public ulong Glasses { get => ReadUInt64LittleEndian(Data[0x18..]); set => WriteUInt64LittleEndian(Data[0x18..], value); }
|
||||
public ulong Hat { get => ReadUInt64LittleEndian(Data[0x20..]); set => WriteUInt64LittleEndian(Data[0x20..], value); }
|
||||
public ulong Top { get => ReadUInt64LittleEndian(Data[0x28..]); set => WriteUInt64LittleEndian(Data[0x28..], value); }
|
||||
public ulong Bottoms { get => ReadUInt64LittleEndian(Data[0x30..]); set => WriteUInt64LittleEndian(Data[0x30..], value); }
|
||||
public ulong _38 { get => ReadUInt64LittleEndian(Data[0x38..]); set => WriteUInt64LittleEndian(Data[0x38..], value); }
|
||||
public ulong Shoes { get => ReadUInt64LittleEndian(Data[0x40..]); set => WriteUInt64LittleEndian(Data[0x40..], value); }
|
||||
public ulong _48 { get => ReadUInt64LittleEndian(Data[0x48..]); set => WriteUInt64LittleEndian(Data[0x48..], value); }
|
||||
public ulong _50 { get => ReadUInt64LittleEndian(Data[0x50..]); set => WriteUInt64LittleEndian(Data[0x50..], value); }
|
||||
public ulong Skin { get => ReadUInt64LittleEndian(Data[0x58..]); set => WriteUInt64LittleEndian(Data[0x58..], value); }
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public sealed class PokedexSaveData
|
|||
{
|
||||
ArgumentOutOfRangeException.ThrowIfNotEqual(data.Length, POKEDEX_SAVE_DATA_SIZE);
|
||||
|
||||
GlobalData = new PokedexSaveGlobalData(data.Slice(0, PokedexSaveGlobalData.SIZE));
|
||||
GlobalData = new PokedexSaveGlobalData(data[..PokedexSaveGlobalData.SIZE]);
|
||||
|
||||
LocalData = new PokedexSaveLocalData[5];
|
||||
for (var i = 0; i < LocalData.Length; i++)
|
||||
|
|
|
@ -9,21 +9,21 @@ namespace PKHeX.Core;
|
|||
public sealed class Coordinates8(SAV8SWSH sav, SCBlock block) : SaveBlock<SAV8SWSH>(sav, block.Data)
|
||||
{
|
||||
// Position
|
||||
public float X { get => ReadSingleLittleEndian(Data.Slice(0x10)); set => WriteSingleLittleEndian(Data.Slice(0x10), value); }
|
||||
public float Z { get => ReadSingleLittleEndian(Data.Slice(0x14)); set => WriteSingleLittleEndian(Data.Slice(0x14), value); }
|
||||
public float Y { get => ReadSingleLittleEndian(Data.Slice(0x18)); set => WriteSingleLittleEndian(Data.Slice(0x18), value); }
|
||||
public float X { get => ReadSingleLittleEndian(Data[0x10..]); set => WriteSingleLittleEndian(Data[0x10..], value); }
|
||||
public float Z { get => ReadSingleLittleEndian(Data[0x14..]); set => WriteSingleLittleEndian(Data[0x14..], value); }
|
||||
public float Y { get => ReadSingleLittleEndian(Data[0x18..]); set => WriteSingleLittleEndian(Data[0x18..], value); }
|
||||
|
||||
// Scale
|
||||
public float SX { get => ReadSingleLittleEndian(Data.Slice(0x20)); set => WriteSingleLittleEndian(Data.Slice(0x20), value); }
|
||||
public float SZ { get => ReadSingleLittleEndian(Data.Slice(0x24)); set => WriteSingleLittleEndian(Data.Slice(0x24), value); }
|
||||
public float SY { get => ReadSingleLittleEndian(Data.Slice(0x28)); set => WriteSingleLittleEndian(Data.Slice(0x28), value); }
|
||||
public float SX { get => ReadSingleLittleEndian(Data[0x20..]); set => WriteSingleLittleEndian(Data[0x20..], value); }
|
||||
public float SZ { get => ReadSingleLittleEndian(Data[0x24..]); set => WriteSingleLittleEndian(Data[0x24..], value); }
|
||||
public float SY { get => ReadSingleLittleEndian(Data[0x28..]); set => WriteSingleLittleEndian(Data[0x28..], value); }
|
||||
|
||||
// Rotation
|
||||
public float RX { get => ReadSingleLittleEndian(Data.Slice(0x30)); set => WriteSingleLittleEndian(Data.Slice(0x30), value); }
|
||||
public float RZ { get => ReadSingleLittleEndian(Data.Slice(0x34)); set => WriteSingleLittleEndian(Data.Slice(0x34), value); }
|
||||
public float RY { get => ReadSingleLittleEndian(Data.Slice(0x38)); set => WriteSingleLittleEndian(Data.Slice(0x38), value); }
|
||||
public float RW { get => ReadSingleLittleEndian(Data.Slice(0x3C)); set => WriteSingleLittleEndian(Data.Slice(0x3C), value); }
|
||||
public float RX { get => ReadSingleLittleEndian(Data[0x30..]); set => WriteSingleLittleEndian(Data[0x30..], value); }
|
||||
public float RZ { get => ReadSingleLittleEndian(Data[0x34..]); set => WriteSingleLittleEndian(Data[0x34..], value); }
|
||||
public float RY { get => ReadSingleLittleEndian(Data[0x38..]); set => WriteSingleLittleEndian(Data[0x38..], value); }
|
||||
public float RW { get => ReadSingleLittleEndian(Data[0x3C..]); set => WriteSingleLittleEndian(Data[0x3C..], value); }
|
||||
|
||||
// Map
|
||||
public ulong M { get => ReadUInt64LittleEndian(Data.Slice(0x6000)); set => WriteUInt64LittleEndian(Data.Slice(0x6000), value); }
|
||||
public ulong M { get => ReadUInt64LittleEndian(Data[0x6000..]); set => WriteUInt64LittleEndian(Data[0x6000..], value); }
|
||||
}
|
||||
|
|
|
@ -39,9 +39,8 @@ public sealed class PlayTime8(SAV8SWSH sav, SCBlock block) : SaveBlock<SAV8SWSH>
|
|||
set
|
||||
{
|
||||
// Only update the properties if a value is provided.
|
||||
if (value.HasValue)
|
||||
if (value is { } dt)
|
||||
{
|
||||
var dt = value.Value;
|
||||
LastSavedYear = dt.Year;
|
||||
LastSavedMonth = dt.Month;
|
||||
LastSavedDay = dt.Day;
|
||||
|
|
|
@ -10,18 +10,18 @@ namespace PKHeX.Core;
|
|||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public sealed class PlayerAppearance9(SAV9SV sav, SCBlock block) : SaveBlock<SAV9SV>(sav, block.Data)
|
||||
{
|
||||
public ulong SkinColor { get => ReadUInt64LittleEndian(Data.Slice(0x00)); set => WriteUInt64LittleEndian(Data.Slice(0x00), value); }
|
||||
public ulong LipColor { get => ReadUInt64LittleEndian(Data.Slice(0x08)); set => WriteUInt64LittleEndian(Data.Slice(0x08), value); }
|
||||
public ulong ColorContacts { get => ReadUInt64LittleEndian(Data.Slice(0x10)); set => WriteUInt64LittleEndian(Data.Slice(0x10), value); }
|
||||
public ulong EyeShape { get => ReadUInt64LittleEndian(Data.Slice(0x18)); set => WriteUInt64LittleEndian(Data.Slice(0x18), value); }
|
||||
public ulong EyebrowColor { get => ReadUInt64LittleEndian(Data.Slice(0x20)); set => WriteUInt64LittleEndian(Data.Slice(0x20), value); }
|
||||
public ulong EyebrowShape { get => ReadUInt64LittleEndian(Data.Slice(0x28)); set => WriteUInt64LittleEndian(Data.Slice(0x28), value); }
|
||||
public ulong EyebrowVolume { get => ReadUInt64LittleEndian(Data.Slice(0x30)); set => WriteUInt64LittleEndian(Data.Slice(0x30), value); }
|
||||
public ulong EyelashColor { get => ReadUInt64LittleEndian(Data.Slice(0x38)); set => WriteUInt64LittleEndian(Data.Slice(0x38), value); }
|
||||
public ulong EyelashShape { get => ReadUInt64LittleEndian(Data.Slice(0x40)); set => WriteUInt64LittleEndian(Data.Slice(0x40), value); }
|
||||
public ulong EyelashVolume { get => ReadUInt64LittleEndian(Data.Slice(0x48)); set => WriteUInt64LittleEndian(Data.Slice(0x48), value); }
|
||||
public ulong Mouth { get => ReadUInt64LittleEndian(Data.Slice(0x50)); set => WriteUInt64LittleEndian(Data.Slice(0x50), value); }
|
||||
public ulong BeautySpot { get => ReadUInt64LittleEndian(Data.Slice(0x58)); set => WriteUInt64LittleEndian(Data.Slice(0x58), value); }
|
||||
public ulong Freckles { get => ReadUInt64LittleEndian(Data.Slice(0x60)); set => WriteUInt64LittleEndian(Data.Slice(0x60), value); }
|
||||
public ulong HairColor { get => ReadUInt64LittleEndian(Data.Slice(0x68)); set => WriteUInt64LittleEndian(Data.Slice(0x68), value); }
|
||||
public ulong SkinColor { get => ReadUInt64LittleEndian(Data); set => WriteUInt64LittleEndian(Data, value); }
|
||||
public ulong LipColor { get => ReadUInt64LittleEndian(Data[0x08..]); set => WriteUInt64LittleEndian(Data[0x08..], value); }
|
||||
public ulong ColorContacts { get => ReadUInt64LittleEndian(Data[0x10..]); set => WriteUInt64LittleEndian(Data[0x10..], value); }
|
||||
public ulong EyeShape { get => ReadUInt64LittleEndian(Data[0x18..]); set => WriteUInt64LittleEndian(Data[0x18..], value); }
|
||||
public ulong EyebrowColor { get => ReadUInt64LittleEndian(Data[0x20..]); set => WriteUInt64LittleEndian(Data[0x20..], value); }
|
||||
public ulong EyebrowShape { get => ReadUInt64LittleEndian(Data[0x28..]); set => WriteUInt64LittleEndian(Data[0x28..], value); }
|
||||
public ulong EyebrowVolume { get => ReadUInt64LittleEndian(Data[0x30..]); set => WriteUInt64LittleEndian(Data[0x30..], value); }
|
||||
public ulong EyelashColor { get => ReadUInt64LittleEndian(Data[0x38..]); set => WriteUInt64LittleEndian(Data[0x38..], value); }
|
||||
public ulong EyelashShape { get => ReadUInt64LittleEndian(Data[0x40..]); set => WriteUInt64LittleEndian(Data[0x40..], value); }
|
||||
public ulong EyelashVolume { get => ReadUInt64LittleEndian(Data[0x48..]); set => WriteUInt64LittleEndian(Data[0x48..], value); }
|
||||
public ulong Mouth { get => ReadUInt64LittleEndian(Data[0x50..]); set => WriteUInt64LittleEndian(Data[0x50..], value); }
|
||||
public ulong BeautySpot { get => ReadUInt64LittleEndian(Data[0x58..]); set => WriteUInt64LittleEndian(Data[0x58..], value); }
|
||||
public ulong Freckles { get => ReadUInt64LittleEndian(Data[0x60..]); set => WriteUInt64LittleEndian(Data[0x60..], value); }
|
||||
public ulong HairColor { get => ReadUInt64LittleEndian(Data[0x68..]); set => WriteUInt64LittleEndian(Data[0x68..], value); }
|
||||
}
|
||||
|
|
|
@ -10,15 +10,15 @@ namespace PKHeX.Core;
|
|||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public sealed class PlayerFashion9(SAV9SV sav, SCBlock block) : SaveBlock<SAV9SV>(sav, block.Data)
|
||||
{
|
||||
public ulong Base { get => ReadUInt64LittleEndian(Data.Slice(0x00)); set => WriteUInt64LittleEndian(Data.Slice(0x00), value); }
|
||||
public ulong Accessory { get => ReadUInt64LittleEndian(Data.Slice(0x08)); set => WriteUInt64LittleEndian(Data.Slice(0x08), value); }
|
||||
public ulong Bag { get => ReadUInt64LittleEndian(Data.Slice(0x10)); set => WriteUInt64LittleEndian(Data.Slice(0x10), value); }
|
||||
public ulong Eyewear { get => ReadUInt64LittleEndian(Data.Slice(0x18)); set => WriteUInt64LittleEndian(Data.Slice(0x18), value); }
|
||||
public ulong Footwear { get => ReadUInt64LittleEndian(Data.Slice(0x20)); set => WriteUInt64LittleEndian(Data.Slice(0x20), value); }
|
||||
public ulong Gloves { get => ReadUInt64LittleEndian(Data.Slice(0x28)); set => WriteUInt64LittleEndian(Data.Slice(0x28), value); }
|
||||
public ulong Headwear { get => ReadUInt64LittleEndian(Data.Slice(0x30)); set => WriteUInt64LittleEndian(Data.Slice(0x30), value); }
|
||||
public ulong Hairstyle { get => ReadUInt64LittleEndian(Data.Slice(0x38)); set => WriteUInt64LittleEndian(Data.Slice(0x38), value); }
|
||||
public ulong Legwear { get => ReadUInt64LittleEndian(Data.Slice(0x40)); set => WriteUInt64LittleEndian(Data.Slice(0x40), value); }
|
||||
public ulong Clothing { get => ReadUInt64LittleEndian(Data.Slice(0x48)); set => WriteUInt64LittleEndian(Data.Slice(0x48), value); }
|
||||
public ulong Face { get => ReadUInt64LittleEndian(Data.Slice(0x50)); set => WriteUInt64LittleEndian(Data.Slice(0x50), value); }
|
||||
public ulong Base { get => ReadUInt64LittleEndian(Data); set => WriteUInt64LittleEndian(Data, value); }
|
||||
public ulong Accessory { get => ReadUInt64LittleEndian(Data[0x08..]); set => WriteUInt64LittleEndian(Data[0x08..], value); }
|
||||
public ulong Bag { get => ReadUInt64LittleEndian(Data[0x10..]); set => WriteUInt64LittleEndian(Data[0x10..], value); }
|
||||
public ulong Eyewear { get => ReadUInt64LittleEndian(Data[0x18..]); set => WriteUInt64LittleEndian(Data[0x18..], value); }
|
||||
public ulong Footwear { get => ReadUInt64LittleEndian(Data[0x20..]); set => WriteUInt64LittleEndian(Data[0x20..], value); }
|
||||
public ulong Gloves { get => ReadUInt64LittleEndian(Data[0x28..]); set => WriteUInt64LittleEndian(Data[0x28..], value); }
|
||||
public ulong Headwear { get => ReadUInt64LittleEndian(Data[0x30..]); set => WriteUInt64LittleEndian(Data[0x30..], value); }
|
||||
public ulong Hairstyle { get => ReadUInt64LittleEndian(Data[0x38..]); set => WriteUInt64LittleEndian(Data[0x38..], value); }
|
||||
public ulong Legwear { get => ReadUInt64LittleEndian(Data[0x40..]); set => WriteUInt64LittleEndian(Data[0x40..], value); }
|
||||
public ulong Clothing { get => ReadUInt64LittleEndian(Data[0x48..]); set => WriteUInt64LittleEndian(Data[0x48..], value); }
|
||||
public ulong Face { get => ReadUInt64LittleEndian(Data[0x50..]); set => WriteUInt64LittleEndian(Data[0x50..], value); }
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public partial class SAV_HallOfFame : Form
|
|||
int index = LB_DataEntry.SelectedIndex;
|
||||
int offset = index * StructureSize;
|
||||
|
||||
uint vnd = ReadUInt32LittleEndian(Data.Slice(offset + 0x1B0));
|
||||
uint vnd = ReadUInt32LittleEndian(Data[(offset + 0x1B0)..]);
|
||||
uint vn = vnd & 0xFF;
|
||||
TB_VN.Text = vn.ToString("000");
|
||||
var s = new List<string> { $"Entry #{vn}" };
|
||||
|
@ -241,9 +241,9 @@ public partial class SAV_HallOfFame : Form
|
|||
date |= (uint)((CAL_MetDate.Value.Day & 0x1F) << 12);
|
||||
vnd |= (date & 0x1FFFF) << 14;
|
||||
//Fix for top bit
|
||||
uint rawvnd = ReadUInt32LittleEndian(Data.Slice(offset + 0x1B0));
|
||||
uint rawvnd = ReadUInt32LittleEndian(Data[(offset + 0x1B0)..]);
|
||||
vnd |= rawvnd & 0x80000000;
|
||||
WriteUInt32LittleEndian(Data.Slice(offset + 0x1B0), vnd);
|
||||
WriteUInt32LittleEndian(Data[(offset + 0x1B0)..], vnd);
|
||||
|
||||
var shiny = entry.IsShiny ? Shiny.Always : Shiny.Never;
|
||||
bpkx.Image = SpriteUtil.GetSprite(entry.Species, entry.Form, (byte)entry.Gender, 0, entry.HeldItem, false, shiny, EntityContext.Gen6);
|
||||
|
|
Loading…
Reference in a new issue