diff --git a/project/code/LGS/Database/Chunks/Property.cs b/project/code/LGS/Database/Chunks/Property.cs index a670ccf..001efeb 100644 --- a/project/code/LGS/Database/Chunks/Property.cs +++ b/project/code/LGS/Database/Chunks/Property.cs @@ -1,8 +1,6 @@ -using System; using System.Collections.Generic; using System.IO; using System.Numerics; -using System.Text; namespace KeepersCompound.LGS.Database.Chunks; @@ -56,14 +54,38 @@ public class PropGeneric : Property } } -public class PropModelName : Property +public class PropLabel : Property { - public string modelName; + public string value; public override void Read(BinaryReader reader) { base.Read(reader); - modelName = reader.ReadNullString(length); + value = reader.ReadNullString(length); + } +} + +public class PropString : Property +{ + public int stringLength; + public string value; + + public override void Read(BinaryReader reader) + { + base.Read(reader); + stringLength = reader.ReadInt32(); + value = reader.ReadNullString(stringLength); + } +} + +public class PropFloat : Property +{ + public float value; + + public override void Read(BinaryReader reader) + { + base.Read(reader); + value = reader.ReadSingle(); } } @@ -96,28 +118,4 @@ public class PropRenderType : Property base.Read(reader); mode = (Mode)reader.ReadUInt32(); } -} - -public class PropString : Property -{ - public int stringLength; - public string value; - - public override void Read(BinaryReader reader) - { - base.Read(reader); - stringLength = reader.ReadInt32(); - value = reader.ReadNullString(stringLength); - } -} - -public class PropFloat : Property -{ - public float value; - - public override void Read(BinaryReader reader) - { - base.Read(reader); - value = reader.ReadSingle(); - } -} +} \ No newline at end of file diff --git a/project/code/LGS/Database/File.cs b/project/code/LGS/Database/File.cs index a886d26..606aa2a 100644 --- a/project/code/LGS/Database/File.cs +++ b/project/code/LGS/Database/File.cs @@ -101,7 +101,7 @@ public class DbFile "TXLIST" => new TxList(), "WREXT" => new WorldRep(), "BRLIST" => new BrList(), - "P$ModelName" => new PropertyChunk(), + "P$ModelName" => new PropertyChunk(), "P$Scale" => new PropertyChunk(), "P$RenderTyp" => new PropertyChunk(), "P$OTxtRepr0" => new PropertyChunk(), diff --git a/project/code/LGS/Database/ObjectHierarchy.cs b/project/code/LGS/Database/ObjectHierarchy.cs index 3042c5f..a8ddfcb 100644 --- a/project/code/LGS/Database/ObjectHierarchy.cs +++ b/project/code/LGS/Database/ObjectHierarchy.cs @@ -91,7 +91,7 @@ public class ObjectHierarchy } } - AddProp("P$ModelName"); + AddProp("P$ModelName"); AddProp("P$Scale"); AddProp("P$RenderTyp"); AddProp("P$OTxtRepr0"); diff --git a/project/code/TMV/Mission.cs b/project/code/TMV/Mission.cs index f5a477f..4c44ad2 100644 --- a/project/code/TMV/Mission.cs +++ b/project/code/TMV/Mission.cs @@ -246,7 +246,7 @@ public partial class Mission : Node3D } var id = (int)brush.brushInfo; - var modelNameProp = objHierarchy.GetProperty(id, "P$ModelName"); + var modelNameProp = objHierarchy.GetProperty(id, "P$ModelName"); var scaleProp = objHierarchy.GetProperty(id, "P$Scale"); var renderTypeProp = objHierarchy.GetProperty(id, "P$RenderTyp"); var txtRepl0 = objHierarchy.GetProperty(id, "P$OTxtRepr0"); @@ -262,7 +262,7 @@ public partial class Mission : Node3D } // Let's try and place an object :) - var modelName = modelNameProp.modelName + ".bin"; + var modelName = modelNameProp.value + ".bin"; var pos = brush.position.ToGodotVec3(); var rawRot = brush.angle; var rot = new Vector3(rawRot.Y, rawRot.Z, rawRot.X) * 360 / ushort.MaxValue;