Skip to content

Commit

Permalink
Locale fix for GML writing
Browse files Browse the repository at this point in the history
  • Loading branch information
wu4 committed Oct 28, 2020
1 parent e7672ed commit 84528e3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions rewt-wizard/rewt-wizard.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -515,15 +515,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Rivals Easy Workshop Tool"
"ProductCode" = "8:{B930039E-B76A-4A7A-9033-7F21BFDB3ED3}"
"PackageCode" = "8:{84A52D10-B617-405E-B9C5-43AFB6A79AE4}"
"ProductCode" = "8:{DE683E8D-6701-4A9C-8FE2-192FB2403E01}"
"PackageCode" = "8:{93F3D45B-3E2A-47C3-9E80-DB126D147DFC}"
"UpgradeCode" = "8:{162C470C-835B-4DBA-9BB6-F6A25E36B9E7}"
"AspNetVersion" = "8:2.0.50727.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:FALSE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.1.2"
"ProductVersion" = "8:1.1.3"
"Manufacturer" = "8:wuffie"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down Expand Up @@ -1051,7 +1051,7 @@
{
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_CFB817958E544F46AF8068A9C4CA0247"
{
"SourcePath" = "8:"
"SourcePath" = "8:..\\workshop_forms\\obj\\Debug\\rivals-easy-workshop-tool.exe"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_1A198EE584A34CFC9ACA5BDA8277F363"
Expand Down
2 changes: 1 addition & 1 deletion workshop_forms/AboutWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions workshop_forms/AttackToGML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Threading.Tasks;

namespace workshop_forms
Expand All @@ -26,11 +27,14 @@ public class Parser
const string G_HITBOX = "set_hitbox_value({0}, {1}, {2}, {3});\n";
const string G_HITBOX_SFX = "set_hitbox_value({0}, {1}, {2}, asset_get(\"{3}\"));\n";

// ensure decimal output to always be periods regardless of locale
private static IFormatProvider enUSFormat = new CultureInfo("en-US");

private string AsGML(string vtype, params object[] args)
{
var argsL = args.ToList();
argsL.Insert(0, atk_name);
return string.Format(vtype, argsL.ToArray());
return string.Format(enUSFormat, vtype, argsL.ToArray());
}

private void IterateHitbox(AtkFileParsing.Hitbox h)
Expand Down Expand Up @@ -78,9 +82,9 @@ public string ToGML()
}
atk_vals.Append(AsGML(vtype, entry.Key, entry.Value));
}
if (!atk.Values.ContainsKey("AG_SPRITE")) atk_vals.Append(AsGML(G_ATTACK_SPRITE, "AG_SPRITE", atk_name_orig));
if (!atk.Values.ContainsKey("AG_SPRITE")) atk_vals.Append(AsGML(G_ATTACK_SPRITE, "AG_SPRITE", atk_name_orig));
if (!atk.Values.ContainsKey("AG_HURTBOX_SPRITE")) atk_vals.Append(AsGML(G_ATTACK_SPRITE, "AG_HURTBOX_SPRITE", $"{atk_name_orig}_hurt"));
if (!atk.Values.ContainsKey("AG_NUM_WINDOWS")) atk_vals.Append(AsGML(G_ATTACK, "AG_NUM_WINDOWS", win_count.ToString()));
if (!atk.Values.ContainsKey("AG_NUM_WINDOWS")) atk_vals.Append(AsGML(G_ATTACK, "AG_NUM_WINDOWS", win_count.ToString()));
atk_vals.Append($"set_num_hitboxes({atk_name}, {hbx_count});\n");

return atk_vals.Append(
Expand Down
4 changes: 2 additions & 2 deletions workshop_forms/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.2.0")]
[assembly: AssemblyFileVersion("1.1.2.0")]
[assembly: AssemblyVersion("1.1.3.0")]
[assembly: AssemblyFileVersion("1.1.3.0")]

0 comments on commit 84528e3

Please sign in to comment.