From 816c40429b5a8c64ce51ffee2834e8f37b58ca5a Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 7 Jul 2018 17:02:17 -0700 Subject: [PATCH] Reuse language data source for trainer editors provides nice descriptions rather than 3 character codes --- .../Subforms/Save Editors/Gen6/SAV_Trainer.cs | 12 +----------- .../Subforms/Save Editors/Gen7/SAV_Trainer7.cs | 14 +------------- .../Subforms/Save Editors/TrainerStat.Designer.cs | 6 +++++- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs index 8aaf6358f..04120b597 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs @@ -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"; diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs index adaafde7a..91d01d11e 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs @@ -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; diff --git a/PKHeX.WinForms/Subforms/Save Editors/TrainerStat.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/TrainerStat.Designer.cs index fc9945824..587cb5d01 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/TrainerStat.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/TrainerStat.Designer.cs @@ -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;