Mercurial > repos > WarFoundryForge
annotate FrmSystem.cs @ 14:26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
author | Tsudico |
---|---|
date | Sat, 18 Dec 2010 21:04:51 -0600 |
parents | 372f921c20fc |
children | 3a347947ecea |
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 | |
4
866d0093bb11
WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents:
0
diff
changeset
|
78 public FrmSystem(IBBoard.WarFoundry.API.Objects.GameSystem loadSystem) |
0 | 79 { |
80 InitializeComponent(); | |
4
866d0093bb11
WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents:
0
diff
changeset
|
81 system = loadSystem; |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
82 this.txtSystemName.Text = system.Name; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
83 this.txtSystemId.Text = system.ID; |
8 | 84 this.numDefaultSize.Value = system.SystemArmyDefaultSize; |
85 this.numPointMax.Value = this.numDefaultSize.Value; | |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
86 if(system.AllowAllies) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
87 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
88 this.radSystemAlliesYes.Checked = true; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
89 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
90 else |
4
866d0093bb11
WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents:
0
diff
changeset
|
91 { |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
92 this.radSystemAlliesNo.Checked = true; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
93 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
94 if (system.WarnOnError) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
95 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
96 this.radSystemWarnYes.Checked = true; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
97 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
98 else |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
99 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
100 this.radSystemWarnNo.Checked = true; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
101 } |
8 | 102 updateCategoryList(); |
13 | 103 updateSystemStatsList(); |
0 | 104 } |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
105 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
106 private string generateID(string name) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
107 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
108 string newId = String.Empty; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
109 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
110 MatchCollection id_parts = Regex.Matches(name, @"[A-Z\d]"); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
111 foreach (Match part in id_parts) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
112 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
113 newId += part.ToString(); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
114 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
115 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
116 if (newId.Length < 3) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
117 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
118 newId = name.ToLower().Replace(" ", ""); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
119 } |
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 return newId.ToLower(); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
122 } |
8 | 123 |
124 private void clearCategory() | |
125 { | |
126 this.txtCategoryName.Text = string.Empty; | |
127 this.txtCategoryID.Text = string.Empty; | |
128 this.cbPointMin.Checked = false; | |
129 this.cbPointMax.Checked = false; | |
130 this.cbPercentMin.Checked = false; | |
131 this.cbPercentMax.Checked = false; | |
132 this.numPointMin.Value = 0; | |
133 this.numPointMin.Enabled = false; | |
134 this.numPointMax.Value = this.numDefaultSize.Value; | |
135 this.numPointMax.Enabled = false; | |
136 this.numPercentMin.Value = 0; | |
137 this.numPercentMin.Enabled = false; | |
138 this.numPercentMax.Value = 100; | |
139 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
|
140 currentCategory = null; |
8 | 141 } |
142 | |
143 private void updateCategoryList() | |
144 { | |
145 if (system.Categories.Length > 0) | |
146 { | |
147 this.listCategories.Items.Clear(); | |
148 for (int i = 0; i < system.Categories.Length; i++) | |
149 { | |
150 this.listCategories.Items.Add(system.Categories[i].Name); | |
151 } | |
152 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
153 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
154 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
155 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
|
156 } |
8 | 157 } |
13 | 158 |
159 private void updateSystemStatsList() | |
160 { | |
161 this.lviewStats.Items.Clear(); | |
162 if (system.SystemStats.Length > 0) | |
163 { | |
164 for(int i = 0; i < system.SystemStats.Length; i++) | |
165 { | |
166 ListViewItem item = new ListViewItem(); | |
167 item.Text = system.SystemStats[i].ID; | |
168 if(system.SystemStats[i].Equals(system.StandardSystemStats)) | |
169 { | |
170 item.SubItems.Add('\u2713'+""); | |
171 } | |
172 this.lviewStats.Items.Add(item); | |
173 } | |
174 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
175 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
|
176 this.lviewStats.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.HeaderSize); |
13 | 177 } |
178 | |
179 private void updateStatLinePreview(IBBoard.WarFoundry.API.Objects.SystemStats stats) | |
180 { | |
181 if(stats.SlotCount > 0) | |
182 { | |
183 this.lviewStatPreview.Items.Clear(); | |
184 this.lviewStatPreview.Columns.Clear(); | |
185 for(int i = 0; i < stats.SlotCount; i++) | |
186 { | |
187 System.Windows.Forms.ColumnHeader column = new ColumnHeader(); | |
188 column.Name = generateID(stats.StatSlots[i].Name); | |
189 column.Text = stats.StatSlots[i].Name; | |
190 column.TextAlign = HorizontalAlignment.Center; | |
191 this.lviewStatPreview.Columns.Add(column); | |
192 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
193 this.lviewStatPreview.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); |
13 | 194 this.lviewStatPreview.Items.Add(" "); |
195 } | |
196 } | |
197 | |
198 private void updateStatNames(IBBoard.WarFoundry.API.Objects.SystemStats stats) | |
199 { | |
200 if (stats.SlotCount > 0) | |
201 { | |
202 this.listStatNames.Items.Clear(); | |
203 for (int i = 0; i < stats.SlotCount; i++) | |
204 { | |
205 this.listStatNames.Items.Add(stats.StatSlots[i].Name); | |
206 } | |
207 } | |
208 } | |
0 | 209 |
210 private void btnSystemClose_Click(object sender, EventArgs e) | |
211 { | |
212 this.Close(); | |
213 } | |
214 | |
215 private void btnGenerateSysId_Click(object sender, EventArgs e) | |
216 { | |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
217 this.txtSystemId.Text = generateID(this.txtSystemName.Text); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
218 } |
0 | 219 |
8 | 220 private void listCategories_SelectedIndexChanged(object sender, EventArgs e) |
221 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
222 currentCategory = null; |
8 | 223 foreach (IBBoard.WarFoundry.API.Objects.Category cat in system.Categories) |
224 { | |
225 if (cat.Name == this.listCategories.SelectedItem) | |
226 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
227 currentCategory = cat; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
228 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
|
229 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
|
230 if (currentCategory.MinimumPoints > 0) |
8 | 231 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
232 this.numPointMin.Value = currentCategory.MinimumPoints; |
8 | 233 this.cbPointMin.Checked = true; |
234 this.numPointMin.Enabled = true; | |
235 } | |
236 else | |
237 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
238 this.cbPointMin.Checked = false; |
8 | 239 this.numPointMin.Enabled = false; |
240 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
241 if (currentCategory.MaximumPoints > 0 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
242 && currentCategory.MaximumPoints < this.numPercentMax.Maximum) |
8 | 243 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
244 this.numPointMax.Value = currentCategory.MaximumPoints; |
8 | 245 this.cbPointMax.Checked = true; |
246 this.numPointMax.Enabled = true; | |
247 } | |
248 else | |
249 { | |
250 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
|
251 this.cbPointMax.Checked = false; |
8 | 252 this.numPointMax.Enabled = false; |
253 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
254 if (currentCategory.MinimumPercentage > 0) |
8 | 255 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
256 this.numPercentMin.Value = currentCategory.MinimumPercentage; |
8 | 257 this.cbPercentMin.Checked = true; |
258 this.numPercentMin.Enabled = true; | |
259 } | |
260 else | |
261 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
262 this.cbPercentMin.Checked = false; |
8 | 263 this.numPercentMin.Enabled = false; |
264 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
265 if (currentCategory.MaximumPercentage < 100) |
8 | 266 { |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
267 this.numPercentMax.Value = currentCategory.MaximumPercentage; |
8 | 268 this.cbPercentMax.Checked = true; |
269 this.numPercentMax.Enabled = true; | |
270 } | |
271 else | |
272 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
273 this.cbPercentMax.Checked = false; |
8 | 274 this.numPercentMax.Enabled = false; |
275 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
276 this.btnCategoryRemove.Enabled = true; |
8 | 277 this.btnCategoryApply.Enabled = false; |
278 break; | |
279 } | |
280 } | |
10 | 281 if(this.listCategories.SelectedIndex == 0) |
282 { | |
283 this.btnCategoryUp.Enabled = false; | |
284 } | |
285 else | |
286 { | |
287 this.btnCategoryUp.Enabled = true; | |
288 } | |
289 if (this.listCategories.SelectedIndex == this.listCategories.Items.Count - 1) | |
290 { | |
291 this.btnCategoryDown.Enabled = false; | |
292 } | |
293 else | |
294 { | |
295 this.btnCategoryDown.Enabled = true; | |
296 } | |
8 | 297 } |
298 | |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
299 private void btnCategoryAdd_Click(object sender, EventArgs e) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
300 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
301 if(this.txtCategoryName.Text == string.Empty) |
0 | 302 { |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
303 MessageBox.Show("Category must have a name", "Category Error"); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
304 return; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
305 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
306 if (this.txtCategoryID.Text == string.Empty) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
307 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
308 MessageBox.Show("Category must have an ID", "Category Error"); |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
309 return; |
0 | 310 } |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
311 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
|
312 this.txtCategoryID.Text, |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
313 this.txtCategoryName.Text |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
314 ); |
0 | 315 |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
316 cat.MinimumPoints = (int)this.numPointMin.Value; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
317 cat.MaximumPoints = (int)this.numPointMax.Value; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
318 cat.MinimumPercentage = (int)this.numPercentMin.Value; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
319 cat.MaximumPercentage = (int)this.numPercentMax.Value; |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
320 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
321 system.AddCategory(cat); |
8 | 322 updateCategoryList(); |
323 clearCategory(); | |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
324 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
325 |
8 | 326 private void btnCategoryRemove_Click(object sender, EventArgs e) |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
327 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
328 foreach(IBBoard.WarFoundry.API.Objects.Category cat in system.Categories) |
0 | 329 { |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
330 if(cat.Name == this.listCategories.SelectedItem) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
331 { |
8 | 332 system.RemoveCategory(cat.ID); |
333 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
|
334 this.btnCategoryRemove.Enabled = false; |
8 | 335 break; |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
336 } |
0 | 337 } |
8 | 338 updateCategoryList(); |
339 } | |
340 | |
10 | 341 private void btnCategoryUp_Click(object sender, EventArgs e) |
342 { | |
343 int index = this.listCategories.SelectedIndex; | |
344 IBBoard.WarFoundry.API.Objects.Category[] catList = new IBBoard.WarFoundry.API.Objects.Category[this.listCategories.Items.Count]; | |
345 | |
346 for(int i = 0; i < system.Categories.Length; i++) | |
347 { | |
348 catList[i] = system.Categories[i]; | |
349 } | |
350 foreach(IBBoard.WarFoundry.API.Objects.Category cat in system.Categories) | |
351 { | |
352 system.RemoveCategory(cat.ID); | |
353 } | |
354 | |
355 IBBoard.WarFoundry.API.Objects.Category temp = catList[index]; | |
356 catList[index] = catList[index - 1]; | |
357 catList[index - 1] = temp; | |
358 | |
359 for(int i = catList.Length - 1; i >= 0; i--) | |
360 { | |
361 system.AddCategory(catList[i]); | |
362 } | |
363 | |
364 updateCategoryList(); | |
365 this.listCategories.SelectedIndex = index - 1; | |
366 } | |
367 | |
368 private void btnCategoryDown_Click(object sender, EventArgs e) | |
369 { | |
370 int index = this.listCategories.SelectedIndex; | |
371 IBBoard.WarFoundry.API.Objects.Category[] catList = new IBBoard.WarFoundry.API.Objects.Category[this.listCategories.Items.Count]; | |
372 | |
373 for (int i = 0; i < system.Categories.Length; i++) | |
374 { | |
375 catList[i] = system.Categories[i]; | |
376 } | |
377 foreach (IBBoard.WarFoundry.API.Objects.Category cat in system.Categories) | |
378 { | |
379 system.RemoveCategory(cat.ID); | |
380 } | |
381 | |
382 IBBoard.WarFoundry.API.Objects.Category temp = catList[index]; | |
383 catList[index] = catList[index + 1]; | |
384 catList[index + 1] = temp; | |
385 | |
386 for (int i = catList.Length - 1; i >= 0; i--) | |
387 { | |
388 system.AddCategory(catList[i]); | |
389 } | |
390 | |
391 updateCategoryList(); | |
392 this.listCategories.SelectedIndex = index + 1; | |
393 } | |
394 | |
8 | 395 private void txtCategoryName_TextChanged(object sender, EventArgs e) |
396 { | |
397 if (this.UpdateCategory) | |
398 { | |
399 this.btnCategoryApply.Enabled = true; | |
400 } | |
401 else | |
402 { | |
403 this.btnCategoryApply.Enabled = false; | |
404 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
405 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
|
406 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
407 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
|
408 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
409 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
410 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
411 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
|
412 } |
8 | 413 } |
414 | |
415 private void txtCategoryID_TextChanged(object sender, EventArgs e) | |
416 { | |
417 if (this.UpdateCategory) | |
418 { | |
419 this.btnCategoryApply.Enabled = true; | |
420 } | |
421 else | |
422 { | |
423 this.btnCategoryApply.Enabled = false; | |
424 } | |
6
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
425 } |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
426 |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
427 private void btnGenerateCatID_Click(object sender, EventArgs e) |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
428 { |
d63df495cf5a
Implemented initial support for adding and editing categories.
Tsudico
parents:
4
diff
changeset
|
429 this.txtCategoryID.Text = generateID(this.txtCategoryName.Text); |
0 | 430 } |
8 | 431 |
432 private void cbPointMin_CheckedChanged(object sender, EventArgs e) | |
433 { | |
434 if(this.cbPointMin.Checked) | |
435 { | |
436 this.numPointMin.Enabled = true; | |
437 } | |
438 else | |
439 { | |
440 this.numPointMin.Enabled = false; | |
441 } | |
442 if(this.UpdateCategory) | |
443 { | |
444 this.btnCategoryApply.Enabled = true; | |
445 } | |
446 else | |
447 { | |
448 this.btnCategoryApply.Enabled = false; | |
449 } | |
450 } | |
451 | |
452 private void cbPointMax_CheckedChanged(object sender, EventArgs e) | |
453 { | |
454 if (this.cbPointMax.Checked) | |
455 { | |
456 this.numPointMax.Enabled = true; | |
457 } | |
458 else | |
459 { | |
460 this.numPointMax.Enabled = false; | |
461 } | |
462 if (this.UpdateCategory) | |
463 { | |
464 this.btnCategoryApply.Enabled = true; | |
465 } | |
466 else | |
467 { | |
468 this.btnCategoryApply.Enabled = false; | |
469 } | |
470 } | |
471 | |
472 private void cbPercentMin_CheckedChanged(object sender, EventArgs e) | |
473 { | |
474 if (this.cbPercentMin.Checked) | |
475 { | |
476 this.numPercentMin.Enabled = true; | |
477 } | |
478 else | |
479 { | |
480 this.numPercentMin.Enabled = false; | |
481 } | |
482 if (this.UpdateCategory) | |
483 { | |
484 this.btnCategoryApply.Enabled = true; | |
485 } | |
486 else | |
487 { | |
488 this.btnCategoryApply.Enabled = false; | |
489 } | |
490 } | |
491 | |
492 private void cbPercentMax_CheckedChanged(object sender, EventArgs e) | |
493 { | |
494 if (this.cbPercentMax.Checked) | |
495 { | |
496 this.numPercentMax.Enabled = true; | |
497 } | |
498 else | |
499 { | |
500 this.numPercentMax.Enabled = false; | |
501 } | |
502 if (this.UpdateCategory) | |
503 { | |
504 this.btnCategoryApply.Enabled = true; | |
505 } | |
506 else | |
507 { | |
508 this.btnCategoryApply.Enabled = false; | |
509 } | |
510 } | |
511 | |
512 private void numPointMin_ValueChanged(object sender, EventArgs e) | |
513 { | |
514 if (this.UpdateCategory) | |
515 { | |
516 this.btnCategoryApply.Enabled = true; | |
517 } | |
518 else | |
519 { | |
520 this.btnCategoryApply.Enabled = false; | |
521 } | |
522 } | |
523 | |
524 private void numPointMax_ValueChanged(object sender, EventArgs e) | |
525 { | |
526 if (this.UpdateCategory) | |
527 { | |
528 this.btnCategoryApply.Enabled = true; | |
529 } | |
530 else | |
531 { | |
532 this.btnCategoryApply.Enabled = false; | |
533 } | |
534 } | |
535 | |
536 private void numPercentMin_ValueChanged(object sender, EventArgs e) | |
537 { | |
538 if (this.UpdateCategory) | |
539 { | |
540 this.btnCategoryApply.Enabled = true; | |
541 } | |
542 else | |
543 { | |
544 this.btnCategoryApply.Enabled = false; | |
545 } | |
546 } | |
547 | |
548 private void numPercentMax_ValueChanged(object sender, EventArgs e) | |
549 { | |
550 if (this.UpdateCategory) | |
551 { | |
552 this.btnCategoryApply.Enabled = true; | |
553 } | |
554 else | |
555 { | |
556 this.btnCategoryApply.Enabled = false; | |
557 } | |
558 } | |
13 | 559 |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
560 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
|
561 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
562 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
|
563 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
|
564 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
|
565 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
566 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
|
567 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
568 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
569 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
570 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
|
571 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
572 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
|
573 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
574 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
|
575 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
576 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
577 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
578 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
|
579 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
580 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
|
581 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
582 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
|
583 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
584 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
585 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
586 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
|
587 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
588 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
|
589 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
590 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
|
591 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
592 else |
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 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
|
595 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
596 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
|
597 updateCategoryList(); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
598 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
|
599 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
600 |
13 | 601 void lviewStats_SelectedIndexChanged(object sender, System.EventArgs e) |
602 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
603 currentStats = null; |
13 | 604 foreach(IBBoard.WarFoundry.API.Objects.SystemStats stat in system.SystemStats) |
605 { | |
606 ListView.SelectedListViewItemCollection items = this.lviewStats.SelectedItems; | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
607 if(items.Count > 0) |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
608 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
609 this.btnStatsRemove.Enabled = true; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
610 } |
13 | 611 foreach(ListViewItem item in items) |
612 { | |
613 if(stat.ID == item.Text) | |
614 { | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
615 currentStats = stat; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
616 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
|
617 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
618 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
|
619 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
620 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
621 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
622 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
|
623 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
624 this.txtStatLineID.Text = currentStats.ID; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
625 updateStatNames(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
626 updateStatLinePreview(currentStats); |
13 | 627 } |
628 } | |
629 } | |
630 } | |
631 | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
632 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
|
633 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
634 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
|
635 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
|
636 updateSystemStatsList(); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
637 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
638 |
13 | 639 private void btnStatsDefault_Click(object sender, EventArgs e) |
640 { | |
641 system.StandardSystemStatsID = this.lviewStats.SelectedItems[0].Text; | |
642 updateSystemStatsList(); | |
643 } | |
14
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
644 |
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 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
|
646 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
647 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
|
648 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
649 this.btnStatsAdd.Enabled = true; |
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 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
652 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
653 this.btnStatsAdd.Enabled = false; |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
654 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
655 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
656 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
657 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
|
658 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
659 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
|
660 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
661 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
|
662 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
663 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
664 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
665 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
|
666 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
667 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
668 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
669 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
|
670 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
671 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
|
672 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
673 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
|
674 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
675 updateStatNames(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
676 updateStatLinePreview(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
677 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
678 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
679 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
|
680 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
681 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
|
682 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
683 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
|
684 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
|
685 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
686 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
|
687 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
688 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
689 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
690 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
|
691 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
692 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
|
693 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
694 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
|
695 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
696 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
697 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
698 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
|
699 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
700 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
701 else |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
702 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
703 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
|
704 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
|
705 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
|
706 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
707 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
708 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
709 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
|
710 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
711 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
|
712 updateStatNames(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
713 updateStatLinePreview(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
714 } |
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 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
|
717 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
718 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
|
719 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
|
720 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
721 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
|
722 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
723 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
|
724 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
725 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
|
726 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
727 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
|
728 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
729 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
730 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
|
731 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
|
732 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
|
733 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
734 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
|
735 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
736 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
|
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 updateStatNames(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
740 updateStatLinePreview(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
741 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
|
742 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
743 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
744 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
|
745 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
746 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
|
747 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
|
748 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
749 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
|
750 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
751 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
|
752 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
753 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
|
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.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
|
756 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
757 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
758 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
|
759 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
|
760 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
|
761 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
762 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
|
763 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
764 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
|
765 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
766 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
767 updateStatNames(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
768 updateStatLinePreview(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
769 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
|
770 } |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
771 |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
772 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
|
773 { |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
774 system.SetSystemStats(currentStats); |
26f7f6d2b4f8
Implement most of the buttons on the stats tab and adjust button enabling on category tab.
Tsudico
parents:
13
diff
changeset
|
775 } |
0 | 776 } |
777 } |