private void btnNewComponent_Click(object sender, EventArgs e) { if (_newComponent.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _editorMode = EDITOR_MODE.COMPONENT; } }
private void mpvMapView_Click(object sender, EventArgs e) { MouseEventArgs args = (MouseEventArgs)e; Vector2 position = mpvMapView.getMouseSnapCoords(); switch (_editorMode) { case EDITOR_MODE.TILE: if (args.Button == System.Windows.Forms.MouseButtons.Left) { mpvMapView.dropTile(txvTextures.currentTile, _loadedMap.getLayer(cmbLayers.SelectedIndex), mapHScroll.Value, mapVScroll.Value); } else if (args.Button == System.Windows.Forms.MouseButtons.Right) { mpvMapView.removeTile(_loadedMap.getLayer(cmbLayers.SelectedIndex), position, mapHScroll.Value, mapVScroll.Value); } break; case EDITOR_MODE.COMPONENT: string actorName = ""; string[] parameters = null; _newComponent = new FrmNewComponent(this); if (_newComponent.ShowDialog() == System.Windows.Forms.DialogResult.OK) { actorName = _newComponent.actorName; parameters = _newComponent.parameters; try { position.X += mapHScroll.Value; position.Y += mapVScroll.Value; mpvMapView.dropActor(_actorFullyQualifiedNames[cmbActorList.Text], actorName, position, cmbLayers.SelectedIndex, parameters); } catch (KotException.KotBadArgumentException ex) { MessageBox.Show("Invalid parameter used for actor."); } } break; case EDITOR_MODE.HITBOX: dropHitbox(position, args); break; } }