# HG changeset patch
# User Tsudico
# Date 1292700018 21600
# Node ID 372f921c20fcd182b61ae1f0edca0c242810b53d
# Parent 6284c091b13250595773e7f00e84e02006af6bba
Mock up of the stat line tab
Select a stat line to view
Make Default changes default stat line
diff -r 6284c091b132 -r 372f921c20fc FrmSystem.Designer.cs
--- a/FrmSystem.Designer.cs Fri Dec 17 22:14:43 2010 -0600
+++ b/FrmSystem.Designer.cs Sat Dec 18 13:20:18 2010 -0600
@@ -71,10 +71,24 @@
this.btnCategoryRemove = new System.Windows.Forms.Button();
this.btnCategoryApply = new System.Windows.Forms.Button();
this.tabStats = new System.Windows.Forms.TabPage();
+ this.btnMoveStatDown = new System.Windows.Forms.Button();
+ this.btnMoveStatUp = new System.Windows.Forms.Button();
+ this.btnRemoveStat = new System.Windows.Forms.Button();
+ this.btnAddStat = new System.Windows.Forms.Button();
+ this.gbStats = new System.Windows.Forms.GroupBox();
+ this.listStatNames = new System.Windows.Forms.ListBox();
+ this.txtStatName = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtStatLineID = new System.Windows.Forms.TextBox();
+ this.lblStatLineID = new System.Windows.Forms.Label();
+ this.lviewStatPreview = new System.Windows.Forms.ListView();
+ this.btnStatLineApply = new System.Windows.Forms.Button();
+ this.lblStatLinePreview = new System.Windows.Forms.Label();
this.btnStatsDefault = new System.Windows.Forms.Button();
- this.lvStats = new System.Windows.Forms.ListView();
+ this.lviewStats = new System.Windows.Forms.ListView();
+ this.chStatsID = new System.Windows.Forms.ColumnHeader();
+ this.chStatsDefault = new System.Windows.Forms.ColumnHeader();
this.btnStatsRemove = new System.Windows.Forms.Button();
- this.btnStatsEdit = new System.Windows.Forms.Button();
this.btnStatsAdd = new System.Windows.Forms.Button();
this.tabSystem.SuspendLayout();
this.tabInfo.SuspendLayout();
@@ -88,6 +102,7 @@
((System.ComponentModel.ISupportInitialize)(this.numPointMax)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numPointMin)).BeginInit();
this.tabStats.SuspendLayout();
+ this.gbStats.SuspendLayout();
this.SuspendLayout();
//
// btnSystemSave
@@ -573,10 +588,21 @@
//
// tabStats
//
+ this.tabStats.Controls.Add(this.btnMoveStatDown);
+ this.tabStats.Controls.Add(this.btnMoveStatUp);
+ this.tabStats.Controls.Add(this.btnRemoveStat);
+ this.tabStats.Controls.Add(this.btnAddStat);
+ this.tabStats.Controls.Add(this.gbStats);
+ this.tabStats.Controls.Add(this.txtStatName);
+ this.tabStats.Controls.Add(this.label1);
+ this.tabStats.Controls.Add(this.txtStatLineID);
+ this.tabStats.Controls.Add(this.lblStatLineID);
+ this.tabStats.Controls.Add(this.lviewStatPreview);
+ this.tabStats.Controls.Add(this.btnStatLineApply);
+ this.tabStats.Controls.Add(this.lblStatLinePreview);
this.tabStats.Controls.Add(this.btnStatsDefault);
- this.tabStats.Controls.Add(this.lvStats);
+ this.tabStats.Controls.Add(this.lviewStats);
this.tabStats.Controls.Add(this.btnStatsRemove);
- this.tabStats.Controls.Add(this.btnStatsEdit);
this.tabStats.Controls.Add(this.btnStatsAdd);
this.tabStats.Location = new System.Drawing.Point(4, 22);
this.tabStats.Name = "tabStats";
@@ -586,41 +612,175 @@
this.tabStats.Text = "Stat Lines";
this.tabStats.UseVisualStyleBackColor = true;
//
+ // btnMoveStatDown
+ //
+ this.btnMoveStatDown.Enabled = false;
+ this.btnMoveStatDown.Location = new System.Drawing.Point(500, 205);
+ this.btnMoveStatDown.Name = "btnMoveStatDown";
+ this.btnMoveStatDown.Size = new System.Drawing.Size(76, 23);
+ this.btnMoveStatDown.TabIndex = 25;
+ this.btnMoveStatDown.Text = "Down";
+ this.btnMoveStatDown.UseVisualStyleBackColor = true;
+ //
+ // btnMoveStatUp
+ //
+ this.btnMoveStatUp.Enabled = false;
+ this.btnMoveStatUp.Location = new System.Drawing.Point(500, 176);
+ this.btnMoveStatUp.Name = "btnMoveStatUp";
+ this.btnMoveStatUp.Size = new System.Drawing.Size(76, 23);
+ this.btnMoveStatUp.TabIndex = 24;
+ this.btnMoveStatUp.Text = "Up";
+ this.btnMoveStatUp.UseVisualStyleBackColor = true;
+ //
+ // btnRemoveStat
+ //
+ this.btnRemoveStat.Enabled = false;
+ this.btnRemoveStat.Location = new System.Drawing.Point(500, 147);
+ this.btnRemoveStat.Name = "btnRemoveStat";
+ this.btnRemoveStat.Size = new System.Drawing.Size(76, 23);
+ this.btnRemoveStat.TabIndex = 23;
+ this.btnRemoveStat.Text = "Remove";
+ this.btnRemoveStat.UseVisualStyleBackColor = true;
+ //
+ // btnAddStat
+ //
+ this.btnAddStat.Enabled = false;
+ this.btnAddStat.Location = new System.Drawing.Point(500, 118);
+ this.btnAddStat.Name = "btnAddStat";
+ this.btnAddStat.Size = new System.Drawing.Size(76, 23);
+ this.btnAddStat.TabIndex = 22;
+ this.btnAddStat.Text = "Add";
+ this.btnAddStat.UseVisualStyleBackColor = true;
+ //
+ // gbStats
+ //
+ this.gbStats.Controls.Add(this.listStatNames);
+ this.gbStats.Location = new System.Drawing.Point(290, 146);
+ this.gbStats.Name = "gbStats";
+ this.gbStats.Size = new System.Drawing.Size(204, 103);
+ this.gbStats.TabIndex = 21;
+ this.gbStats.TabStop = false;
+ this.gbStats.Text = "Stat List";
+ //
+ // listStatNames
+ //
+ this.listStatNames.FormattingEnabled = true;
+ this.listStatNames.Location = new System.Drawing.Point(7, 20);
+ this.listStatNames.Name = "listStatNames";
+ this.listStatNames.Size = new System.Drawing.Size(191, 69);
+ this.listStatNames.TabIndex = 0;
+ //
+ // txtStatName
+ //
+ this.txtStatName.Location = new System.Drawing.Point(368, 120);
+ this.txtStatName.Name = "txtStatName";
+ this.txtStatName.Size = new System.Drawing.Size(126, 20);
+ this.txtStatName.TabIndex = 20;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(290, 123);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(60, 13);
+ this.label1.TabIndex = 19;
+ this.label1.Text = "Stat Name:";
+ //
+ // txtStatLineID
+ //
+ this.txtStatLineID.Location = new System.Drawing.Point(368, 93);
+ this.txtStatLineID.Name = "txtStatLineID";
+ this.txtStatLineID.Size = new System.Drawing.Size(126, 20);
+ this.txtStatLineID.TabIndex = 18;
+ //
+ // lblStatLineID
+ //
+ this.lblStatLineID.AutoSize = true;
+ this.lblStatLineID.Location = new System.Drawing.Point(290, 96);
+ this.lblStatLineID.Name = "lblStatLineID";
+ this.lblStatLineID.Size = new System.Drawing.Size(66, 13);
+ this.lblStatLineID.TabIndex = 17;
+ this.lblStatLineID.Text = "Stat Line ID:";
+ //
+ // lviewStatPreview
+ //
+ this.lviewStatPreview.GridLines = true;
+ this.lviewStatPreview.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
+ this.lviewStatPreview.Location = new System.Drawing.Point(290, 27);
+ this.lviewStatPreview.MultiSelect = false;
+ this.lviewStatPreview.Name = "lviewStatPreview";
+ this.lviewStatPreview.Size = new System.Drawing.Size(286, 60);
+ this.lviewStatPreview.TabIndex = 16;
+ this.lviewStatPreview.UseCompatibleStateImageBehavior = false;
+ this.lviewStatPreview.View = System.Windows.Forms.View.Details;
+ //
+ // btnStatLineApply
+ //
+ this.btnStatLineApply.Enabled = false;
+ this.btnStatLineApply.Location = new System.Drawing.Point(500, 255);
+ this.btnStatLineApply.Name = "btnStatLineApply";
+ this.btnStatLineApply.Size = new System.Drawing.Size(76, 23);
+ this.btnStatLineApply.TabIndex = 15;
+ this.btnStatLineApply.Text = "Apply";
+ this.btnStatLineApply.UseVisualStyleBackColor = true;
+ //
+ // lblStatLinePreview
+ //
+ this.lblStatLinePreview.AutoSize = true;
+ this.lblStatLinePreview.Location = new System.Drawing.Point(290, 11);
+ this.lblStatLinePreview.Name = "lblStatLinePreview";
+ this.lblStatLinePreview.Size = new System.Drawing.Size(93, 13);
+ this.lblStatLinePreview.TabIndex = 12;
+ this.lblStatLinePreview.Text = "Stat Line Preview:";
+ //
// btnStatsDefault
//
- this.btnStatsDefault.Location = new System.Drawing.Point(203, 122);
+ this.btnStatsDefault.Location = new System.Drawing.Point(203, 64);
this.btnStatsDefault.Name = "btnStatsDefault";
this.btnStatsDefault.Size = new System.Drawing.Size(81, 23);
this.btnStatsDefault.TabIndex = 11;
this.btnStatsDefault.Text = "Make Default";
this.btnStatsDefault.UseVisualStyleBackColor = true;
+ this.btnStatsDefault.Click += new System.EventHandler(this.btnStatsDefault_Click);
//
- // lvStats
+ // lviewStats
//
- this.lvStats.Location = new System.Drawing.Point(6, 6);
- this.lvStats.Name = "lvStats";
- this.lvStats.Size = new System.Drawing.Size(188, 204);
- this.lvStats.TabIndex = 10;
- this.lvStats.UseCompatibleStateImageBehavior = false;
+ this.lviewStats.AutoArrange = false;
+ this.lviewStats.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.chStatsID,
+ this.chStatsDefault});
+ this.lviewStats.FullRowSelect = true;
+ this.lviewStats.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
+ this.lviewStats.HideSelection = false;
+ this.lviewStats.Location = new System.Drawing.Point(6, 6);
+ this.lviewStats.MultiSelect = false;
+ this.lviewStats.Name = "lviewStats";
+ this.lviewStats.Size = new System.Drawing.Size(188, 272);
+ this.lviewStats.TabIndex = 10;
+ this.lviewStats.UseCompatibleStateImageBehavior = false;
+ this.lviewStats.View = System.Windows.Forms.View.Details;
+ this.lviewStats.SelectedIndexChanged += new System.EventHandler(this.lviewStats_SelectedIndexChanged);
+ //
+ // chStatsID
+ //
+ this.chStatsID.Text = "ID";
+ this.chStatsID.Width = 134;
+ //
+ // chStatsDefault
+ //
+ this.chStatsDefault.Text = "Default";
+ this.chStatsDefault.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+ this.chStatsDefault.Width = 50;
//
// btnStatsRemove
//
- this.btnStatsRemove.Location = new System.Drawing.Point(203, 64);
+ this.btnStatsRemove.Location = new System.Drawing.Point(203, 35);
this.btnStatsRemove.Name = "btnStatsRemove";
this.btnStatsRemove.Size = new System.Drawing.Size(81, 23);
this.btnStatsRemove.TabIndex = 9;
this.btnStatsRemove.Text = "Remove";
this.btnStatsRemove.UseVisualStyleBackColor = true;
//
- // btnStatsEdit
- //
- this.btnStatsEdit.Location = new System.Drawing.Point(203, 35);
- this.btnStatsEdit.Name = "btnStatsEdit";
- this.btnStatsEdit.Size = new System.Drawing.Size(81, 23);
- this.btnStatsEdit.TabIndex = 8;
- this.btnStatsEdit.Text = "Edit";
- this.btnStatsEdit.UseVisualStyleBackColor = true;
- //
// btnStatsAdd
//
this.btnStatsAdd.Location = new System.Drawing.Point(203, 6);
@@ -655,6 +815,8 @@
((System.ComponentModel.ISupportInitialize)(this.numPointMax)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numPointMin)).EndInit();
this.tabStats.ResumeLayout(false);
+ this.tabStats.PerformLayout();
+ this.gbStats.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -687,9 +849,8 @@
private System.Windows.Forms.Button btnCategoryApply;
private System.Windows.Forms.TabPage tabStats;
private System.Windows.Forms.Button btnStatsDefault;
- private System.Windows.Forms.ListView lvStats;
+ private System.Windows.Forms.ListView lviewStats;
private System.Windows.Forms.Button btnStatsRemove;
- private System.Windows.Forms.Button btnStatsEdit;
private System.Windows.Forms.Button btnStatsAdd;
private System.Windows.Forms.NumericUpDown numDefaultSize;
private System.Windows.Forms.Label lblDefaultSize;
@@ -709,6 +870,21 @@
private System.Windows.Forms.CheckBox cbPercentMin;
private System.Windows.Forms.NumericUpDown numPercentMin;
private System.Windows.Forms.Label lblPercentLimit;
+ private System.Windows.Forms.ColumnHeader chStatsID;
+ private System.Windows.Forms.ColumnHeader chStatsDefault;
+ private System.Windows.Forms.Label lblStatLinePreview;
+ private System.Windows.Forms.ListView lviewStatPreview;
+ private System.Windows.Forms.Button btnStatLineApply;
+ private System.Windows.Forms.TextBox txtStatName;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtStatLineID;
+ private System.Windows.Forms.Label lblStatLineID;
+ private System.Windows.Forms.Button btnRemoveStat;
+ private System.Windows.Forms.Button btnAddStat;
+ private System.Windows.Forms.GroupBox gbStats;
+ private System.Windows.Forms.Button btnMoveStatDown;
+ private System.Windows.Forms.Button btnMoveStatUp;
+ private System.Windows.Forms.ListBox listStatNames;
}
}
diff -r 6284c091b132 -r 372f921c20fc FrmSystem.cs
--- a/FrmSystem.cs Fri Dec 17 22:14:43 2010 -0600
+++ b/FrmSystem.cs Sat Dec 18 13:20:18 2010 -0600
@@ -98,6 +98,7 @@
this.radSystemWarnNo.Checked = true;
}
updateCategoryList();
+ updateSystemStatsList();
}
private string generateID(string name)
@@ -147,6 +148,58 @@
}
}
}
+
+ private void updateSystemStatsList()
+ {
+ this.lviewStats.Items.Clear();
+ if (system.SystemStats.Length > 0)
+ {
+ for(int i = 0; i < system.SystemStats.Length; i++)
+ {
+ ListViewItem item = new ListViewItem();
+ item.Text = system.SystemStats[i].ID;
+ if(system.SystemStats[i].Equals(system.StandardSystemStats))
+ {
+ item.SubItems.Add('\u2713'+"");
+ }
+ this.lviewStats.Items.Add(item);
+ }
+ }
+ }
+
+ private void updateStatLinePreview(IBBoard.WarFoundry.API.Objects.SystemStats stats)
+ {
+ if(stats.SlotCount > 0)
+ {
+ this.lviewStatPreview.Items.Clear();
+ this.lviewStatPreview.Columns.Clear();
+ for(int i = 0; i < stats.SlotCount; i++)
+ {
+ System.Windows.Forms.ColumnHeader column = new ColumnHeader();
+ column.Name = generateID(stats.StatSlots[i].Name);
+ column.Text = stats.StatSlots[i].Name;
+ column.TextAlign = HorizontalAlignment.Center;
+ this.lviewStatPreview.Columns.Add(column);
+ }
+ for(int i = 0; i < this.lviewStatPreview.Columns.Count; i++)
+ {
+ this.lviewStatPreview.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
+ }
+ this.lviewStatPreview.Items.Add(" ");
+ }
+ }
+
+ private void updateStatNames(IBBoard.WarFoundry.API.Objects.SystemStats stats)
+ {
+ if (stats.SlotCount > 0)
+ {
+ this.listStatNames.Items.Clear();
+ for (int i = 0; i < stats.SlotCount; i++)
+ {
+ this.listStatNames.Items.Add(stats.StatSlots[i].Name);
+ }
+ }
+ }
private void btnSystemClose_Click(object sender, EventArgs e)
{
@@ -480,5 +533,28 @@
this.btnCategoryApply.Enabled = false;
}
}
+
+ void lviewStats_SelectedIndexChanged(object sender, System.EventArgs e)
+ {
+ foreach(IBBoard.WarFoundry.API.Objects.SystemStats stat in system.SystemStats)
+ {
+ ListView.SelectedListViewItemCollection items = this.lviewStats.SelectedItems;
+ foreach(ListViewItem item in items)
+ {
+ if(stat.ID == item.Text)
+ {
+ this.txtStatLineID.Text = stat.ID;
+ updateStatNames(stat);
+ updateStatLinePreview(stat);
+ }
+ }
+ }
+ }
+
+ private void btnStatsDefault_Click(object sender, EventArgs e)
+ {
+ system.StandardSystemStatsID = this.lviewStats.SelectedItems[0].Text;
+ updateSystemStatsList();
+ }
}
}
diff -r 6284c091b132 -r 372f921c20fc IBBoard.WarFoundry.Forge.WinForms.csproj
--- a/IBBoard.WarFoundry.Forge.WinForms.csproj Fri Dec 17 22:14:43 2010 -0600
+++ b/IBBoard.WarFoundry.Forge.WinForms.csproj Sat Dec 18 13:20:18 2010 -0600
@@ -93,6 +93,7 @@
True
Resources.resx
+ True
SettingsSingleFileGenerator