From 0d59a4dcd7e11032b445c88f11ce81e2e2b0e7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 28 Jun 2012 00:09:34 +0200 Subject: [PATCH] fixes #2005 Don't save floats in settings.yaml using country-specific decimal separators which can be misunderstood as group seperators which will put values out-of-range. --- OpenRA.FileFormats/FieldLoader.cs | 4 ++++ mods/ra/chrome/settings.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.FileFormats/FieldLoader.cs b/OpenRA.FileFormats/FieldLoader.cs index d06fab6252..5525b3e26a 100755 --- a/OpenRA.FileFormats/FieldLoader.cs +++ b/OpenRA.FileFormats/FieldLoader.cs @@ -325,6 +325,10 @@ namespace OpenRA.FileFormats ((int)c.B).Clamp(0, 255)); } + // Don't save floats in settings.yaml using country-specific decimal separators which can be misunderstood as group seperators. + if (t == typeof(float)) + return ((float)v).ToString(CultureInfo.InvariantCulture); + if (t == typeof(Rectangle)) { var r = (Rectangle)v; diff --git a/mods/ra/chrome/settings.yaml b/mods/ra/chrome/settings.yaml index e69d5b72a5..65a064f15b 100644 --- a/mods/ra/chrome/settings.yaml +++ b/mods/ra/chrome/settings.yaml @@ -144,7 +144,7 @@ Background@SETTINGS_MENU: X:100 Y:60 Width:250 - Height:20 + Height:25 Font:Regular Text:Extreme Container@DISPLAY_PANE: