/// <summary> /// Constructor /// </summary> /// <param name="tile">name of tile to edit</param> public TileEditor(string tile) { tileName = tile; InitializeComponent(); bool? currentType = TileData.GetType(tile); int index = 0; foreach (string s in types) { typeComboBox.Items.Add(s); if (typeValues[index++] == currentType) typeComboBox.SelectedIndex = index - 1; } TileManager sprite = new TileManager(this); sprite.Draw(tile, 0, 0); }
/// <summary> /// Constructor /// </summary> /// <param name="s">message text</param> public PositionSelection(string s) { InitializeComponent(); messageLabel.Content = s; x = 0; y = 0; TileManager tiles = new TileManager(this); foreach (string tile in MainWindow.map) { tiles.Draw(tile, 0, 0); y++; if (y == MainWindow.height) { y = 0; x++; } } x = -1; y = -1; }
/// <summary> /// Constructor /// </summary> /// <param name="currentTile">currently selected tile</param> public TileSelection(string currentTile) { InitializeComponent(); cursor = ControlManager.CreateCanvas(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\TowerHaven\\Marker", 8, 4, 8); grid1.Children.Add(cursor); string[] tiles = TileData.GetTileNames(); int index = 0; TileManager sprite = new TileManager(this); // Add tile labels foreach (string s in tiles) { if (s.Equals(currentTile)) cursor.Margin = new Thickness(8, 4 + 16 * index, 0, 0); sprite.Draw(s, -6, index); Label label = ControlManager.CreateLabel(s, 50, 16 * index - 5); label.MouseLeftButtonDown += TileName_Clicked; grid1.Children.Add(label); index++; } }