diff --git a/MLEM.Data/DataTextureAtlas.cs b/MLEM.Data/DataTextureAtlas.cs
index 1f94587..20fc086 100644
--- a/MLEM.Data/DataTextureAtlas.cs
+++ b/MLEM.Data/DataTextureAtlas.cs
@@ -78,8 +78,8 @@ namespace MLEM.Data {
if (match.Groups[8].Success) {
for (var i = 0; i < match.Groups[8].Captures.Count; i++) {
region.SetData(match.Groups[8].Captures[i].Value, new Vector2(
- float.Parse(match.Groups[9].Captures[i].Value) - (pivotRelative ? 0 : loc.X),
- float.Parse(match.Groups[10].Captures[i].Value) - (pivotRelative ? 0 : loc.Y)));
+ float.Parse(match.Groups[9].Captures[i].Value, CultureInfo.InvariantCulture) - (pivotRelative ? 0 : loc.X),
+ float.Parse(match.Groups[10].Captures[i].Value, CultureInfo.InvariantCulture) - (pivotRelative ? 0 : loc.Y)));
}
}
atlas.regions.Add(name, region);
diff --git a/MLEM.Extended/Tiled/TiledExtensions.cs b/MLEM.Extended/Tiled/TiledExtensions.cs
index 8a055d1..51b5830 100644
--- a/MLEM.Extended/Tiled/TiledExtensions.cs
+++ b/MLEM.Extended/Tiled/TiledExtensions.cs
@@ -55,7 +55,7 @@ namespace MLEM.Extended.Tiled {
/// The key by which to get a property
/// The float property, or 0 if there is none
public static float GetFloat(this TiledMapProperties properties, string key) {
- float.TryParse(properties.Get(key), NumberStyles.Number, NumberFormatInfo.InvariantInfo, out var val);
+ float.TryParse(properties.Get(key), NumberStyles.Number, CultureInfo.InvariantCulture, out var val);
return val;
}
@@ -66,7 +66,7 @@ namespace MLEM.Extended.Tiled {
/// The key by which to get a property
/// The int property, or 0 if there is none
public static int GetInt(this TiledMapProperties properties, string key) {
- int.TryParse(properties.Get(key), NumberStyles.Number, NumberFormatInfo.InvariantInfo, out var val);
+ int.TryParse(properties.Get(key), NumberStyles.Number, CultureInfo.InvariantCulture, out var val);
return val;
}
diff --git a/MLEM/Formatting/TextFormatter.cs b/MLEM/Formatting/TextFormatter.cs
index 8bc7c8d..b52bab1 100644
--- a/MLEM/Formatting/TextFormatter.cs
+++ b/MLEM/Formatting/TextFormatter.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using Microsoft.Xna.Framework;
@@ -33,7 +34,9 @@ namespace MLEM.Formatting {
// font codes
this.Codes.Add(new Regex(""), (f, m, r) => new FontCode(m, r, fnt => fnt.Bold));
this.Codes.Add(new Regex(""), (f, m, r) => new FontCode(m, r, fnt => fnt.Italic));
- this.Codes.Add(new Regex(@""), (f, m, r) => new ShadowCode(m, r, m.Groups[1].Success ? ColorHelper.FromHexString(m.Groups[1].Value) : Color.Black, new Vector2(float.TryParse(m.Groups[2].Value, out var offset) ? offset : 2)));
+ this.Codes.Add(new Regex(@""), (f, m, r) => new ShadowCode(m, r,
+ m.Groups[1].Success ? ColorHelper.FromHexString(m.Groups[1].Value) : Color.Black,
+ new Vector2(float.TryParse(m.Groups[2].Value, NumberStyles.Number, CultureInfo.InvariantCulture, out var offset) ? offset : 2)));
this.Codes.Add(new Regex(""), (f, m, r) => new UnderlineCode(m, r, 1 / 16F, 0.85F));
this.Codes.Add(new Regex("(b|i|s|u|l)>"), (f, m, r) => new FontCode(m, r, null));
@@ -48,7 +51,9 @@ namespace MLEM.Formatting {
this.Codes.Add(new Regex(""), (f, m, r) => new ColorCode(m, r, null));
// animation codes
- this.Codes.Add(new Regex(@""), (f, m, r) => new WobblyCode(m, r, float.TryParse(m.Groups[1].Value, out var mod) ? mod : 5, float.TryParse(m.Groups[2].Value, out var heightMod) ? heightMod : 1 / 8F));
+ this.Codes.Add(new Regex(@""), (f, m, r) => new WobblyCode(m, r,
+ float.TryParse(m.Groups[1].Value, NumberStyles.Number, CultureInfo.InvariantCulture, out var mod) ? mod : 5,
+ float.TryParse(m.Groups[2].Value, NumberStyles.Number, CultureInfo.InvariantCulture, out var heightMod) ? heightMod : 1 / 8F));
this.Codes.Add(new Regex(""), (f, m, r) => new AnimatedCode(m, r));
// macros