# HG changeset patch # User snowblizz # Date 1295967521 0 # Node ID 70575ace029b166ad9f6172d2d95f5f755f0c0c8 # Parent 1ca23c47345a33d1afec28717ee02037cbdc2e59 Re #340: fixes bug, adding test for selected race before running method. Also "fixes" some spurious commented code from previous commit. diff -r 1ca23c47345a -r 70575ace029b FrmMain.cs --- a/FrmMain.cs Mon Jan 24 16:50:31 2011 +0000 +++ b/FrmMain.cs Tue Jan 25 14:58:41 2011 +0000 @@ -1292,103 +1292,7 @@ SetPointsPanelText(); } } -/* - public static string UsePointsAbbrev(double pointTemp) - { - if (pointTemp == 1) - { - pointsAbbreviation = pointsAbbrevSingle; - } - else - { - pointsAbbreviation = pointsAbbrevPlural; - } - return pointsAbbreviation; - } - public static string UsePointsName(double pointTemp) - { - - if (pointTemp == 1) - { - pointsName = pointsNameSingle; - } - else - { - pointsName = pointsNamePlural; - } - return pointsName; - } - - private void LoadPointsSystemNames() - { - LoadPointsAbbrevPlural(); - LoadPointsAbbrevSingle(); - LoadPointsNamePlural(); - LoadPointsNameSingle(); - } - private void LoadPointsAbbrevPlural() - { - // Use this before calling on pointsAbbreviationPlural to "populate" the variable - if (CurrentGameSystem != null ) - { - if (CurrentGameSystem.SystemPtsAbbrevPlural == "") - { - pointsAbbrevPlural = String.Format(Translation.GetTranslation("PointsLocalisationAbbrevPlural")); - } - else - { - pointsAbbrevPlural = CurrentGameSystem.SystemPtsAbbrevPlural; - } - } - } - private void LoadPointsAbbrevSingle() - { - // Use this before calling on pointsAbbreviationSingle to "populate" the variable - if (CurrentGameSystem != null ) - { - if (CurrentGameSystem.SystemPtsAbbrevSingle == "") - { - pointsAbbrevSingle = String.Format(Translation.GetTranslation("PointsLocalisationAbbrevSingle")); - } - else - { - pointsAbbrevSingle = CurrentGameSystem.SystemPtsAbbrevSingle; - } - } - } - private void LoadPointsNamePlural() - { - if (CurrentGameSystem != null ) - { - // Use this before calling on pointsNamePlural to "populate" the variable - if (CurrentGameSystem.SystemPtsNamePlural == "") - { - pointsNamePlural = String.Format(Translation.GetTranslation("PointsLocalisationNamePlural")); - } - else - { - pointsNamePlural = CurrentGameSystem.SystemPtsNamePlural; - } - } - } - - private void LoadPointsNameSingle() - { - if (CurrentGameSystem != null ) - { - // Use this before calling on pointsNameSingle to "populate" the variable - if (CurrentGameSystem.SystemPtsNameSingle == "") - { - pointsNameSingle = String.Format(Translation.GetTranslation("PointsLocalisationNameSingle")); - } - else - { - pointsNameSingle = CurrentGameSystem.SystemPtsNameSingle; - } - } - } - */ private void SetPointsPanelText() { if (CurrentArmy==null) diff -r 1ca23c47345a -r 70575ace029b FrmNewArmy.cs --- a/FrmNewArmy.cs Mon Jan 24 16:50:31 2011 +0000 +++ b/FrmNewArmy.cs Tue Jan 25 14:58:41 2011 +0000 @@ -336,8 +336,11 @@ private void setTxtArmyNameVal() { - txtArmyName.Text = String.Format(race.ArmyDefaultName, Translation.GetTranslation("armySizePts", "{0}pt", armySize.Value)); - isDefaultArmyName = true; + if (lstRaces.SelectedIndex > -1) + { + txtArmyName.Text = String.Format(race.ArmyDefaultName, Translation.GetTranslation("armySizePts", "{0}pt", armySize.Value)); + isDefaultArmyName = true; + } } private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e)