Mercurial > repos > WarFoundryForge
annotate FrmSystem.cs @ 17:0ea6ce3c6434 default tip
Updated System Form on General Tab
Added System Information text box. Currently only a mock up.
author | Tsudico |
---|---|
date | Thu, 06 Jan 2011 21:44:05 -0600 |
parents | 489d36b167a6 |
children |
rev | line source |
---|---|
0 | 1 using System; |
2 using System.Collections.Generic; | |
3 using System.ComponentModel; | |
4 using System.Data; | |
5 using System.Drawing; | |
6 using System.Text; | |
7 using System.Text.RegularExpressions; | |
8 using System.Windows.Forms; | |
9 using IBBoard.Lang; | |
10 using IBBoard.Windows.Forms; | |
11 using IBBoard.Windows.Forms.I18N; | |
12 | |
13 namespace IBBoard.WarFoundry.Forge.WinForms | |
14 { | |
15 public partial class FrmSystem : IBBoard.Windows.Forms.IBBForm | |
16 { | |
4
866d0093bb11
WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents:
0
diff
changeset
|
17 private IBBoard.WarFoundry.API.Objects.GameSystem system; |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
18 private IBBoard.WarFoundry.API.Objects.Category currentCategory; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
19 private IBBoard.WarFoundry.API.Objects.SystemStats currentStats; |
4
866d0093bb11
WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents:
0
diff
changeset
|
20 |
8 | 21 private bool UpdateCategory |
22 { | |
23 get | |
24 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
25 if(currentCategory == null) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
26 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
27 return false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
28 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
29 if (currentCategory.Name == (string)this.listCategories.SelectedItem) |
8 | 30 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
31 if (currentCategory.Name != this.txtCategoryName.Text) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
32 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
33 return true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
34 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
35 if (currentCategory.ID != this.txtCategoryID.Text) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
36 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
37 return true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
38 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
39 if (currentCategory.MinimumPoints > 0 && !this.cbPointMin.Checked) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
40 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
41 return true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
42 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
43 else if (currentCategory.MinimumPoints != this.numPointMin.Value) |
8 | 44 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
45 return true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
46 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
47 if (currentCategory.MaximumPoints < this.numPointMax.Maximum |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
48 && !this.cbPointMax.Checked) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
49 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
50 return true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
51 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
52 else if (currentCategory.MaximumPoints != this.numPointMax.Value) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
53 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
54 return true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
55 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
56 if (currentCategory.MinimumPercentage > 0 && !this.cbPercentMin.Checked) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
57 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
58 return true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
59 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
60 else if (currentCategory.MinimumPercentage != this.numPercentMin.Value) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
61 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
62 return true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
63 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
64 if (currentCategory.MaximumPercentage < this.numPercentMax.Maximum |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
65 && !this.cbPercentMax.Checked) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
66 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
67 return true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
68 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
69 else if (currentCategory.MaximumPercentage != this.numPercentMax.Value) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
70 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
71 return true; |
8 | 72 } |
73 } | |
74 return false; | |
75 } | |
76 } | |
77 | |
15 | 78 private bool UpdateSystemStats |
79 { | |
80 get | |
81 { | |
82 if(currentStats == null) | |
83 { | |
84 return false; | |
85 } | |
86 if(currentStats.ID != this.txtStatLineID.Text) | |
87 { | |
88 return true; | |
89 } | |
90 if(currentStats.SlotCount != this.listCategories.Items.Count) | |
91 { | |
92 return true; | |
93 } | |
94 if(system.GetSystemStatsForID(currentStats.ID).SlotCount != currentStats.SlotCount) | |
95 { | |
96 return true; | |
97 } | |
98 for(int i = 0; i < currentStats.SlotCount; i++) | |
99 { | |
100 if(system.GetSystemStatsForID(currentStats.ID).StatSlots[i].Name == currentStats.StatSlots[i].Name) | |
101 { | |
102 return true; | |
103 } | |
104 } | |
105 return false; | |
106 } | |
107 } | |
108 | |
4
866d0093bb11
WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents:
0
diff
changeset
|
109 public FrmSystem(IBBoard.WarFoundry.API.Objects.GameSystem loadSystem) |
0 | 110 { |
111 InitializeComponent(); | |
4
866d0093bb11
WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents:
0
diff
changeset
|
112 system = loadSystem; |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
113 this.txtSystemName.Text = system.Name; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
114 this.txtSystemId.Text = system.ID; |
8 | 115 this.numDefaultSize.Value = system.SystemArmyDefaultSize; |
116 this.numPointMax.Value = this.numDefaultSize.Value; | |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
117 if(system.AllowAllies) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
118 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
119 this.radSystemAlliesYes.Checked = true; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
120 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
121 else |
4
866d0093bb11
WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents:
0
diff
changeset
|
122 { |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
123 this.radSystemAlliesNo.Checked = true; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
124 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
125 if (system.WarnOnError) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
126 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
127 this.radSystemWarnYes.Checked = true; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
128 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
129 else |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
130 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
131 this.radSystemWarnNo.Checked = true; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
132 } |
8 | 133 updateCategoryList(); |
13 | 134 updateSystemStatsList(); |
0 | 135 } |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
136 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
137 private string generateID(string name) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
138 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
139 string newId = String.Empty; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
140 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
141 MatchCollection id_parts = Regex.Matches(name, @"[A-Z\d]"); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
142 foreach (Match part in id_parts) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
143 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
144 newId += part.ToString(); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
145 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
146 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
147 if (newId.Length < 3) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
148 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
149 newId = name.ToLower().Replace(" ", ""); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
150 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
151 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
152 return newId.ToLower(); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
153 } |
8 | 154 |
155 private void clearCategory() | |
156 { | |
157 this.txtCategoryName.Text = string.Empty; | |
158 this.txtCategoryID.Text = string.Empty; | |
159 this.cbPointMin.Checked = false; | |
160 this.cbPointMax.Checked = false; | |
161 this.cbPercentMin.Checked = false; | |
162 this.cbPercentMax.Checked = false; | |
163 this.numPointMin.Value = 0; | |
164 this.numPointMin.Enabled = false; | |
165 this.numPointMax.Value = this.numDefaultSize.Value; | |
166 this.numPointMax.Enabled = false; | |
167 this.numPercentMin.Value = 0; | |
168 this.numPercentMin.Enabled = false; | |
169 this.numPercentMax.Value = 100; | |
170 this.numPercentMax.Enabled = false; | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
171 currentCategory = null; |
8 | 172 } |
173 | |
15 | 174 private void clearStatLine() |
175 { | |
176 this.txtStatName.Clear(); | |
177 this.txtStatLineID.Clear(); | |
178 this.listStatNames.Items.Clear(); | |
179 this.lviewStatPreview.Columns.Clear(); | |
180 this.lviewStatPreview.Items.Clear(); | |
181 currentStats = null; | |
182 } | |
183 | |
8 | 184 private void updateCategoryList() |
185 { | |
16 | 186 this.listCategories.Items.Clear(); |
8 | 187 if (system.Categories.Length > 0) |
188 { | |
189 for (int i = 0; i < system.Categories.Length; i++) | |
190 { | |
191 this.listCategories.Items.Add(system.Categories[i].Name); | |
192 } | |
193 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
194 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
195 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
196 this.btnCategoryRemove.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
197 } |
8 | 198 } |
13 | 199 |
200 private void updateSystemStatsList() | |
201 { | |
202 this.lviewStats.Items.Clear(); | |
203 if (system.SystemStats.Length > 0) | |
204 { | |
205 for(int i = 0; i < system.SystemStats.Length; i++) | |
206 { | |
207 ListViewItem item = new ListViewItem(); | |
208 item.Text = system.SystemStats[i].ID; | |
209 if(system.SystemStats[i].Equals(system.StandardSystemStats)) | |
210 { | |
211 item.SubItems.Add('\u2713'+""); | |
212 } | |
213 this.lviewStats.Items.Add(item); | |
214 } | |
215 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
216 this.lviewStats.AutoResizeColumn(0, ColumnHeaderAutoResizeStyle.ColumnContent); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
217 this.lviewStats.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.HeaderSize); |
13 | 218 } |
219 | |
220 private void updateStatLinePreview(IBBoard.WarFoundry.API.Objects.SystemStats stats) | |
221 { | |
15 | 222 this.lviewStatPreview.Items.Clear(); |
223 this.lviewStatPreview.Columns.Clear(); | |
13 | 224 if(stats.SlotCount > 0) |
225 { | |
226 for(int i = 0; i < stats.SlotCount; i++) | |
227 { | |
228 System.Windows.Forms.ColumnHeader column = new ColumnHeader(); | |
229 column.Name = generateID(stats.StatSlots[i].Name); | |
230 column.Text = stats.StatSlots[i].Name; | |
231 column.TextAlign = HorizontalAlignment.Center; | |
232 this.lviewStatPreview.Columns.Add(column); | |
233 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
234 this.lviewStatPreview.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); |
13 | 235 this.lviewStatPreview.Items.Add(" "); |
236 } | |
15 | 237 this.btnStatLineApply.Enabled = this.UpdateSystemStats; |
13 | 238 } |
239 | |
240 private void updateStatNames(IBBoard.WarFoundry.API.Objects.SystemStats stats) | |
241 { | |
15 | 242 this.listStatNames.Items.Clear(); |
13 | 243 if (stats.SlotCount > 0) |
244 { | |
245 for (int i = 0; i < stats.SlotCount; i++) | |
246 { | |
247 this.listStatNames.Items.Add(stats.StatSlots[i].Name); | |
248 } | |
249 } | |
250 } | |
0 | 251 |
252 private void btnSystemClose_Click(object sender, EventArgs e) | |
253 { | |
254 this.Close(); | |
255 } | |
256 | |
257 private void btnGenerateSysId_Click(object sender, EventArgs e) | |
258 { | |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
259 this.txtSystemId.Text = generateID(this.txtSystemName.Text); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
260 } |
0 | 261 |
8 | 262 private void listCategories_SelectedIndexChanged(object sender, EventArgs e) |
263 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
264 currentCategory = null; |
8 | 265 foreach (IBBoard.WarFoundry.API.Objects.Category cat in system.Categories) |
266 { | |
15 | 267 if (cat.Name == (string)this.listCategories.SelectedItem) |
8 | 268 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
269 currentCategory = cat; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
270 this.txtCategoryName.Text = currentCategory.Name; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
271 this.txtCategoryID.Text = currentCategory.ID; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
272 if (currentCategory.MinimumPoints > 0) |
8 | 273 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
274 this.numPointMin.Value = currentCategory.MinimumPoints; |
8 | 275 this.cbPointMin.Checked = true; |
276 this.numPointMin.Enabled = true; | |
277 } | |
278 else | |
279 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
280 this.cbPointMin.Checked = false; |
8 | 281 this.numPointMin.Enabled = false; |
282 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
283 if (currentCategory.MaximumPoints > 0 |
15 | 284 && currentCategory.MaximumPoints < this.numPointMax.Maximum) |
8 | 285 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
286 this.numPointMax.Value = currentCategory.MaximumPoints; |
8 | 287 this.cbPointMax.Checked = true; |
288 this.numPointMax.Enabled = true; | |
289 } | |
290 else | |
291 { | |
292 this.numPointMax.Value = this.numDefaultSize.Value; | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
293 this.cbPointMax.Checked = false; |
8 | 294 this.numPointMax.Enabled = false; |
295 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
296 if (currentCategory.MinimumPercentage > 0) |
8 | 297 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
298 this.numPercentMin.Value = currentCategory.MinimumPercentage; |
8 | 299 this.cbPercentMin.Checked = true; |
300 this.numPercentMin.Enabled = true; | |
301 } | |
302 else | |
303 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
304 this.cbPercentMin.Checked = false; |
8 | 305 this.numPercentMin.Enabled = false; |
306 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
307 if (currentCategory.MaximumPercentage < 100) |
8 | 308 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
309 this.numPercentMax.Value = currentCategory.MaximumPercentage; |
8 | 310 this.cbPercentMax.Checked = true; |
311 this.numPercentMax.Enabled = true; | |
312 } | |
313 else | |
314 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
315 this.cbPercentMax.Checked = false; |
8 | 316 this.numPercentMax.Enabled = false; |
317 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
318 this.btnCategoryRemove.Enabled = true; |
8 | 319 this.btnCategoryApply.Enabled = false; |
320 break; | |
321 } | |
322 } | |
10 | 323 if(this.listCategories.SelectedIndex == 0) |
324 { | |
325 this.btnCategoryUp.Enabled = false; | |
326 } | |
327 else | |
328 { | |
329 this.btnCategoryUp.Enabled = true; | |
330 } | |
331 if (this.listCategories.SelectedIndex == this.listCategories.Items.Count - 1) | |
332 { | |
333 this.btnCategoryDown.Enabled = false; | |
334 } | |
335 else | |
336 { | |
337 this.btnCategoryDown.Enabled = true; | |
338 } | |
8 | 339 } |
340 | |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
341 private void btnCategoryAdd_Click(object sender, EventArgs e) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
342 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
343 if(this.txtCategoryName.Text == string.Empty) |
0 | 344 { |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
345 MessageBox.Show("Category must have a name", "Category Error"); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
346 return; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
347 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
348 if (this.txtCategoryID.Text == string.Empty) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
349 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
350 MessageBox.Show("Category must have an ID", "Category Error"); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
351 return; |
0 | 352 } |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
353 IBBoard.WarFoundry.API.Objects.Category cat = new IBBoard.WarFoundry.API.Objects.Category( |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
354 this.txtCategoryID.Text, |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
355 this.txtCategoryName.Text |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
356 ); |
0 | 357 |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
358 cat.MinimumPoints = (int)this.numPointMin.Value; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
359 cat.MaximumPoints = (int)this.numPointMax.Value; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
360 cat.MinimumPercentage = (int)this.numPercentMin.Value; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
361 cat.MaximumPercentage = (int)this.numPercentMax.Value; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
362 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
363 system.AddCategory(cat); |
8 | 364 updateCategoryList(); |
365 clearCategory(); | |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
366 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
367 |
8 | 368 private void btnCategoryRemove_Click(object sender, EventArgs e) |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
369 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
370 foreach(IBBoard.WarFoundry.API.Objects.Category cat in system.Categories) |
0 | 371 { |
15 | 372 if(cat.Name == (string)this.listCategories.SelectedItem) |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
373 { |
8 | 374 system.RemoveCategory(cat.ID); |
375 this.listCategories.ClearSelected(); | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
376 this.btnCategoryRemove.Enabled = false; |
8 | 377 break; |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
378 } |
0 | 379 } |
8 | 380 updateCategoryList(); |
381 } | |
382 | |
10 | 383 private void btnCategoryUp_Click(object sender, EventArgs e) |
384 { | |
385 int index = this.listCategories.SelectedIndex; | |
386 IBBoard.WarFoundry.API.Objects.Category[] catList = new IBBoard.WarFoundry.API.Objects.Category[this.listCategories.Items.Count]; | |
387 | |
388 for(int i = 0; i < system.Categories.Length; i++) | |
389 { | |
390 catList[i] = system.Categories[i]; | |
391 } | |
392 foreach(IBBoard.WarFoundry.API.Objects.Category cat in system.Categories) | |
393 { | |
394 system.RemoveCategory(cat.ID); | |
395 } | |
396 | |
397 IBBoard.WarFoundry.API.Objects.Category temp = catList[index]; | |
398 catList[index] = catList[index - 1]; | |
399 catList[index - 1] = temp; | |
400 | |
401 for(int i = catList.Length - 1; i >= 0; i--) | |
402 { | |
403 system.AddCategory(catList[i]); | |
404 } | |
405 | |
406 updateCategoryList(); | |
407 this.listCategories.SelectedIndex = index - 1; | |
408 } | |
409 | |
410 private void btnCategoryDown_Click(object sender, EventArgs e) | |
411 { | |
412 int index = this.listCategories.SelectedIndex; | |
413 IBBoard.WarFoundry.API.Objects.Category[] catList = new IBBoard.WarFoundry.API.Objects.Category[this.listCategories.Items.Count]; | |
414 | |
415 for (int i = 0; i < system.Categories.Length; i++) | |
416 { | |
417 catList[i] = system.Categories[i]; | |
418 } | |
419 foreach (IBBoard.WarFoundry.API.Objects.Category cat in system.Categories) | |
420 { | |
421 system.RemoveCategory(cat.ID); | |
422 } | |
423 | |
424 IBBoard.WarFoundry.API.Objects.Category temp = catList[index]; | |
425 catList[index] = catList[index + 1]; | |
426 catList[index + 1] = temp; | |
427 | |
428 for (int i = catList.Length - 1; i >= 0; i--) | |
429 { | |
430 system.AddCategory(catList[i]); | |
431 } | |
432 | |
433 updateCategoryList(); | |
434 this.listCategories.SelectedIndex = index + 1; | |
435 } | |
436 | |
8 | 437 private void txtCategoryName_TextChanged(object sender, EventArgs e) |
438 { | |
15 | 439 this.btnCategoryApply.Enabled = this.UpdateCategory; |
440 | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
441 if(this.txtCategoryName.Text != string.Empty && this.txtCategoryID.Text != string.Empty) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
442 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
443 this.btnCategoryAdd.Enabled = true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
444 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
445 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
446 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
447 this.btnCategoryAdd.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
448 } |
8 | 449 } |
450 | |
451 private void txtCategoryID_TextChanged(object sender, EventArgs e) | |
452 { | |
15 | 453 this.btnCategoryApply.Enabled = this.UpdateCategory; |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
454 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
455 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
456 private void btnGenerateCatID_Click(object sender, EventArgs e) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
457 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
458 this.txtCategoryID.Text = generateID(this.txtCategoryName.Text); |
0 | 459 } |
8 | 460 |
461 private void cbPointMin_CheckedChanged(object sender, EventArgs e) | |
462 { | |
463 if(this.cbPointMin.Checked) | |
464 { | |
465 this.numPointMin.Enabled = true; | |
466 } | |
467 else | |
468 { | |
469 this.numPointMin.Enabled = false; | |
470 } | |
15 | 471 this.btnCategoryApply.Enabled = this.UpdateCategory; |
8 | 472 } |
473 | |
474 private void cbPointMax_CheckedChanged(object sender, EventArgs e) | |
475 { | |
476 if (this.cbPointMax.Checked) | |
477 { | |
478 this.numPointMax.Enabled = true; | |
479 } | |
480 else | |
481 { | |
482 this.numPointMax.Enabled = false; | |
483 } | |
15 | 484 this.btnCategoryApply.Enabled = this.UpdateCategory; |
8 | 485 } |
486 | |
487 private void cbPercentMin_CheckedChanged(object sender, EventArgs e) | |
488 { | |
489 if (this.cbPercentMin.Checked) | |
490 { | |
491 this.numPercentMin.Enabled = true; | |
492 } | |
493 else | |
494 { | |
495 this.numPercentMin.Enabled = false; | |
496 } | |
15 | 497 this.btnCategoryApply.Enabled = this.UpdateCategory; |
8 | 498 } |
499 | |
500 private void cbPercentMax_CheckedChanged(object sender, EventArgs e) | |
501 { | |
502 if (this.cbPercentMax.Checked) | |
503 { | |
504 this.numPercentMax.Enabled = true; | |
505 } | |
506 else | |
507 { | |
508 this.numPercentMax.Enabled = false; | |
509 } | |
15 | 510 this.btnCategoryApply.Enabled = this.UpdateCategory; |
8 | 511 } |
512 | |
513 private void numPointMin_ValueChanged(object sender, EventArgs e) | |
514 { | |
15 | 515 this.btnCategoryApply.Enabled = this.UpdateCategory; |
8 | 516 } |
517 | |
518 private void numPointMax_ValueChanged(object sender, EventArgs e) | |
519 { | |
15 | 520 this.btnCategoryApply.Enabled = this.UpdateCategory; |
8 | 521 } |
522 | |
523 private void numPercentMin_ValueChanged(object sender, EventArgs e) | |
524 { | |
15 | 525 this.btnCategoryApply.Enabled = this.UpdateCategory; |
8 | 526 } |
527 | |
528 private void numPercentMax_ValueChanged(object sender, EventArgs e) | |
529 { | |
15 | 530 this.btnCategoryApply.Enabled = this.UpdateCategory; |
8 | 531 } |
13 | 532 |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
533 private void btnCategoryApply_Click(object sender, EventArgs e) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
534 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
535 currentCategory.Name = this.txtCategoryName.Text; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
536 currentCategory.ID = this.txtCategoryID.Text; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
537 if(this.cbPointMin.Checked) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
538 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
539 currentCategory.MinimumPoints = (int)this.numPointMin.Value; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
540 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
541 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
542 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
543 currentCategory.MinimumPoints = 0; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
544 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
545 if (this.cbPointMax.Checked) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
546 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
547 currentCategory.MaximumPoints = (int)this.numPointMax.Value; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
548 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
549 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
550 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
551 currentCategory.MaximumPoints = IBBoard.WarFoundry.API.WarFoundryCore.INFINITY; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
552 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
553 if (this.cbPercentMin.Checked) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
554 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
555 currentCategory.MinimumPercentage = (int)this.numPercentMin.Value; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
556 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
557 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
558 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
559 currentCategory.MinimumPercentage = 0; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
560 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
561 if (this.cbPercentMax.Checked) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
562 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
563 currentCategory.MinimumPercentage = (int)this.numPercentMax.Value; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
564 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
565 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
566 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
567 currentCategory.MaximumPercentage = 100; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
568 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
569 system.SetCategory(currentCategory); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
570 updateCategoryList(); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
571 this.listCategories.ClearSelected(); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
572 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
573 |
13 | 574 void lviewStats_SelectedIndexChanged(object sender, System.EventArgs e) |
575 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
576 currentStats = null; |
13 | 577 foreach(IBBoard.WarFoundry.API.Objects.SystemStats stat in system.SystemStats) |
578 { | |
16 | 579 foreach(ListViewItem item in this.lviewStats.SelectedItems) |
13 | 580 { |
581 if(stat.ID == item.Text) | |
582 { | |
16 | 583 if(this.lviewStats.Items.Count > 0) |
584 { | |
585 this.btnStatsRemove.Enabled = true; | |
586 } | |
15 | 587 currentStats = new IBBoard.WarFoundry.API.Objects.SystemStats(stat.ID); |
588 foreach(IBBoard.WarFoundry.API.Objects.StatSlot slot in stat.StatSlots) | |
589 { | |
590 currentStats.AddStatSlot(slot.Name); | |
591 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
592 if(currentStats.ID.Equals(system.StandardSystemStatsID)) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
593 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
594 this.btnStatsDefault.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
595 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
596 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
597 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
598 this.btnStatsDefault.Enabled = true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
599 } |
16 | 600 if (item.Index == 0) |
601 { | |
602 this.btnStatsUp.Enabled = false; | |
603 } | |
604 else | |
605 { | |
606 this.btnStatsUp.Enabled = true; | |
607 } | |
608 if (item.Index == this.lviewStats.Items.Count - 1) | |
609 { | |
610 this.btnStatsDown.Enabled = false; | |
611 } | |
612 else | |
613 { | |
614 this.btnStatsDown.Enabled = true; | |
615 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
616 this.txtStatLineID.Text = currentStats.ID; |
15 | 617 this.txtStatName.Enabled = true; |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
618 updateStatNames(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
619 updateStatLinePreview(currentStats); |
13 | 620 } |
621 } | |
622 } | |
15 | 623 if(this.txtStatLineID.Text == string.Empty) |
624 { | |
625 this.txtStatName.Enabled = false; | |
626 } | |
627 } | |
628 | |
629 private void btnStatsAdd_Click(object sender, EventArgs e) | |
630 { | |
631 if(this.txtStatLineID.Text == string.Empty) | |
632 { | |
633 MessageBox.Show("You must enter an ID!", "Create Stat Line Error"); | |
634 return; | |
635 } | |
636 if (currentStats == null) | |
637 { | |
638 currentStats = new IBBoard.WarFoundry.API.Objects.SystemStats(this.txtStatLineID.Text); | |
639 } | |
640 system.AddSystemStats(currentStats); | |
641 clearStatLine(); | |
642 updateSystemStatsList(); | |
13 | 643 } |
644 | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
645 private void btnStatsRemove_Click(object sender, EventArgs e) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
646 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
647 system.RemoveSystemStats(currentStats.ID); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
648 this.btnStatsRemove.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
649 updateSystemStatsList(); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
650 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
651 |
13 | 652 private void btnStatsDefault_Click(object sender, EventArgs e) |
653 { | |
654 system.StandardSystemStatsID = this.lviewStats.SelectedItems[0].Text; | |
655 updateSystemStatsList(); | |
656 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
657 |
16 | 658 private void btnStatsUp_Click(object sender, EventArgs e) |
659 { | |
660 int index = this.lviewStats.SelectedIndices[0]; | |
661 IBBoard.WarFoundry.API.Objects.SystemStats[] statsList = new IBBoard.WarFoundry.API.Objects.SystemStats[this.lviewStats.Items.Count]; | |
662 | |
663 for (int i = 0; i < system.SystemStats.Length; i++) | |
664 { | |
665 statsList[i] = system.SystemStats[i]; | |
666 } | |
667 foreach (IBBoard.WarFoundry.API.Objects.SystemStats stat in system.SystemStats) | |
668 { | |
669 system.RemoveSystemStats(stat.ID); | |
670 } | |
671 | |
672 IBBoard.WarFoundry.API.Objects.SystemStats temp = statsList[index]; | |
673 statsList[index] = statsList[index - 1]; | |
674 statsList[index - 1] = temp; | |
675 | |
676 for (int i = statsList.Length - 1; i >= 0; i--) | |
677 { | |
678 system.AddSystemStats(statsList[i]); | |
679 } | |
680 | |
681 updateSystemStatsList(); | |
682 this.lviewStats.Items[index - 1].Selected = true; | |
683 } | |
684 | |
685 private void btnStatsDown_Click(object sender, EventArgs e) | |
686 { | |
687 int index = this.lviewStats.SelectedIndices[0]; | |
688 IBBoard.WarFoundry.API.Objects.SystemStats[] statsList = new IBBoard.WarFoundry.API.Objects.SystemStats[this.lviewStats.Items.Count]; | |
689 | |
690 for (int i = 0; i < system.SystemStats.Length; i++) | |
691 { | |
692 statsList[i] = system.SystemStats[i]; | |
693 } | |
694 foreach (IBBoard.WarFoundry.API.Objects.SystemStats stat in system.SystemStats) | |
695 { | |
696 system.RemoveSystemStats(stat.ID); | |
697 } | |
698 | |
699 IBBoard.WarFoundry.API.Objects.SystemStats temp = statsList[index]; | |
700 statsList[index] = statsList[index + 1]; | |
701 statsList[index + 1] = temp; | |
702 | |
703 for (int i = statsList.Length - 1; i >= 0; i--) | |
704 { | |
705 system.AddSystemStats(statsList[i]); | |
706 } | |
707 | |
708 updateSystemStatsList(); | |
709 this.lviewStats.Items[index + 1].Selected = true; | |
710 } | |
711 | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
712 private void txtStatLineID_TextChanged(object sender, EventArgs e) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
713 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
714 if(this.txtStatLineID.Text != string.Empty) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
715 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
716 this.btnStatsAdd.Enabled = true; |
15 | 717 this.txtStatName.Enabled = true; |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
718 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
719 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
720 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
721 this.btnStatsAdd.Enabled = false; |
15 | 722 this.txtStatName.Enabled = false; |
723 this.btnStatListAdd.Enabled = false; | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
724 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
725 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
726 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
727 private void txtStatName_TextChanged(object sender, EventArgs e) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
728 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
729 if(this.txtStatName.Text != string.Empty) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
730 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
731 this.btnStatListAdd.Enabled = true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
732 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
733 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
734 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
735 this.btnStatListAdd.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
736 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
737 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
738 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
739 private void btnStatListAdd_Click(object sender, EventArgs e) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
740 { |
15 | 741 if(currentStats == null) |
742 { | |
743 if(this.txtStatLineID.Text != string.Empty) | |
744 { | |
745 currentStats = new IBBoard.WarFoundry.API.Objects.SystemStats(this.txtStatLineID.Text); | |
746 } | |
747 else | |
748 { | |
749 MessageBox.Show("You must first define an ID for the stat line.", "No ID Error"); | |
750 return; | |
751 } | |
752 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
753 if(this.txtStatName.Text != string.Empty) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
754 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
755 currentStats.AddStatSlot(this.txtStatName.Text); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
756 } |
15 | 757 this.txtStatName.Clear(); |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
758 updateStatNames(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
759 updateStatLinePreview(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
760 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
761 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
762 private void listStatNames_SelectedIndexChanged(object sender, EventArgs e) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
763 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
764 if(this.listStatNames.SelectedIndex >= 0) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
765 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
766 this.btnStatListRemove.Enabled = true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
767 if(this.listStatNames.SelectedIndex == 0) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
768 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
769 this.btnStatListUp.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
770 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
771 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
772 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
773 this.btnStatListUp.Enabled = true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
774 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
775 if(this.listStatNames.SelectedIndex == this.listStatNames.Items.Count - 1) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
776 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
777 this.btnStatListDown.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
778 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
779 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
780 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
781 this.btnStatListDown.Enabled = true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
782 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
783 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
784 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
785 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
786 this.btnStatListRemove.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
787 this.btnStatListUp.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
788 this.btnStatListDown.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
789 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
790 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
791 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
792 private void btnStatListRemove_Click(object sender, EventArgs e) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
793 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
794 currentStats.RemoveStatSlot((string)this.listStatNames.SelectedItem); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
795 updateStatNames(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
796 updateStatLinePreview(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
797 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
798 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
799 private void btnStatListUp_Click(object sender, EventArgs e) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
800 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
801 int index = this.listStatNames.SelectedIndex; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
802 string[] slotList = new string[this.listStatNames.Items.Count]; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
803 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
804 for (int i = 0; i < currentStats.SlotCount; i++) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
805 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
806 slotList[i] = currentStats.StatSlots[i].Name; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
807 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
808 for (int i = 0; i < slotList.Length; i++) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
809 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
810 currentStats.RemoveStatSlot(slotList[i]); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
811 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
812 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
813 string temp = slotList[index]; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
814 slotList[index] = slotList[index - 1]; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
815 slotList[index - 1] = temp; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
816 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
817 for (int i = 0; i < slotList.Length; i++) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
818 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
819 currentStats.AddStatSlot(slotList[i]); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
820 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
821 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
822 updateStatNames(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
823 updateStatLinePreview(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
824 this.listStatNames.SelectedIndex = index - 1; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
825 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
826 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
827 private void btnStatListDown_Click(object sender, EventArgs e) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
828 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
829 int index = this.listStatNames.SelectedIndex; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
830 string[] slotList = new string[this.listStatNames.Items.Count]; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
831 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
832 for (int i = 0; i < currentStats.SlotCount; i++) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
833 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
834 slotList[i] = currentStats.StatSlots[i].Name; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
835 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
836 for (int i = 0; i < slotList.Length; i++) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
837 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
838 currentStats.RemoveStatSlot(slotList[i]); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
839 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
840 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
841 string temp = slotList[index]; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
842 slotList[index] = slotList[index + 1]; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
843 slotList[index + 1] = temp; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
844 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
845 for (int i = 0; i < slotList.Length; i++) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
846 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
847 currentStats.AddStatSlot(slotList[i]); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
848 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
849 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
850 updateStatNames(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
851 updateStatLinePreview(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
852 this.listStatNames.SelectedIndex = index + 1; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
853 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
854 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
855 private void btnStatLineApply_Click(object sender, EventArgs e) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
856 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
857 system.SetSystemStats(currentStats); |
15 | 858 clearStatLine(); |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
859 } |
0 | 860 } |
861 } |