示例#1
0
 // Import
 private void Import_Architecture()
 {
     byte[] array = new byte[0x80000];
     array = (byte[])Do.Import(array, fullPath);
     ImportPalette(array, 0);
     ImportGraphics(array, 0x200);
     ImportTileset(array, 0, 0x10200);
     ImportTileset(array, 1, 0x11200);
     ImportTileset(array, 2, 0x12200);
     ImportTilemap(array, 0, 0x13200);
     ImportTilemap(array, 1, 0x33200);
     ImportTilemap(array, 2, 0x53200);
     ImportPriority(array, 0x73200);
 }
示例#2
0
        private bool Import()
        {
            bool success = true;

            if (this.element is Areas.Area[])
            {
                this.Enabled = false;
                if (radioButtonCurrent.Checked)
                {
                    success = Areas.Model.ImportArea(currentIndex, fullPath);
                }
                else
                {
                    success = Areas.Model.ImportAreas(fullPath);
                }
            }
            else if (this.element is Battlefields.Battlefield[])
            {
                var battlefields = Battlefields.Model.Battlefields;
                if (radioButtonCurrent.Checked)
                {
                    success = Battlefields.Model.ImportBattlefield(currentIndex, fullPath);
                }
                else
                {
                    success = Battlefields.Model.ImportBattlefields(fullPath);
                }
            }
            else if (this.element is Audio.BRRSample[])
            {
                if (this.Text == "IMPORT SAMPLE BRRs...")
                {
                    if (radioButtonCurrent.Checked)
                    {
                        success = Audio.Model.ImportBRRSample(currentIndex, fullPath);
                    }
                    else
                    {
                        success = Audio.Model.ImportBRRSamples(fullPath);
                    }
                }
                else if (this.Text == "IMPORT SAMPLE WAVs...")
                {
                    if (radioButtonCurrent.Checked)
                    {
                        success = Audio.Model.ImportWAVSample(currentIndex, fullPath);
                    }
                    else
                    {
                        success = Audio.Model.ImportWAVSamples(fullPath);
                    }
                }
            }
            else if (this.element is Audio.SPCTrack[])
            {
                if (radioButtonCurrent.Checked)
                {
                    success = Audio.Model.ImportSPC(currentIndex, fullPath);
                }
                else
                {
                    success = Audio.Model.ImportSPCs(fullPath);
                }
            }
            else
            {
                try
                {
                    Element[] array = element as Element[];
                    string    name  = this.Text.ToLower().Substring(7, this.Text.Length - 7 - 4);
                    if (radioButtonCurrent.Checked)
                    {
                        try
                        {
                            array[currentIndex] = Do.Import(array[currentIndex], fullPath) as Element;
                        }
                        catch
                        {
                            MessageBox.Show("Incorrect data file type.",
                                            "LAZY SHELL", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            return(false);
                        }
                        array[currentIndex].Index = currentIndex;
                    }
                    else
                    {
                        try
                        {
                            Do.Import(array, fullPath + "\\" + name, name.ToUpper(), true);
                        }
                        catch
                        {
                            MessageBox.Show("One or more files incorrect data file type.",
                                            "LAZY SHELL", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            return(false);
                        }
                        for (int i = 0; i < array.Length; i++)
                        {
                            array[i].Index = i;
                        }
                    }
                }
                catch
                {
                    return(false);
                }
            }
            return(success);
        }