changeset 42:d06c2e390a14

Re #117: Add percentage and number boxes to equipment item dialogs * Add new widget to "Edit equipment" dialog * Still needs "OK" button functionality re-implementing
author IBBoard <dev@ibboard.co.uk>
date Sun, 06 Sep 2009 19:58:39 +0000
parents 4fc87d6e6119
children 7ace7d2249ac
files FrmEditUnitEquipment.cs FrmEditUnitEquipment.resx UI/EquipmentAmountControl.cs
diffstat 3 files changed, 105 insertions(+), 203 deletions(-) [+]
line diff
     1.1 --- a/FrmEditUnitEquipment.cs	Sun Sep 06 19:31:49 2009 +0000
     1.2 +++ b/FrmEditUnitEquipment.cs	Sun Sep 06 19:58:39 2009 +0000
     1.3 @@ -12,7 +12,7 @@
     1.4  using IBBoard.WarFoundry.API.Commands;
     1.5  using IBBoard.WarFoundry.API.Objects;
     1.6  
     1.7 -namespace IBBoard.WarFoundry
     1.8 +namespace IBBoard.WarFoundry.GUI.WinForms
     1.9  {
    1.10  	/// <summary>
    1.11  	/// Summary description for FrmEditUnitEquipment.
    1.12 @@ -21,15 +21,11 @@
    1.13  	{
    1.14  		private Unit unit;
    1.15  		private UnitEquipmentItem equipItem;
    1.16 -		private double equipAmount;
    1.17  		private CommandStack commandStack;
    1.18 -
    1.19 -		private System.Windows.Forms.NumericUpDown numEquipAmount;
    1.20 -		private System.Windows.Forms.Label lblPercent;
    1.21  		private System.Windows.Forms.Label lblAmount;
    1.22  		private System.Windows.Forms.Button bttnCancel;
    1.23  		private System.Windows.Forms.Button bttnOkay;
    1.24 -		private System.Windows.Forms.CheckBox cbEquipAll;
    1.25 +		private IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl equipmentAmount;
    1.26  		/// <summary>
    1.27  		/// Required designer variable.
    1.28  		/// </summary>
    1.29 @@ -42,28 +38,9 @@
    1.30  			this.equipItem = equipItem;
    1.31  			InitializeComponent();
    1.32  			this.Text = equipItem.Name + " for " + unit.Name;
    1.33 -			equipAmount = unit.GetEquipmentAmount(equipItem);
    1.34 -
    1.35 -			if (equipItem.IsRatioLimit)
    1.36 -			{
    1.37 -				numEquipAmount.Minimum = (decimal)Math.Round(equipItem.MinPercentage, 2);
    1.38 -				numEquipAmount.Maximum = (decimal)Math.Round(equipItem.MaxPercentage, 2);
    1.39 -				numEquipAmount.Value = (decimal)Math.Round(equipAmount, 2);
    1.40 -				cbEquipAll.Enabled = false;
    1.41 -				lblPercent.Visible = true;
    1.42 -				numEquipAmount.Width = 120;
    1.43 -			}
    1.44 -			else
    1.45 -			{
    1.46 -				numEquipAmount.Minimum = (decimal)(equipItem.MinNumber != WarFoundryCore.INFINITY ? equipItem.MinNumber : unit.Size);
    1.47 -				numEquipAmount.Maximum = (decimal)(equipItem.MaxNumber != WarFoundryCore.INFINITY ? equipItem.MaxNumber : unit.Size);
    1.48 -				numEquipAmount.Value = (decimal)(equipAmount == WarFoundryCore.INFINITY ? unit.Size : equipAmount);
    1.49 -				cbEquipAll.Checked = (equipAmount == WarFoundryCore.INFINITY);
    1.50 -				cbEquipAll.Enabled = (equipItem.MaxNumber == WarFoundryCore.INFINITY && equipItem.MinNumber != WarFoundryCore.INFINITY);
    1.51 -				numEquipAmount.Enabled = !cbEquipAll.Checked && equipItem.MinNumber != WarFoundryCore.INFINITY;
    1.52 -				numEquipAmount.Width = 144;
    1.53 -			}
    1.54 -
    1.55 +			equipmentAmount.SetUnit(unit);
    1.56 +			equipmentAmount.SetUnitEquipmentItem(equipItem);
    1.57 +			equipmentAmount.SetUnitEquipmentItemAmount(unit.GetEquipmentAmount(equipItem), unit.GetEquipmentAmountIsRatio(equipItem));
    1.58  			bttnOkay.Enabled = false;
    1.59  		}
    1.60  
    1.61 @@ -89,32 +66,12 @@
    1.62  		/// </summary>
    1.63  		private void InitializeComponent()
    1.64  		{
    1.65 -			this.numEquipAmount = new System.Windows.Forms.NumericUpDown();
    1.66 -			this.lblPercent = new System.Windows.Forms.Label();
    1.67  			this.lblAmount = new System.Windows.Forms.Label();
    1.68  			this.bttnCancel = new System.Windows.Forms.Button();
    1.69  			this.bttnOkay = new System.Windows.Forms.Button();
    1.70 -			this.cbEquipAll = new System.Windows.Forms.CheckBox();
    1.71 -			((System.ComponentModel.ISupportInitialize)(this.numEquipAmount)).BeginInit();
    1.72 +			this.equipmentAmount = new IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl();
    1.73  			this.SuspendLayout();
    1.74  			// 
    1.75 -			// numEquipAmount
    1.76 -			// 
    1.77 -			this.numEquipAmount.Location = new System.Drawing.Point(88, 8);
    1.78 -			this.numEquipAmount.Name = "numEquipAmount";
    1.79 -			this.numEquipAmount.Size = new System.Drawing.Size(144, 20);
    1.80 -			this.numEquipAmount.TabIndex = 0;
    1.81 -			this.numEquipAmount.ValueChanged += new System.EventHandler(this.numEquipAmount_ValueChanged);
    1.82 -			// 
    1.83 -			// lblPercent
    1.84 -			// 
    1.85 -			this.lblPercent.Location = new System.Drawing.Point(208, 8);
    1.86 -			this.lblPercent.Name = "lblPercent";
    1.87 -			this.lblPercent.Size = new System.Drawing.Size(16, 16);
    1.88 -			this.lblPercent.TabIndex = 1;
    1.89 -			this.lblPercent.Text = "%";
    1.90 -			this.lblPercent.Visible = false;
    1.91 -			// 
    1.92  			// lblAmount
    1.93  			// 
    1.94  			this.lblAmount.Location = new System.Drawing.Point(8, 8);
    1.95 @@ -128,8 +85,9 @@
    1.96  			// 
    1.97  			this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    1.98  			this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
    1.99 -			this.bttnCancel.Location = new System.Drawing.Point(160, 64);
   1.100 +			this.bttnCancel.Location = new System.Drawing.Point(153, 95);
   1.101  			this.bttnCancel.Name = "bttnCancel";
   1.102 +			this.bttnCancel.Size = new System.Drawing.Size(75, 23);
   1.103  			this.bttnCancel.TabIndex = 3;
   1.104  			this.bttnCancel.Text = "cancel";
   1.105  			this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click);
   1.106 @@ -138,41 +96,37 @@
   1.107  			// 
   1.108  			this.bttnOkay.Enabled = false;
   1.109  			this.bttnOkay.FlatStyle = System.Windows.Forms.FlatStyle.System;
   1.110 -			this.bttnOkay.Location = new System.Drawing.Point(8, 64);
   1.111 +			this.bttnOkay.Location = new System.Drawing.Point(12, 95);
   1.112  			this.bttnOkay.Name = "bttnOkay";
   1.113 +			this.bttnOkay.Size = new System.Drawing.Size(75, 23);
   1.114  			this.bttnOkay.TabIndex = 4;
   1.115  			this.bttnOkay.Text = "okay";
   1.116  			this.bttnOkay.Click += new System.EventHandler(this.bttnOkay_Click);
   1.117  			// 
   1.118 -			// cbEquipAll
   1.119 +			// equipmentAmount
   1.120  			// 
   1.121 -			this.cbEquipAll.Enabled = false;
   1.122 -			this.cbEquipAll.FlatStyle = System.Windows.Forms.FlatStyle.System;
   1.123 -			this.cbEquipAll.Location = new System.Drawing.Point(88, 32);
   1.124 -			this.cbEquipAll.Name = "cbEquipAll";
   1.125 -			this.cbEquipAll.TabIndex = 5;
   1.126 -			this.cbEquipAll.Text = "equip all";
   1.127 -			this.cbEquipAll.CheckedChanged += new System.EventHandler(this.cbEquipAll_CheckedChanged);
   1.128 +			this.equipmentAmount.Location = new System.Drawing.Point(88, 5);
   1.129 +			this.equipmentAmount.Name = "equipmentAmount";
   1.130 +			this.equipmentAmount.Size = new System.Drawing.Size(155, 77);
   1.131 +			this.equipmentAmount.TabIndex = 5;
   1.132 +			this.equipmentAmount.ValueChanged += new System.EventHandler(this.equipmentAmount_ValueChanged);
   1.133  			// 
   1.134  			// FrmEditUnitEquipment
   1.135  			// 
   1.136  			this.AcceptButton = this.bttnOkay;
   1.137  			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   1.138  			this.CancelButton = this.bttnCancel;
   1.139 -			this.ClientSize = new System.Drawing.Size(240, 92);
   1.140 +			this.ClientSize = new System.Drawing.Size(240, 130);
   1.141  			this.ControlBox = false;
   1.142 -			this.Controls.Add(this.cbEquipAll);
   1.143 +			this.Controls.Add(this.equipmentAmount);
   1.144  			this.Controls.Add(this.bttnOkay);
   1.145  			this.Controls.Add(this.bttnCancel);
   1.146  			this.Controls.Add(this.lblAmount);
   1.147 -			this.Controls.Add(this.numEquipAmount);
   1.148 -			this.Controls.Add(this.lblPercent);
   1.149  			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
   1.150  			this.Name = "FrmEditUnitEquipment";
   1.151  			this.ShowInTaskbar = false;
   1.152  			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
   1.153  			this.Text = "FrmEditUnitEquipment";
   1.154 -			((System.ComponentModel.ISupportInitialize)(this.numEquipAmount)).EndInit();
   1.155  			this.ResumeLayout(false);
   1.156  
   1.157  		}
   1.158 @@ -188,44 +142,45 @@
   1.159  
   1.160  		private bool setValue()
   1.161  		{
   1.162 -			if ((!numEquipAmount.Enabled || numEquipAmount.Value == 0) && !cbEquipAll.Checked && unit.GetEquipmentAmount(equipItem) != 0)
   1.163 -			{
   1.164 -				if (equipItem.IsRequired)
   1.165 -				{
   1.166 -					MessageBox.Show(this, "This item is required and cannot be removed. It must have a quantity of at least one or be replaced by an alternative.", "Required item", MessageBoxButtons.OK, MessageBoxIcon.Warning);
   1.167 -					return false;
   1.168 -				}
   1.169 -				else
   1.170 -				{
   1.171 -					DialogResult dr = MessageBox.Show(this, "This will remove the item from the unit. Continue?", "Confirm remove", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
   1.172 +			return false;
   1.173 +			//if (!bttnOkay.Enabled)
   1.174 +			//{
   1.175 +			//    if (equipItem.IsRequired)
   1.176 +			//    {
   1.177 +			//        MessageBox.Show(this, "This item is required and cannot be removed. It must have a quantity of at least one or be replaced by an alternative.", "Required item", MessageBoxButtons.OK, MessageBoxIcon.Warning);
   1.178 +			//        return false;
   1.179 +			//    }
   1.180 +			//    else
   1.181 +			//    {
   1.182 +			//        DialogResult dr = MessageBox.Show(this, "This will remove the item from the unit. Continue?", "Confirm remove", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
   1.183  
   1.184 -					if (dr!=DialogResult.Yes)
   1.185 -					{
   1.186 -						return false;
   1.187 -					}
   1.188 -				}
   1.189 -			}
   1.190 +			//        if (dr!=DialogResult.Yes)
   1.191 +			//        {
   1.192 +			//            return false;
   1.193 +			//        }
   1.194 +			//    }
   1.195 +			//}
   1.196  
   1.197 -			if (cbEquipAll.Checked)
   1.198 -			{
   1.199 -				if (equipAmount != WarFoundryCore.INFINITY)
   1.200 -				{
   1.201 -					commandStack.Execute(new SetUnitEquipmentNumericAmountCommand(unit, equipItem, WarFoundryCore.INFINITY));
   1.202 -				}
   1.203 -			}
   1.204 -			else if (numEquipAmount.Value != (decimal)equipAmount)
   1.205 -			{
   1.206 -				if (equipItem.IsRatioLimit)
   1.207 -				{
   1.208 -					commandStack.Execute(new SetUnitEquipmentRatioAmountCommand(unit, equipItem, (double)numEquipAmount.Value));
   1.209 -				}
   1.210 -				else
   1.211 -				{
   1.212 -					commandStack.Execute(new SetUnitEquipmentNumericAmountCommand(unit, equipItem, (int)numEquipAmount.Value));
   1.213 -				}
   1.214 -			}
   1.215 +			//if (cbEquipAll.Checked)
   1.216 +			//{
   1.217 +			//    if (equipAmount != WarFoundryCore.INFINITY)
   1.218 +			//    {
   1.219 +			//        commandStack.Execute(new SetUnitEquipmentNumericAmountCommand(unit, equipItem, WarFoundryCore.INFINITY));
   1.220 +			//    }
   1.221 +			//}
   1.222 +			//else if (numEquipAmount.Value != (decimal)equipAmount)
   1.223 +			//{
   1.224 +			//    if (equipItem.IsRatioLimit)
   1.225 +			//    {
   1.226 +			//        commandStack.Execute(new SetUnitEquipmentRatioAmountCommand(unit, equipItem, (double)numEquipAmount.Value));
   1.227 +			//    }
   1.228 +			//    else
   1.229 +			//    {
   1.230 +			//        commandStack.Execute(new SetUnitEquipmentNumericAmountCommand(unit, equipItem, (int)numEquipAmount.Value));
   1.231 +			//    }
   1.232 +			//}
   1.233  
   1.234 -			return true;
   1.235 +			//return true;
   1.236  		}
   1.237  
   1.238  		private void bttnCancel_Click(object sender, System.EventArgs e)
   1.239 @@ -233,18 +188,13 @@
   1.240  			this.Close();
   1.241  		}
   1.242  
   1.243 -		private void cbEquipAll_CheckedChanged(object sender, System.EventArgs e)
   1.244 +		private void setOkayButton()
   1.245  		{
   1.246 -			numEquipAmount.Enabled = !cbEquipAll.Checked && equipItem.MinNumber != WarFoundryCore.INFINITY;
   1.247 -			setOkayButton();
   1.248 +			double equipAmount = 0;// equipmentAmount.EquipmentAmount;
   1.249 +			bttnOkay.Enabled = equipAmount > 0 || equipAmount == WarFoundryCore.INFINITY || !equipItem.IsRequired;
   1.250  		}
   1.251  
   1.252 -		private void setOkayButton()
   1.253 -		{
   1.254 -			bttnOkay.Enabled = (cbEquipAll.Checked || (numEquipAmount.Enabled && (numEquipAmount.Value > 0 || !equipItem.IsRequired)));
   1.255 -		}
   1.256 -
   1.257 -		private void numEquipAmount_ValueChanged(object sender, System.EventArgs e)
   1.258 +		private void equipmentAmount_ValueChanged(object sender, EventArgs e)
   1.259  		{
   1.260  			setOkayButton();
   1.261  		}
     2.1 --- a/FrmEditUnitEquipment.resx	Sun Sep 06 19:31:49 2009 +0000
     2.2 +++ b/FrmEditUnitEquipment.resx	Sun Sep 06 19:58:39 2009 +0000
     2.3 @@ -3,7 +3,7 @@
     2.4    <!-- 
     2.5      Microsoft ResX Schema 
     2.6      
     2.7 -    Version 1.3
     2.8 +    Version 2.0
     2.9      
    2.10      The primary goals of this format is to allow a simple XML format 
    2.11      that is mostly human readable. The generation and parsing of the 
    2.12 @@ -14,16 +14,17 @@
    2.13      
    2.14      ... ado.net/XML headers & schema ...
    2.15      <resheader name="resmimetype">text/microsoft-resx</resheader>
    2.16 -    <resheader name="version">1.3</resheader>
    2.17 +    <resheader name="version">2.0</resheader>
    2.18      <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    2.19      <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    2.20 -    <data name="Name1">this is my long string</data>
    2.21 +    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    2.22      <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    2.23      <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
    2.24 -        [base64 mime encoded serialized .NET Framework object]
    2.25 +        <value>[base64 mime encoded serialized .NET Framework object]</value>
    2.26      </data>
    2.27      <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    2.28 -        [base64 mime encoded string representing a byte array form of the .NET Framework object]
    2.29 +        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
    2.30 +        <comment>This is a comment</comment>
    2.31      </data>
    2.32                  
    2.33      There are any number of "resheader" rows that contain simple 
    2.34 @@ -35,7 +36,7 @@
    2.35      Classes that don't support this are serialized and stored with the 
    2.36      mimetype set.
    2.37      
    2.38 -    The mimetype is used forserialized objects, and tells the 
    2.39 +    The mimetype is used for serialized objects, and tells the 
    2.40      ResXResourceReader how to depersist the object. This is currently not 
    2.41      extensible. For a given mimetype the value must be set accordingly:
    2.42      
    2.43 @@ -45,7 +46,7 @@
    2.44      
    2.45      mimetype: application/x-microsoft.net.object.binary.base64
    2.46      value   : The object must be serialized with 
    2.47 -            : System.Serialization.Formatters.Binary.BinaryFormatter
    2.48 +            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
    2.49              : and then encoded with base64 encoding.
    2.50      
    2.51      mimetype: application/x-microsoft.net.object.soap.base64
    2.52 @@ -59,18 +60,37 @@
    2.53              : and then encoded with base64 encoding.
    2.54      -->
    2.55    <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    2.56 +    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    2.57      <xsd:element name="root" msdata:IsDataSet="true">
    2.58        <xsd:complexType>
    2.59          <xsd:choice maxOccurs="unbounded">
    2.60 +          <xsd:element name="metadata">
    2.61 +            <xsd:complexType>
    2.62 +              <xsd:sequence>
    2.63 +                <xsd:element name="value" type="xsd:string" minOccurs="0" />
    2.64 +              </xsd:sequence>
    2.65 +              <xsd:attribute name="name" use="required" type="xsd:string" />
    2.66 +              <xsd:attribute name="type" type="xsd:string" />
    2.67 +              <xsd:attribute name="mimetype" type="xsd:string" />
    2.68 +              <xsd:attribute ref="xml:space" />
    2.69 +            </xsd:complexType>
    2.70 +          </xsd:element>
    2.71 +          <xsd:element name="assembly">
    2.72 +            <xsd:complexType>
    2.73 +              <xsd:attribute name="alias" type="xsd:string" />
    2.74 +              <xsd:attribute name="name" type="xsd:string" />
    2.75 +            </xsd:complexType>
    2.76 +          </xsd:element>
    2.77            <xsd:element name="data">
    2.78              <xsd:complexType>
    2.79                <xsd:sequence>
    2.80                  <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
    2.81                  <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
    2.82                </xsd:sequence>
    2.83 -              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
    2.84 +              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
    2.85                <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
    2.86                <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
    2.87 +              <xsd:attribute ref="xml:space" />
    2.88              </xsd:complexType>
    2.89            </xsd:element>
    2.90            <xsd:element name="resheader">
    2.91 @@ -89,96 +109,12 @@
    2.92      <value>text/microsoft-resx</value>
    2.93    </resheader>
    2.94    <resheader name="version">
    2.95 -    <value>1.3</value>
    2.96 +    <value>2.0</value>
    2.97    </resheader>
    2.98    <resheader name="reader">
    2.99 -    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   2.100 +    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   2.101    </resheader>
   2.102    <resheader name="writer">
   2.103 -    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   2.104 +    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   2.105    </resheader>
   2.106 -  <data name="numEquipAmount.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.107 -    <value>False</value>
   2.108 -  </data>
   2.109 -  <data name="numEquipAmount.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.110 -    <value>Private</value>
   2.111 -  </data>
   2.112 -  <data name="numEquipAmount.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.113 -    <value>Private</value>
   2.114 -  </data>
   2.115 -  <data name="lblPercent.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.116 -    <value>False</value>
   2.117 -  </data>
   2.118 -  <data name="lblPercent.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.119 -    <value>Private</value>
   2.120 -  </data>
   2.121 -  <data name="lblPercent.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.122 -    <value>Private</value>
   2.123 -  </data>
   2.124 -  <data name="lblAmount.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.125 -    <value>False</value>
   2.126 -  </data>
   2.127 -  <data name="lblAmount.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.128 -    <value>Private</value>
   2.129 -  </data>
   2.130 -  <data name="lblAmount.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.131 -    <value>Private</value>
   2.132 -  </data>
   2.133 -  <data name="bttnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.134 -    <value>False</value>
   2.135 -  </data>
   2.136 -  <data name="bttnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.137 -    <value>Private</value>
   2.138 -  </data>
   2.139 -  <data name="bttnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.140 -    <value>Private</value>
   2.141 -  </data>
   2.142 -  <data name="bttnOkay.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.143 -    <value>False</value>
   2.144 -  </data>
   2.145 -  <data name="bttnOkay.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.146 -    <value>Private</value>
   2.147 -  </data>
   2.148 -  <data name="bttnOkay.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.149 -    <value>Private</value>
   2.150 -  </data>
   2.151 -  <data name="cbEquipAll.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.152 -    <value>False</value>
   2.153 -  </data>
   2.154 -  <data name="cbEquipAll.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.155 -    <value>Private</value>
   2.156 -  </data>
   2.157 -  <data name="cbEquipAll.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.158 -    <value>Private</value>
   2.159 -  </data>
   2.160 -  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.161 -    <value>False</value>
   2.162 -  </data>
   2.163 -  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.164 -    <value>(Default)</value>
   2.165 -  </data>
   2.166 -  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.167 -    <value>False</value>
   2.168 -  </data>
   2.169 -  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.170 -    <value>False</value>
   2.171 -  </data>
   2.172 -  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   2.173 -    <value>8, 8</value>
   2.174 -  </data>
   2.175 -  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.176 -    <value>True</value>
   2.177 -  </data>
   2.178 -  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.179 -    <value>80</value>
   2.180 -  </data>
   2.181 -  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.182 -    <value>True</value>
   2.183 -  </data>
   2.184 -  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   2.185 -    <value>Private</value>
   2.186 -  </data>
   2.187 -  <data name="$this.Name">
   2.188 -    <value>FrmEditUnitEquipment</value>
   2.189 -  </data>
   2.190  </root>
   2.191 \ No newline at end of file
     3.1 --- a/UI/EquipmentAmountControl.cs	Sun Sep 06 19:31:49 2009 +0000
     3.2 +++ b/UI/EquipmentAmountControl.cs	Sun Sep 06 19:58:39 2009 +0000
     3.3 @@ -208,5 +208,21 @@
     3.4  				return rbPercentage.Checked;
     3.5  			}
     3.6  		}
     3.7 +
     3.8 +		public void SetUnitEquipmentItemAmount(double equipAmountNum, bool isRatio)
     3.9 +		{
    3.10 +			if (isRatio)
    3.11 +			{
    3.12 +				percentage.Value = (decimal)equipAmountNum;
    3.13 +			}
    3.14 +			else if (equipAmountNum == WarFoundryCore.INFINITY)
    3.15 +			{
    3.16 +				rbEquipAll.Checked = true;
    3.17 +			}
    3.18 +			else
    3.19 +			{
    3.20 +				numeric.Value = (int)equipAmountNum;
    3.21 +			}
    3.22 +		}
    3.23  	}
    3.24  }