comparison UIControl/AddEquipmentUIControl.cs @ 68:7028e24b67ec

Re #60: Add UI to add/remove/edit weapons in GTK * Add "Replace" dialog Note: Dialog null refs because of a bad assumption in the base class - base constructor calls SetupUI before Replace constructor has set all of its values
author IBBoard <dev@ibboard.co.uk>
date Wed, 03 Nov 2010 21:02:54 +0000
parents 100626381159
children 4b82515586ac
comparison
equal deleted inserted replaced
67:a7306b5a229e 68:7028e24b67ec
1 // This file (AddEquipmentUIControl.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard 1 // This file (AddEquipmentUIControl.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
2 // 2 //
3 // // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. 3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
4 using System; 4
5 using IBBoard.Commands; 5 using IBBoard.Commands;
6 using IBBoard.WarFoundry.API.Commands;
6 using IBBoard.WarFoundry.API.Objects; 7 using IBBoard.WarFoundry.API.Objects;
7 using IBBoard.WarFoundry.API.Util; 8 using IBBoard.WarFoundry.API.Util;
8 using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces; 9 using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces;
9 using IBBoard.WarFoundry.API.Commands;
10 using CustomMath = IBBoard.CustomMath; 10 using CustomMath = IBBoard.CustomMath;
11 using IBBoard.Lang; 11
12 namespace IBBoard.WarFoundry.GUI.GTK.UIControl 12 namespace IBBoard.WarFoundry.GUI.GTK.UIControl
13 { 13 {
14 public class AddEquipmentUIControl : AbstractBaseEquipmentUIControl<IAddEquipmentUI> 14 public class AddEquipmentUIControl : AbstractBaseEquipmentUIControl<IAddEquipmentUI>
15 { 15 {
16 public AddEquipmentUIControl(Unit unit, CommandStack commandStack) : base(unit, commandStack) 16 public AddEquipmentUIControl(Unit unit, CommandStack commandStack) : base(unit, commandStack)
17 { 17 {
18 //Do nothing extra 18 //Do nothing extra
19 } 19 }
20 20
21 //TODO Make abstract 21 //TODO Make abstract
22 protected override IAddEquipmentUI CreateEquipmentUI() 22 protected override IAddEquipmentUI CreateEquipmentUI()
23 { 23 {
24 return new FrmAddEquipment(); 24 return new FrmAddEquipment();
25 } 25 }
26 26
27 protected override void CompleteUISetup() 27 protected override void CompleteUISetup()
28 { 28 {
29 UnitEquipmentItem[] items = Arrays.Subtract(UnitEquipmentUtil.GetAllowedEquipmentItems(unit), unit.GetEquipment()); 29 UnitEquipmentItem[] items = Arrays.Subtract(UnitEquipmentUtil.GetAllowedEquipmentItems(unit), unit.GetEquipment());
30 ui.SetUnitEquipmentItems(items); 30 ui.SetUnitEquipmentItems(items);
31 ui.UnitEquipmentItemChoiceChanged += HandleUiUnitEquipmentItemChoiceChanged; 31 ui.UnitEquipmentItemChoiceChanged += HandleUiUnitEquipmentItemChoiceChanged;