comparison FrmReplaceUnitEquipment.cs @ 34:3ceb0efd261f

Re #118: Allow equipment amounts of "ratio" equipment to be define as absolute or ratio amounts * Use new commands created in previous revision Re #122: Make usage of percentage or ratio common * Make sure all usage of percentages are correct Re #117: Add percentage and number boxes to equipment item dialogs * Fix some enable/disable inconsistencies for percentage amounts * Fix problems where fixed limits weren't honoured by widgets
author IBBoard <dev@ibboard.co.uk>
date Thu, 13 Aug 2009 21:16:21 +0000
parents 7c366fe55635
children 6ab7ddc038f9
comparison
equal deleted inserted replaced
33:67c283ea77a7 34:3ceb0efd261f
192 { 192 {
193 UnitEquipmentItem equipItem = (UnitEquipmentItem)listItems.SelectedItem; 193 UnitEquipmentItem equipItem = (UnitEquipmentItem)listItems.SelectedItem;
194 194
195 if (cbEquipAll.Checked) 195 if (cbEquipAll.Checked)
196 { 196 {
197 commandStack.Execute(new ReplaceUnitEquipmentCommand(unit, oldItem, equipItem, WarFoundryCore.INFINITY)); 197 commandStack.Execute(new ReplaceUnitEquipmentWithNumericAmountItemCommand(unit, oldItem, equipItem, WarFoundryCore.INFINITY));
198 } 198 }
199 else 199 else
200 { 200 {
201 if (equipItem.IsRatioLimit) 201 if (equipItem.IsRatioLimit)
202 { 202 {
203 commandStack.Execute(new ReplaceUnitEquipmentCommand(unit, oldItem, equipItem, (double)numEquipAmount.Value / 100.0)); 203 commandStack.Execute(new ReplaceUnitEquipmentWithRatioAmountItemCommand(unit, oldItem, equipItem, (double)numEquipAmount.Value));
204 } 204 }
205 else 205 else
206 { 206 {
207 commandStack.Execute(new ReplaceUnitEquipmentCommand(unit, oldItem, equipItem, (double)numEquipAmount.Value)); 207 commandStack.Execute(new ReplaceUnitEquipmentWithNumericAmountItemCommand(unit, oldItem, equipItem, (int)numEquipAmount.Value));
208 } 208 }
209 } 209 }
210 } 210 }
211 211
212 private void bttnCancel_Click(object sender, System.EventArgs e) 212 private void bttnCancel_Click(object sender, System.EventArgs e)