annotate FrmMain.cs @ 9:ffb49ec86df7

Closes #42 - Update translations file to use Schema (WinForms) * Update WinForms GUI translations to use namespace for schema instead of DTD
author IBBoard <dev@ibboard.co.uk>
date Tue, 19 May 2009 11:10:07 +0000
parents 9828ba4f3f36
children 19bdbb80999c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
8935971e307c Fixes #1 - Correctly license code
IBBoard <dev@ibboard.co.uk>
parents: 2
diff changeset
1 // This file (FrmMain.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2009 IBBoard.
8935971e307c Fixes #1 - Correctly license code
IBBoard <dev@ibboard.co.uk>
parents: 2
diff changeset
2 //
8935971e307c Fixes #1 - Correctly license code
IBBoard <dev@ibboard.co.uk>
parents: 2
diff changeset
3 // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license.
8935971e307c Fixes #1 - Correctly license code
IBBoard <dev@ibboard.co.uk>
parents: 2
diff changeset
4
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 using System;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 using System.Drawing;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 using System.Drawing.Drawing2D;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 using System.Collections;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 using System.ComponentModel;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 using System.Windows.Forms;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 using System.Data;
5
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
12 using System.IO;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 using System.Threading;
5
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
14 using log4net;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 using IBBoard;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 using IBBoard.CustomMath;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 using IBBoard.Commands;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 using IBBoard.IO;
5
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
19 using IBBoard.Lang;
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
20 using IBBoard.Log4Net;
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
21 using IBBoard.Windows.Forms;
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
22 using IBBoard.Windows.Forms.I18N;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 using IBBoard.Xml;
5
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
24 using IBBoard.WarFoundry.API;
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
25 using IBBoard.WarFoundry.API.Commands;
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
26 using IBBoard.WarFoundry.API.Objects;
7
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
27 using IBBoard.WarFoundry.API.Savers;
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
28 using IBBoard.WarFoundry.API.Factories;
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
29 using IBBoard.WarFoundry.API.Factories.Xml;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 namespace IBBoard.WarFoundry
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 /// <summary>
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 /// Summary description for Form1.
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 /// </summary>
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 public class FrmMain : System.Windows.Forms.Form
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 private static readonly string AppTitle = "WarFoundry";
7
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
39 const string DefaultDataDir = "data";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41 private Preferences preferences;
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
42 protected readonly ILog logger = LogManager.GetLogger(typeof(FrmMain));
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 private CommandStack commandStack;
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
45 private ToolBarButton[] categoryButtons;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47 public ObjectAddDelegate UnitAddedMethod;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 public ObjectRemoveDelegate UnitRemovedMethod;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 public DoubleValChangedDelegate PointsValueChangedMethod;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 //public FailedUnitRequirementDelegate FailedUnitRequirementMethod;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 private FrmArmyTree armyTree;
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
53 private FrmDebugOutput debugWindow;
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
54 private string loadedFilePath;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
55
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
56 private System.ComponentModel.IContainer components;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57 private System.Windows.Forms.ToolBar toolBar;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
58 private IBBoard.Windows.Forms.IBBToolBarButton bttnNewArmy;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59 private System.Windows.Forms.ImageList buttonIcons;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
60 private IBBoard.Windows.Forms.IBBToolBarButton bttnSaveArmy;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61 private System.Windows.Forms.OpenFileDialog openArmyDialog;
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
62 private System.Windows.Forms.SaveFileDialog saveArmyDialog;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
63 private IBBoard.Windows.Forms.IBBToolBarButton bttnOpenArmy;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
64 private IBBoard.Windows.Forms.IBBToolBarButton bttnSep1;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
65 private IBBoard.Windows.Forms.IBBToolBarButton bttnUndo;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
66 private IBBoard.Windows.Forms.IBBToolBarButton bttnRedo;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
67 private System.Windows.Forms.MainMenu mainMenu;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
68 private IBBoard.Windows.Forms.IBBMenuItem menuFile;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69 private IBBoard.Windows.Forms.IBBMenuItem miNewArmy;
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
70 private IBBoard.Windows.Forms.IBBMenuItem miOpenArmy;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
71 private IBBoard.Windows.Forms.IBBMenuItem miCloseArmy;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
72 private IBBoard.Windows.Forms.IBBMenuItem miSaveArmy;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
73 private IBBoard.Windows.Forms.IBBMenuItem miSaveArmyAs;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
74 private System.Windows.Forms.MenuItem miSep2;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
75 private IBBoard.Windows.Forms.IBBMenuItem miChangeSystem;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
76 private System.Windows.Forms.MenuItem miSep1;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
77 private IBBoard.Windows.Forms.IBBMenuItem miReloadFiles;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
78 private System.Windows.Forms.MenuItem miSep3;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
79 private IBBoard.Windows.Forms.IBBMenuItem miExit;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
80 private IBBoard.Windows.Forms.IBBMenuItem menuEdit;
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
81 private IBBoard.Windows.Forms.IBBMenuItem miUndo;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
82 private IBBoard.Windows.Forms.IBBMenuItem miRedo;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
83 private IBBoard.Windows.Forms.IBBMenuItem menuHelp;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
84 private IBBoard.Windows.Forms.IBBMenuItem miDebugWindow;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
85 private IBBoard.Windows.Forms.IBBMenuItem miAbout;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
86 private IBBoard.Windows.Forms.ColorableStatusBarPanel sbMainPanel;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
87 private IBBoard.Windows.Forms.ColorableStatusBarPanel sbErrorPanel;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
88 private IBBoard.Windows.Forms.ColorableStatusBarPanel sbPointsPanel;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
89 private System.Windows.Forms.ContextMenu undoMenu;
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
90 private System.Windows.Forms.ContextMenu redoMenu;
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
91 private IBBoard.Windows.Forms.ColorableStatusBar statusBar;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
92 private System.Windows.Forms.Timer statusBarTimer;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
93 private System.Windows.Forms.Panel pnlRight;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
94
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
95 public FrmMain(string[] args)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
96 {
5
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
97 this.Closing+=new CancelEventHandler(FrmMain_Closing);
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
98 CommandStack.CommandStackUpdated += new MethodInvoker(commandStack_CommandStackUpdated);
26fc79eeda37 Fixes #31 - Add log4net logging to WinForms interface
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
99 LogNotifierHandler.RegisterNotifierHandler();
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
100
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
101 InitializeComponent();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
102
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
103 Preferences = new Preferences("WarFoundry");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
104 Translation.InitialiseTranslations(Constants.ExecutablePath, Preferences["language"].ToString());
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
105
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
106 //pnlRight.Left = ClientSize.Width - pnlRight.Width - 2;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
107 //pnlRight.Top = toolBar.Height + 5;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
108 //pnlRight.Height = ClientRectangle.Bottom - statusBar.Height - pnlRight.Top - 3;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
109
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
110 foreach (Control ctrl in Controls)
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
111 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
112 ControlTranslator.TranslateControl(ctrl);
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
113 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
114
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
115 foreach(Component comp in components.Components)
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
116 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
117 ControlTranslator.TranslateComponent(comp);
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
118 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
119
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
120 foreach (IBBMenuItem mi in Menu.MenuItems)
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
121 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
122 ControlTranslator.TranslateComponent(mi);
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
123 }
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
124
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
125 ControlTranslator.TranslateComponent(openArmyDialog);
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
126 ControlTranslator.TranslateComponent(saveArmyDialog);
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
127
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
128 WarFoundryCore.GameSystemChanged+= new GameSystemChangedDelegate(FrmMain_GameSystemChanged);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
129 WarFoundryCore.ArmyChanged += new ArmyChangedDelegate(FrmMain_ArmyChanged);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
130 UnitAddedMethod = new ObjectAddDelegate(FrmMain_UnitAddedMethod);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
131 UnitRemovedMethod = new ObjectRemoveDelegate(FrmMain_UnitRemovedMethod);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
132 PointsValueChangedMethod = new DoubleValChangedDelegate(FrmMain_PointsValueChangedMethod);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
133 //FailedUnitRequirementMethod = new FailedUnitRequirementDelegate(FrmMain_FailedUnitRequirement);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
134
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
135 sbErrorPanel.Color = Color.Red;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
136
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
137 armyTree = new FrmArmyTree(CommandStack);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
138 armyTree.MdiParent = this;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
139 armyTree.Show();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
140 armyTree.StartPosition = FormStartPosition.Manual;
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
141 armyTree.Location = new Point(this.DisplayRectangle.Width - armyTree.Width - 10, 10);
7
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
142 ControlTranslator.TranslateControl(armyTree);
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
143
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
144 // hack to load default files
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
145 WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Constants.ExecutablePath + Constants.DirectoryString + DefaultDataDir));
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
146
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
147 IWarFoundryFactory factory = WarFoundryFactoryFactory.GetFactoryFactory().GetFactory(typeof(WarFoundryXmlFactory));
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
148
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
149 if (factory != null && factory is WarFoundryXmlFactory)
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
150 {
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
151 WarFoundryLoader.GetDefault().RegisterFactory((WarFoundryXmlFactory)factory);
9828ba4f3f36 Closes #43 - Test Ticket for checking into SVN
gregmita
parents: 5
diff changeset
152 }
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
153
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
154 /*
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
155 if (args.Length == 1)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
156 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
157 logger.Debug("Attempting to load from file");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
158 FileInfo file = new FileInfo(args[0]);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
159
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
160 try
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
161 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
162 if (file.Extension.Equals("."+Factory.GetArmyFileExtension()))
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
163 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
164 WarFoundryCore.CurrentArmy = Factory.CreateArmyFromFile(file);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
165 logger.InfoFormat("Loaded army from {0}", file.FullName);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
166 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
167 else if (file.Extension.Equals("."+Factory.GetSystemFileExtension()))
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
168 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
169 WarFoundryCore.CurrentGameSystem = Factory.CreateGameSystemFromFile(file);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
170 logger.InfoFormat("Loaded game system from {0}", file.FullName);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
171 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
172 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
173 catch (InvalidFileException ex)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
174 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
175 MessageBox.Show(Translation.GetTranslation("InvalidFileLoadError", "The file loaded ({0}) was not a valid WarFoundry file", file.FullName), Translation.GetTranslation("InvalidFileLoadTitle", "Invalid data file", null), MessageBoxButtons.OK, MessageBoxIcon.Error);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
176 logger.Error(ex);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
177 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
178 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
179 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
180 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
181 string gameSystemID = Preferences.GetStringProperty("currSystem");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
182
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
183 if (gameSystemID!=null && !"".Equals(gameSystemID))
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
184 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
185 logger.Debug("Attempting to load current game system from properties");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
186 GameSystem sys = Factory.GetGameSystem(gameSystemID);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
187
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
188 if (sys!=null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
189 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
190 WarFoundryCore.CurrentGameSystem = sys;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
191 logger.InfoFormat("Loaded game system {0} from properties", gameSystemID);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
192 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
193 }
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
194 }*/
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
195 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
196
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
197 public static string DataPath
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
198 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
199 get { return Constants.ExecutablePath+Constants.DirectoryChar+"data"; }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
200 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
201
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
202 public static String ArmiesPath
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
203 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
204 get { return Constants.UserDataPath+Constants.DirectoryChar+"armies"; }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
205 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
206
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
207 public Preferences Preferences
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
208 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
209 get { return preferences; }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
210 set { preferences = value; }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
211 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
212
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
213 public CommandStack CommandStack
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
214 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
215 get
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
216 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
217 if (commandStack == null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
218 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
219 commandStack = new CommandStack();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
220 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
221
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
222 return commandStack;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
223 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
224 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
225
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
226 /// <summary>
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
227 /// Clean up any resources being used.
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
228 /// </summary>
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
229 protected override void Dispose( bool disposing )
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
230 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
231 if( disposing )
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
232 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
233 if (components != null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
234 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
235 components.Dispose();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
236 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
237 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
238 base.Dispose( disposing );
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
239 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
240
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
241 #region Windows Form Designer generated code
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
242 /// <summary>
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
243 /// Required method for Designer support - do not modify
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
244 /// the contents of this method with the code editor.
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
245 /// </summary>
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
246 private void InitializeComponent()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
247 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
248 this.components = new System.ComponentModel.Container();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
249 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
250 this.statusBar = new IBBoard.Windows.Forms.ColorableStatusBar();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
251 this.sbMainPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
252 this.sbErrorPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
253 this.sbPointsPanel = new IBBoard.Windows.Forms.ColorableStatusBarPanel();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
254 this.toolBar = new System.Windows.Forms.ToolBar();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
255 this.bttnNewArmy = new IBBoard.Windows.Forms.IBBToolBarButton();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
256 this.bttnOpenArmy = new IBBoard.Windows.Forms.IBBToolBarButton();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
257 this.bttnSaveArmy = new IBBoard.Windows.Forms.IBBToolBarButton();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
258 this.bttnSep1 = new IBBoard.Windows.Forms.IBBToolBarButton();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
259 this.bttnUndo = new IBBoard.Windows.Forms.IBBToolBarButton();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
260 this.undoMenu = new System.Windows.Forms.ContextMenu();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
261 this.bttnRedo = new IBBoard.Windows.Forms.IBBToolBarButton();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
262 this.redoMenu = new System.Windows.Forms.ContextMenu();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
263 this.buttonIcons = new System.Windows.Forms.ImageList(this.components);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
264 this.mainMenu = new System.Windows.Forms.MainMenu(this.components);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
265 this.menuFile = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
266 this.miNewArmy = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
267 this.miOpenArmy = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
268 this.miSaveArmy = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
269 this.miSaveArmyAs = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
270 this.miCloseArmy = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
271 this.miSep1 = new System.Windows.Forms.MenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
272 this.miChangeSystem = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
273 this.miSep2 = new System.Windows.Forms.MenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
274 this.miReloadFiles = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
275 this.miSep3 = new System.Windows.Forms.MenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
276 this.miExit = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
277 this.menuEdit = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
278 this.miUndo = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
279 this.miRedo = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
280 this.menuHelp = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
281 this.miAbout = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
282 this.miDebugWindow = new IBBoard.Windows.Forms.IBBMenuItem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
283 this.openArmyDialog = new System.Windows.Forms.OpenFileDialog();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
284 this.saveArmyDialog = new System.Windows.Forms.SaveFileDialog();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
285 this.pnlRight = new System.Windows.Forms.Panel();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
286 this.statusBarTimer = new System.Windows.Forms.Timer(this.components);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
287 ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).BeginInit();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
288 ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).BeginInit();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
289 ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).BeginInit();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
290 this.SuspendLayout();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
291 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
292 // statusBar
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
293 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
294 this.statusBar.Location = new System.Drawing.Point(0, 548);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
295 this.statusBar.Name = "statusBar";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
296 this.statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
297 this.sbMainPanel,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
298 this.sbErrorPanel,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
299 this.sbPointsPanel});
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
300 this.statusBar.ShowPanels = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
301 this.statusBar.Size = new System.Drawing.Size(792, 22);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
302 this.statusBar.TabIndex = 1;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
303 this.statusBar.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar_PanelClick);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
304 this.statusBar.DrawItem += new System.Windows.Forms.StatusBarDrawItemEventHandler(this.statusBar_DrawItem);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
305 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
306 // sbMainPanel
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
307 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
308 this.sbMainPanel.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
309 this.sbMainPanel.Color = System.Drawing.SystemColors.WindowText;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
310 this.sbMainPanel.Name = "sbMainPanel";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
311 this.sbMainPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
312 this.sbMainPanel.Width = 475;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
313 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
314 // sbErrorPanel
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
315 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
316 this.sbErrorPanel.Color = System.Drawing.SystemColors.WindowText;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
317 this.sbErrorPanel.Name = "sbErrorPanel";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
318 this.sbErrorPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
319 this.sbErrorPanel.Width = 150;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
320 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
321 // sbPointsPanel
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
322 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
323 this.sbPointsPanel.Color = System.Drawing.SystemColors.WindowText;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
324 this.sbPointsPanel.Name = "sbPointsPanel";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
325 this.sbPointsPanel.Style = System.Windows.Forms.StatusBarPanelStyle.OwnerDraw;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
326 this.sbPointsPanel.ToolTipText = "Current Points Total";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
327 this.sbPointsPanel.Width = 150;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
328 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
329 // toolBar
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
330 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
331 this.toolBar.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
332 this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
333 this.bttnNewArmy,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
334 this.bttnOpenArmy,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
335 this.bttnSaveArmy,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
336 this.bttnSep1,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
337 this.bttnUndo,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
338 this.bttnRedo});
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
339 this.toolBar.ButtonSize = new System.Drawing.Size(16, 16);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
340 this.toolBar.DropDownArrows = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
341 this.toolBar.ImageList = this.buttonIcons;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
342 this.toolBar.Location = new System.Drawing.Point(0, 0);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
343 this.toolBar.Name = "toolBar";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
344 this.toolBar.ShowToolTips = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
345 this.toolBar.Size = new System.Drawing.Size(792, 28);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
346 this.toolBar.TabIndex = 2;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
347 this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
348 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
349 // bttnNewArmy
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
350 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
351 this.bttnNewArmy.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
352 this.bttnNewArmy.ImageIndex = 0;
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
353 this.bttnNewArmy.Name = "bttnNewArmy";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
354 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
355 // bttnOpenArmy
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
356 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
357 this.bttnOpenArmy.ImageIndex = 2;
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
358 this.bttnOpenArmy.Name = "bttnOpenArmy";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
359 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
360 // bttnSaveArmy
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
361 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
362 this.bttnSaveArmy.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
363 this.bttnSaveArmy.ImageIndex = 1;
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
364 this.bttnSaveArmy.Name = "bttnSaveArmy";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
365 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
366 // bttnSep1
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
367 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
368 this.bttnSep1.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
369 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
370 // bttnUndo
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
371 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
372 this.bttnUndo.DropDownMenu = this.undoMenu;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
373 this.bttnUndo.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
374 this.bttnUndo.ImageIndex = 3;
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
375 this.bttnUndo.Name = "bttnUndo";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
376 this.bttnUndo.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
377 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
378 // bttnRedo
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
379 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
380 this.bttnRedo.DropDownMenu = this.redoMenu;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
381 this.bttnRedo.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
382 this.bttnRedo.ImageIndex = 4;
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
383 this.bttnRedo.Name = "bttnRedo";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
384 this.bttnRedo.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
385 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
386 // buttonIcons
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
387 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
388 this.buttonIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("buttonIcons.ImageStream")));
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
389 this.buttonIcons.TransparentColor = System.Drawing.Color.Transparent;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
390 this.buttonIcons.Images.SetKeyName(0, "");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
391 this.buttonIcons.Images.SetKeyName(1, "");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
392 this.buttonIcons.Images.SetKeyName(2, "");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
393 this.buttonIcons.Images.SetKeyName(3, "");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
394 this.buttonIcons.Images.SetKeyName(4, "");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
395 this.buttonIcons.Images.SetKeyName(5, "");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
396 this.buttonIcons.Images.SetKeyName(6, "");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
397 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
398 // mainMenu
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
399 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
400 this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
401 this.menuFile,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
402 this.menuEdit,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
403 this.menuHelp});
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
404 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
405 // menuFile
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
406 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
407 this.menuFile.Index = 0;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
408 this.menuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
409 this.miNewArmy,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
410 this.miOpenArmy,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
411 this.miSaveArmy,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
412 this.miSaveArmyAs,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
413 this.miCloseArmy,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
414 this.miSep1,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
415 this.miChangeSystem,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
416 this.miSep2,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
417 this.miReloadFiles,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
418 this.miSep3,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
419 this.miExit});
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
420 this.menuFile.Text = "&file";
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
421 this.menuFile.Name = "menuFile";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
422 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
423 // miNewArmy
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
424 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
425 this.miNewArmy.Index = 0;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
426 this.miNewArmy.Text = "&new army";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
427 this.miNewArmy.Click += new System.EventHandler(this.miNewArmy_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
428 this.miNewArmy.Name = "miNewArmy";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
429 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
430 // miOpenArmy
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
431 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
432 this.miOpenArmy.Index = 1;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
433 this.miOpenArmy.Text = "&open army";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
434 this.miOpenArmy.Click += new System.EventHandler(this.miOpenArmy_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
435 this.miOpenArmy.Name = "miOpenArmy";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
436 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
437 // miSaveArmy
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
438 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
439 this.miSaveArmy.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
440 this.miSaveArmy.Index = 2;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
441 this.miSaveArmy.Text = "&save army";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
442 this.miSaveArmy.Click += new System.EventHandler(this.miSaveArmy_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
443 this.miSaveArmy.Name = "miSaveArmy";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
444 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
445 // miSaveArmyAs
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
446 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
447 this.miSaveArmyAs.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
448 this.miSaveArmyAs.Index = 3;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
449 this.miSaveArmyAs.Text = "save army &as...";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
450 this.miSaveArmyAs.Click += new System.EventHandler(this.miSaveArmyAs_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
451 this.miSaveArmyAs.Name = "miSaveArmyAs";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
452 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
453 // miCloseArmy
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
454 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
455 this.miCloseArmy.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
456 this.miCloseArmy.Index = 4;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
457 this.miCloseArmy.Text = "&close army";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
458 this.miCloseArmy.Click += new System.EventHandler(this.miCloseArmy_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
459 this.miCloseArmy.Name = "miCloseArmy";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
460 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
461 // miSep1
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
462 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
463 this.miSep1.Index = 5;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
464 this.miSep1.Text = "-";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
465 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
466 // miChangeSystem
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
467 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
468 this.miChangeSystem.Index = 6;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
469 this.miChangeSystem.Text = "change &game system";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
470 this.miChangeSystem.Click += new System.EventHandler(this.miChangeSystem_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
471 this.miChangeSystem.Name = "miChangeSystem";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
472 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
473 // miSep2
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
474 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
475 this.miSep2.Index = 7;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
476 this.miSep2.Text = "-";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
477 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
478 // miReloadFiles
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
479 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
480 this.miReloadFiles.Index = 8;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
481 this.miReloadFiles.Text = "&reload files";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
482 this.miReloadFiles.Click += new System.EventHandler(this.miReloadFiles_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
483 this.miReloadFiles.Name = "miReloadFiles";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
484 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
485 // miSep3
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
486 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
487 this.miSep3.Index = 9;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
488 this.miSep3.Text = "-";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
489 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
490 // miExit
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
491 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
492 this.miExit.Index = 10;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
493 this.miExit.Text = "e&xit";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
494 this.miExit.Click += new System.EventHandler(this.miExit_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
495 this.miExit.Name = "miExit";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
496 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
497 // menuEdit
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
498 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
499 this.menuEdit.Index = 1;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
500 this.menuEdit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
501 this.miUndo,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
502 this.miRedo});
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
503 this.menuEdit.Text = "&edit";
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
504 this.menuEdit.Name = "menuEdit";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
505 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
506 // miUndo
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
507 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
508 this.miUndo.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
509 this.miUndo.Index = 0;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
510 this.miUndo.Text = "&undo";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
511 this.miUndo.Click += new System.EventHandler(this.miUndo_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
512 this.miUndo.Name = "miUndo";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
513 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
514 // miRedo
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
515 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
516 this.miRedo.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
517 this.miRedo.Index = 1;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
518 this.miRedo.Text = "&redo";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
519 this.miRedo.Click += new System.EventHandler(this.miRedo_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
520 this.miRedo.Name = "miRedo";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
521 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
522 // menuHelp
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
523 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
524 this.menuHelp.Index = 2;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
525 this.menuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
526 this.miAbout,
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
527 this.miDebugWindow});
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
528 this.menuHelp.Text = "&help";
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
529 this.menuHelp.Name = "menuHelp";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
530 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
531 // miAbout
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
532 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
533 this.miAbout.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
534 this.miAbout.Index = 0;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
535 this.miAbout.Text = "&about";
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
536 this.miAbout.Name = "miAbout";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
537 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
538 // miDebugWindow
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
539 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
540 this.miDebugWindow.Index = 1;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
541 this.miDebugWindow.Text = "&debug";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
542 this.miDebugWindow.Click += new System.EventHandler(this.miDebugWindow_Click);
2
74df258710fe Fixes #8 - Update SWF version of WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 1
diff changeset
543 this.miDebugWindow.Name = "miDebugWindow";
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
544 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
545 // saveArmyDialog
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
546 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
547 this.saveArmyDialog.Title = "Translatable:saveArmyDialog";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
548 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
549 // pnlRight
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
550 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
551 this.pnlRight.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
552 | System.Windows.Forms.AnchorStyles.Right)));
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
553 this.pnlRight.BackColor = System.Drawing.SystemColors.AppWorkspace;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
554 this.pnlRight.Location = new System.Drawing.Point(726, 30);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
555 this.pnlRight.Name = "pnlRight";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
556 this.pnlRight.Size = new System.Drawing.Size(64, 516);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
557 this.pnlRight.TabIndex = 4;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
558 this.pnlRight.Visible = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
559 this.pnlRight.Paint += new System.Windows.Forms.PaintEventHandler(this.pnlRight_Paint);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
560 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
561 // statusBarTimer
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
562 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
563 this.statusBarTimer.Interval = 5000;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
564 this.statusBarTimer.Tick += new System.EventHandler(this.statusBarTimer_Tick);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
565 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
566 // FrmMain
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
567 //
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
568 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
569 this.ClientSize = new System.Drawing.Size(792, 570);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
570 this.Controls.Add(this.pnlRight);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
571 this.Controls.Add(this.toolBar);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
572 this.Controls.Add(this.statusBar);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
573 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
574 this.IsMdiContainer = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
575 this.Menu = this.mainMenu;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
576 this.Name = "FrmMain";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
577 this.Text = "WarFoundry";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
578 ((System.ComponentModel.ISupportInitialize)(this.sbMainPanel)).EndInit();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
579 ((System.ComponentModel.ISupportInitialize)(this.sbErrorPanel)).EndInit();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
580 ((System.ComponentModel.ISupportInitialize)(this.sbPointsPanel)).EndInit();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
581 this.ResumeLayout(false);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
582 this.PerformLayout();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
583
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
584 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
585 #endregion
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
586
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
587 /// <summary>
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
588 /// The main entry point for the application.
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
589 /// </summary>
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
590 [STAThread]
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
591 static void Main(string[] args)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
592 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
593 try
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
594 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
595 ///TODO: Work out how to auto-embed the Manifest file so that we can have visual styles without having a .manifest file floating around
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
596 //and without using the line below, which causes the toolbar buttons to lose their icons
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
597 //Application.EnableVisualStyles();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
598 Application.Run(new FrmMain(args));
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
599 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
600 catch(Exception ex)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
601 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
602 LogManager.GetLogger(typeof(FrmMain)).Fatal(ex);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
603 MessageBox.Show(null, "A major, unexpected and fatal error ocurred while starting the application: \r\n\r\n"+ex.Message+"\r\n\r\n"+ex.StackTrace, "Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Error);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
604 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
605 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
606
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
607 private void miExit_Click(object sender, System.EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
608 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
609 Application.Exit();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
610 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
611
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
612 private void miNewArmy_Click(object sender, System.EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
613 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
614 createNewArmy();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
615 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
616
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
617 private void createNewArmy()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
618 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
619 if (closeCurrentArmy())
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
620 {
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
621 FrmNewArmy newArmy = new FrmNewArmy(CurrentGameSystem);
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
622 DialogResult dr = newArmy.ShowDialog();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
623
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
624 if (dr == DialogResult.OK)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
625 {
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
626 CurrentArmy = new Army(newArmy.SelectedRace, newArmy.ArmyName, newArmy.ArmySize);
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
627 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
628 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
629 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
630
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
631 private bool openArmy()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
632 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
633 if (closeCurrentArmy())
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
634 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
635 if (openArmyDialog.Filter=="")
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
636 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
637 string savePath = ArmiesPath;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
638
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
639 if (!Directory.Exists(savePath))
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
640 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
641 Directory.CreateDirectory(savePath);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
642 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
643
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
644 openArmyDialog.InitialDirectory = savePath;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
645 openArmyDialog.Filter = Translation.GetTranslation("armyFileFilter")+"|*.army";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
646 openArmyDialog.Title = Translation.GetTranslation("openArmyDialog");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
647
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
648 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
649
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
650 DialogResult dr = openArmyDialog.ShowDialog(this);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
651
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
652 if (dr == DialogResult.OK)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
653 {
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
654 /*
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
655 try
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
656 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
657 CurrentArmy = Factory.LoadArmy(openArmyDialog.FileName);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
658 return true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
659 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
660 catch (InvalidFileException ex)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
661 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
662 logger.Error(ex);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
663 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidFileBoxTitle", "Invalid data file"), MessageBoxButtons.OK, MessageBoxIcon.Error);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
664 return false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
665 }
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
666 * */
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
667 return false;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
668 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
669 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
670 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
671 return false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
672 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
673 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
674 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
675 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
676 return false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
677 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
678 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
679
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
680 private bool closeCurrentArmy()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
681 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
682 if (CurrentArmy!=null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
683 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
684 bool canClose = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
685
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
686 if (CommandStack.IsDirty())
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
687 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
688 DialogResult dr = MessageBox.Show(this, "The army \""+CurrentArmy.Name+"\" has been modified.\r\nSave changes before closing army?", "Unsaved changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button3);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
689
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
690 if (dr == DialogResult.Yes)
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
691 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
692 canClose = SaveCurrentArmy();
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
693 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
694 else if (dr == DialogResult.No)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
695 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
696 canClose = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
697 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
698 //else they said cancel and we default to "canClose = false" so do nothing
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
699 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
700 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
701 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
702 canClose = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
703 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
704
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
705 if (canClose)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
706 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
707 //do close
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
708 disableCategoryButtons();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
709 CurrentArmy = null;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
710 return true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
711 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
712 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
713 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
714 return false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
715 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
716 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
717 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
718 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
719 disableCategoryButtons();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
720 //pretend we succeeded
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
721 return true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
722 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
723 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
724
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
725 private void undoLastAction()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
726 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
727 if (commandStack.CanUndo())
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
728 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
729 commandStack.Undo();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
730 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
731 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
732
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
733 private void redoAction()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
734 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
735 if (commandStack.CanRedo())
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
736 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
737 commandStack.Redo();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
738 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
739 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
740
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
741 private bool SaveCurrentArmy()
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
742 {
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
743 bool saved = false;
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
744
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
745 if (loadedFilePath != null || PromptForFilePath())
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
746 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
747 saved = SaveCurrentArmyToFile();
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
748 }
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
749
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
750 return saved;
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
751 }
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
752
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
753 private bool SaveCurrentArmyAs()
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
754 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
755 bool saved = false;
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
756
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
757 if (PromptForFilePath())
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
758 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
759 saved = SaveCurrentArmyToFile();
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
760 }
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
761
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
762 return saved;
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
763 }
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
764
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
765 private bool SaveCurrentArmyToFile()
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
766 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
767 if (WarFoundrySaver.GetSaver().Save(CurrentArmy, loadedFilePath))
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
768 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
769 miSaveArmy.Enabled = false;
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
770 bttnSaveArmy.Enabled = false;
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
771 CommandStack.setCleanMark();
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
772 return true;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
773 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
774 else
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
775 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
776 loadedFilePath = null;
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
777 MessageBox.Show(this, Translation.GetTranslation("SaveFailed"), Translation.GetTranslation("SaveFailedTitle"), MessageBoxButtons.OK, MessageBoxIcon.Error);
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
778 return false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
779 }
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
780 }
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
781
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
782 private bool PromptForFilePath()
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
783 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
784 if (saveArmyDialog.Filter == "")
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
785 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
786 string savePath = ArmiesPath;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
787
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
788 if (!Directory.Exists(savePath))
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
789 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
790 Directory.CreateDirectory(savePath);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
791 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
792
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
793 saveArmyDialog.InitialDirectory = savePath;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
794 saveArmyDialog.Filter = Translation.GetTranslation("armyFileFilter")+"|*.army";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
795 saveArmyDialog.Title = Translation.GetTranslation("saveArmyDialog");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
796 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
797
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
798 DialogResult dr = saveArmyDialog.ShowDialog(this);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
799
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
800 if (dr == DialogResult.OK)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
801 {
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
802 loadedFilePath = saveArmyDialog.FileName;
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
803 return true;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
804 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
805 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
806 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
807 return false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
808 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
809 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
810
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
811 private void toolBar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
812 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
813 if (e.Button == bttnUndo)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
814 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
815 undoLastAction();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
816 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
817 else if (e.Button == bttnRedo)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
818 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
819 redoAction();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
820 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
821 else if (e.Button == bttnNewArmy)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
822 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
823 createNewArmy();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
824 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
825 else if (e.Button == bttnOpenArmy)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
826 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
827 openArmy();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
828 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
829 else if (e.Button == bttnSaveArmy)
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
830 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
831 SaveCurrentArmy();
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
832 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
833 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
834 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
835 //it must be one of our extra buttons for the categories
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
836 addUnitFromCategory((Category)e.Button.Tag);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
837 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
838 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
839
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
840 private GameSystem CurrentGameSystem
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
841 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
842 get { return WarFoundryCore.CurrentGameSystem; }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
843 set { WarFoundryCore.CurrentGameSystem = value; }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
844 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
845
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
846 private static Army CurrentArmy
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
847 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
848 get { return WarFoundryCore.CurrentArmy; }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
849 set { WarFoundryCore.CurrentArmy = value; }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
850 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
851
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
852 private void SelectGameSystem()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
853 {
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
854 FrmSelectSystem selectSystem = new FrmSelectSystem();
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
855 DialogResult dr = selectSystem.ShowDialog(this);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
856
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
857 if (dr==DialogResult.OK)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
858 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
859 closeCurrentArmy();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
860 CurrentGameSystem = selectSystem.GameSystem;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
861 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
862 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
863
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
864 private void miChangeSystem_Click(object sender, System.EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
865 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
866 SelectGameSystem();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
867 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
868
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
869 private void FrmMain_GameSystemChanged(GameSystem oldSystem, GameSystem newSystem)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
870 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
871 miNewArmy.Enabled = newSystem != null;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
872 bttnNewArmy.Enabled = newSystem != null;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
873 setAppTitle();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
874 removeCategoryButtons();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
875 addCategoryButtons();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
876 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
877
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
878 private void FrmMain_ArmyChanged(Army oldArmy, Army newArmy)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
879 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
880 setAppTitle();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
881
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
882 if (oldArmy != null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
883 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
884 oldArmy.UnitAdded += UnitAddedMethod;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
885 oldArmy.UnitRemoved += UnitRemovedMethod;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
886 oldArmy.PointsValueChanged += PointsValueChangedMethod;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
887 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
888
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
889 if (CurrentArmy==null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
890 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
891 miSaveArmyAs.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
892 miCloseArmy.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
893 disableCategoryButtons();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
894 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
895 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
896 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
897 newArmy.UnitAdded += UnitAddedMethod;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
898 newArmy.UnitRemoved += UnitRemovedMethod;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
899 newArmy.PointsValueChanged += PointsValueChangedMethod;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
900 //TODO: Clear all buttons
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
901 miSaveArmyAs.Enabled = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
902 miCloseArmy.Enabled = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
903 enableCategoryButtons();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
904
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
905 if (newArmy.Race.HasCategoryOverrides())
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
906 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
907 removeCategoryButtons();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
908 addCategoryButtons(newArmy.Race.Categories);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
909 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
910 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
911
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
912 CommandStack.Reset();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
913
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
914 miSaveArmy.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
915 bttnSaveArmy.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
916
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
917 setPointsPanelText();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
918 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
919
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
920 private void addCategoryButtons()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
921 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
922 if (CurrentGameSystem!=null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
923 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
924 addCategoryButtons(CurrentGameSystem.Categories);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
925 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
926 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
927
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
928 private void addCategoryButtons(Category[] cats)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
929 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
930 int catCount = cats.Length;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
931 Category cat;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
932 categoryButtons = new ToolBarButton[catCount+1];
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
933
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
934 ToolBarButton sep = new ToolBarButton();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
935 sep.Style = ToolBarButtonStyle.Separator;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
936 categoryButtons[0] = sep;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
937
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
938 IBBToolBarButton button;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
939
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
940 for (int i = 0; i<catCount; i++)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
941 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
942 cat = cats[i];
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
943 button = new IBBToolBarButton();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
944 ///button.Name = "bttnAddCategory" + cat.Name[0].ToString();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
945 button.Text = cat.Name.ToString();//String.Format(Translation.GetTranslation("bttnAddCategory"), cat.Name);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
946 button.Tag = cat;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
947 button.ImageIndex = 6;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
948 button.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
949 categoryButtons[i+1] = button;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
950 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
951
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
952 this.Invoke(new ToolBarButtonRangeDelegate(toolBar.Buttons.AddRange), new object[]{categoryButtons});
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
953 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
954
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
955 private void removeCategoryButtons()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
956 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
957 if (categoryButtons!=null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
958 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
959 for (int i = 0; i<categoryButtons.Length; i++)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
960 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
961 this.Invoke(new ToolBarButtonDelegate(toolBar.Buttons.Remove), new object[]{categoryButtons[i]});
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
962 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
963 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
964 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
965
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
966 private void enableCategoryButtons()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
967 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
968 setCategoryButtonState(true);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
969 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
970
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
971 private void disableCategoryButtons()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
972 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
973 setCategoryButtonState(false);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
974 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
975
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
976 private void setCategoryButtonState(bool state)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
977 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
978 if (categoryButtons!=null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
979 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
980 for (int i = 0; i<categoryButtons.Length; i++)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
981 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
982 categoryButtons[i].Enabled = state;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
983 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
984 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
985 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
986
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
987 private void miSaveArmyAs_Click(object sender, System.EventArgs e)
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
988 {
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
989 SaveCurrentArmyAs();
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
990 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
991
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
992 private void commandStack_CommandStackUpdated()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
993 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
994 bttnUndo.Enabled = commandStack.CanUndo();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
995 miUndo.Enabled = bttnUndo.Enabled;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
996 bttnRedo.Enabled = commandStack.CanRedo();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
997 miRedo.Enabled = bttnRedo.Enabled;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
998 MenuItem[] menuItems = null;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
999 int redoLength = commandStack.RedoLength;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1000 int maxRedo = Math.Min(10, redoLength);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1001
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1002 if (redoLength > 0)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1003 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1004 menuItems = new MenuItem[maxRedo];
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1005 Command com;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1006 MenuItem mi;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1007
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1008 for (int i = 0; i < maxRedo; i++)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1009 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1010 com = commandStack.PeekRedoCommand(i+1);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1011
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1012 if (com == null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1013 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1014 break;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1015 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1016
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1017 mi = new MenuItem(com.Description);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1018 mi.Click+=new EventHandler(redoMenu_Click);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1019 menuItems[i] = mi;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1020 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1021 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1022
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1023 redoMenu.MenuItems.Clear();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1024
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1025 if (menuItems!=null && menuItems[0]!=null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1026 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1027 bttnRedo.ToolTipText = menuItems[0].Text;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1028 redoMenu.MenuItems.AddRange(menuItems);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1029 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1030
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1031 int undoLength = commandStack.UndoLength;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1032 int maxUndo = Math.Min(10, undoLength);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1033 MenuItem[] menuItemsUndo = null;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1034
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1035 if (undoLength > 0)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1036 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1037 menuItemsUndo = new MenuItem[maxUndo];
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1038 Command com;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1039 MenuItem mi;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1040
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1041 for (int i = 0; i < maxUndo; i++)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1042 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1043 com = commandStack.PeekUndoCommand(i+1);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1044
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1045 if (com == null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1046 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1047 break;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1048 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1049
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1050 mi = new MenuItem(com.UndoDescription);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1051 mi.Click+=new EventHandler(undoMenu_Click);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1052 menuItemsUndo[i] = mi;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1053 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1054 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1055
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1056 undoMenu.MenuItems.Clear();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1057
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1058 if (menuItemsUndo!=null && menuItemsUndo[0]!=null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1059 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1060 bttnUndo.ToolTipText = menuItemsUndo[0].Text;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1061 undoMenu.MenuItems.AddRange(menuItemsUndo);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1062 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1063
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
1064 bool canSave = loadedFilePath != null;
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1065 bttnSaveArmy.Enabled = commandStack.IsDirty() && CurrentArmy!=null && canSave;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1066 miSaveArmy.Enabled = commandStack.IsDirty() && CurrentArmy!=null && canSave;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1067 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1068
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1069 private void miSaveArmy_Click(object sender, System.EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1070 {
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
1071 SaveCurrentArmy();
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1072 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1073
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1074 private void setAppTitle()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1075 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1076 string str = AppTitle;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1077
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1078 if (CurrentGameSystem!=null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1079 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1080 str+= " - "+CurrentGameSystem.Name;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1081 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1082
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1083 if (CurrentArmy!=null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1084 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1085 str+= " - "+CurrentArmy.Name;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1086 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1087
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1088 this.Text = str;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1089 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1090
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1091 private void addUnitFromCategory(Category cat)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1092 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1093 FrmNewUnit newUnit = new FrmNewUnit(CurrentArmy.Race, cat, CurrentArmy);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1094 DialogResult dr = newUnit.ShowDialog(this);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1095
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1096 if (dr == DialogResult.OK)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1097 {
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
1098 CreateAndAddUnitCommand cmd = new CreateAndAddUnitCommand(newUnit.SelectedUnit, cat, CurrentArmy);
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1099 commandStack.Execute(cmd);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1100 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1101 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1102
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1103 private void FrmMain_UnitAddedMethod(object unitObj)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1104 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1105 if (unitObj is Unit)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1106 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1107 Unit unit = (Unit)unitObj;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1108 sbErrorPanel.Text = "";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1109 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1110 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1111
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1112 private void FrmMain_UnitRemovedMethod(object unitObj)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1113 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1114 if (unitObj is Unit)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1115 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1116 Unit unit = (Unit)unitObj;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1117 sbErrorPanel.Text = "";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1118
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1119 //check if window is open, and close it if it is
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1120 foreach (Form frm in this.MdiChildren)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1121 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1122 if (frm is FrmUnit)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1123 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1124 if (((FrmUnit)frm).Unit == unit)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1125 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1126 frm.Close();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1127 break;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1128 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1129 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1130 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1131 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1132 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1133
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1134 /*private void FrmMain_FailedUnitRequirement(FailedUnitRequirement failedRequirement)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1135 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1136 sbErrorPanel.Text = Translation.GetTranslation("UnitRequirementFailed", "Unit Requirement Failed");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1137 sbErrorPanel.Tag = failedRequirement.Description;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1138 }*/
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1139
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1140 /*public void MdiChildMoved()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1141 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1142 Point mouseAt = PointToClient(ActiveMdiChild.Location);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1143
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1144 if (Comparisons.ValueWithinAmount(pnlRight.Right, ActiveMdiChild.Right, 10))
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1145 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1146 pnlRight.Visible = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1147 //pnlRight.Container.Add(ActiveMdiChild);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1148 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1149 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1150 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1151 pnlRight.Visible = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1152 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1153 }*/
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1154
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1155 public void pnlRight_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1156 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1157 HatchBrush dockCueBrush = new HatchBrush(HatchStyle.LightDownwardDiagonal, Color.White, Color.Gray);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1158 Pen dockCuePen = new Pen(dockCueBrush, 10);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1159 e.Graphics.DrawRectangle(dockCuePen, new Rectangle(pnlRight.Left, pnlRight.Top, pnlRight.Width, pnlRight.Height));
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1160 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1161
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1162 private void miUndo_Click(object sender, System.EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1163 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1164 undoLastAction();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1165 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1166
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1167 private void miRedo_Click(object sender, System.EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1168 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1169 redoAction();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1170 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1171
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1172 private void miCloseArmy_Click(object sender, EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1173 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1174 closeCurrentArmy();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1175 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1176
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1177 private void miOpenArmy_Click(object sender, EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1178 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1179 openArmy();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1180 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1181
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1182 private void FrmMain_PointsValueChangedMethod(WarFoundryObject obj, double oldVal, double newVal)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1183 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1184 if (obj is Army)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1185 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1186 setPointsPanelText();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1187 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1188 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1189
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1190 private void setPointsPanelText()
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1191 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1192 if (CurrentArmy==null)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1193 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1194 sbPointsPanel.Text = "";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1195 sbPointsPanel.ResetColor();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1196 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1197 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1198 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1199 sbPointsPanel.Text = String.Format(Translation.GetTranslation("statusPanelPoints"), CurrentArmy.PointsTotal, CurrentArmy.MaxPoints);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1200
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1201 if (CurrentArmy.PointsTotal>CurrentArmy.MaxPoints)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1202 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1203 sbPointsPanel.Color = Color.Red;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1204 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1205 else
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1206 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1207 sbPointsPanel.ResetColor();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1208 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1209 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1210 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1211
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1212 private void redoMenu_Click(object sender, EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1213 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1214 if (sender is MenuItem)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1215 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1216 MenuItem mi = (MenuItem)sender;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1217
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1218 if (mi.Parent == redoMenu)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1219 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1220 //we know it's an redo menu item so find it's index and redo everything
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1221 int max = mi.Index;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1222
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1223 for (int i = 0; i <= max; i++)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1224 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1225 commandStack.Redo();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1226 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1227 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1228 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1229 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1230
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1231 private void undoMenu_Click(object sender, EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1232 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1233 if (sender is MenuItem)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1234 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1235 MenuItem mi = (MenuItem)sender;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1236
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1237 if (mi.Parent == undoMenu)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1238 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1239 //we know it's an undo menu item so find it's index and undo everything
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1240 int max = mi.Index;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1241 for (int i = 0; i <= max; i++)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1242 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1243 commandStack.Undo();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1244 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1245 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1246 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1247 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1248
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1249 private void statusBar_DrawItem(object sender, System.Windows.Forms.StatusBarDrawItemEventArgs sbdevent)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1250 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1251 statusBar.ColorableStatusBarDrawItem(sender, sbdevent);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1252 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1253
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1254 private void miDebugWindow_Click(object sender, EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1255 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1256 if (debugWindow == null || debugWindow.IsDisposed)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1257 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1258 debugWindow = new FrmDebugOutput();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1259 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1260
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1261 debugWindow.Show();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1262 debugWindow.Focus();
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1263 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1264
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1265 private void FrmMain_Closing(object sender, CancelEventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1266 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1267 if (!closeCurrentArmy())
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1268 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1269 e.Cancel = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1270 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1271 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1272
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1273 private void miReloadFiles_Click(object sender, System.EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1274 {
1
42cf06b8f897 Re #8 - Get a working Windows WarFoundry
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
1275 WarFoundryLoader.GetDefault().LoadFiles();
0
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1276 sbMainPanel.Text = Translation.GetTranslation("GameSystemFilesReloaded", "Game system and race files reloaded");
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1277 statusBarTimer.Enabled = true;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1278 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1279
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1280 private void statusBarTimer_Tick(object sender, System.EventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1281 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1282 sbMainPanel.Text = "";
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1283 statusBarTimer.Enabled = false;
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1284 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1285
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1286 private void statusBar_PanelClick(object sender, StatusBarPanelClickEventArgs e)
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1287 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1288 if (e.StatusBarPanel == sbErrorPanel && sbErrorPanel.Text!="")
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1289 {
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1290 MessageBox.Show(this, sbErrorPanel.TagString, Translation.GetTranslation("FailedRequirementMessage"), MessageBoxButtons.OK, MessageBoxIcon.Warning);
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1291 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1292 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1293 }
7dd160dacb60 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1294 }