Change PropModelName to PropLabel
This commit is contained in:
		
							parent
							
								
									bd7005d034
								
							
						
					
					
						commit
						da67a26eec
					
				|  | @ -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(); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | @ -101,7 +101,7 @@ public class DbFile | |||
|             "TXLIST" => new TxList(), | ||||
|             "WREXT" => new WorldRep(), | ||||
|             "BRLIST" => new BrList(), | ||||
|             "P$ModelName" => new PropertyChunk<PropModelName>(), | ||||
|             "P$ModelName" => new PropertyChunk<PropLabel>(), | ||||
|             "P$Scale" => new PropertyChunk<PropScale>(), | ||||
|             "P$RenderTyp" => new PropertyChunk<PropRenderType>(), | ||||
|             "P$OTxtRepr0" => new PropertyChunk<PropString>(), | ||||
|  |  | |||
|  | @ -91,7 +91,7 @@ public class ObjectHierarchy | |||
|             } | ||||
|         } | ||||
| 
 | ||||
|         AddProp<PropModelName>("P$ModelName"); | ||||
|         AddProp<PropLabel>("P$ModelName"); | ||||
|         AddProp<PropScale>("P$Scale"); | ||||
|         AddProp<PropRenderType>("P$RenderTyp"); | ||||
|         AddProp<PropString>("P$OTxtRepr0"); | ||||
|  |  | |||
|  | @ -246,7 +246,7 @@ public partial class Mission : Node3D | |||
| 			} | ||||
| 
 | ||||
| 			var id = (int)brush.brushInfo; | ||||
| 			var modelNameProp = objHierarchy.GetProperty<PropModelName>(id, "P$ModelName"); | ||||
| 			var modelNameProp = objHierarchy.GetProperty<PropLabel>(id, "P$ModelName"); | ||||
| 			var scaleProp = objHierarchy.GetProperty<PropScale>(id, "P$Scale"); | ||||
| 			var renderTypeProp = objHierarchy.GetProperty<PropRenderType>(id, "P$RenderTyp"); | ||||
| 			var txtRepl0 = objHierarchy.GetProperty<PropString>(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; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue