Ejemplo n.º 1
0
        private void lbJobList_DoubleClick(object sender, EventArgs e)
        {
            // Open up our dialog for editing equippables using the index from the job list
            if (lbJobList.SelectedIndex > -1)
            {
                EquippableEditor equippableEditor = new EquippableEditor(availableEquipment.equippables[lbJobList.SelectedIndex]);
                equippableEditor.ShowDialog();

                if (equippableEditor.DialogResult == DialogResult.OK)
                {
                    availableEquipment.equippables[lbJobList.SelectedIndex] = equippableEditor.editEquippable;
                    updateLists();
                }
            }
        }
Ejemplo n.º 2
0
        private void btnAddJob_Click(object sender, EventArgs e)
        {
            Equippable toAdd = new Equippable("job" + availableEquipment.equippables.Count);

            toAdd.type = Equippable.EquipmentType.Job;

            EquippableEditor equippableEditor = new EquippableEditor(toAdd);

            equippableEditor.ShowDialog();

            if (equippableEditor.DialogResult == DialogResult.OK)
            {
                availableEquipment.equippables.Add(equippableEditor.editEquippable);
                updateLists();
            }
        }