comparison FrmNewArmy.cs @ 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 b3a47b712a8b
comparison
equal deleted inserted replaced
190:1ca23c47345a 191:70575ace029b
334 bttnSelectRace.Enabled = (lstRaces.SelectedIndex>-1 && txtArmyName.Text.Trim()!="" && armySize.Value > 0); 334 bttnSelectRace.Enabled = (lstRaces.SelectedIndex>-1 && txtArmyName.Text.Trim()!="" && armySize.Value > 0);
335 } 335 }
336 336
337 private void setTxtArmyNameVal() 337 private void setTxtArmyNameVal()
338 { 338 {
339 txtArmyName.Text = String.Format(race.ArmyDefaultName, Translation.GetTranslation("armySizePts", "{0}pt", armySize.Value)); 339 if (lstRaces.SelectedIndex > -1)
340 isDefaultArmyName = true; 340 {
341 txtArmyName.Text = String.Format(race.ArmyDefaultName, Translation.GetTranslation("armySizePts", "{0}pt", armySize.Value));
342 isDefaultArmyName = true;
343 }
341 } 344 }
342 345
343 private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e) 346 private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e)
344 { 347 {
345 setSelectRaceEnabledVal(); 348 setSelectRaceEnabledVal();