Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
comparison FrmNewArmy.cs @ 110:39b93ca5fb9c
Fixes #234: Invalid data file doesn't stop load
* Refactor army change code
* Only set CurrentArmy value once we know it is safe and properly loaded
* Separate out smaller methods with sensible names
* Make CurrentGameSystem and CurrentArmy non-static
Also:
* Use parameter in FrmNewArmy constructor instead of ignoring it
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 19 Dec 2009 15:45:21 +0000 |
parents | 3fae39208d06 |
children | 18d607b0249b |
comparison
equal
deleted
inserted
replaced
109:f4d3e64bdb18 | 110:39b93ca5fb9c |
---|---|
49 foreach (GameSystem gameSystem in WarFoundryLoader.GetDefault().GetGameSystems()) | 49 foreach (GameSystem gameSystem in WarFoundryLoader.GetDefault().GetGameSystems()) |
50 { | 50 { |
51 gameSystems.Items.Add(gameSystem); | 51 gameSystems.Items.Add(gameSystem); |
52 } | 52 } |
53 | 53 |
54 if (WarFoundryCore.CurrentGameSystem != null) | 54 if (system != null) |
55 { | 55 { |
56 gameSystems.SelectedItem = FrmMain.CurrentGameSystem; | 56 gameSystems.SelectedItem = system; |
57 } | 57 } |
58 else if (gameSystems.Items.Count == 1) | 58 else if (gameSystems.Items.Count == 1) |
59 { | 59 { |
60 gameSystems.SelectedIndex = 0; | 60 gameSystems.SelectedIndex = 0; |
61 } | 61 } |