Misc updates

extract programlanguage to enum
fix parse fail for settings' version; old syntax fails to parse
delete unused file from recent pull
This commit is contained in:
Kurt
2018-12-10 20:48:21 -08:00
parent 34f4fb176c
commit 2c1717a409
3 changed files with 48 additions and 16 deletions

View File

@@ -201,4 +201,47 @@ public static IReadOnlyList<ComboItem> GetLocationList(GameVersion version, int
return Strings.GetLocationList(version, pkmFormat, egg);
}
}
public enum ProgramLanguage
{
/// <summary>
/// Japanese
/// </summary>
,
/// <summary>
/// English
/// </summary>
English,
/// <summary>
/// French
/// </summary>
Français,
/// <summary>
/// Italian
/// </summary>
Italiano,
/// <summary>
/// German
/// </summary>
Deutsch,
/// <summary>
/// Spanish
/// </summary>
Español,
/// <summary>
/// Korean
/// </summary>
,
/// <summary>
/// Chinese
/// </summary>
,
}
}

View File

@@ -80,17 +80,7 @@ private set
public static bool HaX { get; private set; }
public static bool IsInitialized { get; private set; }
private readonly string[] main_langlist =
{
"日本語", // JPN
"English", // ENG
"Français", // FRE
"Italiano", // ITA
"Deutsch", // GER
"Español", // SPA
"한국어", // KOR
"中文", // CHN
};
private readonly string[] main_langlist = Enum.GetNames(typeof(ProgramLanguage));
private static readonly List<IPlugin> Plugins = new List<IPlugin>();
#endregion
@@ -254,7 +244,7 @@ private void FormLoadCheckForUpdates()
catch (Exception ex)
{
Debug.WriteLine($"Exception while checking for latest version: {ex}");
}
}
});
}
@@ -273,13 +263,13 @@ private void FormLoadConfig(out bool BAKprompt, out bool showChangelog)
int lang = GameInfo.Language(l);
if (lang < 0)
lang = GameInfo.Language();
CB_MainLanguage.SelectedIndex = lang >= 0 ? lang : 1; // english
CB_MainLanguage.SelectedIndex = lang >= 0 ? lang : (int)ProgramLanguage.English;
// Version Check
if (Settings.Version.Length > 0) // already run on system
{
Version.TryParse(Settings.Version, out Version lastrev);
showChangelog = lastrev < CurrentProgramVersion;
bool parsed = Version.TryParse(Settings.Version, out Version lastrev);
showChangelog = parsed && lastrev < CurrentProgramVersion;
}
// BAK Prompt

View File

@@ -1 +0,0 @@
18.11.01