Example #1
0
 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);
 }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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];
        }
Example #5
0
 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);
 }
Example #6
0
 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);
 }
Example #7
0
        private void lbStructures_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = lbStructures.SelectedIndex;

            if (index == -1)
            {
                return;
            }
            curTileStruct = tileStructs[index];

            resetTileStructControls();
            mapScreen.Invalidate();
        }
Example #8
0
        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();
        }
Example #9
0
 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];
 }
Example #10
0
 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();
 }
Example #11
0
 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);
 }
Example #12
0
        private void lbStructures_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = lbStructures.SelectedIndex;
            if (index == -1)
                return;
            curTileStruct = tileStructs[index];

            resetTileStructControls();
            mapScreen.Invalidate();
        }