Пример #1
0
        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;
            }
        }
Пример #2
0
 public override void Read(BinaryReader br, FrontendChunkBlock chunkBlock, Package package,
                           ushort id,
                           ushort length)
 {
     FrontendObject.InitializeData();
     FrontendObject.Data.Read(br);
 }
Пример #3
0
        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);
        }
Пример #4
0
 private void ProcessTag(FrontendObject frontendObject, FrontendScript frontendScript, FrontendTag tag)
 {
     switch (tag)
     {
     case ScriptHeaderTag scriptHeaderTag:
         ProcessScriptHeaderTag(frontendObject, frontendScript, scriptHeaderTag);
         break;
     }
 }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
 public MessageResponseInfoTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #9
0
 public StringBufferLabelHashTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #10
0
 public ObjectParentTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #11
0
 public ObjectTypeTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #12
0
 public ScriptEventsTag(FrontendObject frontendObject, FrontendScript frontendScript) : base(frontendObject, frontendScript)
 {
 }
Пример #13
0
 public ObjectReferenceTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #14
0
 public ScriptChainTag(FrontendObject frontendObject, FrontendScript frontendScript) : base(frontendObject, frontendScript)
 {
 }
Пример #15
0
 public StringBufferFormattingTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #16
0
 public FrontendImage(FrontendObject original) : base(original)
 {
 }
Пример #17
0
 public ResponseParamTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #18
0
 public FrontendString(FrontendObject original) : base(original)
 {
 }
Пример #19
0
 public StringBufferTextTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #20
0
 public ObjectDataTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #21
0
 public MultiImageTextureFlagsTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #22
0
 public MessageResponseCountTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #23
0
 public FrontendObjectContainerChunk(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #24
0
 public StringBufferLeadingTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #25
0
 public ScriptHeaderTag(FrontendObject frontendObject, FrontendScript frontendScript) : base(frontendObject, frontendScript)
 {
 }
Пример #26
0
 private void ProcessScriptHeaderTag(FrontendObject frontendObject, FrontendScript frontendScript, ScriptHeaderTag scriptHeaderTag)
 {
     frontendScript.Id     = scriptHeaderTag.Id;
     frontendScript.Flags  = scriptHeaderTag.Flags;
     frontendScript.Length = scriptHeaderTag.Length;
 }
Пример #27
0
 public ScriptUnknownTag(FrontendObject frontendObject, FrontendScript frontendScript) : base(frontendObject, frontendScript)
 {
 }
Пример #28
0
 public ScriptDataChunk(FrontendObject frontendObject) : base(frontendObject)
 {
 }
Пример #29
0
 public ScriptKeyTrackTag(FrontendObject frontendObject, FrontendScript frontendScript) : base(frontendObject, frontendScript)
 {
 }
Пример #30
0
 public ResponseTargetTag(FrontendObject frontendObject) : base(frontendObject)
 {
 }