PKHeX/PKHeX.WinForms/Subforms/Save Editors/Gen2/SAV_Misc2.cs
Kurt 97aa9805a9 Add GS Ball manual enable button
Adds a "misc" editor for Gen2 saves (only crystal for now), with a single button to enable the event (button enabled if the event is not yet enabled, lol)

746a06f1de/engine/menus/save.asm (L164-L175)

Closes #4335
2024-08-07 18:55:19 -05:00

39 lines
1.1 KiB
C#

using System;
using System.Windows.Forms;
using PKHeX.Core;
namespace PKHeX.WinForms;
public partial class SAV_Misc2 : Form
{
private readonly SaveFile Origin;
private readonly SAV2 SAV;
public SAV_Misc2(SAV2 sav)
{
InitializeComponent();
WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
SAV = (SAV2)(Origin = sav).Clone();
B_VirtualConsoleGSBall.Visible = SAV.Version is GameVersion.C;
B_VirtualConsoleGSBall.Enabled = !SAV.IsEnabledGSBallMobileEvent;
}
private void B_Save_Click(object sender, EventArgs e)
{
Origin.CopyChangesFrom(SAV);
Close();
}
private void B_Cancel_Click(object sender, EventArgs e) => Close();
private void B_VirtualConsoleGSBall_Click(object sender, EventArgs e)
{
// Don't bother checking if the save is from Virtual Console.
// Can be moved between VC and GB era, and can be a quick way to enable the event on either.
SAV.EnableGSBallMobileEvent();
B_VirtualConsoleGSBall.Enabled = false;
System.Media.SystemSounds.Asterisk.Play();
}
}