Inheritance: System.Windows.Forms.Form
示例#1
0
 private void btExport_Click(object sender, EventArgs e)
 {
     var f = new SelectFile();
     f.Filename = "level.png";
     f.ShowDialog();
     if (!f.Result)
         return;
     var fn = f.Filename;
     Bitmap levelImage = makeLevelImage();
     levelImage.Save(fn);
 }
示例#2
0
 private void btExport_Click(object sender, EventArgs e)
 {
     var f = new SelectFile();
     f.Filename = "exportedConfigScript.videoNes.bin";
     f.ShowDialog();
     if (!f.Result)
         return;
     var fn = f.Filename;
     byte videoPageId = (byte)(curActiveVideo + 0x90);
     var data = ConfigScript.getVideoChunk(videoPageId);
     Utils.saveDataToFile(fn, data);
 }
示例#3
0
        private void btExport_Click(object sender, EventArgs e)
        {
            var f = new SelectFile();

            f.Filename = "exportedConfigScript.videoNes.bin";
            f.ShowDialog();
            if (!f.Result)
            {
                return;
            }
            var data = ConfigScript.getVideoChunk(curActiveVideo);

            Utils.saveDataToFile(f.Filename, data);
        }
示例#4
0
        private void btExport_Click(object sender, EventArgs e)
        {
            var f = new SelectFile();

            f.filename = "level.png";
            f.ShowDialog();
            if (!f.result)
            {
                return;
            }
            var    fn         = f.filename;
            Bitmap levelImage = makeLevelImage();

            levelImage.Save(fn);
        }
示例#5
0
 protected void btImport_Click(object sender, EventArgs e)
 {
     var f = new SelectFile();
     f.Filename = "exportedBigBlocks.bin";
     f.ShowDialog();
     if (!f.Result)
         return;
     var fn = f.Filename;
     var data = Utils.loadDataFromFile(fn);
     //duck tales 2 has other format
     bigBlockIndexes = data;
     reloadLevel(false);
     dirty = true;
     updateSaveVisibility();
 }
示例#6
0
        protected virtual void exportBlocks()
        {
            var f = new SelectFile()
            {
                Filename = "exportedBigBlocks.png", ShowExportParams = true
            };

            f.ShowDialog();
            if (!f.Result)
            {
                return;
            }
            var fn = f.Filename;

            //TODO: add export binaries //if (f.getExportType() == ExportType.Binary)
            exportPictures(fn);
        }
示例#7
0
        private void btImport_Click(object sender, EventArgs e)
        {
            var f = new SelectFile();
            f.Filename = "exportedConfigScript.videoNes.bin";
            f.ShowDialog();
            if (!f.Result)
                return;
            var fn = f.Filename;
            var data = Utils.loadDataFromFile(fn);
            if (data == null)
                return;
            byte videoPageId = (byte)(curActiveVideo + 0x90);
            ConfigScript.setVideoChunk(videoPageId, data);

            //dirty = true;
            reloadVideo();
        }
示例#8
0
        private void btImport_Click(object sender, EventArgs e)
        {
            var f = new SelectFile();

            f.Filename = "exportedConfigScript.videoNes.bin";
            f.ShowDialog();
            if (!f.Result)
            {
                return;
            }
            var fn   = f.Filename;
            var data = Utils.loadDataFromFile(fn);

            if (data == null)
            {
                return;
            }
            ConfigScript.setVideoChunk(curActiveVideo, data);

            //dirty = true;
            reloadVideo();
        }
示例#9
0
 protected virtual void exportBlocks()
 {
     //duck tales 2 has other format
     var f = new SelectFile();
     f.Filename = "exportedBigBlocks.bin";
     f.ShowExportParams = true;
     f.ShowDialog();
     if (!f.Result)
         return;
     var fn = f.Filename;
     if (f.getExportType() == ExportType.Binary)
     {
         Utils.saveDataToFile(fn, Utils.linearizeBigBlocks(bigBlockIndexes));
     }
     else
     {
         Bitmap result = new Bitmap((int)(32 * formMain.CurScale * 256),(int)(32 * formMain.CurScale)); //need some hack for duck tales 1
         Image[][] smallBlocksPack = new Image[1][];
         smallBlocksPack[0] = smallBlocks.Images.Cast<Image>().ToArray();
         using (Graphics g = Graphics.FromImage(result))
         {
             for (int i = 0; i < ConfigScript.getBigBlocksCount(); i++)
             {
                 Bitmap b;
                 b = ConfigScript.videoNes.makeBigBlock(i, bigBlockIndexes, smallBlocksPack);
                 g.DrawImage(b, new Point((int)(32 * formMain.CurScale * i), 0));
             }
         }
         result.Save(fn);
     }
 }
