Decouple incompatible conversion routes from HaX, make setting

This commit is contained in:
Kurt 2021-06-17 22:48:31 -07:00
parent 9e427ad9a0
commit 412bd18139
10 changed files with 27 additions and 12 deletions

View file

@ -282,8 +282,7 @@ namespace PKHeX.WinForms
ReloadProgramSettings(settings);
CB_MainLanguage.Items.AddRange(main_langlist);
PB_Legal.Visible = !HaX;
PKMConverter.AllowIncompatibleConversion = C_SAV.HaX = PKME_Tabs.HaX = HaX;
WinFormsUtil.DetectSaveFileOnFileOpen = settings.Startup.TryDetectRecentSave;
C_SAV.HaX = PKME_Tabs.HaX = HaX;
#if DEBUG
DevUtil.AddControl(Menu_Tools);
@ -427,6 +426,8 @@ namespace PKHeX.WinForms
SpriteBuilder.ShowEggSpriteAsItem = settings.Display.ShowEggSpriteAsHeldItem;
ParseSettings.InitFromSettings(settings.Legality);
PKME_Tabs.HideSecretValues = C_SAV.HideSecretDetails = settings.Privacy.HideSecretDetails;
PKMConverter.AllowIncompatibleConversion = settings.Advanced.AllowIncompatibleConversion;
WinFormsUtil.DetectSaveFileOnFileOpen = settings.Startup.TryDetectRecentSave;
}
private void MainMenuBoxLoad(object sender, EventArgs e)
@ -911,23 +912,26 @@ namespace PKHeX.WinForms
// Language Translation
private void ChangeMainLanguage(object sender, EventArgs e)
{
if (CB_MainLanguage.SelectedIndex < 8)
CurrentLanguage = GameLanguage.Language2Char(CB_MainLanguage.SelectedIndex);
var index = CB_MainLanguage.SelectedIndex;
if ((uint)index < CB_MainLanguage.Items.Count)
CurrentLanguage = GameLanguage.Language2Char(index);
// Set the culture (makes it easy to pass language to other forms)
Settings.Startup.Language = CurrentLanguage;
Thread.CurrentThread.CurrentCulture = new CultureInfo(CurrentLanguage[..2]);
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
var lang = CurrentLanguage;
Settings.Startup.Language = lang;
var ci = new CultureInfo(lang[..2]);
Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = ci;
Menu_Options.DropDown.Close();
LocalizeUtil.InitializeStrings(CurrentLanguage, C_SAV.SAV, HaX);
WinFormsUtil.TranslateInterface(this, CurrentLanguage); // Translate the UI to language.
LocalizedDescriptionAttribute.Localizer = WinFormsTranslator.GetDictionary(CurrentLanguage);
if (C_SAV.SAV is not FakeSaveFile)
var sav = C_SAV.SAV;
LocalizeUtil.InitializeStrings(lang, sav, HaX);
WinFormsUtil.TranslateInterface(this, lang); // Translate the UI to language.
LocalizedDescriptionAttribute.Localizer = WinFormsTranslator.GetDictionary(lang);
if (sav is not FakeSaveFile)
{
var pk = PKME_Tabs.CurrentPKM.Clone();
var sav = C_SAV.SAV;
PKME_Tabs.ChangeLanguage(sav, pk);
Text = GetProgramTitle(sav);

View file

@ -210,6 +210,9 @@ namespace PKHeX.WinForms
[Serializable]
public class AdvancedSettings
{
[LocalizedDescription("Allow PKM file conversion paths that are not possible via official methods. Individual properties will be copied sequentially.")]
public bool AllowIncompatibleConversion { get; set; }
[LocalizedDescription("Path to a dump of block hash-names. If file does not exist, only names defined within the program's code will be loaded.")]
public string PathBlockKeyListSWSH { get; set; } = "SCBlocks.txt";
}

View file

@ -73,6 +73,7 @@ ErrorWindow.B_Continue=Fortfahren
ErrorWindow.B_CopyToClipboard=In Zwischenablage kopieren
ErrorWindow.L_ProvideInfo=Bitte sende diese Information, wenn du den Fehler meldest:
LocalizedDescription.AllowGen1Tradeback=AllowGen1Tradeback
LocalizedDescription.AllowIncompatibleConversion=Allow PKM file conversion paths that are not possible via official methods. Individual properties will be copied sequentially.
LocalizedDescription.ApplyMarkings=Apply Markings on Import
LocalizedDescription.ApplyNature=Apply StatNature to Nature on Import
LocalizedDescription.AutoLoadSaveOnStartup=Automatically Detect Save File on Program Startup

View file

@ -73,6 +73,7 @@ ErrorWindow.B_Continue=Continue
ErrorWindow.B_CopyToClipboard=Copy to Clipboard
ErrorWindow.L_ProvideInfo=Please provide this information when reporting this error:
LocalizedDescription.AllowGen1Tradeback=GB: Allow Generation 2 tradeback learnsets
LocalizedDescription.AllowIncompatibleConversion=Allow PKM file conversion paths that are not possible via official methods. Individual properties will be copied sequentially.
LocalizedDescription.ApplyMarkings=Apply Markings on Import
LocalizedDescription.ApplyNature=Apply StatNature to Nature on Import
LocalizedDescription.AutoLoadSaveOnStartup=Automatically Detect Save File on Program Startup

View file

@ -73,6 +73,7 @@ ErrorWindow.B_Continue=Continuar
ErrorWindow.B_CopyToClipboard=Copiar al portapapeles
ErrorWindow.L_ProvideInfo=Por favor, proporcione esta información cuando reporte el fallo:
LocalizedDescription.AllowGen1Tradeback=GB: Permitir intercambio de movimientos desde la Generación 2.
LocalizedDescription.AllowIncompatibleConversion=Allow PKM file conversion paths that are not possible via official methods. Individual properties will be copied sequentially.
LocalizedDescription.ApplyMarkings=Aplicar marcadores al importar
LocalizedDescription.ApplyNature=Aplicar StatNature a la naturaleza al importar
LocalizedDescription.AutoLoadSaveOnStartup=Detectar automáticamente el archivo de guardado al iniciar el programa

View file

@ -73,6 +73,7 @@ ErrorWindow.B_Continue=Continuer
ErrorWindow.B_CopyToClipboard=Copier dans le presse-papier
ErrorWindow.L_ProvideInfo=Veuillez fournir les informations suivantes dans votre rapport d'erreur :
LocalizedDescription.AllowGen1Tradeback=GB: Permettre les movepools de revenants de la Gén. 2
LocalizedDescription.AllowIncompatibleConversion=Allow PKM file conversion paths that are not possible via official methods. Individual properties will be copied sequentially.
LocalizedDescription.ApplyMarkings=Appliquer des marques de l'import
LocalizedDescription.ApplyNature=Appliquer StatNature à la nature lors de l'import
LocalizedDescription.AutoLoadSaveOnStartup=Automatically Detect Save File on Program Startup

View file

@ -73,6 +73,7 @@ ErrorWindow.B_Continue=Continue
ErrorWindow.B_CopyToClipboard=Copy to Clipboard
ErrorWindow.L_ProvideInfo=Please provide this information when reporting this error:
LocalizedDescription.AllowGen1Tradeback=GB: Allow Generation 2 tradeback learnsets
LocalizedDescription.AllowIncompatibleConversion=Allow PKM file conversion paths that are not possible via official methods. Individual properties will be copied sequentially.
LocalizedDescription.ApplyMarkings=Apply Markings on Import
LocalizedDescription.ApplyNature=Apply StatNature to Nature on Import
LocalizedDescription.AutoLoadSaveOnStartup=Automatically Detect Save File on Program Startup

View file

@ -73,6 +73,7 @@ ErrorWindow.B_Continue=続ける
ErrorWindow.B_CopyToClipboard=クリップボードにコピー
ErrorWindow.L_ProvideInfo=Please provide this information when reporting this error:
LocalizedDescription.AllowGen1Tradeback=GB: Allow Generation 2 tradeback learnsets
LocalizedDescription.AllowIncompatibleConversion=Allow PKM file conversion paths that are not possible via official methods. Individual properties will be copied sequentially.
LocalizedDescription.ApplyMarkings=Apply Markings on Import
LocalizedDescription.ApplyNature=Apply StatNature to Nature on Import
LocalizedDescription.AutoLoadSaveOnStartup=Automatically Detect Save File on Program Startup

View file

@ -73,6 +73,7 @@ ErrorWindow.B_Continue=계속
ErrorWindow.B_CopyToClipboard=클립보드에 복사
ErrorWindow.L_ProvideInfo=오류를 보고할 때 이 정보를 제공해 주세요:
LocalizedDescription.AllowGen1Tradeback=GB: 2세대에서 옮겨온 1세대 기술 허용
LocalizedDescription.AllowIncompatibleConversion=Allow PKM file conversion paths that are not possible via official methods. Individual properties will be copied sequentially.
LocalizedDescription.ApplyMarkings=가져오기 시 마킹하기
LocalizedDescription.ApplyNature=임포트시 자연에 StatNature 적용
LocalizedDescription.AutoLoadSaveOnStartup=Automatically Detect Save File on Program Startup

View file

@ -73,6 +73,7 @@ ErrorWindow.B_Continue=继续
ErrorWindow.B_CopyToClipboard=复制到剪切板
ErrorWindow.L_ProvideInfo=提交错误报告时请提供以下信息:
LocalizedDescription.AllowGen1Tradeback=GB 允许二代传回的招式组合
LocalizedDescription.AllowIncompatibleConversion=Allow PKM file conversion paths that are not possible via official methods. Individual properties will be copied sequentially.
LocalizedDescription.ApplyMarkings=导入时标记
LocalizedDescription.ApplyNature=在导入时将修正性格应用于性格
LocalizedDescription.AutoLoadSaveOnStartup=在程序启动时自动加载存档文件