PKHeX/PKHeX.WinForms/Subforms/Save Editors/Gen4/SAV_Underground.cs
Egzon Qukovci Jusufi d0b5ceb8ff Underground Score Editor (help needed) (#1416)
* Underground Score Editor first commit

* not needed space

* changed anchor points

* added dp offsets, ug scores to underground, underground button click code
2017-08-27 12:32:43 -07:00

54 lines
1.5 KiB
C#

using System;
using System.Linq;
using System.Windows.Forms;
using PKHeX.Core;
namespace PKHeX.WinForms
{
public partial class SAV_Underground : Form
{
private readonly SaveFile Origin;
private readonly SAV4 SAV;
public SAV_Underground(SaveFile sav)
{
SAV = (SAV4)(Origin = sav).Clone();
InitializeComponent();
WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
GetUGScores();
}
private void GetUGScores()
{
U_PlayersMet.Value = SAV.UG_PlayersMet;
U_Gifts.Value = SAV.UG_Gifts;
U_Spheres.Value = SAV.UG_Spheres;
U_Fossils.Value = SAV.UG_Fossils;
U_TrapsA.Value = SAV.UG_TrapsAvoided;
U_TrapsT.Value = SAV.UG_TrapsTriggered;
U_Flags.Value = SAV.UG_Flags;
}
private void SetUGScores()
{
SAV.UG_PlayersMet = (int)U_PlayersMet.Value;
SAV.UG_Gifts = (int)U_Gifts.Value;
SAV.UG_Spheres = (int)U_Spheres.Value;
SAV.UG_Fossils = (int)U_Fossils.Value;
SAV.UG_TrapsAvoided = (int)U_TrapsA.Value;
SAV.UG_TrapsTriggered = (int)U_TrapsT.Value;
SAV.UG_Flags = (int)U_Flags.Value;
}
private void B_Save_Click(object sender, EventArgs e)
{
SetUGScores();
Origin.SetData(SAV.Data, 0);
Close();
}
private void B_Cancel_Click(object sender, EventArgs e) => Close();
}
}