Add backward compatibility for skin. (Amend)

This commit is contained in:
2023-02-17 16:27:49 +08:00
parent 675ce68073
commit 88d35e4eaf

View File

@@ -2,6 +2,7 @@ using Cryville.Common;
using Cryville.Common.Pdt;
using Cryville.Crtr.Browsing;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
@@ -33,8 +34,11 @@ namespace Cryville.Crtr {
Root.elements = (SkinElement)new SkinInterpreter(src, new PdtBinder()).Interpret(typeof(SkinElement));
}
else {
if (format[1] == 1) {
Root = (PdtSkin)new SkinInterpreter(src, new PdtBinder()).Interpret(typeof(PdtSkin));
switch (format[1]) {
case 1:
Root = (PdtSkin)new SkinInterpreter(src, new PdtBinder()).Interpret(typeof(PdtSkin));
break;
default: throw new NotSupportedException("Unsupported skin format");
}
}
}