riperiperi / FreeSO

Re-implementation of The Sims Online.
http://freeso.org
Mozilla Public License 2.0
816 stars 95 forks source link

Fix decimal numbers for different User Culture settings #124

Closed AstroPsynapse closed 5 years ago

AstroPsynapse commented 5 years ago

Fixes the issue with default config values that contain decimals (floats, decimals, doubles). It should also update accordingly if a user should ever switch their number separator format.

AstroPsynapse commented 5 years ago

That makes a lot more sense, otherwise the configuration could get messy depending on different formats.

I changed it to save and load values using CultureInfo.InvariantCulture only.

EDIT By doing this change, any configuration entries that already exist with commas in them (DPI scaling and chat opacity) will cause them to become whole numbers (E.G. 0,88 will become 88).

Opacity was tested with values over 1 and that seems to work fine, but DPI scaling can be a bigger problem ☠️