Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.WinForms
diff FrmMain.cs @ 197:10ba2c5340b2
Re #343: Show unit requirement failures
* Rework existing dialog box to use new messages
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 01 May 2011 15:21:13 +0000 |
parents | 15148d255e50 |
children | 53d79e1be712 ac5f87626abd |
line wrap: on
line diff
--- a/FrmMain.cs Sun May 01 11:05:29 2011 +0000 +++ b/FrmMain.cs Sun May 01 15:21:13 2011 +0000 @@ -1221,15 +1221,16 @@ private void ValidateArmy() { - if (Validates.AsOkay(RequirementHandler.ValidateArmy(CurrentArmy))) + ICollection<string> failureMessages; + if (Validates.AsOkay(RequirementHandler.ValidateArmy(CurrentArmy, out failureMessages))) { sbErrorPanel.Text = ""; sbErrorPanel.Tag = ""; } else { - sbErrorPanel.Text = "Validation errors exist"; - sbErrorPanel.Tag = "One or more army requirements have not been met"; + sbErrorPanel.Text = failureMessages.Count + " validation errors"; + sbErrorPanel.Tag = String.Join("\n", new List<string>(failureMessages).ToArray()); } }