Skip to content

Commit

Permalink
Added import and export for STSC2 Choice
Browse files Browse the repository at this point in the history
  • Loading branch information
thesupersonic16 committed Oct 8, 2024
1 parent a18391d commit 1c4da1f
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions DALTools/DALLib/ImportExport/TranslationSTSCHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ public static TranslationLine[] ExportTranslationLines(STSC2File script, Diction
lines.Add(new TranslationLine("Message", name, line.arguments[3] as string));
break;
case "Choice":
case "SetChoice":
//lines.Add(new TranslationLine("Choice", "", line.GetArgument<string>(1)));
lines.Add(new TranslationLine("Choice", "", line.arguments[1] as string));
break;
case "MapPlace":
//lines.Add(new TranslationLine("MapMarker", "", line.GetArgument<string>(1)));
Expand Down Expand Up @@ -296,16 +295,15 @@ private static bool SetSTSCLine(TranslationLine line, List<STSC2Commands.Command
}
break;
case "Choice":
case "SetChoice":
//// Check if the entry is a Choice translation
//if (!string.IsNullOrEmpty(line.Operator) && line.Operator != "Choice")
// break;
//// Check if the key matches the current text
//if (inst.GetArgument<string>(1) == line.Key || ignoreKey)
//{
// inst.Arguments[1] = line.Translation;
// return true;
//}
// Check if the entry is a Choice line
if (!string.IsNullOrEmpty(line.Operator) && line.Operator != "Choice")
break;
// Check if the key matches the current text
if (inst.arguments[1] as string == line.Key || ignoreKey)
{
inst.arguments[1] = line.Translation;
return true;
}
break;
case "MapPlace":
//// Check if the entry is a MapPlace translation
Expand Down

0 comments on commit 1c4da1f

Please sign in to comment.