dexyfex / CodeWalker

https://www.gta5-mods.com/tools/codewalker-gtav-interactive-3d-map
469 stars 205 forks source link

Fix decimal point being removed in BSRadius input #190

Closed Gamzky closed 1 year ago

Gamzky commented 1 year ago

Currently, when you click away from an archetype and click back, the decimal point is being removed causing an incorrect BSRadius. Not sure if this is a good fix as I am not that familiar with C#.

Before: before

After: after

dexyfex commented 1 year ago

Really FloatUtil.ToString should be used here and not float.ToString... Note how in your screenshots, the decimal separator for that field is a comma, where it should be a dot (CW is using invariant culture in an attempt to avoid these issues). So really the problem is being caused when the value in the textbox is being parsed, in BSRadiusTextBox_TextChanged, it's currently using float.TryParse instead of FloatUtil.TryParse. I'll close this PR and add the correct fix in a separate commit. Thanks for finding the issue.