2017-04-02 13:42:42 -07:00
|
|
|
|
using System;
|
2018-02-05 14:12:42 -06:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2017-04-02 13:42:42 -07:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.WinForms
|
|
|
|
|
{
|
|
|
|
|
public partial class SAV_GameSelect : Form
|
|
|
|
|
{
|
|
|
|
|
public GameVersion Result = GameVersion.Invalid;
|
2018-08-04 10:06:06 -07:00
|
|
|
|
|
2019-01-15 22:26:45 -08:00
|
|
|
|
public SAV_GameSelect(IEnumerable<ComboItem> items, params string[] lines)
|
2017-04-02 13:42:42 -07:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2018-04-02 20:36:13 -07:00
|
|
|
|
WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
|
2019-01-15 22:26:45 -08:00
|
|
|
|
L_Prompt.Text = string.Join(Environment.NewLine + Environment.NewLine, lines);
|
2018-07-14 16:00:28 -07:00
|
|
|
|
CB_Game.InitializeBinding();
|
2018-02-05 15:48:47 +00:00
|
|
|
|
CB_Game.DataSource = new BindingSource(items.ToList(), null);
|
2017-04-02 13:42:42 -07:00
|
|
|
|
CB_Game.SelectedIndex = 0;
|
|
|
|
|
CB_Game.Focus();
|
|
|
|
|
}
|
2018-08-04 10:06:06 -07:00
|
|
|
|
|
2017-04-02 13:42:42 -07:00
|
|
|
|
private void B_Cancel_Click(object sender, EventArgs e) => Close();
|
2018-08-04 10:06:06 -07:00
|
|
|
|
|
2017-04-02 13:42:42 -07:00
|
|
|
|
private void B_OK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2017-06-17 18:37:19 -07:00
|
|
|
|
Result = (GameVersion)WinFormsUtil.GetIndex(CB_Game);
|
2017-04-02 13:42:42 -07:00
|
|
|
|
Close();
|
|
|
|
|
}
|
2018-08-04 10:06:06 -07:00
|
|
|
|
|
2017-04-02 13:42:42 -07:00
|
|
|
|
private void SAV_GameSelect_KeyDown(object sender, KeyEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (e.KeyCode == Keys.Enter)
|
2020-10-18 11:02:39 -07:00
|
|
|
|
B_OK_Click(sender, EventArgs.Empty);
|
2017-04-02 13:42:42 -07:00
|
|
|
|
if (e.KeyCode == Keys.Escape)
|
2020-10-18 11:02:39 -07:00
|
|
|
|
B_Cancel_Click(sender, EventArgs.Empty);
|
2017-04-02 13:42:42 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|