diff --git a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs index a472e2f1..9fdb5f13 100644 --- a/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs +++ b/PCK-Studio/Forms/Skins-And-Textures/generateModel.cs @@ -106,7 +106,7 @@ namespace PckStudio public ValueTuple ToProperty() { string value = $"{Type} {X} {Y} {Z} {Width} {Height} {Length} {U} {V}"; - return new ValueTuple("BOX", value); + return new ValueTuple("BOX", value.Replace(',', '.')); } } @@ -124,7 +124,7 @@ namespace PckStudio public ValueTuple ToProperty() { string value = $"{Name} Y {YOffset}"; - return new ValueTuple("OFFSET", value); + return new ValueTuple("OFFSET", value.Replace(',','.')); } } @@ -153,8 +153,7 @@ namespace PckStudio { case "BOX": { - string temp = Regex.Replace(property.Item2, @"\s+", " ").TrimEnd('\n', '\r', ' '); - string[] Format = ReplaceWhitespace(temp, ",").Split(','); + string[] Format = ReplaceWhitespace(property.Item2, ",").TrimEnd('\n', '\r', ' ').Split(','); if (Format.Length < 9) { Console.WriteLine($"'{property.Item1}' property has too few arguments: {property.Item2}"); @@ -177,12 +176,12 @@ namespace PckStudio // %f try { - float x = float.Parse(Format[1]); - float y = float.Parse(Format[2]); - float z = float.Parse(Format[3]); - float sizeX = float.Parse(Format[4]); - float sizeY = float.Parse(Format[5]); - float sizeZ = float.Parse(Format[6]); + float x = float.Parse(Format[1], System.Globalization.CultureInfo.InvariantCulture); + float y = float.Parse(Format[2], System.Globalization.CultureInfo.InvariantCulture); + float z = float.Parse(Format[3], System.Globalization.CultureInfo.InvariantCulture); + float sizeX = float.Parse(Format[4], System.Globalization.CultureInfo.InvariantCulture); + float sizeY = float.Parse(Format[5], System.Globalization.CultureInfo.InvariantCulture); + float sizeZ = float.Parse(Format[6], System.Globalization.CultureInfo.InvariantCulture); int u = int.Parse(Format[7]); int v = int.Parse(Format[8]); modelParts.Add(new ModelPart(name, x, y, z, sizeX, sizeY, sizeZ, u, v)); @@ -190,7 +189,6 @@ namespace PckStudio catch (FormatException ex) { Console.WriteLine(ex.Message); - Console.WriteLine("\"" + property.Item2 + "\""); MessageBox.Show("A Format Exception was thrown\nFailed to parse BOX value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (OverflowException ex) @@ -211,8 +209,7 @@ namespace PckStudio case "OFFSET": { - string temp = Regex.Replace(property.Item2, @"\s+", " ").TrimEnd('\n', '\r', ' '); - string[] offset = ReplaceWhitespace(temp, ",").Split(','); + string[] offset = ReplaceWhitespace(property.Item2, ",").TrimEnd('\n', '\r', ' ').Split(','); if (offset.Length < 3) continue; string name = offset[0]; string dimension = offset[1]; // "Y" diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index f9d7c198..25d7630c 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -3,6 +3,7 @@ preview + true publish\ true Disk @@ -17,7 +18,6 @@ 1.0.0.%2a false true - true Debug