public void SetMap(Map Map) { this.MapData = Map; while (StackPanel.Widgets.Count > 0) { StackPanel.Widgets[0].Dispose(); } foreach (MapConnection c in Map.Connections) { ConnectionWidget w = new ConnectionWidget(StackPanel); w.SetConnection(c); } if (Map.Connections.Count == 0) { NoConnectionsLabel = new MultilineLabel(StackPanel); NoConnectionsLabel.SetWidth(StackPanel.Size.Width); NoConnectionsLabel.SetFont(Font.Get("Fonts/ProductSans-M", 14)); NoConnectionsLabel.SetText("This map does not have any map connections."); NoConnectionsLabel.SetMargin(8, 8); } new Widget(StackPanel).SetHeight(1).SetMargin(0, 4).SetBackgroundColor(17, 27, 38); new NewConnectionWidget(StackPanel, MapData); if (Map.Connections.Count > 0) { ((ConnectionWidget)StackPanel.Widgets[0]).SetSelected(true); } StackPanel.UpdateLayout(); }
public void SetMap(Map Map) { this.MapData = Map; while (StackPanel.Widgets.Count > 0) { StackPanel.Widgets[0].Dispose(); } List <int> Keys = new List <int>(Map.Events.Keys); Keys.Sort(); foreach (int key in Keys) { EventListEntryWidget e = new EventListEntryWidget(StackPanel); e.SetEvent(Map.Events[key]); } if (Map.Events.Count == 0) { MultilineLabel label = new MultilineLabel(StackPanel); label.SetFont(Font.Get("Fonts/ProductSans-M", 14)); label.SetText("This map does not have any events."); label.SetMargin(8, 8); } StackPanel.UpdateLayout(); }