Skip to content

Commit

Permalink
Fix CSV import/export when param has versioned fields (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingborehaha authored Nov 5, 2023
1 parent 1436bb1 commit 1240f40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/StudioCore/ParamEditor/ParamIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static string GenerateColumnLabels(Param param, char separator)
{
var str = "";
str += $@"ID{separator}Name{separator}";
foreach (PARAMDEF.Field? f in param.AppliedParamdef.Fields)
foreach (PARAMDEF.Field? f in param.AppliedParamdef.Fields.FindAll(f => f.IsValidForRegulationVersion(ParamBank.PrimaryBank.ParamVersion)))
{
str += $@"{f.InternalName}{separator}";
}
Expand Down Expand Up @@ -76,7 +76,7 @@ public static (string, CompoundAction?) ApplyCSV(ParamBank bank, string csvStrin
return ("No Param selected", null);
}

var csvLength = p.AppliedParamdef.Fields.Count + 2; // Include ID and name
var csvLength = p.AppliedParamdef.Fields.FindAll(f => f.IsValidForRegulationVersion(bank.ParamVersion)).Count + 2; // Include ID and name
var csvLines = csvString.Split("\n");
if (csvLines[0].StartsWith($@"ID{separator}Name"))
{
Expand Down

0 comments on commit 1240f40

Please sign in to comment.