changeset 191:70575ace029b

Re #340: fixes bug, adding test for selected race before running method. Also "fixes" some spurious commented code from previous commit.
author snowblizz
date Tue, 25 Jan 2011 14:58:41 +0000
parents 1ca23c47345a
children 0ad6bb578c1e
files FrmMain.cs FrmNewArmy.cs
diffstat 2 files changed, 5 insertions(+), 98 deletions(-) [+]
line diff
     1.1 --- a/FrmMain.cs	Mon Jan 24 16:50:31 2011 +0000
     1.2 +++ b/FrmMain.cs	Tue Jan 25 14:58:41 2011 +0000
     1.3 @@ -1292,103 +1292,7 @@
     1.4  				SetPointsPanelText();
     1.5  			}
     1.6  		}
     1.7 -/*
     1.8 -        public static string UsePointsAbbrev(double pointTemp) 
     1.9 -        {
    1.10 -            if (pointTemp == 1)
    1.11 -            {
    1.12 -                pointsAbbreviation = pointsAbbrevSingle;
    1.13 -            }
    1.14 -            else
    1.15 -            {
    1.16 -                pointsAbbreviation = pointsAbbrevPlural;
    1.17 -            }
    1.18 -            return pointsAbbreviation;
    1.19 -        }
    1.20  
    1.21 -        public static string UsePointsName(double pointTemp)
    1.22 -        {
    1.23 -            
    1.24 -                if (pointTemp == 1)
    1.25 -                {
    1.26 -                    pointsName = pointsNameSingle;
    1.27 -                }
    1.28 -                else
    1.29 -                {
    1.30 -                    pointsName = pointsNamePlural;
    1.31 -                }
    1.32 -            return pointsName;
    1.33 -        }
    1.34 -
    1.35 -        private void LoadPointsSystemNames()
    1.36 -        {
    1.37 -            LoadPointsAbbrevPlural();
    1.38 -            LoadPointsAbbrevSingle();
    1.39 -            LoadPointsNamePlural();
    1.40 -            LoadPointsNameSingle();
    1.41 -        }
    1.42 -        private void LoadPointsAbbrevPlural()
    1.43 -        {
    1.44 -            // Use this before calling on pointsAbbreviationPlural to "populate" the variable
    1.45 -            if (CurrentGameSystem != null )
    1.46 -            {
    1.47 -                if (CurrentGameSystem.SystemPtsAbbrevPlural == "")
    1.48 -                {
    1.49 -                    pointsAbbrevPlural = String.Format(Translation.GetTranslation("PointsLocalisationAbbrevPlural"));
    1.50 -                }
    1.51 -                else
    1.52 -                {
    1.53 -                    pointsAbbrevPlural = CurrentGameSystem.SystemPtsAbbrevPlural;
    1.54 -                }
    1.55 -            }
    1.56 -        }
    1.57 -        private void LoadPointsAbbrevSingle()
    1.58 -        {
    1.59 -            // Use this before calling on pointsAbbreviationSingle to "populate" the variable
    1.60 -            if (CurrentGameSystem != null )
    1.61 -            {
    1.62 -                if (CurrentGameSystem.SystemPtsAbbrevSingle == "")
    1.63 -                {
    1.64 -                    pointsAbbrevSingle = String.Format(Translation.GetTranslation("PointsLocalisationAbbrevSingle"));
    1.65 -                }
    1.66 -                else
    1.67 -                {
    1.68 -                    pointsAbbrevSingle = CurrentGameSystem.SystemPtsAbbrevSingle;
    1.69 -                }
    1.70 -            }
    1.71 -        }
    1.72 -        private void LoadPointsNamePlural()
    1.73 -        {
    1.74 -            if (CurrentGameSystem != null )
    1.75 -            {
    1.76 -                // Use this before calling on pointsNamePlural to "populate" the variable
    1.77 -                if (CurrentGameSystem.SystemPtsNamePlural == "")
    1.78 -                {
    1.79 -                    pointsNamePlural = String.Format(Translation.GetTranslation("PointsLocalisationNamePlural"));
    1.80 -                }
    1.81 -                else
    1.82 -                {
    1.83 -                    pointsNamePlural = CurrentGameSystem.SystemPtsNamePlural;
    1.84 -                }
    1.85 -            }
    1.86 -        }
    1.87 -
    1.88 -        private void LoadPointsNameSingle()
    1.89 -        {
    1.90 -            if (CurrentGameSystem != null )
    1.91 -            {
    1.92 -                // Use this before calling on pointsNameSingle to "populate" the variable
    1.93 -                if (CurrentGameSystem.SystemPtsNameSingle == "")
    1.94 -                {
    1.95 -                    pointsNameSingle = String.Format(Translation.GetTranslation("PointsLocalisationNameSingle"));
    1.96 -                }
    1.97 -                else
    1.98 -                {
    1.99 -                    pointsNameSingle = CurrentGameSystem.SystemPtsNameSingle;
   1.100 -                }
   1.101 -            }
   1.102 -        }
   1.103 -        */
   1.104          private void SetPointsPanelText()
   1.105  		{	
   1.106  			if (CurrentArmy==null)
     2.1 --- a/FrmNewArmy.cs	Mon Jan 24 16:50:31 2011 +0000
     2.2 +++ b/FrmNewArmy.cs	Tue Jan 25 14:58:41 2011 +0000
     2.3 @@ -336,8 +336,11 @@
     2.4  
     2.5          private void setTxtArmyNameVal()
     2.6          {
     2.7 -            txtArmyName.Text = String.Format(race.ArmyDefaultName, Translation.GetTranslation("armySizePts", "{0}pt", armySize.Value));
     2.8 -            isDefaultArmyName = true;
     2.9 +            if (lstRaces.SelectedIndex > -1)
    2.10 +            {
    2.11 +                txtArmyName.Text = String.Format(race.ArmyDefaultName, Translation.GetTranslation("armySizePts", "{0}pt", armySize.Value));
    2.12 +                isDefaultArmyName = true;
    2.13 +            }
    2.14          }
    2.15  
    2.16          private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e)