mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-03-21 17:48:28 -05:00
Minor tweak
Small reduction in allocation for a method that is ever so rarely used, but yay me
This commit is contained in:
parent
06d95efc64
commit
733c829570
|
|
@ -11,16 +11,16 @@ public static class DialogUtil
|
|||
{
|
||||
public bool TrySelectIndex(string caption, string text, IReadOnlyList<string> options, out int index, int preSelect = -1)
|
||||
{
|
||||
List<TaskDialogRadioButton> choices = [];
|
||||
var choices = new TaskDialogRadioButtonCollection();
|
||||
for (int i = 0; i < options.Count; i++)
|
||||
choices.Add(new(options[i]) { Tag = i, Checked = (i == preSelect) });
|
||||
choices.Add(new TaskDialogRadioButton(options[i]) { Tag = i, Checked = (i == preSelect) });
|
||||
|
||||
var page = new TaskDialogPage
|
||||
{
|
||||
Caption = caption,
|
||||
Text = text,
|
||||
Icon = TaskDialogIcon.Information,
|
||||
RadioButtons = [..choices],
|
||||
RadioButtons = choices,
|
||||
DefaultButton = TaskDialogButton.OK,
|
||||
Buttons = [TaskDialogButton.OK],
|
||||
AllowCancel = true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user