(d9779ffb1) Don't reset the language when resetting settings to defaults
This commit is contained in:
@@ -755,7 +755,7 @@ namespace Barotrauma
|
|||||||
OnClicked = (button, data) =>
|
OnClicked = (button, data) =>
|
||||||
{
|
{
|
||||||
// TODO: add a prompt
|
// TODO: add a prompt
|
||||||
LoadDefaultConfig();
|
LoadDefaultConfig(setLanguage: false);
|
||||||
CheckBindings(true);
|
CheckBindings(true);
|
||||||
RefreshItemMessages();
|
RefreshItemMessages();
|
||||||
ApplySettings();
|
ApplySettings();
|
||||||
|
|||||||
@@ -337,24 +337,6 @@ namespace Barotrauma
|
|||||||
keyMapping[(int)InputType.SelectNextCharacter] = new KeyOrMouse(Keys.Z);
|
keyMapping[(int)InputType.SelectNextCharacter] = new KeyOrMouse(Keys.Z);
|
||||||
keyMapping[(int)InputType.SelectPreviousCharacter] = new KeyOrMouse(Keys.X);
|
keyMapping[(int)InputType.SelectPreviousCharacter] = new KeyOrMouse(Keys.X);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#region Load DefaultConfig
|
|
||||||
private void LoadDefaultConfig()
|
|
||||||
{
|
|
||||||
XDocument doc = XMLExtensions.TryLoadXml(savePath);
|
|
||||||
|
|
||||||
Language = doc.Root.GetAttributeString("language", "English");
|
|
||||||
|
|
||||||
MasterServerUrl = doc.Root.GetAttributeString("masterserverurl", "");
|
|
||||||
|
|
||||||
AutoCheckUpdates = doc.Root.GetAttributeBool("autocheckupdates", true);
|
|
||||||
WasGameUpdated = doc.Root.GetAttributeBool("wasgameupdated", false);
|
|
||||||
|
|
||||||
VerboseLogging = doc.Root.GetAttributeBool("verboselogging", false);
|
|
||||||
SaveDebugConsoleLogs = doc.Root.GetAttributeBool("savedebugconsolelogs", false);
|
|
||||||
|
|
||||||
QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", "");
|
|
||||||
|
|
||||||
if (legacy)
|
if (legacy)
|
||||||
{
|
{
|
||||||
@@ -433,6 +415,17 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Load DefaultConfig
|
||||||
|
private void LoadDefaultConfig(bool setLanguage = true)
|
||||||
|
{
|
||||||
|
XDocument doc = XMLExtensions.TryLoadXml(savePath);
|
||||||
|
|
||||||
|
if (setLanguage || string.IsNullOrEmpty(Language))
|
||||||
|
{
|
||||||
|
Language = doc.Root.GetAttributeString("language", "English");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Load DefaultConfig
|
#region Load DefaultConfig
|
||||||
private void LoadDefaultConfig()
|
private void LoadDefaultConfig()
|
||||||
{
|
{
|
||||||
@@ -450,6 +443,16 @@ namespace Barotrauma
|
|||||||
|
|
||||||
QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", "");
|
QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", "");
|
||||||
|
|
||||||
|
MasterServerUrl = doc.Root.GetAttributeString("masterserverurl", "");
|
||||||
|
|
||||||
|
AutoCheckUpdates = doc.Root.GetAttributeBool("autocheckupdates", true);
|
||||||
|
WasGameUpdated = doc.Root.GetAttributeBool("wasgameupdated", false);
|
||||||
|
|
||||||
|
VerboseLogging = doc.Root.GetAttributeBool("verboselogging", false);
|
||||||
|
SaveDebugConsoleLogs = doc.Root.GetAttributeBool("savedebugconsolelogs", false);
|
||||||
|
|
||||||
|
QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", "");
|
||||||
|
|
||||||
if (doc == null)
|
if (doc == null)
|
||||||
{
|
{
|
||||||
GraphicsWidth = 1024;
|
GraphicsWidth = 1024;
|
||||||
|
|||||||
Reference in New Issue
Block a user