Minor behavior tweak for apply all/none

Button closes form when modifying all indexes, so don't bother loading them back to the GUI. The form will immediately close after.
Only read indexes from the GUI if they're kept.
This commit is contained in:
Kurt 2023-05-07 13:36:04 -07:00
parent 5c70e41b76
commit 70020dc7e4

View file

@ -54,30 +54,29 @@ public partial class TechRecordEditor : Form
private void B_All_Click(object sender, EventArgs e)
{
Save();
if (ModifierKeys == Keys.Shift)
{
Record.ClearRecordFlags();
Record.SetRecordFlags(true, Record.Permit.RecordCountUsed);
}
else if (ModifierKeys == Keys.Control)
{
Save();
Span<ushort> moves = stackalloc ushort[4];
Entity.GetMoves(moves);
Record.SetRecordFlags(moves);
}
else
{
Record.ClearRecordFlags();
Record.SetRecordFlags();
}
LoadRecords();
Close();
}
private void B_None_Click(object sender, EventArgs e)
{
Save();
Record.ClearRecordFlags();
LoadRecords();
Close();
}
}