void HandleStartAddMapRegion(object Sender, EventArgs E) { if (_NewRegionPane != null) { _EditScreen.PaneLayer.Remove(_NewRegionPane); } _NewRegionPane = new TextPane("New Region", "Region Name", "Create"); _NewRegionPane.OnValueEntered += HandleAddMapRegion; _EditScreen.PaneLayer.Add(_NewRegionPane); }
void HandleAddMapRegion(object Sender, ValuedEventArgs <string> E) { var m = new MapRegion { Name = E.Value }; m.OnChange += HandleRegionChanged; _EditScreen.MapView.Map.Regions.Add(m); _EditScreen.MapView.MapRegions.Add(new MapRegionView(m, _EditScreen.MapView.TileRenderer)); _EditPane.UpdateFromMap(_EditScreen.MapView.Map); UnHighlight(); _EditScreen.PaneLayer.Remove(_NewRegionPane); _NewRegionPane = null; }
void HandleRemoteConnectionSetup(object Sender, EventArgs E) { _ConnectionPane = new TextPane("Remote Connection", "IP Address", "Connect"); _ConnectionPane.OnValueEntered += HandleRemoteConnect; _LandingScreen.PaneLayer.Add(_ConnectionPane); }