Mercurial > repos > IBBoard.WarFoundry.GUI.GTK
annotate FrmAddEquipment.cs @ 118:070b5762bb47
update tags
author | convert-repo |
---|---|
date | Sun, 14 Aug 2011 01:22:12 +0000 |
parents | 6d2c8ad0d8f1 |
children |
rev | line source |
---|---|
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 // This file (FrmAddEquipment.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 // |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
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. |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
4 |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using System; |
76
7055b24cfc79
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
70
diff
changeset
|
6 using Gtk; |
7055b24cfc79
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
70
diff
changeset
|
7 using IBBoard.GtkSharp; |
7055b24cfc79
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
70
diff
changeset
|
8 using IBBoard.GtkSharp.Translatable; |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 using IBBoard.WarFoundry.API.Objects; |
76
7055b24cfc79
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
70
diff
changeset
|
10 using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces; |
52
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
11 using IBBoard.WarFoundry.GUI.GTK.Util; |
55
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
12 using log4net; |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
13 using IBBoard.Lang; |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
14 |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 namespace IBBoard.WarFoundry.GUI.GTK |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 { |
76
7055b24cfc79
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
70
diff
changeset
|
17 public partial class FrmAddEquipment : TranslatableDialog, IAddEquipmentUI |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 { |
55
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
19 private static ILog log = LogManager.GetLogger(typeof(FrmAddEquipment)); |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
20 |
54
f9f6e9db5350
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
53
diff
changeset
|
21 public event SingleArgMethodInvoker<UnitEquipmentItem> UnitEquipmentItemChoiceChanged; |
76
7055b24cfc79
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
70
diff
changeset
|
22 public event MethodInvoker UnitEquipmentAmountTypeChanged; |
7055b24cfc79
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
70
diff
changeset
|
23 public event MethodInvoker UnitEquipmentAmountChanged; |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
24 |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
25 private bool isRatioLimited; |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
26 |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 public FrmAddEquipment() |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 { |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 this.Build(); |
54
f9f6e9db5350
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
53
diff
changeset
|
30 lstEquipment.Selection.Changed += OnSelectionChanged; |
52
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
31 TreeViewColumn equipColumn = new TreeViewColumn(); |
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
32 CellRendererText equipCell = new CellRendererText(); |
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
33 equipColumn.PackStart(equipCell, true); |
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
34 equipColumn.SetCellDataFunc(equipCell, GtkWarFoundryUtil.RenderWarFoundryObjectName); |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
35 lstEquipment.AppendColumn(equipColumn); |
96
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
36 Translation.TranslationChanged += Retranslate; |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
37 Translate(); |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
38 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
39 |
96
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
40 private void Retranslate() |
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
41 { |
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
42 Translate(); |
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
43 } |
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
44 |
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
45 public override void Dispose() |
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
46 { |
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
47 Translation.TranslationChanged -= Retranslate; |
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
48 base.Dispose(); |
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
49 } |
b4416ca69153
Fixes #309: Add initial preference dialog with language support
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
50 |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
51 protected override void Translate() |
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
52 { |
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
53 base.Translate(); |
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
54 lstEquipment.Columns[0].Title = Translation.GetTranslation("frmAddEquipmentColumnTitle", "equipment"); |
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
55 } |
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
56 |
61
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
57 private void OnUnitEquipmentAmountChanged() |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
58 { |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
59 if (UnitEquipmentAmountChanged != null) |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
60 { |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
61 UnitEquipmentAmountChanged(); |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
62 } |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
63 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
64 |
61
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
65 private void OnUnitEquipmentAmountTypeChanged() |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
66 { |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
67 if (UnitEquipmentAmountChanged != null) |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
68 { |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
69 UnitEquipmentAmountTypeChanged(); |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
70 } |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
71 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
72 |
61
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
73 protected void OnSelectionChanged(object o, EventArgs e) |
54
f9f6e9db5350
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
53
diff
changeset
|
74 { |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
75 if (UnitEquipmentItemChoiceChanged != null) |
54
f9f6e9db5350
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
53
diff
changeset
|
76 { |
57
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
77 UnitEquipmentItemChoiceChanged(SelectedUnitEquipmentItem); |
54
f9f6e9db5350
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
53
diff
changeset
|
78 } |
f9f6e9db5350
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
53
diff
changeset
|
79 } |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
80 |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
81 public void SetUnitEquipmentItems(UnitEquipmentItem[] items) |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
82 { |
52
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
83 ListStore store = new ListStore(typeof(UnitEquipmentItem)); |
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
84 |
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
85 foreach (UnitEquipmentItem equipItem in items) |
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
86 { |
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
87 store.AppendValues(equipItem); |
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
88 } |
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
89 |
4bad8cb3f889
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
51
diff
changeset
|
90 lstEquipment.Model = store; |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
91 } |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
92 |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
93 public void SetUnitEquipmentLimits(bool isRatioLimit, double minPercent, double maxPercent, int minNumber, int maxNumber) |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
94 { |
55
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
95 log.DebugFormat("IsRatio? {0}. Limits: {1}->{2}, {3}%->{4}%", isRatioLimit, minNumber, maxNumber, minPercent, maxPercent); |
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
96 numericAmount.SetRange(minNumber, maxNumber); |
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
97 percentageAmount.SetRange(minPercent, maxPercent); |
61
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
98 |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
99 if (isRatioLimit) |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
100 { |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
101 if (minPercent == 100) |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
102 { |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
103 rbEquipAll.Active = true; |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
104 } |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
105 else |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
106 { |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
107 rbEquipPercent.Active = true; |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
108 } |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
109 } |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
110 else |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
111 { |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
112 rbEquipNumeric.Active = true; |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
113 } |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
114 |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
115 isRatioLimited = isRatioLimit; |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
116 } |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
117 |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
118 public void SetUnitEquipmentLimitsEnabled(bool isEnabled) |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
119 { |
63
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
120 SetNumericAmountEnabledState(isEnabled); |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
121 SetPercentageAmountEnabledState(isEnabled); |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
122 } |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
123 |
54
f9f6e9db5350
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
53
diff
changeset
|
124 public bool ShowControl() |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
125 { |
55
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
126 int result = Run(); |
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
127 bool okayClicked = (result == (int)ResponseType.Ok); |
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
128 this.Hide(); |
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
129 return okayClicked; |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
130 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
131 |
55
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
132 protected virtual void CancelButtonClicked(object sender, System.EventArgs e) |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
133 { |
55
eb7db8495bb5
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
54
diff
changeset
|
134 log.Debug("Cancel clicked"); |
53
28b242612ad7
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
52
diff
changeset
|
135 Respond(ResponseType.Cancel); |
56
0c5fbb54bfb0
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
55
diff
changeset
|
136 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
137 |
56
0c5fbb54bfb0
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
55
diff
changeset
|
138 protected virtual void OkayButtonClicked(object sender, System.EventArgs e) |
0c5fbb54bfb0
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
55
diff
changeset
|
139 { |
0c5fbb54bfb0
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
55
diff
changeset
|
140 log.Debug("Okay clicked"); |
0c5fbb54bfb0
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
55
diff
changeset
|
141 Respond(ResponseType.Ok); |
54
f9f6e9db5350
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
53
diff
changeset
|
142 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
143 |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
144 public void SetOkayEnabledState(bool enabled) |
61
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
145 { |
97
6d2c8ad0d8f1
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
96
diff
changeset
|
146 bttnOkay.Sensitive = enabled; |
61
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
147 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
148 |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
149 protected virtual void SpinButtonValueChanged(object sender, System.EventArgs e) |
61
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
150 { |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
151 OnUnitEquipmentAmountChanged(); |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
152 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
153 |
61
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
154 protected virtual void RadioButtonClicked(object sender, System.EventArgs e) |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
155 { |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
156 OnUnitEquipmentAmountTypeChanged(); |
e7ad676a7344
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
57
diff
changeset
|
157 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
158 |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
159 public void SetNumericAmountEnabledState(bool enabled) |
63
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
160 { |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
161 double minPercent = GetMinPercentage(); |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
162 rbEquipNumeric.Sensitive = enabled && !(isRatioLimited && minPercent == 100); |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
163 numericAmount.Sensitive = rbEquipNumeric.Sensitive; |
63
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
164 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
165 |
63
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
166 public void SetPercentageAmountEnabledState(bool enabled) |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
167 { |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
168 if (enabled) |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
169 { |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
170 double minPercentage = GetMinPercentage(); |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
171 rbEquipPercent.Sensitive = isRatioLimited && minPercentage != 100; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
172 percentageAmount.Sensitive = rbEquipPercent.Sensitive; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
173 double maxPercentage = GetMaxPercentage(); |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
174 rbEquipAll.Sensitive = isRatioLimited && maxPercentage == 100; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
175 lblEquipAll.Sensitive = rbEquipAll.Sensitive; |
63
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
176 } |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
177 else |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
178 { |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
179 rbEquipPercent.Sensitive = false; |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
180 percentageAmount.Sensitive = false; |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
181 rbEquipAll.Sensitive = false; |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
182 lblEquipAll.Sensitive = false; |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
183 } |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
184 } |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
185 |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
186 private double GetMaxPercentage() |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
187 { |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
188 double min, max; |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
189 percentageAmount.GetRange(out min, out max); |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
190 return max; |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
191 } |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
192 |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
193 private double GetMinPercentage() |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
194 { |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
195 double min, max; |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
196 percentageAmount.GetRange(out min, out max); |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
197 return min; |
c2d79b4209e3
* FrmAddEquipment.cs: Re #60: Add UI to add/remove/edit weapons in
IBBoard <dev@ibboard.co.uk>
parents:
62
diff
changeset
|
198 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
199 |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
200 public void ListenToWidgets() |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
201 { |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
202 rbEquipAll.Clicked += RadioButtonClicked; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
203 rbEquipNumeric.Clicked += RadioButtonClicked; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
204 rbEquipPercent.Clicked += RadioButtonClicked; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
205 numericAmount.ValueChanged += SpinButtonValueChanged; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
206 percentageAmount.ValueChanged += SpinButtonValueChanged; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
207 lstEquipment.Selection.Changed += OnSelectionChanged; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
208 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
209 |
70
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
210 public void IgnoreWidgets() |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
211 { |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
212 rbEquipAll.Clicked -= RadioButtonClicked; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
213 rbEquipNumeric.Clicked -= RadioButtonClicked; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
214 rbEquipPercent.Clicked -= RadioButtonClicked; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
215 numericAmount.ValueChanged -= SpinButtonValueChanged; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
216 percentageAmount.ValueChanged -= SpinButtonValueChanged; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
217 lstEquipment.Selection.Changed -= OnSelectionChanged; |
4b82515586ac
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
63
diff
changeset
|
218 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
219 |
57
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
220 public UnitEquipmentItem SelectedUnitEquipmentItem |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
221 { |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
222 get |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
223 { |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
224 return (UnitEquipmentItem)TreeUtils.GetSelectedItem(lstEquipment); |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
225 } |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
226 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
227 |
57
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
228 public bool IsRatioEquipmentAmount |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
229 { |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
230 get |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
231 { |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
232 return !rbEquipNumeric.Active; |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
233 } |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
234 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
235 |
57
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
236 public int EquipmentNumericAmount |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
237 { |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
238 get |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
239 { |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
240 return (int)numericAmount.Value; |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
241 } |
62
f733073967a2
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
242 |
f733073967a2
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
243 set |
f733073967a2
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
244 { |
f733073967a2
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
245 numericAmount.Value = value; |
f733073967a2
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
246 } |
57
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
247 } |
92
58779fcd0166
Re #308: Make GTK# UI translatable
IBBoard <dev@ibboard.co.uk>
parents:
76
diff
changeset
|
248 |
57
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
249 public double EquipmentPercentageAmount |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
250 { |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
251 get |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
252 { |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
253 double percent; |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
254 |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
255 if (rbEquipAll.Active) |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
256 { |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
257 percent = 100; |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
258 } |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
259 else |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
260 { |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
261 percent = percentageAmount.Value; |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
262 } |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
263 |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
264 return percent; |
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
265 } |
62
f733073967a2
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
266 |
f733073967a2
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
267 set |
f733073967a2
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
268 { |
f733073967a2
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
269 percentageAmount.Value = value; |
f733073967a2
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
61
diff
changeset
|
270 } |
57
293d204e40db
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
56
diff
changeset
|
271 } |
51
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
272 } |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
273 } |
dafbd432ca23
Re #60: Add UI to add/remove/edit weapons in GTK
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
274 |