mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-06 05:27:14 -05:00
Add options to sav3 accessor
This commit is contained in:
parent
3e33521796
commit
3e33f0fc2e
|
|
@ -401,10 +401,66 @@ public sealed override int PlayedSeconds
|
|||
set => Small[0x11] = (byte)value;
|
||||
}
|
||||
|
||||
public int PlayedFrames
|
||||
public byte PlayedFrames
|
||||
{
|
||||
get => Small[0x12];
|
||||
set => Small[0x12] = (byte)value;
|
||||
set => Small[0x12] = value;
|
||||
}
|
||||
|
||||
public byte OptionsButtonMode
|
||||
{
|
||||
get => Small[0x13];
|
||||
set => Small[0x13] = value;
|
||||
}
|
||||
|
||||
private uint OptionsConfig
|
||||
{
|
||||
get => ReadUInt32LittleEndian(Small[0x14..]);
|
||||
set => WriteUInt32LittleEndian(Small[0x14..], value);
|
||||
}
|
||||
|
||||
// 2 bits: Text Speed
|
||||
// 5 bits: Window Frame
|
||||
// 1 bit: sound
|
||||
// 1 bit: battle style (shift vs set)
|
||||
// 1 bit: battle scene off toggle (animations enabled/disabled)
|
||||
// 1 bit: regionMapZoom (on/off)
|
||||
// 4 bits unused
|
||||
// 16 bits unused
|
||||
public int TextSpeed
|
||||
{
|
||||
get => (int)(OptionsConfig & 0b11);
|
||||
set => OptionsConfig = (uint)((byte)value & 0b11) | (OptionsConfig & ~0b11u);
|
||||
}
|
||||
|
||||
public byte OptionWindowFrame
|
||||
{
|
||||
get => (byte)((OptionsConfig >> 2) & 0b11111);
|
||||
set => OptionsConfig = (uint)((value & 0b11111) << 2) | (OptionsConfig & ~(0b11111u << 2));
|
||||
}
|
||||
|
||||
public bool OptionSoundStereo
|
||||
{
|
||||
get => (OptionsConfig & 0b100000) != 0;
|
||||
set => OptionsConfig = value ? (OptionsConfig | 0b100000) : (OptionsConfig & ~0b100000u);
|
||||
}
|
||||
|
||||
public bool OptionBattleStyle
|
||||
{
|
||||
get => (OptionsConfig & 0b1000000) != 0;
|
||||
set => OptionsConfig = value ? (OptionsConfig | 0b1000000) : (OptionsConfig & ~0b1000000u);
|
||||
}
|
||||
|
||||
public bool OptionBattleScene
|
||||
{
|
||||
get => (OptionsConfig & 0b10000000) != 0;
|
||||
set => OptionsConfig = value ? (OptionsConfig | 0b10000000) : (OptionsConfig & ~0b10000000u);
|
||||
}
|
||||
|
||||
public bool OptionIsRegionMapZoom
|
||||
{
|
||||
get => (OptionsConfig & 0b100000000) != 0;
|
||||
set => OptionsConfig = value ? (OptionsConfig | 0b100000000) : (OptionsConfig & ~0b100000000u);
|
||||
}
|
||||
|
||||
public ushort X
|
||||
|
|
|
|||
|
|
@ -104,6 +104,16 @@ public SAV_SimpleTrainer(SaveFile sav)
|
|||
L_Started.Visible = L_Fame.Visible = false;
|
||||
CAL_AdventureStartDate.Visible = CAL_HoFDate.Visible = false;
|
||||
CAL_AdventureStartTime.Visible = CAL_HoFTime.Visible = false;
|
||||
|
||||
GB_Options.Visible = true;
|
||||
CB_BattleStyle.Items.AddRange("Switch", "Set");
|
||||
CB_SoundType.Items.AddRange("Mono", "Stereo");
|
||||
CB_TextSpeed.Items.AddRange("0 (Slow)", "1 (Mid)", "2 (Fast)", "3 (Instant)");
|
||||
|
||||
CB_TextSpeed.SelectedIndex = sav3.TextSpeed;
|
||||
CB_BattleStyle.SelectedIndex = sav3.OptionBattleStyle ? 1 : 0;
|
||||
CB_SoundType.SelectedIndex = sav3.OptionSoundStereo ? 0 : 1;
|
||||
CHK_BattleEffects.Checked = sav3.OptionBattleScene;
|
||||
}
|
||||
if (SAV is SAV3Colosseum or SAV3XD)
|
||||
{
|
||||
|
|
@ -238,6 +248,10 @@ private void B_Save_Click(object sender, EventArgs e)
|
|||
if (SAV is SAV3 sav3)
|
||||
{
|
||||
sav3.Badges = badgeval & 0xFF;
|
||||
sav3.OptionBattleStyle = CB_BattleStyle.SelectedIndex == 1;
|
||||
sav3.OptionSoundStereo = CB_SoundType.SelectedIndex == 0;
|
||||
sav3.TextSpeed = CB_TextSpeed.SelectedIndex;
|
||||
sav3.OptionBattleScene = CHK_BattleEffects.Checked;
|
||||
}
|
||||
|
||||
if (SAV is SAV4 sav4)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user