Inheritance: System.Windows.Forms.Form
コード例 #1
0
ファイル: EditLayout.cs プロジェクト: ghostdogtm/CadEditor
 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
ファイル: EditVideo.cs プロジェクト: ProtonNoir/CadEditor
 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
ファイル: EditVideo.cs プロジェクト: kraekin/CadEditor
        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
ファイル: BigBlockEdit.cs プロジェクト: ProtonNoir/CadEditor
 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
ファイル: EditVideo.cs プロジェクト: ProtonNoir/CadEditor
        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
ファイル: EditVideo.cs プロジェクト: kraekin/CadEditor
        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
ファイル: BigBlockEdit.cs プロジェクト: ghostdogtm/CadEditor
 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
ファイル: BlockEdit.cs プロジェクト: spiiin/CadEditor
        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
ファイル: BlockEdit.cs プロジェクト: spiiin/CadEditor
        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
ファイル: BigBlockEdit.cs プロジェクト: ProtonNoir/CadEditor
 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);
     }
 }