Update MuseumEditor.cs

This commit is contained in:
Kurt 2020-05-13 00:15:36 -07:00
parent d22ac35f73
commit 199e57ec6d

View File

@ -37,7 +37,7 @@ private void B_Save_Click(object sender, EventArgs e)
private void LB_Counts_SelectedIndexChanged(object sender, EventArgs e)
{
if (LB_Donations.SelectedIndex < 0)
if (LB_Donations.SelectedIndex < 0 || Changing)
return;
SaveIndex(Index);
@ -73,7 +73,14 @@ private void SaveIndex(in int index)
SetNameForIndex(index);
}
private void SetNameForIndex(in int index) => LB_Donations.Items[index] = Editor.GetDonationText(GameInfo.Strings, index);
private bool Changing;
private void SetNameForIndex(in int index)
{
Changing = true;
LB_Donations.Items[index] = Editor.GetDonationText(GameInfo.Strings, index);
Changing = false;
}
private void B_Dump_Click(object sender, EventArgs e)
{
@ -94,7 +101,7 @@ private void B_Load_Click(object sender, EventArgs e)
private void B_GiveAll_Click(object sender, EventArgs e)
{
SaveIndex(Index);
Editor.GiveAll(GameInfo.GetStrings("en").itemlist);
Editor.GiveAll(GameInfo.GetStrings("en").itemlist, 1000);
Editor.Save();
System.Media.SystemSounds.Asterisk.Play();
DialogResult = DialogResult.OK;