Exemple #1
0
        public archivedfile(archivedfile basis)
        {
            form1        = basis.form1;
            spriteEditor = basis.spriteEditor;

            hash      = basis.hash;
            offset    = basis.offset;
            size      = basis.size;
            filebytes = basis.filebytes;
            filemagic = basis.filemagic;
            filename  = basis.filename;

            parentarcfile = basis.parentarcfile;
            parentrdtfile = basis.parentrdtfile;

            treeNode = basis.treeNode;

            should_this_file_be_decompressed__and_compressed_when_read = basis.should_this_file_be_decompressed__and_compressed_when_read;

            has_LZ11_filesize = basis.has_LZ11_filesize;

            was_LZ10_compressed = basis.was_LZ10_compressed;
            was_LZ11_compressed = basis.was_LZ11_compressed;

            STstrings = basis.STstrings;

            textFileStringType = basis.textFileStringType;

            rdtSubfileDataList = basis.rdtSubfileDataList;

            RDTSpriteNumFrames      = basis.RDTSpriteNumFrames;
            RDTSpriteWidth          = basis.RDTSpriteWidth;
            RDTSpriteHeight         = basis.RDTSpriteHeight;
            RDTSpriteBPP            = basis.RDTSpriteBPP;
            RDTSpriteFrameDurations = basis.RDTSpriteFrameDurations;
            RDTSpriteAlphaColour    = basis.RDTSpriteAlphaColour;
        }
Exemple #2
0
        public void OpenRDTSubfileInEditor(bool showEditor)
        {
            if (spriteEditor == null) //if this hasn't been opened in the spriteeditor before, read the file
            {
                if (rdtSubfileDataList.Count == 0)
                {
                    ReadFile();
                }

                spriteEditor        = new SpriteEditor();
                spriteEditor.form1  = form1;
                spriteEditor.sprite = this;
                if (showEditor)
                {
                    spriteEditor.Show();
                }

                spriteEditor.images   = new List <rdtSubfileData>();
                spriteEditor.palettes = new List <rdtSubfileData>();

                //if (RDTSpriteBPP == 3)
                //   {
                //   Console.WriteLine("3BPP? oof. aborting.");
                //   spriteEditor.Close();
                //   return;
                //   }

                foreach (rdtSubfileData file in rdtSubfileDataList) //get all the images and all the palettes
                {
                    if (file.subfileType == 0x04)
                    {
                        if (file.graphicsType == "image")
                        {
                            spriteEditor.images.Add(file);
                        }
                        else if (file.graphicsType == "palette")
                        {
                            spriteEditor.palettes.Add(file);
                        }
                    }
                }

                if (spriteEditor.images.Count == 0)
                {
                    if (showEditor)
                    {
                        spriteEditor.Close();
                    }
                    MessageBox.Show("Image data not found...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                spriteEditor.RequestSpriteEditorImage(spriteEditor.curFrame);

                spriteEditor.ready = false;
                foreach (rdtSubfileData.setting s in rdtSubfileDataList[1].spriteSettings)
                {
                    switch (s.name)
                    {
                    case "isOAMSprite":
                        spriteEditor.OAMSpriteCheckbox.Checked = s.trueOrFalse;
                        break;

                    case "looping":
                        spriteEditor.loopingCheckbox.Checked = s.trueOrFalse;
                        break;

                    case "rotatable":
                        spriteEditor.rotatableCheckbox.Checked = s.trueOrFalse;
                        break;

                    case "center":
                        spriteEditor.centreX.Value = s.X;
                        spriteEditor.centreY.Value = s.Y;
                        break;

                    case "bounds":
                        spriteEditor.boundsX.Value  = s.X;
                        spriteEditor.boundsY.Value  = s.Y;
                        spriteEditor.boundsX2.Value = s.X2;
                        spriteEditor.boundsY2.Value = s.Y2;
                        break;

                    default:
                        Console.WriteLine("unhandled name " + s.name);
                        break;
                    }
                }
                spriteEditor.ready = true;
            }
            else
            {
                if (showEditor)
                {
                    spriteEditor.BringToFront();
                }
            }
        }