Add UseLang key to settings

This commit is contained in:
Korney Czukowski 2017-12-12 21:49:44 +01:00
parent 2844fad8ab
commit babb48ac51

View File

@ -441,6 +441,12 @@ namespace DS4Windows
get { return m_Config.formLocationY; }
}
public static string UseLang
{
set { m_Config.useLang = value; }
get { return m_Config.useLang; }
}
public static bool DownloadLang
{
set { m_Config.downloadLang = value; }
@ -1345,6 +1351,7 @@ namespace DS4Windows
{ new Dictionary<string, int>(), new Dictionary<string, int>(), new Dictionary<string, int>(),
new Dictionary<string, int>(), new Dictionary<string, int>() };
public string useLang = "";
public bool downloadLang = true;
public bool useWhiteIcon;
public bool flashWhenLate = true;
@ -2832,6 +2839,8 @@ namespace DS4Windows
catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/Profile/CloseMinimizes"); Boolean.TryParse(Item.InnerText, out closeMini); }
catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/Profile/UseLang"); useLang = Item.InnerText; }
catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/Profile/DownloadLang"); Boolean.TryParse(Item.InnerText, out downloadLang); }
catch { missingSetting = true; }
try { Item = m_Xdoc.SelectSingleNode("/Profile/FlashWhenLate"); Boolean.TryParse(Item.InnerText, out flashWhenLate); }
@ -2902,6 +2911,7 @@ namespace DS4Windows
XmlNode xmlQuickCharge = m_Xdoc.CreateNode(XmlNodeType.Element, "QuickCharge", null); xmlQuickCharge.InnerText = quickCharge.ToString(); Node.AppendChild(xmlQuickCharge);
XmlNode xmlFirstXinputPort = m_Xdoc.CreateNode(XmlNodeType.Element, "FirstXinputPort", null); xmlFirstXinputPort.InnerText = firstXinputPort.ToString(); Node.AppendChild(xmlFirstXinputPort);
XmlNode xmlCloseMini = m_Xdoc.CreateNode(XmlNodeType.Element, "CloseMinimizes", null); xmlCloseMini.InnerText = closeMini.ToString(); Node.AppendChild(xmlCloseMini);
XmlNode xmlUseLang = m_Xdoc.CreateNode(XmlNodeType.Element, "UseLang", null); xmlUseLang.InnerText = useLang.ToString(); Node.AppendChild(xmlUseLang);
XmlNode xmlDownloadLang = m_Xdoc.CreateNode(XmlNodeType.Element, "DownloadLang", null); xmlDownloadLang.InnerText = downloadLang.ToString(); Node.AppendChild(xmlDownloadLang);
XmlNode xmlFlashWhenLate = m_Xdoc.CreateNode(XmlNodeType.Element, "FlashWhenLate", null); xmlFlashWhenLate.InnerText = flashWhenLate.ToString(); Node.AppendChild(xmlFlashWhenLate);
XmlNode xmlFlashWhenLateAt = m_Xdoc.CreateNode(XmlNodeType.Element, "FlashWhenLateAt", null); xmlFlashWhenLateAt.InnerText = flashWhenLateAt.ToString(); Node.AppendChild(xmlFlashWhenLateAt);