public void MouseMoveTile(MapEventInfo mei) { int _x0 = mei.start.tx; int _y0 = mei.start.ty; int _x1 = mei.current.tx; int _y1 = mei.current.ty; int x0 = Math.Min(_x0, _x1); int x1 = Math.Max(_x0, _x1); int y0 = Math.Min(_y0, _y1); int y1 = Math.Max(_y0, _y1); Map m = new Map(); if (bMultilayer) { m = mei.editedMap.tileCopyRange(x0, y0, x1 - x0 + 1, y1 - y0 + 1); } else { MapLayer ml = mei.editedLayer.copyRange(x0, y0, x1 - x0 + 1, y1 - y0 + 1); ml.parentmap = m; m.AddLayer(ml); } m.IsBrush = true; m.vsp = mei.editedMap.vsp; Global.clipboard = m; mei.bDirty = true; }
public void tweakMap(MapEventInfo mei) { if (Global.clipboard == null) { return; } this.mei = mei; work(mei.current); }
public void MouseClick(MapEventInfo mei) { oldvalue = mei.getTile(mei.start.tx, mei.start.ty); newvalue = mei.tile; if (oldvalue != newvalue) { mei.opManager.beginGroup("Map: FloodFill"); PrimitiveDrawer.FloodFill(mei.start.tx, mei.start.ty, new PrimitiveDrawer.CheckCallback(ccb), new PrimitiveDrawer.Callback(cb), mei); mei.opManager.endGroup(); } }
public void MouseDown(MapEventInfo mei) { lastTile = mei.getTile(mei.current.tx, mei.current.ty); if (mei.lb) { mei.ltile = lastTile; } if (mei.rb) { mei.rtile = lastTile; } }
public void MouseUp(MapEventInfo mei) { if (Global.clipboard == null) { return; } Global.opManager.beginGroup("Map: Clipboard Paste"); this.mei = mei; work(mei.end); Global.opManager.endGroup(); mei.bDirty = true; }
public void MouseMoveTile(MapEventInfo mei) { int tempTile = mei.getTile(mei.current.tx, mei.current.ty); if (tempTile != lastTile) { if (mei.lb) { mei.ltile = tempTile; } if (mei.rb) { mei.rtile = tempTile; } } lastTile = tempTile; }
protected virtual int getValue(MapEventInfo mei) { if (mei.editedLayer.type == LayerType.Tile || mei.editedLayer.type == LayerType.Obs || mei.editedLayer.type == LayerType.Zone) { if (mei.lb) { return(mei.ltile); } if (mei.rb) { return(mei.rtile); } //throw new Exception("wtf"); return(0); } return(0); }
public void paintWindow(MapEventInfo mei, Graphics g) { int _x0 = (mei.start.tx * 16 - mei.xScroll); int _y0 = (mei.start.ty * 16 - mei.yScroll); int _x1 = (mei.current.tx * 16 - mei.xScroll); int _y1 = (mei.current.ty * 16 - mei.yScroll); int x0 = Math.Min(_x0, _x1); int x1 = Math.Max(_x0, _x1); int y0 = Math.Min(_y0, _y1); int y1 = Math.Max(_y0, _y1); x0 *= mei.zoom; x1 *= mei.zoom; y0 *= mei.zoom; y1 *= mei.zoom; System.Drawing.Rectangle r = new System.Drawing.Rectangle(x0, y0, x1 - x0 + mei.zoom * 16, y1 - y0 + mei.zoom * 16); Pen pen = new Pen(Color.White); pen.DashStyle = DashStyle.Dash; pen.Width = 1; g.DrawRectangle(pen, r); }
public void MouseUp(MapEventInfo mei) { }
public void MouseDown(MapEventInfo mei) { Map.Note note = Poll(mei.editedMap, mei.current.px, mei.current.py); if (note != null) { if (mei.lb) { draggedNote = note; dx = draggedNote.x - mei.current.px; dy = draggedNote.y - mei.current.py; modified(mei); } else { mei.editedMap.Notes.Remove(note); modified(mei); } } }
public void paintWindow(MapEventInfo mei, Graphics g) { }
public void MouseDown(MapEventInfo mei) { //mei.opManager.beginGroup("Map: Brush"); sx = Global.MainMapController.hScrollBar.Value; sy = Global.MainMapController.vScrollBar.Value; }
public void MouseUp(MapEventInfo mei) { if (!mei.editedLayer.canDraw) { return; } mei.opManager.endGroup(); //mei.invalidate(); }
public void MouseMoveTile(MapEventInfo mei) { int _x0 = mei.start.tx; int _y0 = mei.start.ty; int _x1 = mei.current.tx; int _y1 = mei.current.ty; int x0 = Math.Min(_x0, _x1); int x1 = Math.Max(_x0, _x1); int y0 = Math.Min(_y0, _y1); int y1 = Math.Max(_y0, _y1); Map m = new Map(); if (bMultilayer) m = mei.editedMap.tileCopyRange(x0, y0, x1 - x0 + 1, y1 - y0 + 1); else { MapLayer ml = mei.editedLayer.copyRange(x0, y0, x1 - x0 + 1, y1 - y0 + 1); ml.parentmap = m; m.AddLayer(ml); } m.IsBrush = true; m.vsp = mei.editedMap.vsp; Global.clipboard = m; mei.bDirty = true; }
public void MouseDown(MapEventInfo mei) { mei.bDirty = true; }
public void MouseUp(MapEventInfo mei) { this.mei = mei; onSet(); mei.opManager.endGroup(); }
public void tweakLayer(MapEventInfo mei) { }
public void paintMap(MapEventInfo mei, pr2.IRenderImage img) { }
public void MouseUp(MapEventInfo mei) { mei.bDirty = true; }
public void tweakLayer(MapEventInfo mei) { this.mei = mei; onTweak(); }
public void paintMap(MapEventInfo mei, pr2.IRenderImage img) { this.mei = mei; this.img = img; onPaint(); }
public void MouseUp(MapEventInfo mei) { //foreach (var n in mei.editedMap.Notes) //{ // int xmin = n.tx * 16 + 1; // int ymin = n.ty * 16 + 1; // int xmax = (xmin + Render.measureText(n.note) / 16) * 16; // int ymax = ymin + 16; // if (mei.current.px >= xmin && mei.current.px < xmax && mei.current.py >= ymin && mei.current.py < ymax) // { // //edit existing note // var ibr = winmaped2.pr2.InputBox.Show("Enter your note", "Note entry", n.note); // if (ibr.ReturnCode == DialogResult.OK) // { // n.note = ibr.Text; // if (n.note == "") // mei.editedMap.Notes.Remove(n); // } // return; // } //} if (draggedNote != null && mei.clicks == 2) { var ibr = winmaped2.pr2.InputBox.Show("Edit your note", "Note entry", draggedNote.note); if (ibr.ReturnCode == DialogResult.OK) { draggedNote.note = ibr.Text; } } if(draggedNote == null && mei.lb) { var ibr = winmaped2.pr2.InputBox.Show("Enter your note", "Note entry", "default"); if (ibr.ReturnCode == DialogResult.OK) { var note = new Map.Note(); note.x = mei.current.px; note.y = mei.current.py; note.note = ibr.Text; mei.editedMap.Notes.Add(note); modified(mei); } } draggedNote = null; }
public void MouseUp(MapEventInfo mei) { if (Global.clipboard == null) return; Global.opManager.beginGroup("Map: Clipboard Paste"); this.mei = mei; work(mei.end); Global.opManager.endGroup(); mei.bDirty = true; }
public void MouseDown(MapEventInfo mei) { mei.opManager.beginGroup("Map: " + name); }
public void MouseMoveTile(MapEventInfo mei) { winmaped2.PrimitiveDrawer.DrawLine(mei.previous.tx, mei.previous.ty, mei.current.tx, mei.current.ty, new PrimitiveDrawer.Callback(cb), mei); //mei.invalidate(); }
public void tweakMap(MapEventInfo mei) { if (Global.clipboard == null) return; this.mei = mei; work(mei.current); }
protected virtual int getValue(MapEventInfo mei) { if (mei.editedLayer.type == LayerType.Tile || mei.editedLayer.type == LayerType.Obs || mei.editedLayer.type == LayerType.Zone) { if (mei.lb) return mei.ltile; if (mei.rb) return mei.rtile; //throw new Exception("wtf"); return 0; } return 0; }
public void MouseMoveTile(MapEventInfo mei) { int tempTile = mei.getTileDropthrough(mei.current.tx, mei.current.ty); if (tempTile != lastTile) { if (mei.lb) { mei.ltile = tempTile; NotifyScroll(0); } if (mei.rb) { mei.rtile = tempTile; NotifyScroll(1); } } lastTile = tempTile; }
public void paintWindow(MapEventInfo mei, Graphics g) { int _x0 = (mei.start.tx * Global.TILE_SIZE - mei.xScroll); int _y0 = (mei.start.ty * Global.TILE_SIZE - mei.yScroll); int _x1 = (mei.current.tx * Global.TILE_SIZE - mei.xScroll); int _y1 = (mei.current.ty * Global.TILE_SIZE - mei.yScroll); int x0 = Math.Min(_x0, _x1); int x1 = Math.Max(_x0, _x1); int y0 = Math.Min(_y0, _y1); int y1 = Math.Max(_y0, _y1); x0 *= mei.zoom; x1 *= mei.zoom; y0 *= mei.zoom; y1 *= mei.zoom; System.Drawing.Rectangle r = new System.Drawing.Rectangle(x0, y0, x1 - x0 + mei.zoom * Global.TILE_SIZE, y1 - y0 + mei.zoom * Global.TILE_SIZE); Pen pen = new Pen(Color.White); pen.DashStyle = DashStyle.Dash; pen.Width = 1; g.DrawRectangle(pen, r); }
public void MouseMoveTile(MapEventInfo mei) { mei.bDirty = true; }
public void MouseDown(MapEventInfo mei) { mei.opManager.beginGroup("Map: Brush"); }
public void MouseMove(MapEventInfo mei) { }
public void MouseDown(MapEventInfo mei) { lastTile = mei.getTileDropthrough(mei.current.tx, mei.current.ty); if (mei.lb) { mei.ltile = lastTile; NotifyScroll(0); } if (mei.rb) { mei.rtile = lastTile; NotifyScroll(1); } }
public void MouseMoveTile(MapEventInfo mei) { int tempTile = mei.getTile(mei.current.tx, mei.current.ty); if (tempTile != lastTile) { if (mei.lb) mei.ltile = tempTile; if (mei.rb) mei.rtile = tempTile; } lastTile = tempTile; }
public void MouseMove(MapEventInfo mei) { int dx = mei.start.mx - mei.current.mx; int dy = mei.start.my - mei.current.my; dx /= Global.MainMapController.ZoomLevel; dy /= Global.MainMapController.ZoomLevel; int target_x = sx + dx; int target_y = sy + dy; if (target_x >= Global.MainMapController.hScrollBar.Maximum) target_x = Global.MainMapController.hScrollBar.Maximum; if (target_x < Global.MainMapController.hScrollBar.Minimum) target_x = Global.MainMapController.hScrollBar.Minimum; if (target_y >= Global.MainMapController.vScrollBar.Maximum) target_y = Global.MainMapController.vScrollBar.Maximum; if (target_y < Global.MainMapController.vScrollBar.Minimum) target_y = Global.MainMapController.vScrollBar.Minimum; Global.MainMapController.hScrollBar.Value = target_x; Global.MainMapController.vScrollBar.Value = target_y; }
protected virtual int getValue(MapEventInfo mei) { return 0; }
public void MouseMove(MapEventInfo mei) { if (draggedNote != null) { draggedNote.x = mei.current.px + dx; draggedNote.y = mei.current.py + dy; } }
//todo void modified(MapEventInfo mei) { //mei.opManager.addExec(new Ops.SetTile(0, mli, x, y, val)); mei.bDirty = true; }
public void MouseDown(MapEventInfo mei) { //mei.editedLayer. PENIS if (!mei.editedLayer.canDraw) { //MessageBox.Show("You're editing a hidden layer..."); } mei.opManager.beginGroup("Map: Brush"); }
public void MouseUp(MapEventInfo mei) { mei.opManager.endGroup(); //mei.invalidate(); }