Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce dot as decimal separator #19

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions resources/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## 0.5 - Remastered Characters (2023-10-15)

### 0.5.1

- Fixed scaling issue in environments using comma as decimal separator (e.g. German)

### Changes

- Toggle fullscreen/windows with Alt+Enter
- Remastered graphics
- All remaining location maps
Expand Down
8 changes: 4 additions & 4 deletions source/Burntime.MonoGame/BurntimeGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ public void DecreaseLoadingCount()

public bool IsLoading { get; set; }

#if (DEBUG)
// #if (DEBUG)
public bool FullScreen { get; set; } = false;
#else
public bool FullScreen { get; set; } = true;
#endif
// #else
// public bool FullScreen { get; set; } = true;
// #endif
bool _initialized = false;

public BurntimeGame()
Expand Down
14 changes: 8 additions & 6 deletions source/Burntime.Platform/IO/ConfigSection.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Burntime.Platform.IO;
using System.Globalization;

namespace Burntime.Platform.IO;

public class ConfigSection
{
Expand Down Expand Up @@ -227,15 +229,15 @@ public Vector2f GetVector2f(string key, Vector2f defaultValue)
string[] token = str.Split(new char[] { 'x' });
if (token.Length == 1)
{
if (!float.TryParse(token[0], out v.x))
if (!float.TryParse(token[0], NumberStyles.Float, CultureInfo.InvariantCulture, out v.x))
return defaultValue;
return v;
}
if (token.Length != 2)
return v;
if (!float.TryParse(token[0], out v.x))
if (!float.TryParse(token[0], NumberStyles.Float, CultureInfo.InvariantCulture, out v.x))
return defaultValue;
if (!float.TryParse(token[1], out v.y))
if (!float.TryParse(token[1], NumberStyles.Float, CultureInfo.InvariantCulture, out v.y))
return defaultValue;
return v;
}
Expand All @@ -246,7 +248,7 @@ public float GetFloat(string key)
return 0;

float res = 0;
if (!float.TryParse(Get(key), System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out res))
if (!float.TryParse(Get(key), NumberStyles.Float, CultureInfo.InvariantCulture, out res))
return 0;
return res;
}
Expand All @@ -263,7 +265,7 @@ public float[] GetFloats(string key)
float[] floats = new float[strs.Length];
for (int i = 0; i < strs.Length; i++)
{
if (!float.TryParse(strs[i], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out floats[i]))
if (!float.TryParse(strs[i], NumberStyles.Float, CultureInfo.InvariantCulture, out floats[i]))
floats[i] = 0;
}
return floats;
Expand Down
Loading