private void ProcessObjectDataTag(FrontendObject frontendObject, ObjectDataTag objectDataTag) { frontendObject.Position = objectDataTag.Data.Position; frontendObject.Pivot = objectDataTag.Data.Pivot; frontendObject.Color = objectDataTag.Data.Color; frontendObject.Rotation = objectDataTag.Data.Rotation; frontendObject.Size = objectDataTag.Data.Size; if (objectDataTag.Data is FEImageData imageData) { FrontendImage image = (FrontendImage)frontendObject; image.UpperLeft = imageData.UpperLeft; image.LowerRight = imageData.LowerRight; } if (objectDataTag.Data is FEMultiImageData multiImageData) { FrontendMultiImage multiImage = (FrontendMultiImage)frontendObject; multiImage.PivotRotation = multiImageData.PivotRotation; multiImage.TopLeftUV = multiImageData.TopLeftUV; multiImage.BottomRightUV = multiImageData.BottomRightUV; } if (objectDataTag.Data is FEColoredImageData coloredImageData) { FrontendColoredImage coloredImage = (FrontendColoredImage)frontendObject; coloredImage.VertexColors = coloredImageData.VertexColors; } }
public override void Read(BinaryReader br, FrontendChunkBlock chunkBlock, Package package, ushort id, ushort length) { FrontendObject.InitializeData(); FrontendObject.Data.Read(br); }
private FrontendObject ProcessObjectTypeTag(FrontendObject frontendObject, ObjectTypeTag objectTypeTag) { FrontendObject newInstance; switch (objectTypeTag.Type) { case FEObjType.FE_Image: newInstance = new FrontendImage(frontendObject); break; case FEObjType.FE_Group: newInstance = new FrontendGroup(frontendObject); break; case FEObjType.FE_String: newInstance = new FrontendString(frontendObject); break; case FEObjType.FE_MultiImage: newInstance = new FrontendMultiImage(frontendObject); break; case FEObjType.FE_ColoredImage: newInstance = new FrontendColoredImage(frontendObject); break; default: throw new IndexOutOfRangeException($"cannot handle object type: {objectTypeTag.Type}"); } newInstance.Type = objectTypeTag.Type; return(newInstance); }
private void ProcessTag(FrontendObject frontendObject, FrontendScript frontendScript, FrontendTag tag) { switch (tag) { case ScriptHeaderTag scriptHeaderTag: ProcessScriptHeaderTag(frontendObject, frontendScript, scriptHeaderTag); break; } }
public override FrontendObject Read(FrontendPackage package, ObjectReaderState readerState, BinaryReader reader) { FrontendObject newFrontendObject = FrontendObject; FrontendTagStream tagStream = new FrontendObjectTagStream(reader, readerState.CurrentChunkBlock, readerState.CurrentChunkBlock.Size); while (tagStream.HasTag()) { FrontendTag tag = tagStream.NextTag(newFrontendObject); //Debug.WriteLine("OBJECT TAG {0}", tag); newFrontendObject = ProcessTag(newFrontendObject, tag); } return(newFrontendObject); }
private FrontendObject ProcessTag(FrontendObject frontendObject, FrontendTag tag) { switch (tag) { case ObjectTypeTag objectTypeTag: return(ProcessObjectTypeTag(frontendObject, objectTypeTag)); case StringBufferTextTag stringBufferTextTag when frontendObject is FrontendString frontendString: return(ProcessStringBufferTextTag(frontendString, stringBufferTextTag)); case StringBufferFormattingTag stringBufferFormattingTag when frontendObject is FrontendString frontendString: return(ProcessStringBufferFormattingTag(frontendString, stringBufferFormattingTag)); case StringBufferLeadingTag stringBufferLeadingTag when frontendObject is FrontendString frontendString: return(ProcessStringBufferLeadingTag(frontendString, stringBufferLeadingTag)); case StringBufferLabelHashTag stringBufferLabelHashTag when frontendObject is FrontendString frontendString: return(ProcessStringBufferLabelHashTag(frontendString, stringBufferLabelHashTag)); case StringBufferMaxWidthTag stringBufferMaxWidthTag when frontendObject is FrontendString frontendString: return(ProcessStringBufferMaxWidthTag(frontendString, stringBufferMaxWidthTag)); case ObjectHashTag objectHashTag: frontendObject.NameHash = objectHashTag.Hash; break; case ObjectReferenceTag objectReferenceTag: ProcessObjectReferenceTag(frontendObject, objectReferenceTag); break; case ImageInfoTag imageInfoTag when frontendObject is FrontendImage frontendImage: ProcessImageInfoTag(frontendImage, imageInfoTag); break; case ObjectDataTag objectDataTag: ProcessObjectDataTag(frontendObject, objectDataTag); break; default: //Debug.WriteLine("WARN: Unprocessed tag - {0}", tag.GetType()); break; } return(frontendObject); }
private FrontendObject ProcessTag(FrontendObject frontendObject, FrontendChunkBlock frontendChunkBlock, FrontendTag tag) { switch (tag) { case MessageResponseInfoTag messageResponseInfoTag: ProcessMessageResponseInfoTag(frontendObject, frontendChunkBlock, messageResponseInfoTag); break; case ResponseIdTag responseIdTag: ProcessResponseIdTag(frontendObject, frontendChunkBlock, responseIdTag); break; case ResponseParamTag responseParamTag: ProcessResponseParamTag(frontendObject, frontendChunkBlock, responseParamTag); break; case ResponseTargetTag responseTargetTag: ProcessResponseTargetTag(frontendObject, frontendChunkBlock, responseTargetTag); break; } return(frontendObject); }
public MessageResponseInfoTag(FrontendObject frontendObject) : base(frontendObject) { }
public StringBufferLabelHashTag(FrontendObject frontendObject) : base(frontendObject) { }
public ObjectParentTag(FrontendObject frontendObject) : base(frontendObject) { }
public ObjectTypeTag(FrontendObject frontendObject) : base(frontendObject) { }
public ScriptEventsTag(FrontendObject frontendObject, FrontendScript frontendScript) : base(frontendObject, frontendScript) { }
public ObjectReferenceTag(FrontendObject frontendObject) : base(frontendObject) { }
public ScriptChainTag(FrontendObject frontendObject, FrontendScript frontendScript) : base(frontendObject, frontendScript) { }
public StringBufferFormattingTag(FrontendObject frontendObject) : base(frontendObject) { }
public FrontendImage(FrontendObject original) : base(original) { }
public ResponseParamTag(FrontendObject frontendObject) : base(frontendObject) { }
public FrontendString(FrontendObject original) : base(original) { }
public StringBufferTextTag(FrontendObject frontendObject) : base(frontendObject) { }
public ObjectDataTag(FrontendObject frontendObject) : base(frontendObject) { }
public MultiImageTextureFlagsTag(FrontendObject frontendObject) : base(frontendObject) { }
public MessageResponseCountTag(FrontendObject frontendObject) : base(frontendObject) { }
public FrontendObjectContainerChunk(FrontendObject frontendObject) : base(frontendObject) { }
public StringBufferLeadingTag(FrontendObject frontendObject) : base(frontendObject) { }
public ScriptHeaderTag(FrontendObject frontendObject, FrontendScript frontendScript) : base(frontendObject, frontendScript) { }
private void ProcessScriptHeaderTag(FrontendObject frontendObject, FrontendScript frontendScript, ScriptHeaderTag scriptHeaderTag) { frontendScript.Id = scriptHeaderTag.Id; frontendScript.Flags = scriptHeaderTag.Flags; frontendScript.Length = scriptHeaderTag.Length; }
public ScriptUnknownTag(FrontendObject frontendObject, FrontendScript frontendScript) : base(frontendObject, frontendScript) { }
public ScriptDataChunk(FrontendObject frontendObject) : base(frontendObject) { }
public ScriptKeyTrackTag(FrontendObject frontendObject, FrontendScript frontendScript) : base(frontendObject, frontendScript) { }
public ResponseTargetTag(FrontendObject frontendObject) : base(frontendObject) { }