changeset 220:467decfdde8e

Closes #327: "Points" system should be used in UI * Add abbreviation and name as options to default name * Translation armySizePts now supports {0} (size), {1} (pts abbrev) and {2} (pts name) * Future additions of "points" systems should be coded with appropriate calls
author IBBoard <dev@ibboard.co.uk>
date Mon, 29 Aug 2011 15:17:59 +0100
parents ec2b73de16ba
children 5233147ca7e4
files FrmNewArmy.cs
diffstat 1 files changed, 16 insertions(+), 16 deletions(-) [+]
line diff
     1.1 --- a/FrmNewArmy.cs	Fri Aug 26 20:14:08 2011 +0100
     1.2 +++ b/FrmNewArmy.cs	Mon Aug 29 15:17:59 2011 +0100
     1.3 @@ -334,14 +334,15 @@
     1.4  			bttnSelectRace.Enabled = (lstRaces.SelectedIndex>-1 && txtArmyName.Text.Trim()!="" && armySize.Value > 0);
     1.5  		}
     1.6  
     1.7 -        private void setTxtArmyNameVal()
     1.8 -        {
     1.9 -            if (lstRaces.SelectedIndex > -1)
    1.10 -            {
    1.11 -                txtArmyName.Text = String.Format(race.ArmyDefaultName, Translation.GetTranslation("armySizePts", "{0}pt", armySize.Value));
    1.12 -                isDefaultArmyName = true;
    1.13 -            }
    1.14 -        }
    1.15 +		private void setTxtArmyNameVal()
    1.16 +		{
    1.17 +			if (lstRaces.SelectedIndex > -1)
    1.18 +			{
    1.19 +				double armySizeDbl = (double)armySize.Value;
    1.20 +				txtArmyName.Text = String.Format(race.ArmyDefaultName, Translation.GetTranslation("armySizePts", "{0}{1}", armySizeDbl, system.GetPointsAbbrev(armySizeDbl), system.GetPointsName(armySizeDbl)));
    1.21 +				isDefaultArmyName = true;
    1.22 +			}
    1.23 +		}
    1.24  
    1.25          private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e)
    1.26  		{
    1.27 @@ -355,16 +356,15 @@
    1.28  
    1.29  		private void gameSystems_SelectedValueChanged(object sender, EventArgs e)
    1.30  		{
    1.31 -			
    1.32 -            GameSystem selected = GetSelectedGameSystem();
    1.33 +			system = GetSelectedGameSystem();
    1.34  			txtArmyName.Text = "";
    1.35 -            txtArmyName.Enabled = false;
    1.36 -            lstRaces.Items.Clear();
    1.37 -            armySize.Value = selected.SystemArmyDefaultSize;
    1.38 - 
    1.39 -			if (selected != null)
    1.40 +			txtArmyName.Enabled = false;
    1.41 +			lstRaces.Items.Clear();
    1.42 +			armySize.Value = system.SystemArmyDefaultSize;
    1.43 +
    1.44 +			if (system != null)
    1.45  			{
    1.46 -				SetRaces(selected);
    1.47 +				SetRaces(system);
    1.48  
    1.49  				if (lstRaces.Items.Count == 1)
    1.50  				{