Beispiel #1
0
        private void buttonRotateBlocks_Click(object sender, EventArgs e)
        {
            BlocksSource     src    = GetBlocksSource(sender);
            BlocksCollection blocks = GetRightBlocks(src);

            blocks.Rotate(comboBoxRotation.SelectedIndex + 1);
            Status("{0} blocks were rotated by {1}.", src, comboBoxRotation.Text);
            SaveButtonUpdate(src == BlocksSource.Puzzle);
        }
Beispiel #2
0
        private void buttonShiftBlocks_Click(object sender, EventArgs e)
        {
            BlocksSource     src    = GetBlocksSource(sender);
            BlocksCollection blocks = GetRightBlocks(src);
            Vec vec = new Vec((int)numericUpDownXShift.Value, (int)numericUpDownYShift.Value, (int)numericUpDownZShift.Value);

            blocks.Shift(vec);
            Status("{0} blocks were shifted by {1} vector.", src, vec);
            SaveButtonUpdate(src == BlocksSource.Puzzle);
        }
Beispiel #3
0
        private void buttonFlipBlocks_Click(object sender, EventArgs e)
        {
            MessageBox.Show("This feature doesn't really flip the level entirely: while blocks positions will flip, their orientation won't change accordingly.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            BlocksSource     src    = GetBlocksSource(sender);
            BlocksCollection blocks = GetRightBlocks(src);

            blocks.Flip((Axis)comboBoxFlipping.SelectedIndex, BlockInfosManager);
            Status("{0} blocks were flipped along the {1}.", src, comboBoxFlipping.Text);
            SaveButtonUpdate(src == BlocksSource.Puzzle);
        }
Beispiel #4
0
        private void buttonReplaceBlocks_Click(object sender, EventArgs e)
        {
            BlocksSource     src    = GetBlocksSource(sender);
            BlocksCollection blocks = GetRightBlocks(src);
            int    what             = (int)numericUpDownReplaceWhat.Value;
            int    with             = (int)numericUpDownReplaceWith.Value;
            string msg = "There is no block " + with + " in the Block Reference. Do you want to continue with the replacement?";

            if (BlockInfosManager.BlockInfosList.Any(i => !i.Decal && i.Type == with) || MessageBox.Show(msg, "Replace blocks?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                blocks.Replace(what, with);
                Status("{0} blocks {1} were replaced with blocks {2}.", src, what, with);
                SaveButtonUpdate(src == BlocksSource.Puzzle);
            }
        }
Beispiel #5
0
 private BlocksCollection GetRightBlocks(BlocksSource src)
 {
     return(src == BlocksSource.Puzzle ? OpenedLevel.Blocks : ClipboardBlocks);
 }