From 5e32e9203e592c91273af2cf342fa519a2b20eea Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 19 Mar 2020 13:47:25 -0700 Subject: [PATCH] Add setting to apply nature to statnature on import Co-Authored-By: toim22 #2794 --- PKHeX.Core/Editing/CommonEdits.cs | 8 ++++++++ .../Resources/text/zh/LegalityCheckStrings_zh.txt | 2 +- PKHeX.WinForms/MainWindow/Main.cs | 1 + PKHeX.WinForms/Properties/Settings.Designer.cs | 12 ++++++++++++ PKHeX.WinForms/Properties/Settings.settings | 3 +++ PKHeX.WinForms/Resources/text/lang_de.txt | 1 + PKHeX.WinForms/Resources/text/lang_en.txt | 1 + PKHeX.WinForms/Resources/text/lang_es.txt | 1 + PKHeX.WinForms/Resources/text/lang_fr.txt | 1 + PKHeX.WinForms/Resources/text/lang_it.txt | 1 + PKHeX.WinForms/Resources/text/lang_ja.txt | 1 + PKHeX.WinForms/Resources/text/lang_ko.txt | 1 + PKHeX.WinForms/Resources/text/lang_zh.txt | 3 ++- 13 files changed, 34 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Editing/CommonEdits.cs b/PKHeX.Core/Editing/CommonEdits.cs index fc9fc981d..ba6a804e8 100644 --- a/PKHeX.Core/Editing/CommonEdits.cs +++ b/PKHeX.Core/Editing/CommonEdits.cs @@ -13,6 +13,11 @@ public static class CommonEdits /// public static bool ShowdownSetIVMarkings { get; set; } = true; + /// + /// Setting which causes the to the in Gen8+ formats. + /// + public static bool ShowdownSetBehaviorNature { get; set; } = false; + /// /// Sets the to the provided value. /// @@ -224,6 +229,9 @@ public static void ApplySetDetails(this PKM pk, ShowdownSet Set) pk.ClearRecordFlags(); pk.SetRecordFlags(Set.Moves); + if (ShowdownSetBehaviorNature && pk.Format >= 8) + pk.Nature = pk.StatNature; + var legal = new LegalityAnalysis(pk); if (legal.Parsed && legal.Info.Relearn.Any(z => !z.Valid)) pk.SetRelearnMoves(legal.GetSuggestedRelearnMoves()); diff --git a/PKHeX.Core/Resources/text/zh/LegalityCheckStrings_zh.txt b/PKHeX.Core/Resources/text/zh/LegalityCheckStrings_zh.txt index 48585c7db..3d56a573e 100644 --- a/PKHeX.Core/Resources/text/zh/LegalityCheckStrings_zh.txt +++ b/PKHeX.Core/Resources/text/zh/LegalityCheckStrings_zh.txt @@ -203,7 +203,7 @@ LItemEgg = 蛋不能有持有物。 LItemUnreleased = 持有物未解禁。 LIVAllEqual = 所有个体值相等。 LIVF_COUNT0_31 = 至少有 {0} 项个体值 = 31。 -LIVNotCorrect =个体值与相遇要求不匹配 +LIVNotCorrect = 个体值与相遇要求不匹配 LLevelEXPThreshold = 当前经验与等级匹配。 LLevelMetBelow = 当前等级低于相遇等级。 LLevelMetGift = 相遇等级与神秘礼物等级不一致。 diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs index d0e4db742..fde433b72 100644 --- a/PKHeX.WinForms/MainWindow/Main.cs +++ b/PKHeX.WinForms/MainWindow/Main.cs @@ -429,6 +429,7 @@ private void ReloadProgramSettings(Settings settings) SaveFile.SetUpdatePKM = settings.SetUpdatePKM ? PKMImportSetting.Update : PKMImportSetting.Skip; C_SAV.ModifyPKM = PKME_Tabs.ModifyPKM = settings.SetUpdatePKM; CommonEdits.ShowdownSetIVMarkings = settings.ApplyMarkings; + CommonEdits.ShowdownSetBehaviorNature = settings.ApplyNature; C_SAV.FlagIllegal = settings.FlagIllegal; C_SAV.M.Hover.GlowHover = settings.HoverSlotGlowEdges; SpriteBuilder.ShowEggSpriteAsItem = settings.ShowEggSpriteAsHeldItem; diff --git a/PKHeX.WinForms/Properties/Settings.Designer.cs b/PKHeX.WinForms/Properties/Settings.Designer.cs index f97567e54..0ee34c9df 100644 --- a/PKHeX.WinForms/Properties/Settings.Designer.cs +++ b/PKHeX.WinForms/Properties/Settings.Designer.cs @@ -334,5 +334,17 @@ internal sealed partial class Settings : global::System.Configuration.Applicatio this["FlagMissingTracker"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool ApplyNature { + get { + return ((bool)(this["ApplyNature"])); + } + set { + this["ApplyNature"] = value; + } + } } } diff --git a/PKHeX.WinForms/Properties/Settings.settings b/PKHeX.WinForms/Properties/Settings.settings index a0ef67ae5..23650e309 100644 --- a/PKHeX.WinForms/Properties/Settings.settings +++ b/PKHeX.WinForms/Properties/Settings.settings @@ -80,5 +80,8 @@ False + + False + \ No newline at end of file diff --git a/PKHeX.WinForms/Resources/text/lang_de.txt b/PKHeX.WinForms/Resources/text/lang_de.txt index f278b8a57..05ee161d8 100644 --- a/PKHeX.WinForms/Resources/text/lang_de.txt +++ b/PKHeX.WinForms/Resources/text/lang_de.txt @@ -1362,6 +1362,7 @@ SAV_ZygardeCell.L_Cells=Stored: SAV_ZygardeCell.L_Collected=Collected: SettingsEditor.AllowGen1Tradeback=AllowGen1Tradeback SettingsEditor.ApplyMarkings=Apply Markings on Import +SettingsEditor.ApplyNature=Apply StatNature to Nature on Import SettingsEditor.B_Reset=Reset All SettingsEditor.BAKEnabled=Automatic Save File Backups Enabled SettingsEditor.DetectSaveOnStartup=Automatically Detect Save File on Program Startup diff --git a/PKHeX.WinForms/Resources/text/lang_en.txt b/PKHeX.WinForms/Resources/text/lang_en.txt index 16c29c3b7..5f20b2c24 100644 --- a/PKHeX.WinForms/Resources/text/lang_en.txt +++ b/PKHeX.WinForms/Resources/text/lang_en.txt @@ -1358,6 +1358,7 @@ SAV_ZygardeCell.L_Cells=Stored: SAV_ZygardeCell.L_Collected=Collected: SettingsEditor.AllowGen1Tradeback=GB: Allow Generation 2 tradeback learnsets SettingsEditor.ApplyMarkings=Apply Markings on Import +SettingsEditor.ApplyNature=Apply StatNature to Nature on Import SettingsEditor.B_Reset=Reset All SettingsEditor.BAKEnabled=Automatic Save File Backups Enabled SettingsEditor.DetectSaveOnStartup=Automatically Detect Save File on Program Startup diff --git a/PKHeX.WinForms/Resources/text/lang_es.txt b/PKHeX.WinForms/Resources/text/lang_es.txt index a33f471fe..886af967a 100644 --- a/PKHeX.WinForms/Resources/text/lang_es.txt +++ b/PKHeX.WinForms/Resources/text/lang_es.txt @@ -1358,6 +1358,7 @@ SAV_ZygardeCell.L_Cells=Almacenado: SAV_ZygardeCell.L_Collected=Coleccionado: SettingsEditor.AllowGen1Tradeback=GB: Permitir intercambio de movimientos desde la Generación 2. SettingsEditor.ApplyMarkings=Aplicar marcadores al importar +SettingsEditor.ApplyNature=Aplicar StatNature a la naturaleza al importar SettingsEditor.B_Reset=Reiniciar Todo SettingsEditor.BAKEnabled=Respaldo Automático de archivos de guardado habilitado SettingsEditor.DetectSaveOnStartup=Detectar automáticamente el archivo de guardado al inicio del programa diff --git a/PKHeX.WinForms/Resources/text/lang_fr.txt b/PKHeX.WinForms/Resources/text/lang_fr.txt index 55aae38ee..86f184829 100644 --- a/PKHeX.WinForms/Resources/text/lang_fr.txt +++ b/PKHeX.WinForms/Resources/text/lang_fr.txt @@ -1362,6 +1362,7 @@ SAV_ZygardeCell.L_Cells=Conservé : SAV_ZygardeCell.L_Collected=Obtenu : SettingsEditor.AllowGen1Tradeback=GB: Permettre les movepools de revenants de la Gén. 2 SettingsEditor.ApplyMarkings=Appliquer des marques de l'import +SettingsEditor.ApplyNature=Appliquer StatNature à la nature lors de l'import SettingsEditor.B_Reset=Reset All SettingsEditor.BAKEnabled=Automatic Save File Backups Enabled SettingsEditor.DetectSaveOnStartup=Automatically Detect Save File on Program Startup diff --git a/PKHeX.WinForms/Resources/text/lang_it.txt b/PKHeX.WinForms/Resources/text/lang_it.txt index d97526eaa..bdb6cbd01 100644 --- a/PKHeX.WinForms/Resources/text/lang_it.txt +++ b/PKHeX.WinForms/Resources/text/lang_it.txt @@ -1368,6 +1368,7 @@ SAV_ZygardeCell.L_Cells=Stored: SAV_ZygardeCell.L_Collected=Collected: SettingsEditor.AllowGen1Tradeback=GB: Allow Generation 2 tradeback learnsets SettingsEditor.ApplyMarkings=Apply Markings on Import +SettingsEditor.ApplyNature=Apply StatNature to Nature on Import SettingsEditor.B_Reset=Reset All SettingsEditor.BAKEnabled=Automatic Save File Backups Enabled SettingsEditor.DetectSaveOnStartup=Automatically Detect Save File on Program Startup diff --git a/PKHeX.WinForms/Resources/text/lang_ja.txt b/PKHeX.WinForms/Resources/text/lang_ja.txt index df81d7652..eb6efa4cb 100644 --- a/PKHeX.WinForms/Resources/text/lang_ja.txt +++ b/PKHeX.WinForms/Resources/text/lang_ja.txt @@ -1362,6 +1362,7 @@ SAV_ZygardeCell.L_Cells=キューブ内 SAV_ZygardeCell.L_Collected=回収 SettingsEditor.AllowGen1Tradeback=GB: Allow Generation 2 tradeback learnsets SettingsEditor.ApplyMarkings=Apply Markings on Import +SettingsEditor.ApplyNature=Apply StatNature to Nature on Import SettingsEditor.B_Reset=Reset All SettingsEditor.BAKEnabled=Automatic Save File Backups Enabled SettingsEditor.DetectSaveOnStartup=Automatically Detect Save File on Program Startup diff --git a/PKHeX.WinForms/Resources/text/lang_ko.txt b/PKHeX.WinForms/Resources/text/lang_ko.txt index e04310a70..38c731637 100644 --- a/PKHeX.WinForms/Resources/text/lang_ko.txt +++ b/PKHeX.WinForms/Resources/text/lang_ko.txt @@ -1358,6 +1358,7 @@ SAV_ZygardeCell.L_Cells=보관됨: SAV_ZygardeCell.L_Collected=회수함: SettingsEditor.AllowGen1Tradeback=GB: 2세대에서 옮겨온 1세대 기술 허용 SettingsEditor.ApplyMarkings=가져오기 시 마킹하기 +SettingsEditor.ApplyNature=임포트시 자연에 StatNature 적용 SettingsEditor.B_Reset=초기화 SettingsEditor.BAKEnabled=세이브 파일 자동 백업 사용 SettingsEditor.DetectSaveOnStartup=프로그램 시작 시 세이브 파일 자동 감지 diff --git a/PKHeX.WinForms/Resources/text/lang_zh.txt b/PKHeX.WinForms/Resources/text/lang_zh.txt index ed85966f7..f63146dea 100644 --- a/PKHeX.WinForms/Resources/text/lang_zh.txt +++ b/PKHeX.WinForms/Resources/text/lang_zh.txt @@ -258,6 +258,7 @@ Main.mnu_DeletePastGen=清理前代宝可梦 Main.mnu_DeleteUntrained=清理无努力值宝可梦 Main.mnu_Modify=编辑 Main.mnu_ModifyHatchEggs=使蛋孵化 +Main.mnu_ModifyHeal=修复(能力/PP) Main.mnu_ModifyHyperTrain=进行极限训练 Main.mnu_ModifyMaxFriendship=使亲密度最大 Main.mnu_ModifyMaxLevel=使等级最大 @@ -268,7 +269,6 @@ Main.mnu_ModifyResetMoves=填入建议招式 Main.mnu_Sort=排序 Main.mnu_SortAdvanced=排序(高级) Main.mnu_SortBST=按种族值和 -Main.mnu_ModifyHeal=修复(能力/PP) Main.mnu_SortCP=CP Main.mnu_SortDate=按相遇日期 Main.mnu_SortEncounterType=按相遇类型 @@ -1358,6 +1358,7 @@ SAV_ZygardeCell.L_Cells=储存了: SAV_ZygardeCell.L_Collected=收集了: SettingsEditor.AllowGen1Tradeback=GB 允许二代传回的招式组合 SettingsEditor.ApplyMarkings=导入时标记 +SettingsEditor.ApplyNature=在导入时将StatNature应用于自然 SettingsEditor.B_Reset=重置 SettingsEditor.BAKEnabled=自动保存文件备份已启用 SettingsEditor.DetectSaveOnStartup=在程序启动时自动检测保存文件