public BlockDefinition() { FireBallTransitions = new List<BlockTransition>(); IceBallTransitions = new List<BlockTransition>(); PSwitchTransitions = new List<BlockTransition>(); VineTile = 0x85; PSwitchTile = 0xC2; BlockList = new Block[256]; for (int i = 0; i < 256; i++) BlockList[i] = new Block(); }
private void BlsBlocks_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyCode == Keys.C && e.Modifiers == Keys.Control) { copyBlock = BlsBlocks.SelectedBlock; } else if (e.KeyCode == Keys.V && (e.Modifiers & Keys.Control) > Keys.None) { if (copyBlock == null) return; if ((e.Modifiers & Keys.Shift) == Keys.None) { BlvCurrent.SetTile(0, 0, copyBlock[0, 0]); BlvCurrent.SetTile(1, 0, copyBlock[1, 0]); BlvCurrent.SetTile(0, 1, copyBlock[0, 1]); BlvCurrent.SetTile(1, 1, copyBlock[1, 1]); BlockDescription.Text = BlvCurrent.CurrentBlock.Description = copyBlock.Description; } BlvCurrent.CurrentBlock.BlockProperty = copyBlock.BlockProperty; BlsBlocks_SelectionChanged(null, null); } }
private void PatternTableViewer_MouseDown(object sender, MouseEventArgs e) { if (BlockLayout == null || CurrentDefiniton == null) { MessageBox.Show("There is no selected layout to edit. Click add to add a new layout before editing"); return; } if (SelectedBlock != null) { SelectedBlock.DefinitionChanged -= SelectedBlock_DefinitionChanged; } SelectedIndex = e.X / 16 + ((e.Y / 16) * 16); if (BlockLayout.Layout[SelectedIndex] == -1) { Invalidate(); return; } SelectedBlock = CurrentDefiniton[BlockLayout.Layout[SelectedIndex]]; if (SelectionChanged != null) { SelectionChanged(this, new TEventArgs<MouseButtons>(e.Button)); } SelectedBlock.DefinitionChanged += new EventHandler(SelectedBlock_DefinitionChanged); Invalidate(); }