//- Constructor public MapMode() { GuiBorder = new Border { BorderBrush = ColorHandler.ColorFromHex("FFCBA112"), BorderThickness = new System.Windows.Thickness(2), CornerRadius = new System.Windows.CornerRadius(25), Width = 30, Height = 30, Background = ColorHandler.ColorFromHex("FF4C518B"), Margin = new System.Windows.Thickness(0, 0, 4, 0) }; Button btn = new Button { Background = null, BorderBrush = null, Foreground = null }; btn.Click += Click; GuiBorder.Child = btn; Image img = new Image { Source = Icon, Margin = new System.Windows.Thickness(-3) }; btn.Content = img; }
protected Label NormalText() { Label lbl = new Label(); //<Label Padding="0" Content="in der Armee von" Foreground="#E5F1B660" //FontFamily ="Bell MT" Margin="5,4,5,0" FontSize="16" /> lbl.Padding = new System.Windows.Thickness(0); lbl.Foreground = ColorHandler.ColorFromHex("E5F1B660"); lbl.FontFamily = new System.Windows.Media.FontFamily("Bell MT"); lbl.Margin = new System.Windows.Thickness(5, 4, 5, 0); lbl.FontSize = 16; return(lbl); }
protected Label WhiteText() { Label lbl = new Label(); // <Label Content="Country-Army-Name" Padding="0" Foreground="#E5FFFFFF" //FontFamily ="Bodoni MT" Margin="2,4,0,0" FontWeight="Bold" FontSize="16" /> lbl.Padding = new System.Windows.Thickness(0); lbl.Foreground = ColorHandler.ColorFromHex("E5FFFFFF"); lbl.FontFamily = new System.Windows.Media.FontFamily("Bodoni MT"); lbl.Margin = new System.Windows.Thickness(2, 4, 0, 0); lbl.FontWeight = FontWeights.Bold; lbl.FontSize = 16; return(lbl); }
protected Label HighliteText() { Label lbl = new Label(); //<Label Content="Rank-Name" Padding="0" Foreground="#E5C5B091" //FontFamily ="Bell MT" Margin="0,4,0,0" FontWeight="Bold" //FontStyle ="Italic" FontSize="16" /> lbl.Padding = new System.Windows.Thickness(0); lbl.Foreground = ColorHandler.ColorFromHex("E5C5B091"); lbl.FontFamily = new System.Windows.Media.FontFamily("Bell MT"); lbl.Margin = new System.Windows.Thickness(0, 4, 0, 0); lbl.FontWeight = FontWeights.Bold; lbl.FontStyle = FontStyles.Italic; lbl.FontSize = 16; return(lbl); }
private Border GetActionButton(string name, string color, BitmapImage icon, RoutedEventHandler handler) { Border border = (Border)SubWindow.CopyFrom(border_action_vorlage); border.Background = ColorHandler.ColorFromHex(color); Button btn = (Button)border.Child; btn.Click += handler; btn.Click += Update; StackPanel panel = (StackPanel)btn.Content; Image img = (Image)panel.Children[0]; img.Source = icon; Label lbl = (Label)panel.Children[1]; lbl.Content = name; return(border); }
protected virtual void LoadGrid() { Border = new Border { Background = Brushes.DarkGray, BorderThickness = new Thickness(3), BorderBrush = Brushes.Black, CornerRadius = new CornerRadius(6, 6, 3, 3) }; Children.Add(Border); FullGrid = new Grid(); Border.Child = FullGrid; TopGrid = new Grid { Background = ColorHandler.ColorFromHex("#7F000000"), VerticalAlignment = VerticalAlignment.Top, Height = 35, Margin = new Thickness(0, 15, 0, 0) }; FullGrid.Children.Add(TopGrid); WindowIcon = new Image { Margin = new Thickness(10, 0, 0, 0), HorizontalAlignment = HorizontalAlignment.Left }; TopGrid.Children.Add(WindowIcon); WindowName = new Label { Padding = new Thickness(0), VerticalContentAlignment = VerticalAlignment.Center, HorizontalContentAlignment = HorizontalAlignment.Center, FontWeight = FontWeights.Bold, FontSize = 18, Margin = new Thickness(0), Foreground = Brushes.White, HorizontalAlignment = HorizontalAlignment.Center, FontFamily = new FontFamily("Arial") }; TopGrid.Children.Add(WindowName); Button btn_exit = new Button { HorizontalAlignment = HorizontalAlignment.Right, Background = null, BorderBrush = null, Padding = new Thickness(0), HorizontalContentAlignment = HorizontalAlignment.Stretch, VerticalContentAlignment = VerticalAlignment.Stretch, Width = 35, Height = 35, Margin = new Thickness(0, 0, 10, 0) }; btn_exit.Click += Exit; TopGrid.Children.Add(btn_exit); Border btn_border = new Border { BorderBrush = Brushes.Black, Background = ColorHandler.ColorFromHex("#FF666666"), BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(15) }; btn_exit.Content = btn_border; Label lbl_border = new Label { Content = "X", Padding = new Thickness(0), VerticalContentAlignment = VerticalAlignment.Center, HorizontalContentAlignment = HorizontalAlignment.Center, FontWeight = FontWeights.Bold, FontSize = 18 }; btn_border.Child = lbl_border; //- Additional Load SetIcon(Images.IconQuestionmark); DragHandler.MakeDragable(this); }
private void LoadTiles() { panel_tiles.Children.Clear(); //btn_tile_vorlage_controller.Click += Click; foreach (Tile tile in Province.Tiles) { lbl_tile_vorlage_name.Content = "Umliegende Lanschaft von " + tile.Name; lbl_tile_vorlage_citizen_count.Content = tile.CitizenAmount; lbl_tile_vorlage_city_name.Content = tile.Name; lbl_tile_vorlage_tile_type.Content = "Landschaft"; if (tile is City) { lbl_tile_vorlage_tile_type.Content = "Stadt"; } img_tile_vorlage_icon.Source = tile.Icon; img_tile_vorlage_money_icon.Source = Images.IconMoney; panel_tile_vorlage_buildings.Children.Clear(); img_tile_vorlage_controller.Source = Images.FlagREB; //- OpenCountry //btn_tile_vorlage_controller.Tag = tile.CountryController; if (grid_title_vorlage.Children.Contains(panel_title_vorlage_government_info)) { grid_title_vorlage.Children.Remove(panel_title_vorlage_government_info); } if (tile is City city) { if (city.Government != null) { lbl_title_vorlage_person.Content = city.Government.Cancelor.Name; } else { lbl_title_vorlage_person.Content = "-"; } grid_title_vorlage.Children.Add(panel_title_vorlage_government_info); } if (tile.Controller is Country country) { img_tile_vorlage_controller.Source = country.Flag; } foreach (UniqueBuilding building in tile.UniqueBuildings) { if (building == null) { continue; } Border building_border = new Border(); building_border.Background = ColorHandler.ColorFromHex("7FACACAC"); building_border.BorderBrush = ColorHandler.ColorFromHex("FF4E555F"); building_border.BorderThickness = new Thickness(1); building_border.CornerRadius = new CornerRadius(5); building_border.Padding = new Thickness(2); building_border.HorizontalAlignment = HorizontalAlignment.Center; building_border.Margin = new Thickness(5, 0, 0, 0); building_border.Width = 22; Button btn_building = new Button(); btn_building.BorderBrush = null; btn_building.Margin = new Thickness(0); btn_building.Background = null; building_border.Child = btn_building; Image icon = new Image(); icon.Margin = new Thickness(-3); btn_building.Content = icon; icon.Source = Images.IconQuestionmark; if (building.Image != null) { icon.Source = building.Image; } panel_tile_vorlage_buildings.Children.Add(building_border); } Border outer_border = (Border)SubWindow.CopyFrom(border_tile_vorlage); Button btn = (Button)((Border)((StackPanel)((StackPanel)outer_border.Child).Children[0]).Children[((StackPanel)((StackPanel)outer_border.Child).Children[0]).Children.Count - 1]).Child; btn.Tag = tile.CountryController; btn.Click += Click; panel_tiles.Children.Add(outer_border); } }