changeset 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 417d3f75a752
files FrmMain.cs
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/FrmMain.cs	Sun May 01 11:05:29 2011 +0000
     1.2 +++ b/FrmMain.cs	Sun May 01 15:21:13 2011 +0000
     1.3 @@ -1221,15 +1221,16 @@
     1.4  
     1.5          private void ValidateArmy()
     1.6          {
     1.7 -            if (Validates.AsOkay(RequirementHandler.ValidateArmy(CurrentArmy)))
     1.8 +            ICollection<string> failureMessages;
     1.9 +            if (Validates.AsOkay(RequirementHandler.ValidateArmy(CurrentArmy, out failureMessages)))
    1.10              {
    1.11                  sbErrorPanel.Text = "";
    1.12                  sbErrorPanel.Tag = "";
    1.13              }
    1.14              else
    1.15              {
    1.16 -                sbErrorPanel.Text = "Validation errors exist";
    1.17 -                sbErrorPanel.Tag = "One or more army requirements have not been met";
    1.18 +                sbErrorPanel.Text = failureMessages.Count + " validation errors";
    1.19 +                sbErrorPanel.Tag = String.Join("\n", new List<string>(failureMessages).ToArray());
    1.20              }
    1.21          }
    1.22