comparison Widgets/UnitDisplayWidget.cs @ 65:77448375d2f9

Re #60: Add UI to add/remove/edit weapons in GTK * Add titles and make dialogs not appear on task list * Capture ratio amounts in Control object's local variable, otherwise we get 0s * Set initial values when editing equipment * Only enable the Edit button when we can edit
author IBBoard <dev@ibboard.co.uk>
date Sat, 04 Sep 2010 10:25:39 +0000
parents e3fe48c4d794
children 7028e24b67ec
comparison
equal deleted inserted replaced
64:e3fe48c4d794 65:77448375d2f9
52 } 52 }
53 private void SetButtonsEnabledState() 53 private void SetButtonsEnabledState()
54 { 54 {
55 UnitEquipmentItem equipItem = GetSelectedEquipmentItem(); 55 UnitEquipmentItem equipItem = GetSelectedEquipmentItem();
56 bttnReplaceEquipment.Sensitive = (equipItem != null && equipItem.HasAlternatives()); 56 bttnReplaceEquipment.Sensitive = (equipItem != null && equipItem.HasAlternatives());
57 bttnEditEquipment.Sensitive = (equipItem != null); 57 bttnEditEquipment.Sensitive = (UnitEquipmentUtil.CanEditEquipmentAmount(unit, equipItem));
58 bttnRemoveEquipment.Sensitive = (equipItem != null && !equipItem.IsRequired); 58 bttnRemoveEquipment.Sensitive = (equipItem != null && !equipItem.IsRequired);
59 } 59 }
60 private UnitEquipmentItem GetSelectedEquipmentItem() 60 private UnitEquipmentItem GetSelectedEquipmentItem()
61 { 61 {
62 return (UnitEquipmentItem)TreeUtils.GetSelectedItem(equipmentList); 62 return (UnitEquipmentItem)TreeUtils.GetSelectedItem(equipmentList);