private void FormMain_Load(object sender, EventArgs e) { // Extract files if required StartupUtilities.lblStatus = lblStatus; StartupUtilities.CreateMapEditorRegistryKey(); if (!StartupUtilities.ExtractFiles(Application.UserAppDataPath)) { return; } // Load tiles TileManager.lblStatus = lblStatus; TileManager.Load(Application.UserAppDataPath); // Set forms to be MDI and show them fTile = FormTile.GetFormInstance(); fTile.MdiParent = this; fObject = new FormObject { MdiParent = this }; fTile.Show(); fObject.Show(); if (startupMapFile != null) { FormMap mapForm = new FormMap(this); mapForm.attemptToOpenMap(startupMapFile); mapForm.Show(); } }
private void x24ToolStripMenuItem_Click(object sender, EventArgs e) { DialogResult result = DialogResult.Yes; foreach (Form mdiChild in MdiChildren) { if (mdiChild is FormMap) { result = MessageBox.Show("This will cause the map to be rendered again. Proceed?", "Resize Tiles", MessageBoxButtons.YesNo); break; } } if (result == DialogResult.Yes) { x48ToolStripMenuItem.Checked = false; x36ToolStripMenuItem.Checked = false; ImageRenderer.Singleton.ClearTileCache(); ImageRenderer.Singleton.ClearObjectCache(); ImageRenderer.Singleton.sizeModifier = 24; fTile.AdjustSizeModifier(24); fObject.Reload(true); foreach (Form mdiChild in MdiChildren) { if (mdiChild is FormMap) { FormMap map = (FormMap)mdiChild; map.Reload(); } } } }
private void FormMain_MdiChildActivate(object sender, EventArgs e) { if (ActiveMdiChild is FormMap) { FormMap formMap = (FormMap)ActiveMdiChild; //formMap.MinimapWindow.Location = new Point(Width - 280, 20); formMap.MinimapWindow.SetImage(formMap.pnlImage.Image); formMap.MinimapWindow.Visible = formMap.IsMinimapVisible; foreach (Form mdiChild in MdiChildren) { if (mdiChild is FormMinimap && mdiChild != formMap.MinimapWindow) { mdiChild.Visible = false; } } } }