private void tbMapName_TextChanged(object sender, EventArgs e) { KeyMap map = (KeyMap)cmbKeyMapList.Items[cmbKeyMapList.SelectedIndex]; map.Name = tbMapName.Text; cmbKeyMapList.Items[cmbKeyMapList.SelectedIndex] = map; }
private void cmbKeyMapList_SelectedValueChanged(object sender, EventArgs e) { UpdateButtons(); KeyMap km = (KeyMap)cmbKeyMapList.SelectedItem; tbMapName.Text = km.Name; btnDel.Enabled = !km.IsPermanent; }
private void AddKeyList() { if (MapList.Count >= 7) { return; } KeyMap map = new KeyMap("New Map", false, controller.addNewMap()); MapList.Add(map); cmbKeyMapList.Items.Add(map); cmbKeyMapList.SelectedIndex = cmbKeyMapList.Items.Count - 1; }
private void UpdateButtons() { KeyMap maps = (KeyMap)cmbKeyMapList.SelectedItem; foreach (KeyValuePair <ushort, IKeyProcess> map in maps.Map) { if (!buttons.ContainsKey(map.Key)) { continue; } buttons[map.Key].Text = map.Value.Name; buttons[map.Key].BackColor = map.Value.InterfaceColor; } }