Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Jan 14, 2024
1 parent 7e7bd0e commit 4b0cdb5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions OpenDreamRuntime/Procs/Native/DreamProcNativeSavefile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public static DreamValue NativeProc_ImportText(NativeProc.Bundle bundle, DreamOb
private static string ExportTextInternal(DreamObjectSavefile savefile, int indent = 0) {
string result = "";
var value = savefile.CurrentDir;
var key = savefile.CurrentPath;
var oldPath = savefile.CurrentPath;
var key = savefile.CurrentPath.Split('/').Last();
switch(value) {
case DreamObjectSavefile.DreamPrimitive primitiveValue:
if(primitiveValue.Value.IsNull)
Expand All @@ -112,6 +113,8 @@ private static string ExportTextInternal(DreamObjectSavefile savefile, int inden
//result += $"encoding=base64\",{{\"{Convert.ToBase64String(fileValue.Data)}\"}}";
result += ")\n";
break;
case DreamObjectSavefile.DreamObjectValue objectValue:
throw new NotImplementedException($"ExportText() can't do objects yet TODO");
case DreamObjectSavefile.DreamJsonValue jsonValue:
result += $"{new string('\t', indent)}{key}\n";
break;
Expand All @@ -125,7 +128,7 @@ private static string ExportTextInternal(DreamObjectSavefile savefile, int inden
savefile.CurrentPath = subkey;
result += ExportTextInternal(savefile, indent + 1);
}
savefile.CurrentPath = key;
savefile.CurrentPath = oldPath;


return result;
Expand Down

0 comments on commit 4b0cdb5

Please sign in to comment.