# HG changeset patch # User IBBoard # Date 1304278286 0 # Node ID f9ef9b2db496f0a1abce2de95e0d40904051a53f # Parent 417d3f75a7525d86cf81189d426af6160bc331b8 Re #343: Show unit requirement failures * Add missing translation for dialog * Add first pass of showing messages when adding units (needs reworking due to space limitations) diff -r 417d3f75a752 -r f9ef9b2db496 FrmNewUnit.cs --- a/FrmNewUnit.cs Sun May 01 19:30:33 2011 +0000 +++ b/FrmNewUnit.cs Sun May 01 19:31:26 2011 +0000 @@ -2,7 +2,8 @@ // // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. -using System; +using System; +using System.Collections.Generic; using System.Drawing; using System.ComponentModel; using System.Windows.Forms; @@ -198,14 +199,14 @@ { if (lstUnits.SelectedIndex>-1) { - bttnSelectUnit.Enabled = true; - lblNewUnitWarning.Visible = !Validates.AsOkay(RequirementHandler.AllowsAdding(SelectedUnit, army)); + bttnSelectUnit.Enabled = true; + ICollection failureMessages; + lblNewUnitWarning.Visible = !Validates.AsOkay(RequirementHandler.AllowsAdding(SelectedUnit, army, out failureMessages)); lblWarningIcon.Visible = lblNewUnitWarning.Visible; if (lblNewUnitWarning.Visible) { - //lblNewUnitWarning.Text = army.GetFailedAddRequirement(units[lstUnits.SelectedIndex]).Description; - //FIXME: Add failed requirement text + lblNewUnitWarning.Text = String.Join("\n", new List(failureMessages).ToArray()); } } else diff -r 417d3f75a752 -r f9ef9b2db496 translations/en.translation --- a/translations/en.translation Sun May 01 19:30:33 2011 +0000 +++ b/translations/en.translation Sun May 01 19:31:26 2011 +0000 @@ -130,4 +130,5 @@ Game system and race files reloaded {0} ({1} {2}) ( {0} {1} each) + Army Requirement Failures \ No newline at end of file