public static void addTileStruct(int[][] indexes) { var ts = new TileStructure("NewStruct", indexes[0].Length, indexes.Length); for (int i = 0; i < indexes.Length; i++) { for (int j = 0; j < indexes[i].Length; j++) ts[j,i] = indexes[i][j]; } // /*var f = new FormStructuresName(); FormStructuresName.StructName = ts.Name; FormStructuresName.StructWidth = ts.Width; FormStructuresName.StructHeight = ts.Height; f.ShowDialog(); // if (FormStructuresName.Result) { ts.Name = FormStructuresName.StructName; ts.resetDim(FormStructuresName.StructWidth, FormStructuresName.StructHeight); tileStructs.Add(ts); lbStructures.Items.Add(ts.Name); lbStructures_SelectedIndexChanged(lbStructures, new EventArgs()); }*/ tileStructs.Add(ts); }
public static void addTileStruct(int[][] indexes) { var ts = new TileStructure("NewStruct", indexes[0].Length, indexes.Length); for (int i = 0; i < indexes.Length; i++) { for (int j = 0; j < indexes[i].Length; j++) { ts[j, i] = indexes[i][j]; } } // /*var f = new FormStructuresName(); * FormStructuresName.StructName = ts.Name; * FormStructuresName.StructWidth = ts.Width; * FormStructuresName.StructHeight = ts.Height; * f.ShowDialog(); * // * if (FormStructuresName.Result) * { * ts.Name = FormStructuresName.StructName; * ts.resetDim(FormStructuresName.StructWidth, FormStructuresName.StructHeight); * tileStructs.Add(ts); * lbStructures.Items.Add(ts.Name); * lbStructures_SelectedIndexChanged(lbStructures, new EventArgs()); * }*/ tileStructs.Add(ts); }
private void btAddStructure_Click(object sender, EventArgs e) { var ts = new TileStructure("Struct" + tileStructs.Count.ToString(), 4, 4); tileStructs.Add(ts); lbStructures.Items.Add(ts.Name); }
private void lbStructures_SelectedIndexChanged(object sender, EventArgs e) { int index = lbStructures.SelectedIndex; var tss = FormStructures.getTileStructures(); if (index == -1 || index >= tss.Count) { return; } curTileStruct = tss[index]; }
private void FormStructures_Load(object sender, EventArgs e) { blockWidth = ConfigScript.getBlocksPicturesWidth(); blockHeight = 32; curActiveBlock = 0; //curViewType = MapViewType.Tiles; curScale = 2.0f; //showAxis = true; curTileStruct = null; resetControls(true); }
private void FormStructures_Load(object sender, EventArgs e) { blockWidth = ConfigScript.getBlocksPicturesWidth(); blockHeight = 32; curButtonScale = 2; curActiveBlock = 0; //curViewType = MapViewType.Tiles; curScale = 2.0f; //showAxis = true; curTileStruct = null; resetControls(true); }
private void lbStructures_SelectedIndexChanged(object sender, EventArgs e) { int index = lbStructures.SelectedIndex; if (index == -1) { return; } curTileStruct = tileStructs[index]; resetTileStructControls(); mapScreen.Invalidate(); }
private void btRemoveStructure_Click(object sender, EventArgs e) { if (lbStructures.SelectedIndices.Count != 1) { return; } if (MessageBox.Show("Do you really want to delete structure?", "Warning", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } int index = lbStructures.SelectedIndex; curTileStruct = null; resetTileStructControls(); lbStructures.Items.RemoveAt(index); tileStructs.RemoveAt(index); mapScreen.Invalidate(); }
private void lbStructures_SelectedIndexChanged(object sender, EventArgs e) { int index = lbStructures.SelectedIndex; var tss = FormStructures.getTileStructures(); if (index == -1 || index >= tss.Count) return; curTileStruct = tss[index]; }
private void btRemoveStructure_Click(object sender, EventArgs e) { if (lbStructures.SelectedIndices.Count != 1) return; if (MessageBox.Show("Do you really want to delete structure?", "Warning", MessageBoxButtons.YesNo) != DialogResult.Yes) return; int index = lbStructures.SelectedIndex; curTileStruct = null; resetTileStructControls(); lbStructures.Items.RemoveAt(index); tileStructs.RemoveAt(index); mapScreen.Invalidate(); }
private void lbStructures_SelectedIndexChanged(object sender, EventArgs e) { int index = lbStructures.SelectedIndex; if (index == -1) return; curTileStruct = tileStructs[index]; resetTileStructControls(); mapScreen.Invalidate(); }