示例#10
0
        protected void btExport_Click(object sender, EventArgs e)
        {
            var f = new SelectFile();
            f.Filename = "exportedBlocks.bin";
            //f.ShowExportParams = true;
            f.ShowDialog();
            if (!f.Result)
                return;
            var fn = f.Filename;
            byte blockId = getBigBlockNo();
            int blocksCount = ConfigScript.getBlocksCount();
            var data = new byte[blocksCount * 5];
            for (int i = 0; i < blocksCount; i++)
            {
                data[i] = objects[i].c1;
                data[blocksCount * 1 + i] = objects[i].c2;
                data[blocksCount * 2 + i] = objects[i].c3;
                data[blocksCount * 3 + i] = objects[i].c4;
                data[blocksCount * 4 + i] = objects[i].typeColor;
            }

            Utils.saveDataToFile(fn, data);
        }
示例#11
0
        protected void btImport_Click(object sender, EventArgs e)
        {
            var f = new SelectFile();
            f.Filename = "exportedBlocks.bin";
            f.ShowDialog();
            if (!f.Result)
                return;
            var fn = f.Filename;
            var data = Utils.loadDataFromFile(fn);
            if (data == null)
                return;

            int addr = ConfigScript.getTilesAddr(getBigBlockNo());
            for (int i = 0; i < ConfigScript.getBlocksCount(); i++)
            {
                Globals.romdata[addr + i] = data[i];
                Globals.romdata[addr + 0x100 + i] = data[i + 0x100];
                Globals.romdata[addr + 0x200 + i] = data[i + 0x200];
                Globals.romdata[addr + 0x300 + i] = data[i + 0x300];
                Globals.romdata[addr + 0x400 + i] = data[i + 0x400];
            }
            reloadLevel(false);
            dirty = true;
        }
示例#12
0
 protected virtual void exportBlocks()
 {
     //duck tales 2 has other format
     var f = new SelectFile();
     f.Filename = "exportedBigBlocks.bin";
     f.ShowExportParams = true;
     f.ShowDialog();
     if (!f.Result)
         return;
     var fn = f.Filename;
     if (f.getExportType() == ExportType.Binary)
     {
         Utils.saveDataToFile(fn, bigBlockIndexes);
     }
     else
     {
         Bitmap result = new Bitmap((int)(32 * formMain.CurScale * 256),(int)(32 * formMain.CurScale)); //need some hack for duck tales 1
         using (Graphics g = Graphics.FromImage(result))
         {
             for (int i = 0; i < ConfigScript.getBigBlocksCount(); i++)
             {
                 Bitmap b;
                 /*switch (Globals.gameType)
                 {
                     //todo: write code to export blocks for TinyToon
                     //case GameTyp.TT:
                     //    b = ConfigScript.videoNes.makeBigBlockTT(i, 64, 64, bigBlockIndexes, smallBlocksAll, smallBlocksColorBytes);
                     //    break;
                     case GameTyp._3E:
                         b = ConfigScript.videoNes.makeBigBlock3E(i, 64, 64, bigBlockIndexes, smallBlocks);
                         break;
                     default:
                         b = ConfigScript.videoNes.makeBigBlock(i, 64, 64, bigBlockIndexes, smallBlocks);
                         break;
                 }*/
                 b = ConfigScript.videoNes.makeBigBlock(i, 64, 64, bigBlockIndexes, smallBlocks);
                 g.DrawImage(b, new Point((int)(32 * formMain.CurScale * i), 0));
             }
         }
         result.Save(fn);
     }
 }