A hackish workaround to make Select All faster in the Cheat Dialog
This commit is contained in:
parent
6d1675e54c
commit
8b6bf3fc89
|
@ -776,11 +776,21 @@ namespace BizHawk.Client.EmuHawk
|
|||
selection = -1;
|
||||
}
|
||||
|
||||
// Informs user that a select all event is in place, can be used in change events to wait until this is false
|
||||
public bool SelectAllInProgress { get; set; }
|
||||
|
||||
public void SelectAll()
|
||||
{
|
||||
this.BeginUpdate();
|
||||
SelectAllInProgress = true;
|
||||
|
||||
for (var i = 0; i < _itemCount; i++)
|
||||
{
|
||||
if (i == _itemCount - 1)
|
||||
{
|
||||
SelectAllInProgress = false;
|
||||
}
|
||||
|
||||
this.SelectItem(i, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -389,16 +389,19 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void DoSelectedIndexChange()
|
||||
{
|
||||
if (SelectedCheats.Any())
|
||||
if (!CheatListView.SelectAllInProgress)
|
||||
{
|
||||
var cheat = SelectedCheats.First();
|
||||
CheatEditor.SetCheat(cheat);
|
||||
CheatGroupBox.Text = "Editing Cheat " + cheat.Name + " - " + cheat.AddressStr;
|
||||
}
|
||||
else
|
||||
{
|
||||
CheatEditor.ClearForm();
|
||||
CheatGroupBox.Text = "New Cheat";
|
||||
if (SelectedCheats.Any())
|
||||
{
|
||||
var cheat = SelectedCheats.First();
|
||||
CheatEditor.SetCheat(cheat);
|
||||
CheatGroupBox.Text = "Editing Cheat " + cheat.Name + " - " + cheat.AddressStr;
|
||||
}
|
||||
else
|
||||
{
|
||||
CheatEditor.ClearForm();
|
||||
CheatGroupBox.Text = "New Cheat";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue