Skip to content

Commit

Permalink
Merge pull request #38 from FFXIV-CombatReborn/timeline-localization
Browse files Browse the repository at this point in the history
Fixed culture settings on timeline parsing
  • Loading branch information
NostraThomas99 authored Mar 31, 2024
2 parents 6d6be7d + f3b2f25 commit 0e62cc1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions RotationSolver/Updaters/RaidTimeUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using RotationSolver.Basic.Configuration.Timeline.TimelineCondition;
using RotationSolver.Basic.Configuration.Timeline.TimelineDrawing;
using RotationSolver.UI;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Xml.Linq;

Expand Down Expand Up @@ -479,7 +480,7 @@ static async Task<TimelineItem[]> DownloadRaidTimeAsync(string path, RaidLangs l

if (string.IsNullOrEmpty(header)) continue;

var time = float.Parse(Time().Match(header).Value);
var time = float.Parse(Time().Match(header).Value, CultureInfo.InvariantCulture);
var name = Name().Match(header).Value[1..^1];

var timelineStr = ActionGetter().Match(timeline).Value;
Expand All @@ -497,7 +498,7 @@ static async Task<TimelineItem[]> DownloadRaidTimeAsync(string path, RaidLangs l
float? jumpTime = null;
if (jumpTimeStr.Length > 5)
{
jumpTime = float.Parse(jumpTimeStr[5..]);
jumpTime = float.Parse(jumpTimeStr[5..], CultureInfo.InvariantCulture);
}
else
{
Expand All @@ -520,8 +521,8 @@ static async Task<TimelineItem[]> DownloadRaidTimeAsync(string path, RaidLangs l
if (windowStr.Length > 7)
{
var windowStrs = windowStr[7..].Split(',');
windowMin = float.Parse(windowStrs.First());
windowMax = float.Parse(windowStrs.Last());
windowMin = float.Parse(windowStrs.First(), CultureInfo.InvariantCulture);
windowMax = float.Parse(windowStrs.Last(), CultureInfo.InvariantCulture);
}

result.Add(new (time, name, type, item, lang, jumpTime, windowMin, windowMax));
Expand Down

0 comments on commit 0e62cc1

Please sign in to comment.