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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
1 using System;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
2 using System.Collections.Generic;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
3 using System.ComponentModel;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
4 using System.Data;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
5 using System.Drawing;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
6 using System.Text;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
7 using System.Text.RegularExpressions;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
8 using System.Windows.Forms;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
9 using IBBoard.Lang;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
10 using IBBoard.Windows.Forms;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
11 using IBBoard.Windows.Forms.I18N;
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
12
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
13 namespace IBBoard.WarFoundry.Forge.WinForms
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
14 {
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
15 public partial class FrmSystem : IBBoard.Windows.Forms.IBBForm
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
21 private bool UpdateCategory
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
22 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
23 get
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
72 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
73 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
74 return false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
75 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
76 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
77
4
866d0093bb11 WarFoundryLoader.GetDefault().LoadFile returning null object.
Tsudico
parents: 0
diff changeset
78 public FrmSystem(IBBoard.WarFoundry.API.Objects.GameSystem loadSystem)
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
79 {
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
84 this.numDefaultSize.Value = system.SystemArmyDefaultSize;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
102 updateCategoryList();
13
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
103 updateSystemStatsList();
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
123
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
124 private void clearCategory()
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
125 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
126 this.txtCategoryName.Text = string.Empty;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
127 this.txtCategoryID.Text = string.Empty;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
128 this.cbPointMin.Checked = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
129 this.cbPointMax.Checked = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
130 this.cbPercentMin.Checked = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
131 this.cbPercentMax.Checked = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
132 this.numPointMin.Value = 0;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
133 this.numPointMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
134 this.numPointMax.Value = this.numDefaultSize.Value;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
135 this.numPointMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
136 this.numPercentMin.Value = 0;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
137 this.numPercentMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
138 this.numPercentMax.Value = 100;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
141 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
142
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
143 private void updateCategoryList()
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
144 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
145 if (system.Categories.Length > 0)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
146 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
147 this.listCategories.Items.Clear();
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
148 for (int i = 0; i < system.Categories.Length; i++)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
149 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
150 this.listCategories.Items.Add(system.Categories[i].Name);
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
151 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
157 }
13
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
158
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
159 private void updateSystemStatsList()
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
160 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
161 this.lviewStats.Items.Clear();
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
162 if (system.SystemStats.Length > 0)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
163 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
164 for(int i = 0; i < system.SystemStats.Length; i++)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
165 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
166 ListViewItem item = new ListViewItem();
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
167 item.Text = system.SystemStats[i].ID;
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
168 if(system.SystemStats[i].Equals(system.StandardSystemStats))
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
169 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
170 item.SubItems.Add('\u2713'+"");
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
171 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
172 this.lviewStats.Items.Add(item);
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
173 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
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
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
177 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
178
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
179 private void updateStatLinePreview(IBBoard.WarFoundry.API.Objects.SystemStats stats)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
180 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
181 if(stats.SlotCount > 0)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
182 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
183 this.lviewStatPreview.Items.Clear();
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
184 this.lviewStatPreview.Columns.Clear();
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
185 for(int i = 0; i < stats.SlotCount; i++)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
186 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
187 System.Windows.Forms.ColumnHeader column = new ColumnHeader();
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
188 column.Name = generateID(stats.StatSlots[i].Name);
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
189 column.Text = stats.StatSlots[i].Name;
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
190 column.TextAlign = HorizontalAlignment.Center;
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
191 this.lviewStatPreview.Columns.Add(column);
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
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
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
194 this.lviewStatPreview.Items.Add(" ");
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
195 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
196 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
197
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
198 private void updateStatNames(IBBoard.WarFoundry.API.Objects.SystemStats stats)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
199 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
200 if (stats.SlotCount > 0)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
201 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
202 this.listStatNames.Items.Clear();
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
203 for (int i = 0; i < stats.SlotCount; i++)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
204 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
205 this.listStatNames.Items.Add(stats.StatSlots[i].Name);
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
206 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
207 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
208 }
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
209
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
210 private void btnSystemClose_Click(object sender, EventArgs e)
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
211 {
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
212 this.Close();
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
213 }
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
214
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
215 private void btnGenerateSysId_Click(object sender, EventArgs e)
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
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
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
219
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
220 private void listCategories_SelectedIndexChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
223 foreach (IBBoard.WarFoundry.API.Objects.Category cat in system.Categories)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
224 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
225 if (cat.Name == this.listCategories.SelectedItem)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
233 this.cbPointMin.Checked = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
234 this.numPointMin.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
235 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
236 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
239 this.numPointMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
245 this.cbPointMax.Checked = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
246 this.numPointMax.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
247 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
248 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
249 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
252 this.numPointMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
257 this.cbPercentMin.Checked = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
258 this.numPercentMin.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
259 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
260 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
263 this.numPercentMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
268 this.cbPercentMax.Checked = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
269 this.numPercentMax.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
270 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
271 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
274 this.numPercentMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
277 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
278 break;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
279 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
280 }
10
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
281 if(this.listCategories.SelectedIndex == 0)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
282 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
283 this.btnCategoryUp.Enabled = false;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
284 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
285 else
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
286 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
287 this.btnCategoryUp.Enabled = true;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
288 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
289 if (this.listCategories.SelectedIndex == this.listCategories.Items.Count - 1)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
290 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
291 this.btnCategoryDown.Enabled = false;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
292 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
293 else
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
294 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
295 this.btnCategoryDown.Enabled = true;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
296 }
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
297 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
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
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
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
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
322 updateCategoryList();
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
332 system.RemoveCategory(cat.ID);
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
335 break;
6
d63df495cf5a Implemented initial support for adding and editing categories.
Tsudico
parents: 4
diff changeset
336 }
0
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
337 }
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
338 updateCategoryList();
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
339 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
340
10
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
341 private void btnCategoryUp_Click(object sender, EventArgs e)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
342 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
343 int index = this.listCategories.SelectedIndex;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
344 IBBoard.WarFoundry.API.Objects.Category[] catList = new IBBoard.WarFoundry.API.Objects.Category[this.listCategories.Items.Count];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
345
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
346 for(int i = 0; i < system.Categories.Length; i++)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
347 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
348 catList[i] = system.Categories[i];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
349 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
350 foreach(IBBoard.WarFoundry.API.Objects.Category cat in system.Categories)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
351 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
352 system.RemoveCategory(cat.ID);
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
353 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
354
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
355 IBBoard.WarFoundry.API.Objects.Category temp = catList[index];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
356 catList[index] = catList[index - 1];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
357 catList[index - 1] = temp;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
358
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
359 for(int i = catList.Length - 1; i >= 0; i--)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
360 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
361 system.AddCategory(catList[i]);
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
362 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
363
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
364 updateCategoryList();
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
365 this.listCategories.SelectedIndex = index - 1;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
366 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
367
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
368 private void btnCategoryDown_Click(object sender, EventArgs e)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
369 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
370 int index = this.listCategories.SelectedIndex;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
371 IBBoard.WarFoundry.API.Objects.Category[] catList = new IBBoard.WarFoundry.API.Objects.Category[this.listCategories.Items.Count];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
372
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
373 for (int i = 0; i < system.Categories.Length; i++)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
374 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
375 catList[i] = system.Categories[i];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
376 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
377 foreach (IBBoard.WarFoundry.API.Objects.Category cat in system.Categories)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
378 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
379 system.RemoveCategory(cat.ID);
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
380 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
381
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
382 IBBoard.WarFoundry.API.Objects.Category temp = catList[index];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
383 catList[index] = catList[index + 1];
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
384 catList[index + 1] = temp;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
385
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
386 for (int i = catList.Length - 1; i >= 0; i--)
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
387 {
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
388 system.AddCategory(catList[i]);
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
389 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
390
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
391 updateCategoryList();
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
392 this.listCategories.SelectedIndex = index + 1;
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
393 }
43d88f50c712 Continued work on Category Tab
Tsudico
parents: 8
diff changeset
394
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
395 private void txtCategoryName_TextChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
396 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
397 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
398 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
399 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
400 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
401 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
402 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
403 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
413 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
414
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
415 private void txtCategoryID_TextChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
416 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
417 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
418 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
419 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
420 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
421 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
422 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
423 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
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
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
430 }
8
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
431
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
432 private void cbPointMin_CheckedChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
433 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
434 if(this.cbPointMin.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
435 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
436 this.numPointMin.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
437 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
438 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
439 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
440 this.numPointMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
441 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
442 if(this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
443 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
444 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
445 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
446 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
447 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
448 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
449 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
450 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
451
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
452 private void cbPointMax_CheckedChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
453 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
454 if (this.cbPointMax.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
455 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
456 this.numPointMax.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
457 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
458 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
459 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
460 this.numPointMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
461 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
462 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
463 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
464 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
465 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
466 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
467 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
468 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
469 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
470 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
471
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
472 private void cbPercentMin_CheckedChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
473 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
474 if (this.cbPercentMin.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
475 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
476 this.numPercentMin.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
477 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
478 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
479 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
480 this.numPercentMin.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
481 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
482 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
483 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
484 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
485 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
486 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
487 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
488 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
489 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
490 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
491
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
492 private void cbPercentMax_CheckedChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
493 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
494 if (this.cbPercentMax.Checked)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
495 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
496 this.numPercentMax.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
497 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
498 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
499 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
500 this.numPercentMax.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
501 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
502 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
503 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
504 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
505 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
506 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
507 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
508 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
509 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
510 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
511
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
512 private void numPointMin_ValueChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
513 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
514 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
515 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
516 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
517 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
518 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
519 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
520 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
521 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
522 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
523
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
524 private void numPointMax_ValueChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
525 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
526 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
527 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
528 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
529 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
530 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
531 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
532 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
533 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
534 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
535
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
536 private void numPercentMin_ValueChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
537 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
538 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
539 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
540 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
541 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
542 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
543 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
544 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
545 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
546 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
547
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
548 private void numPercentMax_ValueChanged(object sender, EventArgs e)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
549 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
550 if (this.UpdateCategory)
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
551 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
552 this.btnCategoryApply.Enabled = true;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
553 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
554 else
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
555 {
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
556 this.btnCategoryApply.Enabled = false;
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
557 }
0dadaa315430 Category Tab Updates:
Tsudico
parents: 6
diff changeset
558 }
13
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
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
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
601 void lviewStats_SelectedIndexChanged(object sender, System.EventArgs e)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
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
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
604 foreach(IBBoard.WarFoundry.API.Objects.SystemStats stat in system.SystemStats)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
605 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
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
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
611 foreach(ListViewItem item in items)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
612 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
613 if(stat.ID == item.Text)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
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
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
627 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
628 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
629 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
630 }
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
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
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
639 private void btnStatsDefault_Click(object sender, EventArgs e)
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
640 {
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
641 system.StandardSystemStatsID = this.lviewStats.SelectedItems[0].Text;
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
642 updateSystemStatsList();
372f921c20fc Mock up of the stat line tab
Tsudico
parents: 10
diff changeset
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
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
776 }
91b5550eff31 Initial Commit.
Tsudico
parents:
diff changeset
777 }