Наследование: System.Windows.Forms.Form
Пример #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            KeyPreview = true;
            if (OpenFile.fileName == "" || OpenFile.configName == "")
            {
                if (!openFile())
                {
                    Close();
                    return;
                }
            }
            else
            {
                if (!Globals.loadData(OpenFile.fileName, OpenFile.dumpName, OpenFile.configName))
                {
                    Close();
                    return;
                }
                setDefaultScale();
                fileLoaded = true;

                resetControls();
            }

            subeditorsDict = new Dictionary <ToolStripButton, Func <Form> > {
                { bttBigBlocks, () => { var f = new BigBlockEdit();  f.setFormMain(this); return(f); } },
                { bttBlocks, makeBlocksEditor },
                { bttEnemies, () => { var f = new EnemyEditor();  f.setFormMain(this); return(f); } },
            };
        }
Пример #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.KeyPreview = true;
            if (OpenFile.FileName == "" || OpenFile.ConfigName == "")
            {
                if (!openFile())
                {
                    Close();
                    return;
                }
            }
            else
            {
                Globals.loadData(OpenFile.FileName, OpenFile.DumpName, OpenFile.ConfigName);
                curScale   = ConfigScript.isBuildScreenFromSmallBlocks() ? 1 : 2;
                fileLoaded = true;

                resetControls();
            }

            subeditorsDict = new Dictionary <ToolStripButton, Func <Form> > {
                { bttBigBlocks, () => { var f = new BigBlockEdit();  f.setFormMain(this); return(f); } },
                { bttBlocks, makeBlocksEditor },
                { bttEnemies, () => { var f = new EnemyEditor();  f.setFormMain(this); return(f); } },
                { bttConfig, () => { var f = new FormConfig();  f.setFormMain(this); f.onApply += reloadCallback; return(f); } },
            };

            ConfigScript.plugins.ForEach((p) => p.addToolButton(this));
            ConfigScript.plugins.ForEach((p) => p.addSubeditorButton(this));
        }
Пример #3
0
 private Form makeBigBlocksEditor()
 {
     BigBlockEdit f = new BigBlockEdit();
     f.setFormMain(this);
     return f;
 }