public MainForm(AtomicBomberman game) { InitializeComponent(); this.game = game; kOne0 = createKeyPad(spKeys0); kTwo0 = createKeyPad(tpKeys0); kTwo1 = createKeyPad(tpKeys1); }
private void endCapture(TextBox keyBox, Keys key) { KeyBindControlState state = (KeyBindControlState)keyBox.Tag; if (!state.capturing) { return; } state.capturing = false; escapeNoClose = false; if (key != Keys.None) { state.key = key; } keyBox.BackColor = SystemColors.Window; KeyBindControls.updateBox(keyBox); // Update box contents }
/** * Creates a keypad layout in the given parent container */ private KeyBindControls createKeyPad(GroupBox parent) { int groupX = 60; int w = 50; KeyBindControls ctrl = new KeyBindControls(); ctrl.up = addKeyBox(parent, groupX - w / 2, 37, w); ctrl.left = addKeyBox(parent, groupX - w - 1, 64, w); ctrl.right = addKeyBox(parent, groupX + 1, 64, w); ctrl.down = addKeyBox(parent, groupX - w / 2, 91, w); addLabel(parent, groupX - 15, 115, "Move"); int actionOfs = 100; addLabel(parent, actionOfs + 5, 40, "Bomb"); ctrl.action1 = addKeyBox(parent, actionOfs + 40, 37, w); addLabel(parent, actionOfs, 94, "Special"); ctrl.action2 = addKeyBox(parent, actionOfs + 40, 91, w); return(ctrl); }