Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.WinForms
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 wrap: on
line diff
--- 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)
--- 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)