# HG changeset patch # User gregmita # Date 1236460111 0 # Node ID 9828ba4f3f367865fb8a059399cdf786768fca39 # Parent aca4eb3fae5054b8be331af44884d87af9a0f88f Closes #43 - Test Ticket for checking into SVN * First Check-in! * Did some code changes to allow the app to load default race and system files from the "data" directory. * Also changed select system dialog so you can actually select a game system. diff -r aca4eb3fae50 -r 9828ba4f3f36 FrmMain.cs --- a/FrmMain.cs Sun Mar 01 15:31:02 2009 +0000 +++ b/FrmMain.cs Sat Mar 07 21:08:31 2009 +0000 @@ -24,7 +24,9 @@ using IBBoard.WarFoundry.API; using IBBoard.WarFoundry.API.Commands; using IBBoard.WarFoundry.API.Objects; -using IBBoard.WarFoundry.API.Savers; +using IBBoard.WarFoundry.API.Savers; +using IBBoard.WarFoundry.API.Factories; +using IBBoard.WarFoundry.API.Factories.Xml; namespace IBBoard.WarFoundry { @@ -34,6 +36,7 @@ public class FrmMain : System.Windows.Forms.Form { private static readonly string AppTitle = "WarFoundry"; + const string DefaultDataDir = "data"; private Preferences preferences; protected readonly ILog logger = LogManager.GetLogger(typeof(FrmMain)); @@ -136,7 +139,17 @@ armyTree.Show(); armyTree.StartPosition = FormStartPosition.Manual; armyTree.Location = new Point(this.DisplayRectangle.Width - armyTree.Width - 10, 10); - ControlTranslator.TranslateControl(armyTree); + ControlTranslator.TranslateControl(armyTree); + + // hack to load default files + WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Constants.ExecutablePath + Constants.DirectoryString + DefaultDataDir)); + + IWarFoundryFactory factory = WarFoundryFactoryFactory.GetFactoryFactory().GetFactory(typeof(WarFoundryXmlFactory)); + + if (factory != null && factory is WarFoundryXmlFactory) + { + WarFoundryLoader.GetDefault().RegisterFactory((WarFoundryXmlFactory)factory); + } /* if (args.Length == 1) diff -r aca4eb3fae50 -r 9828ba4f3f36 FrmSelectSystem.cs --- a/FrmSelectSystem.cs Sun Mar 01 15:31:02 2009 +0000 +++ b/FrmSelectSystem.cs Sat Mar 07 21:08:31 2009 +0000 @@ -154,10 +154,10 @@ private void bttnSelectSystem_Click(object sender, System.EventArgs e) { -// selectedSystem = lstSystems. - //TODO: Set game system + // set the selected system + selectedSystem = (GameSystem) lstSystems.SelectedItem; - this.DialogResult = DialogResult.OK; + this.DialogResult = DialogResult.OK; this.Close(); }