PKHeX/PKHeX.Avalonia/ViewModels/Subforms/SAVMisc2ViewModel.cs
montanon 1640b0f19f Add Gen 1-4 subform dialogs
20 generation-specific subforms:

Gen 1: EventReset1, HallOfFame1
Gen 2: Misc2
Gen 3: Misc3, SecretBase3, HallOfFame3, Roamer3, RTC3, PokeBlock3Case
Gen 4: Misc4, Pokedex4, Underground, BattlePass, HoneyTree,
       Geonet4, Apricorn, Gear, Trainer4BR, PoffinCase, PokeGear
2026-03-18 15:32:35 -03:00

41 lines
910 B
C#

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using PKHeX.Core;
namespace PKHeX.Avalonia.ViewModels.Subforms;
/// <summary>
/// ViewModel for the Gen 2 Misc editor.
/// Provides GS Ball event activation for Crystal saves.
/// </summary>
public partial class SAVMisc2ViewModel : SaveEditorViewModelBase
{
private readonly SAV2 _sav;
[ObservableProperty]
private bool _showGsBallButton;
[ObservableProperty]
private bool _gsBallEnabled;
public SAVMisc2ViewModel(SAV2 sav) : base(sav)
{
_sav = sav;
_showGsBallButton = sav.Version is GameVersion.C;
_gsBallEnabled = !sav.IsEnabledGSBallMobileEvent;
}
[RelayCommand]
private void EnableGsBall()
{
_sav.EnableGSBallMobileEvent();
GsBallEnabled = false;
}
[RelayCommand]
private void Save()
{
Modified = true;
}
}