comparison FrmUnit.cs @ 145:51463bc1fb21

Fixes #265: Add language preference UI * Make unit equipment lines refresh when language changes
author IBBoard <dev@ibboard.co.uk>
date Sun, 18 Apr 2010 14:22:10 +0000
parents 28105d9c2b25
children 0e3837170637
comparison
equal deleted inserted replaced
144:4023a9bdcb8b 145:51463bc1fb21
79 private void TranslateForm() 79 private void TranslateForm()
80 { 80 {
81 ControlTranslator.TranslateControl(this); 81 ControlTranslator.TranslateControl(this);
82 tbUnitName.Text = unit.Name; 82 tbUnitName.Text = unit.Name;
83 Text = Translation.GetTranslation("FrmUnit", "{0}", unit.Name); 83 Text = Translation.GetTranslation("FrmUnit", "{0}", unit.Name);
84 RefreshUnitEquipment();
84 } 85 }
85 86
86 void unit_PointsValueChanged(WarFoundryObject obj, double oldValue, double newValue) 87 void unit_PointsValueChanged(WarFoundryObject obj, double oldValue, double newValue)
87 { 88 {
88 SetPointsValueText(); 89 SetPointsValueText();
465 { 466 {
466 if (obj is Unit && obj.Equals(unit)) 467 if (obj is Unit && obj.Equals(unit))
467 { 468 {
468 unitSize.Value = newValue; 469 unitSize.Value = newValue;
469 470
470 foreach (UnitEquipmentChoice choice in equipmentChoices.Values) 471 RefreshUnitEquipment();
471 { 472 }
472 SetEquipmentListValue(choice); 473 }
473 } 474
475 private void RefreshUnitEquipment()
476 {
477 foreach (UnitEquipmentChoice choice in equipmentChoices.Values)
478 {
479 SetEquipmentListValue(choice);
474 } 480 }
475 } 481 }
476 482
477 private void equipmentList_SelectedIndexChanged(object sender, System.EventArgs e) 483 private void equipmentList_SelectedIndexChanged(object sender, System.EventArgs e)
478 { 484 {