Reuse language data source for trainer editors

provides nice descriptions rather than 3 character codes
This commit is contained in:
Kurt 2018-07-07 17:02:17 -07:00
parent d4c1093dd9
commit 816c40429b
3 changed files with 7 additions and 25 deletions

View file

@ -237,22 +237,12 @@ namespace PKHeX.WinForms
new { Text = "TW", Value = 6 }
};
var language_list = new[] {
new { Text = "ENG", Value = 2 },
new { Text = "JPN", Value = 1 },
new { Text = "FRE", Value = 3 },
new { Text = "ITA", Value = 4 },
new { Text = "GER", Value = 5 },
new { Text = "SPA", Value = 7 },
new { Text = "KOR", Value = 8 }
};
CB_3DSReg.DisplayMember = "Text";
CB_3DSReg.ValueMember = "Value";
CB_3DSReg.DataSource = dsregion_list;
CB_Language.DisplayMember = "Text";
CB_Language.ValueMember = "Value";
CB_Language.DataSource = language_list;
CB_Language.DataSource = GameInfo.LanguageDataSource(SAV.Generation);
CB_Country.DisplayMember = "Text";
CB_Country.ValueMember = "Value";

View file

@ -59,18 +59,6 @@ namespace PKHeX.WinForms
new { Text = "TW", Value = 6 }
};
var language_list = new[] {
new { Text = "ENG", Value = 2 },
new { Text = "JPN", Value = 1 },
new { Text = "FRE", Value = 3 },
new { Text = "ITA", Value = 4 },
new { Text = "GER", Value = 5 },
new { Text = "SPA", Value = 7 },
new { Text = "KOR", Value = 8 },
new { Text = "CHS", Value = 9 },
new { Text = "CHT", Value = 10},
};
var alolatime_list = new[] { new { Text = "Sun Time", Value = 24*60*60 } };
Array.Resize(ref alolatime_list, 24);
for (int i = 1; i < 24; i++)
@ -82,7 +70,7 @@ namespace PKHeX.WinForms
CB_3DSReg.DataSource = dsregion_list;
CB_Language.DisplayMember = "Text";
CB_Language.ValueMember = "Value";
CB_Language.DataSource = language_list;
CB_Language.DataSource = GameInfo.LanguageDataSource(SAV.Generation);
CB_AlolaTime.DisplayMember = "Text";
CB_AlolaTime.ValueMember = "Value";
CB_AlolaTime.DataSource = alolatime_list;

View file

@ -45,6 +45,8 @@
//
// L_Offset
//
this.L_Offset.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.L_Offset.Font = new System.Drawing.Font("Courier New", 8.25F);
this.L_Offset.Location = new System.Drawing.Point(3, 48);
this.L_Offset.Name = "L_Offset";
@ -56,7 +58,7 @@
// L_Value
//
this.L_Value.AutoSize = true;
this.L_Value.Location = new System.Drawing.Point(0, 27);
this.L_Value.Location = new System.Drawing.Point(2, 28);
this.L_Value.Name = "L_Value";
this.L_Value.Size = new System.Drawing.Size(34, 13);
this.L_Value.TabIndex = 32;
@ -64,6 +66,8 @@
//
// CB_Stats
//
this.CB_Stats.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CB_Stats.DropDownHeight = 256;
this.CB_Stats.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CB_Stats.DropDownWidth = 200;