diff --git a/2DGAMELIB/_2DGAMELIB/Obj.cs b/2DGAMELIB/_2DGAMELIB/BodyTemplate.cs similarity index 97% rename from 2DGAMELIB/_2DGAMELIB/Obj.cs rename to 2DGAMELIB/_2DGAMELIB/BodyTemplate.cs index 220b5dc..47cf951 100644 --- a/2DGAMELIB/_2DGAMELIB/Obj.cs +++ b/2DGAMELIB/_2DGAMELIB/BodyTemplate.cs @@ -7,7 +7,7 @@ using System.IO; namespace _2DGAMELIB { [Serializable] - public class Obj + public class BodyTemplate { public string Tag = ""; @@ -189,7 +189,7 @@ namespace _2DGAMELIB } } - public Obj SetDefaultR() + public BodyTemplate SetDefaultR() { foreach (VariantGrid value in Difss.Values) { @@ -198,7 +198,7 @@ namespace _2DGAMELIB return this; } - public Obj() + public BodyTemplate() { } diff --git a/2DGAMELIB/_2DGAMELIB/ObjExtensions.cs b/2DGAMELIB/_2DGAMELIB/ObjExtensions.cs index a6ae3db..7783b13 100644 --- a/2DGAMELIB/_2DGAMELIB/ObjExtensions.cs +++ b/2DGAMELIB/_2DGAMELIB/ObjExtensions.cs @@ -31,19 +31,19 @@ namespace _2DGAMELIB ["四足下腕"] = "四足LowerArm", }; - public static void MigrateKeys(this Obj obj) + public static void MigrateKeys(this BodyTemplate BodyTemplate) { var newDict = new OrderedDictionary(); - foreach (var key in obj.Keys) + foreach (var key in BodyTemplate.Keys) { var newKey = KeyMap.TryGetValue(key, out var mapped) ? mapped : key; - var difs = obj.Difss[key]; + var difs = BodyTemplate.Difss[key]; newDict.Add(newKey, difs); } - obj.Difss = newDict; + BodyTemplate.Difss = newDict; } } diff --git a/2DGAMELIB/_2DGAMELIB/Oth.cs b/2DGAMELIB/_2DGAMELIB/Oth.cs index 5aaa17d..82b96a1 100644 --- a/2DGAMELIB/_2DGAMELIB/Oth.cs +++ b/2DGAMELIB/_2DGAMELIB/Oth.cs @@ -156,16 +156,16 @@ namespace _2DGAMELIB GetMinMaxY(ShapePart, ref MM[1].Y, ref MM[0].Y); } -public static Obj ObjLoad(this byte[] bd) +public static BodyTemplate ObjLoad(this byte[] bd) { - return bd.Load().ToDeserialObject().SetDefaultR(); + return bd.Load().ToDeserialObject().SetDefaultR(); } - public static Obj? ObjLoadRaw(this byte[] bd) + public static BodyTemplate? ObjLoadRaw(this byte[] bd) { try { - return bd.Load().ToDeserialObject(); + return bd.Load().ToDeserialObject(); } catch { diff --git a/2DGAMELIB/_2DGAMELIB/Ser.cs b/2DGAMELIB/_2DGAMELIB/Ser.cs index aa92ea1..9ebdb7b 100644 --- a/2DGAMELIB/_2DGAMELIB/Ser.cs +++ b/2DGAMELIB/_2DGAMELIB/Ser.cs @@ -21,7 +21,8 @@ namespace _2DGAMELIB .Add("_2DGAMELIB.Out", typeof(CurveOutline)) .Add("_2DGAMELIB.Joi", typeof(JointPoint)) .Add("_2DGAMELIB.Dif", typeof(MorphVariant)) - .Add("_2DGAMELIB.Difs", typeof(VariantGrid)); + .Add("_2DGAMELIB.Difs", typeof(VariantGrid)) + .Add("_2DGAMELIB.Obj", typeof(BodyTemplate)); private static BinaryFormatter NewFormatter() { diff --git a/SlaveMatrix.Extract/Program.cs b/SlaveMatrix.Extract/Program.cs index 038050f..bb55631 100644 --- a/SlaveMatrix.Extract/Program.cs +++ b/SlaveMatrix.Extract/Program.cs @@ -239,7 +239,7 @@ class Program foreach (var (name, data) in resources) { Console.Write($"Loading {name}... "); - Obj? obj; + BodyTemplate? obj; try { obj = data.ObjLoadRaw(); @@ -558,12 +558,12 @@ class Program return result; } - static JObject ExportObj(Obj obj) + static JObject ExportObj(BodyTemplate BodyTemplate) { - var keys = obj.Difss.Keys.Cast().ToList(); + var keys = BodyTemplate.Difss.Keys.Cast().ToList(); var result = new JObject { - ["Tag"] = obj.Tag ?? "", + ["Tag"] = BodyTemplate.Tag ?? "", ["KeyCount"] = keys.Count, ["Keys"] = JArray.FromObject(keys), ["Difss"] = new JObject() @@ -571,7 +571,7 @@ class Program foreach (var key in keys) { - result["Difss"][key] = ExportDifs(obj.Difss[key]); + result["Difss"][key] = ExportDifs(BodyTemplate.Difss[key]); } return result; diff --git a/SlaveMatrix/SlaveMatrix/GameClasses/Sta.cs b/SlaveMatrix/SlaveMatrix/GameClasses/Sta.cs index 16c3eab..85e8a5e 100644 --- a/SlaveMatrix/SlaveMatrix/GameClasses/Sta.cs +++ b/SlaveMatrix/SlaveMatrix/GameClasses/Sta.cs @@ -16,33 +16,33 @@ namespace SlaveMatrix { public static class Sta { - public static Obj 胴体; //胴体 + public static BodyTemplate 胴体; //胴体 - public static Obj 肩左; + public static BodyTemplate 肩左; - public static Obj 腕左; + public static BodyTemplate 腕左; - public static Obj 脚左; + public static BodyTemplate 脚左; - public static Obj 尻尾; + public static BodyTemplate 尻尾; - public static Obj 半身; + public static BodyTemplate 半身; - public static Obj 肢左; + public static BodyTemplate 肢左; - public static Obj 肢中; + public static BodyTemplate 肢中; - public static Obj 性器; + public static BodyTemplate 性器; - public static Obj 性器付; + public static BodyTemplate 性器付; - public static Obj スタンプ; + public static BodyTemplate スタンプ; - public static Obj カーソル; + public static BodyTemplate カーソル; - public static Obj その他; + public static BodyTemplate その他; - public static Obj タイル; + public static BodyTemplate タイル; public static double MaxAre; @@ -1090,14 +1090,14 @@ namespace SlaveMatrix //胴体.SaveExMod("C:\\Users\\adel4\\Documents\\胴体"); //Ser.ToJson(胴体, "C:\\Users\\adel4\\Documents\\胴体.json"); - //胴体 = Ser.UnJson("C:\\Users\\adel4\\Documents\\胴体.json"); + //胴体 = Ser.UnJson("C:\\Users\\adel4\\Documents\\胴体.json"); obj = Resources.肩左.ObjLoad(); obj.MigrateKeys(); 肩左 = obj; //肩左.SaveExMod("C:\\Users\\dave\\Documents\\肩左"); //Ser.ToJson(肩左, "C:\\Users\\dave\\Documents\\肩左.json"); - //肩左 = Ser.UnJson("C:\\Users\\dave\\Documents\\肩左.json"); + //肩左 = Ser.UnJson("C:\\Users\\dave\\Documents\\肩左.json"); obj = Resources.腕左.ObjLoad(); @@ -1105,64 +1105,64 @@ namespace SlaveMatrix 腕左 = obj; //腕左.SaveExMod("C:\\Users\\dave\\Documents\\腕左"); //Ser.ToJson(腕左, "C:\\Users\\dave\\Documents\\腕左.json"); - //腕左 = Ser.UnJson("C:\\Users\\dave\\Documents\\腕左.json"); + //腕左 = Ser.UnJson("C:\\Users\\dave\\Documents\\腕左.json"); obj = Resources.脚左.ObjLoad(); obj.MigrateKeys(); 脚左 = obj; //脚左.SaveExMod("C:\\Users\\dave\\Documents\\脚左"); //Ser.ToJson(脚左, "C:\\Users\\dave\\Documents\\脚左.json"); - //脚左 = Ser.UnJson("C:\\Users\\dave\\Documents\\脚左.json"); + //脚左 = Ser.UnJson("C:\\Users\\dave\\Documents\\脚左.json"); 尻尾 = Resources.尻尾.ObjLoad(); //尻尾.SaveExMod("C:\\Users\\dave\\Documents\\尻尾"); //Ser.ToJson(尻尾, "C:\\Users\\dave\\Documents\\尻尾.json"); - //尻尾 = Ser.UnJson("C:\\Users\\dave\\Documents\\尻尾.json"); + //尻尾 = Ser.UnJson("C:\\Users\\dave\\Documents\\尻尾.json"); 半身 = Resources.半身.ObjLoad(); //半身.SaveExMod("C:\\Users\\dave\\Documents\\半身"); //Ser.ToJson(半身, "C:\\Users\\dave\\Documents\\半身.json"); - //半身 = Ser.UnJson("C:\\Users\\dave\\Documents\\半身.json"); + //半身 = Ser.UnJson("C:\\Users\\dave\\Documents\\半身.json"); 肢左 = Resources.肢左.ObjLoad(); //肢左.SaveExMod("C:\\Users\\dave\\Documents\\肢左"); //Ser.ToJson(肢左, "C:\\Users\\dave\\Documents\\肢左.json"); - //肢左 = Ser.UnJson("C:\\Users\\dave\\Documents\\肢左.json"); + //肢左 = Ser.UnJson("C:\\Users\\dave\\Documents\\肢左.json"); 肢中 = Resources.肢中.ObjLoad(); //肢中.SaveExMod("C:\\Users\\dave\\Documents\\肢中"); //Ser.ToJson(肢中, "C:\\Users\\dave\\Documents\\肢中.json"); - //肢中 = Ser.UnJson("C:\\Users\\dave\\Documents\\肢中.json"); + //肢中 = Ser.UnJson("C:\\Users\\dave\\Documents\\肢中.json"); 性器 = Resources.性器.ObjLoad(); //性器.SaveExMod("C:\\Users\\dave\\Documents\\性器"); //Ser.ToJson(性器, "C:\\Users\\dave\\Documents\\性器.json"); - //性器 = Ser.UnJson("C:\\Users\\dave\\Documents\\性器.json"); + //性器 = Ser.UnJson("C:\\Users\\dave\\Documents\\性器.json"); 性器付 = Resources.性器付.ObjLoad(); //性器付.SaveExMod("C:\\Users\\dave\\Documents\\性器付"); //Ser.ToJson(性器付, "C:\\Users\\dave\\Documents\\性器付.json"); - //性器付 = Ser.UnJson("C:\\Users\\dave\\Documents\\性器付.json"); + //性器付 = Ser.UnJson("C:\\Users\\dave\\Documents\\性器付.json"); スタンプ = Resources.スタンプ.ObjLoad(); //スタンプ.SaveExMod("C:\\Users\\dave\\Documents\\スタンプ"); //Ser.ToJson(スタンプ, "C:\\Users\\dave\\Documents\\スタンプ.json"); - //スタンプ = Ser.UnJson("C:\\Users\\dave\\Documents\\スタンプ.json"); + //スタンプ = Ser.UnJson("C:\\Users\\dave\\Documents\\スタンプ.json"); カーソル = Resources.カーソル.ObjLoad(); //カーソル.SaveExMod("C:\\Users\\dave\\Documents\\カーソル"); //Ser.ToJson(カーソル, "C:\\Users\\dave\\Documents\\カーソル.json"); - //カーソル = Ser.UnJson("C:\\Users\\dave\\Documents\\カーソル.json"); + //カーソル = Ser.UnJson("C:\\Users\\dave\\Documents\\カーソル.json"); その他 = Resources.その他.ObjLoad(); //その他.SaveExMod("C:\\Users\\dave\\Documents\\その他"); //Ser.ToJson(その他, "C:\\Users\\dave\\Documents\\その他.json"); - //その他 = Ser.UnJson("C:\\Users\\dave\\Documents\\その他.json"); + //その他 = Ser.UnJson("C:\\Users\\dave\\Documents\\その他.json"); タイル = Resources.タイル.ObjLoad(); //タイル.SaveExMod("C:\\Users\\dave\\Documents\\タイル"); //Ser.ToJson(タイル, "C:\\Users\\dave\\Documents\\タイル.json"); - //タイル = Ser.UnJson("C:\\Users\\dave\\Documents\\タイル.json"); + //タイル = Ser.UnJson("C:\\Users\\dave\\Documents\\タイル.json"); MaxAre = 0.0584246154149664; Elet = typeof(Ele);