Mercurial > repos > IBBoard.WarFoundry.GUI.GTK
annotate Widgets/UnitDisplayWidget.cs @ 53:28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
* Use proper method for making dialog appear
Re #306: Combine equipment lists in GTK#
* Populate unit equipment lists on unit display widget
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 25 Aug 2010 15:21:56 +0000 |
parents | 4bad8cb3f889 |
children | 7bba99c368c8 |
rev | line source |
---|---|
19
a191d0655f55
Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents:
15
diff
changeset
|
1 // This file (UnitDisplayWidget.cs) is a part of the IBBoard.WarFoundry.GTK project and is copyright 2008, 2009 IBBoard. |
0 | 2 // |
19
a191d0655f55
Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents:
15
diff
changeset
|
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. |
0 | 4 |
5 using System; | |
6 using Gtk; | |
7 using IBBoard.Commands; | |
8 using IBBoard.Lang; | |
9 using IBBoard.WarFoundry.API; | |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
10 using WFObjects = IBBoard.WarFoundry.API.Objects; |
0 | 11 using IBBoard.WarFoundry.API.Commands; |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
12 using IBBoard.WarFoundry.GUI.GTK.UIControl; |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
13 using IBBoard.WarFoundry.API.Objects; |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
14 using IBBoard.WarFoundry.API.Util; |
0 | 15 |
5 | 16 namespace IBBoard.WarFoundry.GTK.Widgets |
0 | 17 { |
5 | 18 [System.ComponentModel.Category("WarFoundry GTK# GUI")] |
19 [System.ComponentModel.ToolboxItem(true)] | |
0 | 20 public partial class UnitDisplayWidget : Gtk.Bin |
21 { | |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
22 private WFObjects.Unit unit; |
0 | 23 private CommandStack stack; |
24 | |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
25 public UnitDisplayWidget(WFObjects.Unit sourceUnit, CommandStack commandStack) |
0 | 26 { |
27 this.Build(); | |
28 stack = commandStack; | |
29 unit = sourceUnit; | |
30 unitName.Text = unit.Name; | |
31 unitSize.Value = unit.Size; | |
48
23238d998535
Re #86: Complete initial GTK# UI
IBBoard <dev@ibboard.co.uk>
parents:
34
diff
changeset
|
32 notesView.Buffer.Text = unit.UnitType.Notes; |
0 | 33 double max = unit.UnitType.MaxSize; |
34 | |
35 if (max == -1) | |
36 { | |
37 max = double.MaxValue; | |
38 } | |
39 | |
40 unitSize.SetRange(unit.UnitType.MinSize, max); | |
41 unit.NameChanged+= new StringValChangedDelegate(UnitNameChanged); | |
42 unit.UnitSizeChanged+= new IntValChangedDelegate(UnitSizeChanged); | |
43 SetStats(); | |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
44 SetWeapons(); |
13 | 45 } |
46 | |
47 private void SetStats() | |
48 { | |
0 | 49 CellRendererText renderer = new CellRendererText(); |
50 unitStats.AppendColumn(Translation.GetTranslation("UnitNameColumn", "Unit Type", null), renderer, new TreeCellDataFunc(RenderUnitName)); | |
51 | |
11
4e5e382fbd2e
Re #10 (Code readability) and Re #86 (Complete GTK# GUI):
IBBoard <dev@ibboard.co.uk>
parents:
5
diff
changeset
|
52 TreeCellDataFunc statFunc = new TreeCellDataFunc(RenderUnitStat); |
13 | 53 Stat[] stats = unit.UnitStatsArray; |
54 | |
55 int length = stats.Length; | |
56 | |
57 for (int i = 0; i < length; i++) | |
0 | 58 { |
34
a35c8be46006
Re #198: Add unit equipment slots
IBBoard <dev@ibboard.co.uk>
parents:
19
diff
changeset
|
59 unitStats.AppendColumn(stats[i].ParentSlotName, renderer, statFunc); |
13 | 60 } |
0 | 61 |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
62 TreeStore model = new TreeStore(typeof(WFObjects.Unit)); |
13 | 63 model.AppendValues(unit); |
64 unitStats.Model = model; | |
0 | 65 } |
66 | |
67 private void RenderUnitName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) | |
68 { | |
69 object o = model.GetValue(iter, 0); | |
70 | |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
71 if (o is WFObjects.Unit) |
0 | 72 { |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
73 WFObjects.Unit u = (WFObjects.Unit)o; |
0 | 74 (cell as CellRendererText).Text = u.UnitType.Name; |
75 } | |
76 } | |
77 | |
78 private void RenderUnitStat(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) | |
79 { | |
80 object o = model.GetValue(iter, 0); | |
81 | |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
82 if (o is WFObjects.Unit) |
0 | 83 { |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
84 WFObjects.Unit u = (WFObjects.Unit)o; |
11
4e5e382fbd2e
Re #10 (Code readability) and Re #86 (Complete GTK# GUI):
IBBoard <dev@ibboard.co.uk>
parents:
5
diff
changeset
|
85 (cell as CellRendererText).Text = u.GetStatValue(column.Title); |
0 | 86 } |
87 } | |
15
85db2c9a1546
Fixes #95: Can't re-open GTK# tabs
IBBoard <dev@ibboard.co.uk>
parents:
13
diff
changeset
|
88 |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
89 private void SetWeapons() |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
90 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
91 CellRendererText renderer = new CellRendererText(); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
92 equipmentList.AppendColumn("", renderer, new TreeCellDataFunc(RenderEquipmentLine)); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
93 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
94 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
95 TreeStore model = new TreeStore(typeof(UnitEquipmentItem)); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
96 model.AppendValues(unit.GetEquipment()); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
97 equipmentList.Model = model; |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
98 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
99 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
100 public void RenderEquipmentLine(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
101 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
102 object o = model.GetValue(iter, 0); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
103 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
104 if (o is UnitEquipmentItem) |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
105 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
106 UnitEquipmentItem item = (UnitEquipmentItem)o; |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
107 (cell as CellRendererText).Text = GetUnitEquipmentText(item); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
108 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
109 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
110 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
111 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
112 private string GetUnitEquipmentText(UnitEquipmentItem item) |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
113 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
114 string translation = ""; |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
115 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
116 if (item.Cost == 0) |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
117 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
118 translation = Translation.GetTranslation("equipmentAmountWithZeroCost", "{0} ({1} - free)", item.Name, GetAmountString(item)); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
119 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
120 else |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
121 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
122 translation = Translation.GetTranslation("equipmentAmountWithCost", "{0} ({1} at {2}pts each)", item.Name, GetAmountString(item), item.Cost); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
123 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
124 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
125 return translation; |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
126 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
127 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
128 private string GetAmountString(UnitEquipmentItem item) |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
129 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
130 double amount = UnitEquipmentUtil.GetEquipmentAmount(unit, item); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
131 string amountString = ""; |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
132 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
133 if (UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, item)) |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
134 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
135 int number = UnitEquipmentUtil.GetEquipmentAmountTaken(unit, item); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
136 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
137 if (amount == 100) |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
138 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
139 amountString = Translation.GetTranslation("equipmentChoiceAmountAll", "all ({1})", amount, number); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
140 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
141 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
142 else |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
143 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
144 amountString = Translation.GetTranslation("equipmentChoiceAmountPercentage", "{0}% ({1})", amount, number); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
145 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
146 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
147 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
148 else |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
149 { |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
150 amountString = Translation.GetTranslation("equipmentChoiceAmountNumber", "{0}", amount); |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
151 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
152 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
153 return amountString; |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
154 } |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
155 |
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
156 public WFObjects.Unit Unit |
15
85db2c9a1546
Fixes #95: Can't re-open GTK# tabs
IBBoard <dev@ibboard.co.uk>
parents:
13
diff
changeset
|
157 { |
85db2c9a1546
Fixes #95: Can't re-open GTK# tabs
IBBoard <dev@ibboard.co.uk>
parents:
13
diff
changeset
|
158 get { return unit; } |
85db2c9a1546
Fixes #95: Can't re-open GTK# tabs
IBBoard <dev@ibboard.co.uk>
parents:
13
diff
changeset
|
159 } |
0 | 160 |
161 private void UnitNameChanged(WarFoundryObject obj, string oldValue, string newValue) | |
162 { | |
163 unitName.Text = newValue; | |
164 } | |
165 | |
166 private void UnitSizeChanged(WarFoundryObject obj, int oldValue, int newValue) | |
167 { | |
168 unitSize.Value = newValue; | |
169 } | |
170 | |
171 protected virtual void OnUnitSizeFocusOut (object o, Gtk.FocusOutEventArgs args) | |
172 { | |
173 SetNewUnitSize(); | |
174 } | |
175 | |
176 [GLib.ConnectBefore ()] | |
177 protected virtual void OnUnitSizeKeyPress (object o, Gtk.KeyPressEventArgs args) | |
178 { | |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
179 if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter) |
0 | 180 { |
181 SetNewUnitSize(); | |
182 } | |
183 } | |
184 | |
185 private void SetNewUnitSize() | |
186 { | |
187 if (unitSize.Value!=unit.Size) | |
188 { | |
189 SetUnitSizeCommand cmd = new SetUnitSizeCommand(unit, (int)Math.Round(unitSize.Value)); | |
190 stack.Execute(cmd); | |
191 } | |
192 } | |
193 | |
194 protected virtual void OnUnitNameFocusOut (object o, Gtk.FocusOutEventArgs args) | |
195 { | |
196 SetNewUnitName(); | |
197 } | |
198 | |
199 [GLib.ConnectBefore ()] | |
200 protected virtual void OnUnitNameKeyPress (object o, Gtk.KeyPressEventArgs args) | |
201 { | |
49 | 202 if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter) |
0 | 203 { |
204 SetNewUnitName(); | |
205 } | |
206 } | |
207 | |
208 private void SetNewUnitName() | |
209 { | |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
210 if (unitName.Text != unit.Name) |
0 | 211 { |
212 SetNameCommand cmd = new SetNameCommand(unit, unitName.Text); | |
213 stack.Execute(cmd); | |
214 } | |
215 } | |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
216 |
52
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
217 private void OnBttnAddEquipmentClicked(object sender, System.EventArgs e) |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
218 { |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
219 AddEquipment(); |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
220 } |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
221 |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
222 private void AddEquipment() |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
223 { |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
224 AddEquipmentUIControl addEquipment = new AddEquipmentUIControl(unit, stack); |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
225 addEquipment.Show(); |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
49
diff
changeset
|
226 } |
0 | 227 } |
228 } |