public void SetMap(IMap_Base map) { _mapView.Map = map; _mapView.Focus(); OnResize(null); }
public override void SelectedTileChanged(IMap_Base sender, SelectedTileChangedEventArgs e) { MapLocation pt = e.MapPosition; Text = "c: " + pt.Col + " r: " + pt.Row; // I don't think this actually prints anywhere. var hWidth = DrawContentService.HWidth; var hHeight = DrawContentService.HHeight; int xc = (pt.Col - pt.Row) * hWidth; int yc = (pt.Col + pt.Row) * hHeight; _selected.Reset(); _selected.AddLine( xc, yc, xc + hWidth, yc + hHeight); _selected.AddLine( xc + hWidth, yc + hHeight, xc, yc + 2 * hHeight); _selected.AddLine( xc, yc + 2 * hHeight, xc - hWidth, yc + hHeight); _selected.CloseFigure(); ViewDrag(null, null); Refresh(); }
private void TileChange(IMap_Base mapFile, SelectedTileChangedEventArgs e) // MapLocation newCoords) { MapLocation newCoords = e.MapPosition; var dragStart = new Point( newCoords.Col, newCoords.Row); SetDrag(dragStart, DragEnd); MainWindow.Instance.StatusBarPrintPosition(newCoords.Col, newCoords.Row); }
public MapView() { map = null; _dragStart = _dragEnd = new Point(-1, -1); SetStyle( ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); gridColor = Color.FromArgb(175, 69, 100, 129); transBrush = new SolidBrush(gridColor); dashPen = new Pen(Brushes.Black, 1); }
private void SetMap(IMap_Base newMap, IMap_Observer observer) { if (observer.Map != null) { observer.Map.HeightChanged -= observer.HeightChanged; observer.Map.SelectedTileChanged -= observer.SelectedTileChanged; } observer.Map = newMap; if (newMap != null) { newMap.HeightChanged += observer.HeightChanged; newMap.SelectedTileChanged += observer.SelectedTileChanged; } foreach (string key in observer.MoreObservers.Keys) { SetMap(newMap, observer.MoreObservers[key]); } }
public void SetMap(IMap_Base map) { var maps = new IMap_Observer[] { TopRmpView.TopViewControl, TopRmpView.RouteViewControl, TileView.TileViewControl, RmpView.RouteViewControl, TopView.TopViewControl }; foreach (var f in maps) { if (f != null) { SetMap(map, f); } } MapViewPanel.Instance.MapView.Refresh(); }
public void ReviewRouteEntries(IMap_Base map) { var xMap = map as XCMapFile; if (xMap != null) { var entryOutside = new List <RmpEntry>(); foreach (RmpEntry entry in xMap.Rmp) { if (RmpFile.IsOutsideMap( entry, map.MapSize.Cols, map.MapSize.Rows, map.MapSize.Height)) { entryOutside.Add(entry); } } if (entryOutside.Count > 0) { var result = MessageBox.Show( "There are route entries outside the bounds of this Map. Do you want to remove them?", "Incorrect Routes", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { foreach (var rmpEntry in entryOutside) { xMap.Rmp.RemoveEntry(rmpEntry); } xMap.MapChanged = true; } } } }
private void MapHeight(IMap_Base mapFile, HeightChangedEventArgs e) { Refresh(); }
public virtual void SelectedTileChanged(IMap_Base sender, SelectedTileChangedEventArgs e) { Refresh(); }
public virtual void HeightChanged(IMap_Base sender, HeightChangedEventArgs e) { Refresh(); }
public override void HeightChanged(IMap_Base sender, HeightChangedEventArgs e) { ClearSelected(); FillGui(); Refresh(); }
public override void SelectedTileChanged(IMap_Base sender, SelectedTileChangedEventArgs e) { Text = string.Format( "Position\nc:{0} r:{1}", e.MapPosition.Col, e.MapPosition.Row); }
public override void SelectedTileChanged(IMap_Base sender, SelectedTileChangedEventArgs e) { _mapTile = (XCMapTile)e.SelectedTile; _lastLoc = e.MapPosition; Refresh(); }
public override void HeightChanged(IMap_Base sender, HeightChangedEventArgs e) { _lastLoc.Height = e.NewHeight; _mapTile = map[_lastLoc.Row, _lastLoc.Col] as XCMapTile; Refresh(); }