changeset 190:1ca23c47345a

Re #327: Point names used in the GUI
author snowblizz
date Mon, 24 Jan 2011 16:50:31 +0000
parents cb86380cbf61
children 70575ace029b
files FrmArmyTree.cs FrmMain.cs FrmNewArmy.cs FrmUnit.cs Util/UnitEquipmentChoice.cs translations/en.translation translations/sv.translation
diffstat 7 files changed, 733 insertions(+), 577 deletions(-) [+]
line diff
     1.1 --- a/FrmArmyTree.cs	Sun Dec 12 17:30:53 2010 +0000
     1.2 +++ b/FrmArmyTree.cs	Mon Jan 24 16:50:31 2011 +0000
     1.3 @@ -1,462 +1,472 @@
     1.4 -// This file (FrmArmyTree.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2009 IBBoard.
     1.5 -//
     1.6 -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
     1.7 -
     1.8 -using System;
     1.9 -using System.Drawing;
    1.10 -using System.Collections.Generic;
    1.11 -using System.ComponentModel;
    1.12 -using System.Windows.Forms;
    1.13 -using IBBoard.Commands;
    1.14 -using IBBoard.Lang;
    1.15 -using IBBoard.Windows.Forms.I18N;
    1.16 -using IBBoard.Windows.Forms;
    1.17 -using IBBoard.WarFoundry.API;
    1.18 -using IBBoard.WarFoundry.API.Commands;
    1.19 -using IBBoard.WarFoundry.API.Objects;
    1.20 -
    1.21 -namespace IBBoard.WarFoundry.GUI.WinForms
    1.22 -{
    1.23 -	/// <summary>
    1.24 -	/// Summary description for FrmArmyTree.
    1.25 -	/// </summary>
    1.26 -	public class FrmArmyTree : IBBoard.Windows.Forms.IBBForm
    1.27 -	{
    1.28 -		private System.Windows.Forms.TreeView treeView;
    1.29 -		private IContainer components;
    1.30 -		private Dictionary<string, TreeNode> nodes;
    1.31 -		private System.Windows.Forms.ContextMenu contextMenu;
    1.32 -		private IBBMenuItem miDeleteUnit;
    1.33 -		private IBBMenuItem miEditUnit;
    1.34 -		
    1.35 -		private ObjectAddDelegate UnitAddedMethod;
    1.36 -		private ObjectRemoveDelegate UnitRemovedMethod;
    1.37 -		private StringValChangedDelegate UnitNameChangedMethod, ArmyNameChangedMethod, TreeNameChangedMethod;
    1.38 -		private ToolBar toolBar;
    1.39 -		private IBBToolBarButton bttnEdit;
    1.40 -		private IBBToolBarButton bttnDelete;
    1.41 -		private ImageList imageList;
    1.42 -		private CommandStack commandStack;
    1.43 -
    1.44 -		public FrmArmyTree(CommandStack cmdStack)
    1.45 -		{
    1.46 -			commandStack = cmdStack;
    1.47 -			InitializeComponent();
    1.48 -			UnitAddedMethod = new ObjectAddDelegate(UnitAdded);
    1.49 -			UnitRemovedMethod = new ObjectRemoveDelegate(UnitRemoved);
    1.50 -			UnitNameChangedMethod = new StringValChangedDelegate(UpdateUnitName);
    1.51 -			ArmyNameChangedMethod = new StringValChangedDelegate(UpdateArmyName);
    1.52 -			TreeNameChangedMethod = new StringValChangedDelegate(FrmArmyTree_TreeNameChanged);
    1.53 -			nodes = new Dictionary<string, TreeNode>();
    1.54 -			this.Name = "ArmyTree";			
    1.55 -			WarFoundryCore.ArmyChanged+= new ArmyChangedDelegate(FrmArmyTree_ArmyChanged);
    1.56 -			TranslateForm();
    1.57 -			Translation.TranslationChanged += new MethodInvoker(TranslateForm);
    1.58 -		}
    1.59 -
    1.60 -		private void TranslateForm()
    1.61 -		{
    1.62 -			ControlTranslator.TranslateControl(this);
    1.63 -
    1.64 -			foreach (Component comp in components.Components)
    1.65 -			{
    1.66 -				ControlTranslator.TranslateComponent(comp);
    1.67 -			}
    1.68 -
    1.69 -			foreach (IBBMenuItem mi in contextMenu.MenuItems)
    1.70 -			{
    1.71 -				ControlTranslator.TranslateComponent(mi);
    1.72 -			}
    1.73 -		}
    1.74 -
    1.75 -		/// <summary>
    1.76 -		/// Clean up any resources being used.
    1.77 -		/// </summary>
    1.78 -		protected override void Dispose( bool disposing )
    1.79 -		{
    1.80 -			if( disposing )
    1.81 -			{
    1.82 -				if(components != null)
    1.83 -				{
    1.84 -					components.Dispose();
    1.85 -				}
    1.86 -			}
    1.87 -			base.Dispose( disposing );
    1.88 -			Translation.TranslationChanged -= new MethodInvoker(TranslateForm);
    1.89 -			WarFoundryCore.ArmyChanged -= new ArmyChangedDelegate(FrmArmyTree_ArmyChanged);
    1.90 -		}
    1.91 -
    1.92 -		#region Windows Form Designer generated code
    1.93 -		/// <summary>
    1.94 -		/// Required method for Designer support - do not modify
    1.95 -		/// the contents of this method with the code editor.
    1.96 -		/// </summary>
    1.97 -		private void InitializeComponent()
    1.98 -		{
    1.99 -			this.components = new System.ComponentModel.Container();
   1.100 -			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmArmyTree));
   1.101 -			this.contextMenu = new System.Windows.Forms.ContextMenu();
   1.102 -			this.miEditUnit = new IBBoard.Windows.Forms.IBBMenuItem();
   1.103 -			this.miDeleteUnit = new IBBoard.Windows.Forms.IBBMenuItem();
   1.104 -			this.imageList = new System.Windows.Forms.ImageList(this.components);
   1.105 -			this.toolBar = new System.Windows.Forms.ToolBar();
   1.106 -			this.bttnEdit = new IBBoard.Windows.Forms.IBBToolBarButton();
   1.107 -			this.bttnDelete = new IBBoard.Windows.Forms.IBBToolBarButton();
   1.108 -			this.treeView = new System.Windows.Forms.TreeView();
   1.109 -			this.SuspendLayout();
   1.110 -			// 
   1.111 -			// contextMenu
   1.112 -			// 
   1.113 -			this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
   1.114 -            this.miEditUnit,
   1.115 -            this.miDeleteUnit});
   1.116 -			this.contextMenu.Popup += new System.EventHandler(this.contextMenu_Popup);
   1.117 -			// 
   1.118 -			// miEditUnit
   1.119 -			// 
   1.120 -			this.miEditUnit.Index = 0;
   1.121 -			this.miEditUnit.Text = "&edit unit";
   1.122 -			this.miEditUnit.Click += new System.EventHandler(this.miEdit_Click);
   1.123 -			this.miEditUnit.Name = "miEditUnit";
   1.124 -			// 
   1.125 -			// miDeleteUnit
   1.126 -			// 
   1.127 -			this.miDeleteUnit.Index = 1;
   1.128 -			this.miDeleteUnit.Text = "&delete unit";
   1.129 -			this.miDeleteUnit.Click += new System.EventHandler(this.miDelete_Click);
   1.130 -			this.miDeleteUnit.Name = "miDeleteUnit";
   1.131 -			// 
   1.132 -			// imageList
   1.133 -			// 
   1.134 -			this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer) (resources.GetObject("imageList.ImageStream")));
   1.135 -			this.imageList.TransparentColor = System.Drawing.Color.Transparent;
   1.136 -			this.imageList.Images.SetKeyName(0, "gtk-edit.png");
   1.137 -			this.imageList.Images.SetKeyName(1, "edit-delete.png");
   1.138 -			// 
   1.139 -			// toolBar
   1.140 -			// 
   1.141 -			this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
   1.142 -            this.bttnEdit,
   1.143 -            this.bttnDelete});
   1.144 -			this.toolBar.ButtonSize = new System.Drawing.Size(16, 16);
   1.145 -			this.toolBar.DropDownArrows = true;
   1.146 -			this.toolBar.ImageList = this.imageList;
   1.147 -			this.toolBar.Location = new System.Drawing.Point(0, 0);
   1.148 -			this.toolBar.Name = "toolBar";
   1.149 -			this.toolBar.ShowToolTips = true;
   1.150 -			this.toolBar.Size = new System.Drawing.Size(240, 28);
   1.151 -			this.toolBar.TabIndex = 3;
   1.152 -			this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);
   1.153 -			// 
   1.154 -			// bttnEdit
   1.155 -			// 
   1.156 -			this.bttnEdit.Enabled = false;
   1.157 -			this.bttnEdit.ImageIndex = 0;
   1.158 -			this.bttnEdit.Name = "bttnEdit";
   1.159 -			// 
   1.160 -			// bttnDelete
   1.161 -			// 
   1.162 -			this.bttnDelete.Enabled = false;
   1.163 -			this.bttnDelete.ImageIndex = 1;
   1.164 -			this.bttnDelete.Name = "bttnDelete";
   1.165 -			// 
   1.166 -			// treeView
   1.167 -			// 
   1.168 -			this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
   1.169 -						| System.Windows.Forms.AnchorStyles.Left)
   1.170 -						| System.Windows.Forms.AnchorStyles.Right)));
   1.171 -			this.treeView.ContextMenu = this.contextMenu;
   1.172 -			this.treeView.FullRowSelect = true;
   1.173 -			this.treeView.Location = new System.Drawing.Point(0, 28);
   1.174 -			this.treeView.Name = "treeView";
   1.175 -			this.treeView.Size = new System.Drawing.Size(240, 250);
   1.176 -			this.treeView.TabIndex = 0;
   1.177 -			this.treeView.DoubleClick += new System.EventHandler(this.treeView_DoubleClick);
   1.178 -			this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect);
   1.179 -			this.treeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseDown);
   1.180 -			// 
   1.181 -			// FrmArmyTree
   1.182 -			// 
   1.183 -			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   1.184 -			this.ClientSize = new System.Drawing.Size(240, 277);
   1.185 -			this.ControlBox = false;
   1.186 -			this.Controls.Add(this.toolBar);
   1.187 -			this.Controls.Add(this.treeView);
   1.188 -			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
   1.189 -			this.MaximizeBox = false;
   1.190 -			this.MinimizeBox = false;
   1.191 -			this.Name = "FrmArmyTree";
   1.192 -			this.Text = "FrmArmyTree";
   1.193 -			this.ResumeLayout(false);
   1.194 -			this.PerformLayout();
   1.195 -
   1.196 -		}
   1.197 -		#endregion
   1.198 -
   1.199 -		private void ClearArmy()
   1.200 -		{
   1.201 -			nodes.Clear();
   1.202 -			treeView.Nodes.Clear();
   1.203 -		}
   1.204 -
   1.205 -		private void SetArmy(Army army)
   1.206 -		{
   1.207 -			ClearArmy();
   1.208 -
   1.209 -			if (army != null)
   1.210 -			{
   1.211 -				ArmyCategory[] cats = army.Categories;
   1.212 -				TreeNode[] catNodes = new TreeNode[cats.Length];
   1.213 -				Unit[] units;
   1.214 -
   1.215 -				for (int i = 0; i < cats.Length; i++)
   1.216 -				{
   1.217 -					ArmyCategory cat = cats[i];
   1.218 -					units = army.GetUnits(cat);
   1.219 -					cat.NameChanged += TreeNameChangedMethod;
   1.220 -					cat.PointsValueChanged += NodePointsValueChanged;
   1.221 -					TreeNode[] unitNodes = new TreeNode[units.Length];
   1.222 -					TreeNode temp;
   1.223 -
   1.224 -					for (int j = 0; j < units.Length; j++)
   1.225 -					{
   1.226 -						unitNodes[j] = CreateTreeNode(units[j]);
   1.227 -					}
   1.228 -
   1.229 -					temp = new TreeNode(CreateNodeName(cat), unitNodes);
   1.230 -					temp.Tag = cat;
   1.231 -					catNodes[i] = temp;
   1.232 -					nodes[cat.ID] = temp;
   1.233 -				}
   1.234 -
   1.235 -				TreeNode root = new TreeNode(CreateNodeName(army), catNodes);
   1.236 -				root.Tag = army;
   1.237 -				army.PointsValueChanged += NodePointsValueChanged;
   1.238 -				nodes[army.ID] = root;
   1.239 -				treeView.Nodes.Add(root);
   1.240 -				root.ExpandAll();
   1.241 -			}
   1.242 -		}
   1.243 -		
   1.244 -		private string CreateNodeName(ICostedWarFoundryObject obj)
   1.245 -		{
   1.246 -			return Translation.GetTranslation("treeNodeText", "{0} ({1}pts)", obj.Name, obj.Points);
   1.247 -		}
   1.248 -
   1.249 -		private void NodePointsValueChanged(WarFoundryObject obj, double oldValue, double newValue)
   1.250 -		{
   1.251 -			if (obj is ICostedWarFoundryObject)
   1.252 -			{
   1.253 -				SetNodeName(obj);
   1.254 -			}
   1.255 -		}
   1.256 -
   1.257 -		private void SetNodeName(WarFoundryObject obj)
   1.258 -		{
   1.259 -			TreeNode node = nodes[obj.ID];
   1.260 -
   1.261 -			if (node != null)
   1.262 -			{
   1.263 -				node.Text = CreateNodeName((ICostedWarFoundryObject)obj);
   1.264 -			}
   1.265 -		}
   1.266 -
   1.267 -		private TreeNode CreateTreeNode(Unit unit)
   1.268 -		{
   1.269 -			TreeNode temp = new TreeNode(CreateNodeName(unit));
   1.270 -			temp.Tag = unit;
   1.271 -			unit.NameChanged+= UnitNameChangedMethod;
   1.272 -			unit.PointsValueChanged += NodePointsValueChanged;
   1.273 -			nodes[unit.ID] = temp;
   1.274 -			return temp;
   1.275 -		}
   1.276 -
   1.277 -		public void FrmArmyTree_ArmyChanged(Army oldArmy, Army newArmy)
   1.278 -		{
   1.279 -			if (oldArmy != null)
   1.280 -			{
   1.281 -				oldArmy.UnitAdded -= UnitAddedMethod;
   1.282 -				oldArmy.UnitRemoved -= UnitRemovedMethod;
   1.283 -				oldArmy.PointsValueChanged -= NodePointsValueChanged;
   1.284 -			}
   1.285 -
   1.286 -			if (newArmy != null)
   1.287 -			{
   1.288 -				newArmy.UnitAdded += UnitAddedMethod;
   1.289 -				newArmy.UnitRemoved += UnitRemovedMethod;
   1.290 -				newArmy.PointsValueChanged += NodePointsValueChanged;
   1.291 -			}
   1.292 -
   1.293 -			SetArmy(newArmy);
   1.294 -		}
   1.295 -
   1.296 -		private void UnitAdded(WarFoundryObject obj)
   1.297 -		{
   1.298 -			if (obj is Unit)
   1.299 -			{
   1.300 -				Unit unit = (Unit)obj;
   1.301 -				ArmyCategory cat = unit.Category;
   1.302 -				TreeNode parent = nodes[cat.ID];
   1.303 -				TreeNode unitNode = CreateTreeNode(unit);
   1.304 -				parent.Nodes.Add(unitNode);
   1.305 -				parent.Expand(); //make sure it's expanded
   1.306 -			}
   1.307 -		}
   1.308 -
   1.309 -		public new FrmMain MdiParent
   1.310 -		{
   1.311 -			get { return (FrmMain) base.MdiParent; }
   1.312 -			set { base.MdiParent = value; }
   1.313 -		}
   1.314 -
   1.315 -		private void UnitRemoved(WarFoundryObject obj)
   1.316 -		{
   1.317 -			if (obj is Unit)
   1.318 -			{
   1.319 -				Unit unit = (Unit)obj;
   1.320 -				RemoveUnitFromTree(unit);
   1.321 -			}
   1.322 -		}
   1.323 -
   1.324 -		private void RemoveUnitFromTree(Unit unit)
   1.325 -		{
   1.326 -			TreeNode unitNode = nodes[unit.ID];
   1.327 -			unit.NameChanged-= UnitNameChangedMethod;
   1.328 -
   1.329 -			if (unitNode!=null)
   1.330 -			{
   1.331 -				unitNode.Remove();
   1.332 -				nodes.Remove(unit.ID);
   1.333 -			}
   1.334 -		}
   1.335 -
   1.336 -
   1.337 -		private void contextMenu_Popup(object sender, System.EventArgs e)
   1.338 -		{
   1.339 -			TreeNode node = treeView.SelectedNode;
   1.340 -
   1.341 -			if (node!=null && node.Tag is Unit)
   1.342 -			{
   1.343 -				foreach(MenuItem item in contextMenu.MenuItems)
   1.344 -				{
   1.345 -					item.Visible = true;
   1.346 -				}
   1.347 -			}
   1.348 -			else
   1.349 -			{
   1.350 -				foreach(MenuItem item in contextMenu.MenuItems)
   1.351 -				{
   1.352 -					item.Visible = false;
   1.353 -				}
   1.354 -			}
   1.355 -		}
   1.356 -
   1.357 -		private void treeView_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
   1.358 -		{
   1.359 -			if (e.Button == MouseButtons.Right)
   1.360 -			{
   1.361 -				TreeNode tn = treeView.GetNodeAt(e.X, e.Y);
   1.362 -
   1.363 -				if (tn!=null)
   1.364 -				{
   1.365 -					treeView.SelectedNode = tn;
   1.366 -				}
   1.367 -				else
   1.368 -				{
   1.369 -					treeView.SelectedNode = null;
   1.370 -				}
   1.371 -			}
   1.372 -		}
   1.373 -
   1.374 -		private void miDelete_Click(object sender, System.EventArgs e)
   1.375 -		{
   1.376 -			DeleteUnit();
   1.377 -		}
   1.378 -
   1.379 -		private void DeleteUnit()
   1.380 -		{
   1.381 -
   1.382 -			TreeNode selected = treeView.SelectedNode;
   1.383 -
   1.384 -			if (selected.Tag != null && selected.Tag is Unit)
   1.385 -			{
   1.386 -				Unit unit = (Unit) selected.Tag;
   1.387 -				commandStack.Execute(new RemoveUnitCommand(unit));
   1.388 -			}
   1.389 -		}
   1.390 -
   1.391 -		private void miEdit_Click(object sender, System.EventArgs e)
   1.392 -		{	
   1.393 -			EditUnit();
   1.394 -		}
   1.395 -
   1.396 -		private void treeView_DoubleClick(object sender, System.EventArgs e)
   1.397 -		{
   1.398 -			EditUnit();			
   1.399 -		}
   1.400 -
   1.401 -		private void EditUnit()
   1.402 -		{
   1.403 -			TreeNode selected = treeView.SelectedNode;
   1.404 -			object tagData = selected.Tag;
   1.405 -
   1.406 -			if (tagData is Unit)
   1.407 -			{
   1.408 -				Unit unit = (Unit) tagData;
   1.409 -				MdiParent.OpenUnitDialog(unit);
   1.410 -			}
   1.411 -		}
   1.412 -
   1.413 -		private void UpdateUnitName(WarFoundryObject obj, string oldValue, string newValue)
   1.414 -		{
   1.415 -			if (obj is ICostedWarFoundryObject)
   1.416 -			{
   1.417 -				SetNodeName(obj);
   1.418 -			}
   1.419 -		}
   1.420 -
   1.421 -		private void UpdateArmyName(WarFoundryObject obj, string oldValue, string newValue)
   1.422 -		{
   1.423 -			if (obj is Army)
   1.424 -			{
   1.425 -				Army army = (Army)obj;
   1.426 -				TreeNode node = treeView.Nodes[0];
   1.427 -				
   1.428 -				if (node!=null)
   1.429 -				{
   1.430 -					node.Text = army.Name;
   1.431 -				}
   1.432 -			}
   1.433 -		}
   1.434 -
   1.435 -		private void FrmArmyTree_TreeNameChanged(WarFoundryObject obj, string oldValue, string newValue)
   1.436 -		{
   1.437 -			TreeNode node = nodes[obj.ID];
   1.438 -
   1.439 -			if (node!=null)
   1.440 -			{
   1.441 -				node.Text = obj.Name;
   1.442 -			}
   1.443 -		}
   1.444 -
   1.445 -		private void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
   1.446 -		{
   1.447 -			if (e.Button == bttnDelete)
   1.448 -			{
   1.449 -				DeleteUnit();
   1.450 -			}
   1.451 -			else if (e.Button == bttnEdit)
   1.452 -			{
   1.453 -				EditUnit();
   1.454 -			}
   1.455 -		}
   1.456 -
   1.457 -		private void treeView_AfterSelect(object sender, TreeViewEventArgs e)
   1.458 -		{
   1.459 -			TreeNode node = treeView.SelectedNode;
   1.460 -
   1.461 -			bttnDelete.Enabled = (node != null && node.Tag is Unit);
   1.462 -			bttnEdit.Enabled = bttnDelete.Enabled;
   1.463 -		}
   1.464 -	}
   1.465 -}
   1.466 +// This file (FrmArmyTree.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2009 IBBoard.
   1.467 +//
   1.468 +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
   1.469 +
   1.470 +using System;
   1.471 +using System.Drawing;
   1.472 +using System.Collections.Generic;
   1.473 +using System.ComponentModel;
   1.474 +using System.Windows.Forms;
   1.475 +using IBBoard.Commands;
   1.476 +using IBBoard.Lang;
   1.477 +using IBBoard.Windows.Forms.I18N;
   1.478 +using IBBoard.Windows.Forms;
   1.479 +using IBBoard.WarFoundry.API;
   1.480 +using IBBoard.WarFoundry.API.Commands;
   1.481 +using IBBoard.WarFoundry.API.Objects;
   1.482 +
   1.483 +namespace IBBoard.WarFoundry.GUI.WinForms
   1.484 +{
   1.485 +	/// <summary>
   1.486 +	/// Summary description for FrmArmyTree.
   1.487 +	/// </summary>
   1.488 +	public class FrmArmyTree : IBBoard.Windows.Forms.IBBForm
   1.489 +	{
   1.490 +		private System.Windows.Forms.TreeView treeView;
   1.491 +		private IContainer components;
   1.492 +		private Dictionary<string, TreeNode> nodes;
   1.493 +		private System.Windows.Forms.ContextMenu contextMenu;
   1.494 +		private IBBMenuItem miDeleteUnit;
   1.495 +		private IBBMenuItem miEditUnit;
   1.496 +		
   1.497 +		private ObjectAddDelegate UnitAddedMethod;
   1.498 +		private ObjectRemoveDelegate UnitRemovedMethod;
   1.499 +		private StringValChangedDelegate UnitNameChangedMethod, ArmyNameChangedMethod, TreeNameChangedMethod;
   1.500 +		private ToolBar toolBar;
   1.501 +		private IBBToolBarButton bttnEdit;
   1.502 +		private IBBToolBarButton bttnDelete;
   1.503 +		private ImageList imageList;
   1.504 +		private CommandStack commandStack;
   1.505 +        public GameSystem CurrentGameSystem
   1.506 +        {
   1.507 +            get { return WarFoundryCore.CurrentGameSystem; }
   1.508 +            set { WarFoundryCore.CurrentGameSystem = value; }
   1.509 +        }
   1.510 +
   1.511 +		public FrmArmyTree(CommandStack cmdStack)
   1.512 +		{
   1.513 +			commandStack = cmdStack;
   1.514 +			InitializeComponent();
   1.515 +			UnitAddedMethod = new ObjectAddDelegate(UnitAdded);
   1.516 +			UnitRemovedMethod = new ObjectRemoveDelegate(UnitRemoved);
   1.517 +			UnitNameChangedMethod = new StringValChangedDelegate(UpdateUnitName);
   1.518 +			ArmyNameChangedMethod = new StringValChangedDelegate(UpdateArmyName);
   1.519 +			TreeNameChangedMethod = new StringValChangedDelegate(FrmArmyTree_TreeNameChanged);
   1.520 +			nodes = new Dictionary<string, TreeNode>();
   1.521 +			this.Name = "ArmyTree";			
   1.522 +			WarFoundryCore.ArmyChanged+= new ArmyChangedDelegate(FrmArmyTree_ArmyChanged);
   1.523 +			TranslateForm();
   1.524 +			Translation.TranslationChanged += new MethodInvoker(TranslateForm);
   1.525 +		}
   1.526 +
   1.527 +		private void TranslateForm()
   1.528 +		{
   1.529 +			ControlTranslator.TranslateControl(this);
   1.530 +
   1.531 +			foreach (Component comp in components.Components)
   1.532 +			{
   1.533 +				ControlTranslator.TranslateComponent(comp);
   1.534 +			}
   1.535 +
   1.536 +			foreach (IBBMenuItem mi in contextMenu.MenuItems)
   1.537 +			{
   1.538 +                ControlTranslator.TranslateComponent(mi);
   1.539 +			}
   1.540 +            foreach (TreeNode node in nodes.Values)
   1.541 +            {
   1.542 +                node.Text = CreateNodeName((ICostedWarFoundryObject)node.Tag);
   1.543 +            }
   1.544 +		}
   1.545 +
   1.546 +		/// <summary>
   1.547 +		/// Clean up any resources being used.
   1.548 +		/// </summary>
   1.549 +		protected override void Dispose( bool disposing )
   1.550 +		{
   1.551 +			if( disposing )
   1.552 +			{
   1.553 +				if(components != null)
   1.554 +				{
   1.555 +					components.Dispose();
   1.556 +				}
   1.557 +			}
   1.558 +			base.Dispose( disposing );
   1.559 +			Translation.TranslationChanged -= new MethodInvoker(TranslateForm);
   1.560 +			WarFoundryCore.ArmyChanged -= new ArmyChangedDelegate(FrmArmyTree_ArmyChanged);
   1.561 +		}
   1.562 +
   1.563 +		#region Windows Form Designer generated code
   1.564 +		/// <summary>
   1.565 +		/// Required method for Designer support - do not modify
   1.566 +		/// the contents of this method with the code editor.
   1.567 +		/// </summary>
   1.568 +		private void InitializeComponent()
   1.569 +		{
   1.570 +            this.components = new System.ComponentModel.Container();
   1.571 +            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmArmyTree));
   1.572 +            this.contextMenu = new System.Windows.Forms.ContextMenu();
   1.573 +            this.miEditUnit = new IBBoard.Windows.Forms.IBBMenuItem();
   1.574 +            this.miDeleteUnit = new IBBoard.Windows.Forms.IBBMenuItem();
   1.575 +            this.imageList = new System.Windows.Forms.ImageList(this.components);
   1.576 +            this.toolBar = new System.Windows.Forms.ToolBar();
   1.577 +            this.bttnEdit = new IBBoard.Windows.Forms.IBBToolBarButton();
   1.578 +            this.bttnDelete = new IBBoard.Windows.Forms.IBBToolBarButton();
   1.579 +            this.treeView = new System.Windows.Forms.TreeView();
   1.580 +            this.SuspendLayout();
   1.581 +            // 
   1.582 +            // contextMenu
   1.583 +            // 
   1.584 +            this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
   1.585 +            this.miEditUnit,
   1.586 +            this.miDeleteUnit});
   1.587 +            this.contextMenu.Popup += new System.EventHandler(this.contextMenu_Popup);
   1.588 +            // 
   1.589 +            // miEditUnit
   1.590 +            // 
   1.591 +            this.miEditUnit.Index = 0;
   1.592 +            this.miEditUnit.Text = "&edit unit";
   1.593 +            this.miEditUnit.Click += new System.EventHandler(this.miEdit_Click);
   1.594 +            // 
   1.595 +            // miDeleteUnit
   1.596 +            // 
   1.597 +            this.miDeleteUnit.Index = 1;
   1.598 +            this.miDeleteUnit.Text = "&delete unit";
   1.599 +            this.miDeleteUnit.Click += new System.EventHandler(this.miDelete_Click);
   1.600 +            // 
   1.601 +            // imageList
   1.602 +            // 
   1.603 +            this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
   1.604 +            this.imageList.TransparentColor = System.Drawing.Color.Transparent;
   1.605 +            this.imageList.Images.SetKeyName(0, "gtk-edit.png");
   1.606 +            this.imageList.Images.SetKeyName(1, "edit-delete.png");
   1.607 +            // 
   1.608 +            // toolBar
   1.609 +            // 
   1.610 +            this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
   1.611 +            this.bttnEdit,
   1.612 +            this.bttnDelete});
   1.613 +            this.toolBar.ButtonSize = new System.Drawing.Size(16, 16);
   1.614 +            this.toolBar.DropDownArrows = true;
   1.615 +            this.toolBar.ImageList = this.imageList;
   1.616 +            this.toolBar.Location = new System.Drawing.Point(0, 0);
   1.617 +            this.toolBar.Name = "toolBar";
   1.618 +            this.toolBar.ShowToolTips = true;
   1.619 +            this.toolBar.Size = new System.Drawing.Size(240, 28);
   1.620 +            this.toolBar.TabIndex = 3;
   1.621 +            this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);
   1.622 +            // 
   1.623 +            // bttnEdit
   1.624 +            // 
   1.625 +            this.bttnEdit.Enabled = false;
   1.626 +            this.bttnEdit.ImageIndex = 0;
   1.627 +            this.bttnEdit.Name = "bttnEdit";
   1.628 +            // 
   1.629 +            // bttnDelete
   1.630 +            // 
   1.631 +            this.bttnDelete.Enabled = false;
   1.632 +            this.bttnDelete.ImageIndex = 1;
   1.633 +            this.bttnDelete.Name = "bttnDelete";
   1.634 +            // 
   1.635 +            // treeView
   1.636 +            // 
   1.637 +            this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
   1.638 +                        | System.Windows.Forms.AnchorStyles.Left)
   1.639 +                        | System.Windows.Forms.AnchorStyles.Right)));
   1.640 +            this.treeView.ContextMenu = this.contextMenu;
   1.641 +            this.treeView.FullRowSelect = true;
   1.642 +            this.treeView.ImageIndex = 0;
   1.643 +            this.treeView.ImageList = this.imageList;
   1.644 +            this.treeView.Location = new System.Drawing.Point(0, 28);
   1.645 +            this.treeView.Name = "treeView";
   1.646 +            this.treeView.SelectedImageIndex = 0;
   1.647 +            this.treeView.Size = new System.Drawing.Size(240, 250);
   1.648 +            this.treeView.TabIndex = 0;
   1.649 +            this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect);
   1.650 +            this.treeView.DoubleClick += new System.EventHandler(this.treeView_DoubleClick);
   1.651 +            this.treeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseDown);
   1.652 +            // 
   1.653 +            // FrmArmyTree
   1.654 +            // 
   1.655 +            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   1.656 +            this.ClientSize = new System.Drawing.Size(240, 277);
   1.657 +            this.ControlBox = false;
   1.658 +            this.Controls.Add(this.toolBar);
   1.659 +            this.Controls.Add(this.treeView);
   1.660 +            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
   1.661 +            this.MaximizeBox = false;
   1.662 +            this.MinimizeBox = false;
   1.663 +            this.Name = "FrmArmyTree";
   1.664 +            this.Text = "FrmArmyTree";
   1.665 +            this.ResumeLayout(false);
   1.666 +            this.PerformLayout();
   1.667 +
   1.668 +		}
   1.669 +		#endregion
   1.670 +
   1.671 +		private void ClearArmy()
   1.672 +		{
   1.673 +			nodes.Clear();
   1.674 +			treeView.Nodes.Clear();
   1.675 +		}
   1.676 +
   1.677 +		private void SetArmy(Army army)
   1.678 +		{
   1.679 +			ClearArmy();
   1.680 +
   1.681 +			if (army != null)
   1.682 +			{
   1.683 +				ArmyCategory[] cats = army.Categories;
   1.684 +				TreeNode[] catNodes = new TreeNode[cats.Length];
   1.685 +				Unit[] units;
   1.686 +
   1.687 +				for (int i = 0; i < cats.Length; i++)
   1.688 +				{
   1.689 +					ArmyCategory cat = cats[i];
   1.690 +					units = army.GetUnits(cat);
   1.691 +					cat.NameChanged += TreeNameChangedMethod;
   1.692 +					cat.PointsValueChanged += NodePointsValueChanged;
   1.693 +					TreeNode[] unitNodes = new TreeNode[units.Length];
   1.694 +					TreeNode temp;
   1.695 +
   1.696 +					for (int j = 0; j < units.Length; j++)
   1.697 +					{
   1.698 +						unitNodes[j] = CreateTreeNode(units[j]);
   1.699 +					}
   1.700 +
   1.701 +					temp = new TreeNode(CreateNodeName(cat), unitNodes);
   1.702 +					temp.Tag = cat;
   1.703 +					catNodes[i] = temp;
   1.704 +					nodes[cat.ID] = temp;
   1.705 +				}
   1.706 +
   1.707 +				TreeNode root = new TreeNode(CreateNodeName(army), catNodes);
   1.708 +				root.Tag = army;
   1.709 +				army.PointsValueChanged += NodePointsValueChanged;
   1.710 +				nodes[army.ID] = root;
   1.711 +				treeView.Nodes.Add(root);
   1.712 +				root.ExpandAll();
   1.713 +			}
   1.714 +		}
   1.715 +		
   1.716 +		private string CreateNodeName(ICostedWarFoundryObject obj)
   1.717 +		{
   1.718 +            return Translation.GetTranslation("treeNodeText", "{0} ({1} pts)", obj.Name, obj.Points, CurrentGameSystem.UsePointsAbbrev(obj.Points));
   1.719 +		}
   1.720 +
   1.721 +		private void NodePointsValueChanged(WarFoundryObject obj, double oldValue, double newValue)
   1.722 +		{
   1.723 +			if (obj is ICostedWarFoundryObject)
   1.724 +			{
   1.725 +				SetNodeName(obj);
   1.726 +			}
   1.727 +		}
   1.728 +
   1.729 +		private void SetNodeName(WarFoundryObject obj)
   1.730 +		{
   1.731 +			TreeNode node = nodes[obj.ID];
   1.732 +
   1.733 +			if (node != null)
   1.734 +			{
   1.735 +				node.Text = CreateNodeName((ICostedWarFoundryObject)obj);
   1.736 +			}
   1.737 +		}
   1.738 +
   1.739 +		private TreeNode CreateTreeNode(Unit unit)
   1.740 +		{
   1.741 +			TreeNode temp = new TreeNode(CreateNodeName(unit));
   1.742 +			temp.Tag = unit;
   1.743 +			unit.NameChanged+= UnitNameChangedMethod;
   1.744 +			unit.PointsValueChanged += NodePointsValueChanged;
   1.745 +			nodes[unit.ID] = temp;
   1.746 +			return temp;
   1.747 +		}
   1.748 +
   1.749 +		public void FrmArmyTree_ArmyChanged(Army oldArmy, Army newArmy)
   1.750 +		{
   1.751 +			if (oldArmy != null)
   1.752 +			{
   1.753 +				oldArmy.UnitAdded -= UnitAddedMethod;
   1.754 +				oldArmy.UnitRemoved -= UnitRemovedMethod;
   1.755 +				oldArmy.PointsValueChanged -= NodePointsValueChanged;
   1.756 +			}
   1.757 +
   1.758 +			if (newArmy != null)
   1.759 +			{
   1.760 +				newArmy.UnitAdded += UnitAddedMethod;
   1.761 +				newArmy.UnitRemoved += UnitRemovedMethod;
   1.762 +				newArmy.PointsValueChanged += NodePointsValueChanged;
   1.763 +			}
   1.764 +
   1.765 +			SetArmy(newArmy);
   1.766 +		}
   1.767 +
   1.768 +		private void UnitAdded(WarFoundryObject obj)
   1.769 +		{
   1.770 +			if (obj is Unit)
   1.771 +			{
   1.772 +				Unit unit = (Unit)obj;
   1.773 +				ArmyCategory cat = unit.Category;
   1.774 +				TreeNode parent = nodes[cat.ID];
   1.775 +				TreeNode unitNode = CreateTreeNode(unit);
   1.776 +				parent.Nodes.Add(unitNode);
   1.777 +				parent.Expand(); //make sure it's expanded
   1.778 +			}
   1.779 +		}
   1.780 +
   1.781 +		public new FrmMain MdiParent
   1.782 +		{
   1.783 +			get { return (FrmMain) base.MdiParent; }
   1.784 +			set { base.MdiParent = value; }
   1.785 +		}
   1.786 +
   1.787 +		private void UnitRemoved(WarFoundryObject obj)
   1.788 +		{
   1.789 +			if (obj is Unit)
   1.790 +			{
   1.791 +				Unit unit = (Unit)obj;
   1.792 +				RemoveUnitFromTree(unit);
   1.793 +			}
   1.794 +		}
   1.795 +
   1.796 +		private void RemoveUnitFromTree(Unit unit)
   1.797 +		{
   1.798 +			TreeNode unitNode = nodes[unit.ID];
   1.799 +			unit.NameChanged-= UnitNameChangedMethod;
   1.800 +
   1.801 +			if (unitNode!=null)
   1.802 +			{
   1.803 +				unitNode.Remove();
   1.804 +				nodes.Remove(unit.ID);
   1.805 +			}
   1.806 +		}
   1.807 +
   1.808 +
   1.809 +		private void contextMenu_Popup(object sender, System.EventArgs e)
   1.810 +		{
   1.811 +			TreeNode node = treeView.SelectedNode;
   1.812 +
   1.813 +			if (node!=null && node.Tag is Unit)
   1.814 +			{
   1.815 +				foreach(MenuItem item in contextMenu.MenuItems)
   1.816 +				{
   1.817 +					item.Visible = true;
   1.818 +				}
   1.819 +			}
   1.820 +			else
   1.821 +			{
   1.822 +				foreach(MenuItem item in contextMenu.MenuItems)
   1.823 +				{
   1.824 +					item.Visible = false;
   1.825 +				}
   1.826 +			}
   1.827 +		}
   1.828 +
   1.829 +		private void treeView_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
   1.830 +		{
   1.831 +			if (e.Button == MouseButtons.Right)
   1.832 +			{
   1.833 +				TreeNode tn = treeView.GetNodeAt(e.X, e.Y);
   1.834 +
   1.835 +				if (tn!=null)
   1.836 +				{
   1.837 +					treeView.SelectedNode = tn;
   1.838 +				}
   1.839 +				else
   1.840 +				{
   1.841 +					treeView.SelectedNode = null;
   1.842 +				}
   1.843 +			}
   1.844 +		}
   1.845 +
   1.846 +		private void miDelete_Click(object sender, System.EventArgs e)
   1.847 +		{
   1.848 +			DeleteUnit();
   1.849 +		}
   1.850 +
   1.851 +		private void DeleteUnit()
   1.852 +		{
   1.853 +
   1.854 +			TreeNode selected = treeView.SelectedNode;
   1.855 +
   1.856 +			if (selected.Tag != null && selected.Tag is Unit)
   1.857 +			{
   1.858 +				Unit unit = (Unit) selected.Tag;
   1.859 +				commandStack.Execute(new RemoveUnitCommand(unit));
   1.860 +			}
   1.861 +		}
   1.862 +
   1.863 +		private void miEdit_Click(object sender, System.EventArgs e)
   1.864 +		{	
   1.865 +			EditUnit();
   1.866 +		}
   1.867 +
   1.868 +		private void treeView_DoubleClick(object sender, System.EventArgs e)
   1.869 +		{
   1.870 +			EditUnit();			
   1.871 +		}
   1.872 +
   1.873 +		private void EditUnit()
   1.874 +		{
   1.875 +			TreeNode selected = treeView.SelectedNode;
   1.876 +			object tagData = selected.Tag;
   1.877 +
   1.878 +			if (tagData is Unit)
   1.879 +			{
   1.880 +				Unit unit = (Unit) tagData;
   1.881 +				MdiParent.OpenUnitDialog(unit);
   1.882 +			}
   1.883 +		}
   1.884 +
   1.885 +		private void UpdateUnitName(WarFoundryObject obj, string oldValue, string newValue)
   1.886 +		{
   1.887 +			if (obj is ICostedWarFoundryObject)
   1.888 +			{
   1.889 +				SetNodeName(obj);
   1.890 +			}
   1.891 +		}
   1.892 +
   1.893 +		private void UpdateArmyName(WarFoundryObject obj, string oldValue, string newValue)
   1.894 +		{
   1.895 +			if (obj is Army)
   1.896 +			{
   1.897 +				Army army = (Army)obj;
   1.898 +				TreeNode node = treeView.Nodes[0];
   1.899 +				
   1.900 +				if (node!=null)
   1.901 +				{
   1.902 +					node.Text = army.Name;
   1.903 +				}
   1.904 +			}
   1.905 +		}
   1.906 +
   1.907 +		private void FrmArmyTree_TreeNameChanged(WarFoundryObject obj, string oldValue, string newValue)
   1.908 +		{
   1.909 +			TreeNode node = nodes[obj.ID];
   1.910 +
   1.911 +			if (node!=null)
   1.912 +			{
   1.913 +				node.Text = obj.Name;
   1.914 +			}
   1.915 +		}
   1.916 +
   1.917 +		private void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
   1.918 +		{
   1.919 +			if (e.Button == bttnDelete)
   1.920 +			{
   1.921 +				DeleteUnit();
   1.922 +			}
   1.923 +			else if (e.Button == bttnEdit)
   1.924 +			{
   1.925 +				EditUnit();
   1.926 +			}
   1.927 +		}
   1.928 +
   1.929 +		private void treeView_AfterSelect(object sender, TreeViewEventArgs e)
   1.930 +		{
   1.931 +			TreeNode node = treeView.SelectedNode;
   1.932 +
   1.933 +			bttnDelete.Enabled = (node != null && node.Tag is Unit);
   1.934 +			bttnEdit.Enabled = bttnDelete.Enabled;
   1.935 +		}
   1.936 +	}
   1.937 +}
     2.1 --- a/FrmMain.cs	Sun Dec 12 17:30:53 2010 +0000
     2.2 +++ b/FrmMain.cs	Mon Jan 24 16:50:31 2011 +0000
     2.3 @@ -24,6 +24,7 @@
     2.4  using IBBoard.WarFoundry.API.Commands;
     2.5  using IBBoard.WarFoundry.API.Exporters;
     2.6  using IBBoard.WarFoundry.API.Objects;
     2.7 +using IBBoard.WarFoundry.API.Util;
     2.8  using IBBoard.WarFoundry.API.Savers;
     2.9  using IBBoard.WarFoundry.API.Factories;
    2.10  using IBBoard.WarFoundry.API.Factories.Xml;
    2.11 @@ -38,6 +39,12 @@
    2.12  		private static readonly string AppTitle = "WarFoundry";
    2.13  		internal static readonly string VERSION = "0.1";
    2.14          const string DefaultDataDir = "data";
    2.15 +       /* public static string pointsAbbrevSingle;
    2.16 +        public static string pointsAbbrevPlural;
    2.17 +        public static string pointsAbbreviation;
    2.18 +        public static string pointsNameSingle;
    2.19 +        public static string pointsNamePlural;
    2.20 +        public static string pointsName;*/
    2.21  
    2.22  		private Preferences preferences;
    2.23  		private readonly ILog log = LogManager.GetLogger(typeof(FrmMain));
    2.24 @@ -94,6 +101,7 @@
    2.25  		private IBBToolStripMenuItem miPreferences;
    2.26  		private IBBToolStripMenuItem miAbout;
    2.27  
    2.28 +
    2.29  		/// <summary>
    2.30  		/// The main entry point for the application.
    2.31  		/// </summary>
    2.32 @@ -146,8 +154,9 @@
    2.33  			PointsValueChangedMethod = new DoubleValChangedDelegate(FrmMain_PointsValueChangedMethod);
    2.34  			//FailedUnitRequirementMethod = new FailedUnitRequirementDelegate(FrmMain_FailedUnitRequirement);
    2.35  
    2.36 +            
    2.37  			sbErrorPanel.Color = Color.Red;
    2.38 -			sbPointsPanel.ToolTipText = Translation.GetTranslation("statusPanelPointsToolTip", "total points value");
    2.39 +			SetPointsPanelToolTipText();
    2.40  
    2.41  			// hack to load default files
    2.42  			WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Constants.ExecutablePath + Constants.DirectoryString + DefaultDataDir));
    2.43 @@ -180,7 +189,15 @@
    2.44  			ControlTranslator.TranslateComponents(components.Components);
    2.45  			ControlTranslator.TranslateComponent(openArmyDialog);
    2.46  			ControlTranslator.TranslateComponent(saveArmyDialog);
    2.47 -		}
    2.48 +            //make sure translations exist for gamesystem pointsnames
    2.49 +            if (CurrentGameSystem != null)
    2.50 +            {
    2.51 +                CurrentGameSystem.LoadPointsSystemNames();
    2.52 +            }
    2.53 +            //translate pointspanel and tooltip
    2.54 +            SetPointsPanelToolTipText();
    2.55 +            SetPointsPanelText();
    2.56 +        }
    2.57  
    2.58  		void TranslationChanged()
    2.59  		{
    2.60 @@ -868,6 +885,7 @@
    2.61  		{
    2.62  			SetAppTitle();
    2.63  			RemoveCategoryButtons();
    2.64 +            newSystem.LoadPointsSystemNames();
    2.65  		}
    2.66  
    2.67  		private void FrmMain_ArmyChanged(Army oldArmy, Army newArmy)
    2.68 @@ -1274,8 +1292,104 @@
    2.69  				SetPointsPanelText();
    2.70  			}
    2.71  		}
    2.72 +/*
    2.73 +        public static string UsePointsAbbrev(double pointTemp) 
    2.74 +        {
    2.75 +            if (pointTemp == 1)
    2.76 +            {
    2.77 +                pointsAbbreviation = pointsAbbrevSingle;
    2.78 +            }
    2.79 +            else
    2.80 +            {
    2.81 +                pointsAbbreviation = pointsAbbrevPlural;
    2.82 +            }
    2.83 +            return pointsAbbreviation;
    2.84 +        }
    2.85  
    2.86 -		private void SetPointsPanelText()
    2.87 +        public static string UsePointsName(double pointTemp)
    2.88 +        {
    2.89 +            
    2.90 +                if (pointTemp == 1)
    2.91 +                {
    2.92 +                    pointsName = pointsNameSingle;
    2.93 +                }
    2.94 +                else
    2.95 +                {
    2.96 +                    pointsName = pointsNamePlural;
    2.97 +                }
    2.98 +            return pointsName;
    2.99 +        }
   2.100 +
   2.101 +        private void LoadPointsSystemNames()
   2.102 +        {
   2.103 +            LoadPointsAbbrevPlural();
   2.104 +            LoadPointsAbbrevSingle();
   2.105 +            LoadPointsNamePlural();
   2.106 +            LoadPointsNameSingle();
   2.107 +        }
   2.108 +        private void LoadPointsAbbrevPlural()
   2.109 +        {
   2.110 +            // Use this before calling on pointsAbbreviationPlural to "populate" the variable
   2.111 +            if (CurrentGameSystem != null )
   2.112 +            {
   2.113 +                if (CurrentGameSystem.SystemPtsAbbrevPlural == "")
   2.114 +                {
   2.115 +                    pointsAbbrevPlural = String.Format(Translation.GetTranslation("PointsLocalisationAbbrevPlural"));
   2.116 +                }
   2.117 +                else
   2.118 +                {
   2.119 +                    pointsAbbrevPlural = CurrentGameSystem.SystemPtsAbbrevPlural;
   2.120 +                }
   2.121 +            }
   2.122 +        }
   2.123 +        private void LoadPointsAbbrevSingle()
   2.124 +        {
   2.125 +            // Use this before calling on pointsAbbreviationSingle to "populate" the variable
   2.126 +            if (CurrentGameSystem != null )
   2.127 +            {
   2.128 +                if (CurrentGameSystem.SystemPtsAbbrevSingle == "")
   2.129 +                {
   2.130 +                    pointsAbbrevSingle = String.Format(Translation.GetTranslation("PointsLocalisationAbbrevSingle"));
   2.131 +                }
   2.132 +                else
   2.133 +                {
   2.134 +                    pointsAbbrevSingle = CurrentGameSystem.SystemPtsAbbrevSingle;
   2.135 +                }
   2.136 +            }
   2.137 +        }
   2.138 +        private void LoadPointsNamePlural()
   2.139 +        {
   2.140 +            if (CurrentGameSystem != null )
   2.141 +            {
   2.142 +                // Use this before calling on pointsNamePlural to "populate" the variable
   2.143 +                if (CurrentGameSystem.SystemPtsNamePlural == "")
   2.144 +                {
   2.145 +                    pointsNamePlural = String.Format(Translation.GetTranslation("PointsLocalisationNamePlural"));
   2.146 +                }
   2.147 +                else
   2.148 +                {
   2.149 +                    pointsNamePlural = CurrentGameSystem.SystemPtsNamePlural;
   2.150 +                }
   2.151 +            }
   2.152 +        }
   2.153 +
   2.154 +        private void LoadPointsNameSingle()
   2.155 +        {
   2.156 +            if (CurrentGameSystem != null )
   2.157 +            {
   2.158 +                // Use this before calling on pointsNameSingle to "populate" the variable
   2.159 +                if (CurrentGameSystem.SystemPtsNameSingle == "")
   2.160 +                {
   2.161 +                    pointsNameSingle = String.Format(Translation.GetTranslation("PointsLocalisationNameSingle"));
   2.162 +                }
   2.163 +                else
   2.164 +                {
   2.165 +                    pointsNameSingle = CurrentGameSystem.SystemPtsNameSingle;
   2.166 +                }
   2.167 +            }
   2.168 +        }
   2.169 +        */
   2.170 +        private void SetPointsPanelText()
   2.171  		{	
   2.172  			if (CurrentArmy==null)
   2.173  			{
   2.174 @@ -1284,7 +1398,8 @@
   2.175  			}
   2.176  			else 
   2.177  			{
   2.178 -				sbPointsPanel.Text = String.Format(Translation.GetTranslation("statusPanelPoints"), CurrentArmy.Points, CurrentArmy.MaxPoints);
   2.179 +                string pointsPanelText = String.Format(Translation.GetTranslation("statusPanelPoints"), CurrentArmy.Points, CurrentGameSystem.UsePointsName(CurrentArmy.Points), CurrentArmy.MaxPoints, CurrentGameSystem.UsePointsName(CurrentArmy.MaxPoints));
   2.180 +                sbPointsPanel.Text = pointsPanelText;
   2.181  
   2.182  				if (CurrentArmy.Points>CurrentArmy.MaxPoints)
   2.183  				{
   2.184 @@ -1297,6 +1412,11 @@
   2.185  			}
   2.186  		}
   2.187  
   2.188 +        private void SetPointsPanelToolTipText()
   2.189 +        {
   2.190 +            sbPointsPanel.ToolTipText = Translation.GetTranslation("statusPanelPointsToolTip", "total points value");
   2.191 +        }
   2.192 +
   2.193  		private void redoMenu_Click(object sender, EventArgs e)
   2.194  		{
   2.195  			if (sender is ToolStripDropDownItem)
     3.1 --- a/FrmNewArmy.cs	Sun Dec 12 17:30:53 2010 +0000
     3.2 +++ b/FrmNewArmy.cs	Mon Jan 24 16:50:31 2011 +0000
     3.3 @@ -357,7 +357,7 @@
     3.4  			txtArmyName.Text = "";
     3.5              txtArmyName.Enabled = false;
     3.6              lstRaces.Items.Clear();
     3.7 -            armySize.Value = (decimal)selected.SystemArmyDefaultSize;
     3.8 +            armySize.Value = selected.SystemArmyDefaultSize;
     3.9   
    3.10  			if (selected != null)
    3.11  			{
     4.1 --- a/FrmUnit.cs	Sun Dec 12 17:30:53 2010 +0000
     4.2 +++ b/FrmUnit.cs	Mon Jan 24 16:50:31 2011 +0000
     4.3 @@ -47,7 +47,13 @@
     4.4  		private TextBox notes;
     4.5  		private ListBox abilitiesList;
     4.6  		private IBBLabel lblAbilities;
     4.7 -		private FlowLayoutPanel statsPanel;
     4.8 +		private FlowLayoutPanel statsPanel;
     4.9 +        public GameSystem CurrentGameSystem
    4.10 +        {
    4.11 +            get { return WarFoundryCore.CurrentGameSystem; }
    4.12 +            set { WarFoundryCore.CurrentGameSystem = value; }
    4.13 +        }
    4.14 +
    4.15  		/// <summary>
    4.16  		/// Required designer variable.
    4.17  		/// </summary>
    4.18 @@ -101,7 +107,7 @@
    4.19  
    4.20  		private void SetPointsValueText()
    4.21  		{
    4.22 -			lblPoints.Text = "(" + unit.Points + " pts)";
    4.23 +            lblPoints.Text = Translation.GetTranslation("FrmUnitlblPoints", "(" + unit.Points + " pts)", unit.Points, CurrentGameSystem.UsePointsAbbrev(unit.Points));
    4.24  		}
    4.25  
    4.26  		private void SetStats()
     5.1 --- a/Util/UnitEquipmentChoice.cs	Sun Dec 12 17:30:53 2010 +0000
     5.2 +++ b/Util/UnitEquipmentChoice.cs	Mon Jan 24 16:50:31 2011 +0000
     5.3 @@ -6,6 +6,7 @@
     5.4  using IBBoard.Lang;
     5.5  using IBBoard.WarFoundry.API.Objects;
     5.6  using IBBoard.WarFoundry.API.Util;
     5.7 +using IBBoard.WarFoundry.API;
     5.8  
     5.9  namespace IBBoard.WarFoundry.GUI.WinForms.Util
    5.10  {
    5.11 @@ -17,6 +18,11 @@
    5.12      {
    5.13          private Unit unit;
    5.14  		private UnitEquipmentItem item;
    5.15 +        public GameSystem CurrentGameSystem
    5.16 +        {
    5.17 +            get { return WarFoundryCore.CurrentGameSystem; }
    5.18 +            set { WarFoundryCore.CurrentGameSystem = value; }
    5.19 +        }
    5.20  
    5.21          public UnitEquipmentChoice(Unit unit, UnitEquipmentItem unitItem)
    5.22          {
    5.23 @@ -34,7 +40,7 @@
    5.24  			}
    5.25  			else
    5.26  			{
    5.27 -				translation = Translation.GetTranslation("equipmentAmountWithCost", "{0} ({1} at {2}pts each)", item.Name, GetAmountString(), item.Cost);
    5.28 +                translation = Translation.GetTranslation("equipmentAmountWithCost", "{0} ({1} at {2}pts each)", item.Name, GetAmountString(), item.Cost, CurrentGameSystem.UsePointsAbbrev(item.Cost));
    5.29  			}
    5.30  
    5.31  			return translation;
     6.1 --- a/translations/en.translation	Sun Dec 12 17:30:53 2010 +0000
     6.2 +++ b/translations/en.translation	Mon Jan 24 16:50:31 2011 +0000
     6.3 @@ -29,7 +29,11 @@
     6.4  	<translation id="openArmyDialog">Open Army</translation>
     6.5  	<translation id="saveArmyDialog">Save Army</translation>
     6.6  	<translation id="armyFileFilter">WarFoundry Army Files (*.army)</translation>
     6.7 -	<translation id="statusPanelPoints">{0} pts / {1} pts</translation>
     6.8 +  <translation id="PointsLocalisationAbbrevSingle">pt</translation>
     6.9 +  <translation id="PointsLocalisationAbbrevPlural">pts</translation>
    6.10 +  <translation id="PointsLocalisationNameSingle">point</translation>
    6.11 +  <translation id="PointsLocalisationNamePlural">points</translation>
    6.12 +	<translation id="statusPanelPoints">{0} {1} / {2} {3}</translation>
    6.13  	<translation id="statusPanelPointsToolTip">Current army points value</translation>
    6.14  	<translation id="defaultUnitName">Unit of {0} {1}</translation>
    6.15  	<translation id="FrmNewArmy">Create new army</translation>
    6.16 @@ -66,6 +70,7 @@
    6.17  	<translation id="lblDevelopers">Developers:</translation>
    6.18  	<translation id="lblThanks">Thanks to:</translation>
    6.19  	<translation id="FrmUnit">{0} ({1})</translation>
    6.20 +  <translation id="FrmUnitlblPoints">({0} {1})</translation>
    6.21  	<translation id="lblUnitSize">Unit size:</translation>
    6.22  	<translation id="StatLineName">Type Name</translation>
    6.23  	<translation id="lblEquip">Equipment:</translation>
    6.24 @@ -75,7 +80,7 @@
    6.25  	<translation id="bttnRemoveWeapon">Remove</translation>
    6.26  	<translation id="bttnReplaceWeapon">Replace</translation>
    6.27  	<translation id="bttnEditWeapon">Edit</translation>
    6.28 -	<translation id="equipmentAmountWithCost">{0} ({1} at {2}pts each)</translation>
    6.29 +	<translation id="equipmentAmountWithCost">{0} ({1} at {2}{3} each)</translation>
    6.30  	<translation id="equipmentAmountWithZeroCost">{0} ({1} for free)</translation>
    6.31  	<translation id="equipmentChoiceAmountAll">For all ({1})</translation>
    6.32  	<translation id="equipmentChoiceAmountPercentage">For {0}% ({1})</translation>
    6.33 @@ -123,4 +128,6 @@
    6.34  	<translation id="lblLanguage">Language:</translation>
    6.35  	<translation id="languagesGroup">Language</translation>
    6.36    <translation id="GameSystemFilesReloaded">Game system and race files reloaded</translation>
    6.37 +  <translation id="treeNodeText">{0} ({1} {2})</translation>
    6.38 +  <translation id="setUnitEquipmentItemName">( {0} {1} each)</translation>
    6.39  </translations>
    6.40 \ No newline at end of file
     7.1 --- a/translations/sv.translation	Sun Dec 12 17:30:53 2010 +0000
     7.2 +++ b/translations/sv.translation	Mon Jan 24 16:50:31 2011 +0000
     7.3 @@ -1,127 +1,134 @@
     7.4 -<?xml version="1.0" encoding="UTF-8"?>
     7.5 +<?xml version="1.0" encoding="UTF-8"?>
     7.6  <translations xmlns="http://ibboard.co.uk/translation" lang="sv">
     7.7 -	<translation id="menuFile">&amp;Arkiv</translation>
     7.8 -	<translation id="menuEdit">&amp;Redigera</translation>
     7.9 -	<translation id="menuHelp">&amp;Hjälp</translation>
    7.10 -	<translation id="miNewArmy">&amp;Skapa ny armé</translation>
    7.11 -	<translation id="miOpenArmy">&amp;Öppna sparad armé</translation>
    7.12 -	<translation id="miSaveArmy">&amp;Spara armé</translation>
    7.13 -	<translation id="miSaveArmyAs">Spara armé &amp;som...</translation>
    7.14 -	<translation id="miExportArmyAs">&amp;Exportera armé</translation>
    7.15 -	<translation id="miExportArmyAsBasicHTML">Normal HTML</translation>
    7.16 -	<translation id="miCloseArmy">&amp;Stäng armé</translation>
    7.17 -	<translation id="miReloadFiles">&amp;Läs in filer på nytt</translation>
    7.18 -	<translation id="miExit">A&amp;vsluta</translation>
    7.19 -	<translation id="miUndo">&amp;Återställ</translation>
    7.20 -	<translation id="miRedo">&amp;Gör om</translation>
    7.21 -	<translation id="miPreferences">&amp;Inställningar</translation>
    7.22 -	<translation id="miAbout">&amp;Om</translation>
    7.23 +	<translation id="armyFileFilter">WarFoundry arméfiler (*.army)</translation>
    7.24 +	<translation id="armyHtmlExportEquipAmountAll">alla ({1})</translation>
    7.25 +	<translation id="armyHtmlExportEquipAmountNumber">{0}</translation>
    7.26 +	<translation id="armyHtmlExportEquipAmountPercentage">{0}% ({1})</translation>
    7.27 +	<translation id="armyHtmlExportEquipAmountRatio">{0} för {1}</translation>
    7.28 +	<translation id="armyHtmlOutputBodyHeader">{0} - {1}poäng</translation>
    7.29 +	<translation id="armyHtmlOutputTableHeaderUnitName">Namn</translation>
    7.30 +	<translation id="armyHtmlOutputTableHeaderUnitNotes">Anteckningar</translation>
    7.31 +	<translation id="armyHtmlOutputTableHeaderUnitPoints">Poäng</translation>
    7.32 +	<translation id="ArmyTree">Arméöversikt</translation>
    7.33 +	<translation id="bttnAddWeapon">Lägg till</translation>
    7.34 +	<translation id="bttnCancel">Avbryt</translation>
    7.35 +	<translation id="bttnEditWeapon">Redigera</translation>
    7.36 +	<translation id="bttnNewArmy">Skapa ny armé</translation>
    7.37  	<translation id="bttnOkay">OK</translation>
    7.38 -	<translation id="bttnCancel">Avbryt</translation>
    7.39 -	<translation id="bttnNewArmy">Skapa ny armé</translation>
    7.40  	<translation id="bttnOpenArmy">Öppna sparad armé</translation>
    7.41 +	<translation id="bttnRedo">Gör om</translation>
    7.42 +	<translation id="bttnRemoveWeapon">Ta bort</translation>
    7.43 +	<translation id="bttnReplaceWeapon">Ersätt</translation>
    7.44  	<translation id="bttnSaveArmy">Spara armé</translation>
    7.45 +	<translation id="bttnSelectRace">Skapa armé</translation>
    7.46 +	<translation id="bttnSelectUnit">Skapa enhet</translation>
    7.47  	<translation id="bttnUndo">Återställ</translation>
    7.48 -	<translation id="bttnRedo">Gör om</translation>
    7.49 -	<translation id="ArmyTree">Arméöversikt</translation>
    7.50 -	<translation id="miDeleteUnit">&amp;Ta bort enhet</translation>
    7.51 -	<translation id="miEditUnit">&amp;Redigera enhet</translation>
    7.52 -	<translation id="openArmyDialog">Öppna armé</translation>
    7.53 -	<translation id="saveArmyDialog">Spara armé</translation>
    7.54 -	<translation id="armyFileFilter">WarFoundry arméfiler (*.army)</translation>
    7.55 -	<translation id="statusPanelPoints">{0} poäng / {1} poäng</translation>
    7.56 -	<translation id="statusPanelPointsToolTip">Aktuellt poängvärde för armé</translation>
    7.57 +	<translation id="createAndAddUnitCommandDescription">Lägg till enhet av {0}</translation>
    7.58 +	<translation id="createAndAddUnitCommandUndoDescription">Ta bort enhet av {0}</translation>
    7.59  	<translation id="defaultUnitName">Enhet av {0} {1}</translation>
    7.60 -	<translation id="FrmNewArmy">Skapa ny armé</translation>
    7.61 -	<translation id="lblGameSystem">Spelsystem:</translation>
    7.62 -	<translation id="lblRaceList">Raser:</translation>
    7.63 -	<translation id="lblArmyName">Arménamn:</translation>
    7.64 -	<translation id="lblArmySize">Arméstorlek:</translation>
    7.65 -	<translation id="bttnSelectRace">Skapa armé</translation>
    7.66 -	<translation id="newArmyNoGameSystems">WarFoundry kunde inte hitta data för spel system.
    7.67 -Vänligen kontrollera felmeddelanden i loggen och se till att du har datafielr för spelsystme i "data" mappen.</translation>
    7.68 -	<translation id="FrmNewUnit">Lägg till en ny {0}</translation>
    7.69 -	<translation id="lblUnitList">Enheter:</translation>
    7.70 -	<translation id="bttnSelectUnit">Skapa enhet</translation>
    7.71 -	<translation id="FrmNewUnitEquipment">Ny utrustning för {0}</translation>
    7.72 -	<translation id="FrmReplaceUnitEquipment">Ersätt {0} med ny utrustning</translation>
    7.73 -	<translation id="lblAmount">Antal:</translation>
    7.74 -	<translation id="lblItem">Utrustning:</translation>
    7.75 -	<translation id="rbEquipAll">Utrusta alla</translation>
    7.76 +	<translation id="equipmentAmountAll">alla ({1})</translation>
    7.77 +	<translation id="equipmentAmountNumber">{0}</translation>
    7.78 +	<translation id="equipmentAmountPercentage">{0}% ({1})</translation>
    7.79 +	<translation id="equipmentAmountWithCost">{0} ({1} för {2} {3} var)</translation>
    7.80 +	<translation id="equipmentAmountWithZeroCost">{0} ({1} gratis)</translation>
    7.81 +	<translation id="equipmentChoiceAmountAll">För alla ({1})</translation>
    7.82 +	<translation id="equipmentChoiceAmountNumber">{0}</translation>
    7.83 +	<translation id="equipmentChoiceAmountPercentage">För {0}% ({1})</translation>
    7.84 +	<translation id="equipNumberTooLarge">Det nuvarande antalet ({0}) är större än det maximalt tillåtna antalet för utrustningen ({1}). Det maximala antalet kommer att användas istället.</translation>
    7.85 +	<translation id="equipNumberTooLargeTitle">Utrustningens antal för stort</translation>
    7.86 +	<translation id="equipNumberTooSmall"> Det nuvarande antalet ({0}) är mindre än det tillåtna minimiantalet för utrustningen({1}). Minimivärdet kommer att användas istället.</translation>
    7.87 +	<translation id="equipNumberTooSmallTitle">Utrustningens antal för litet</translation>
    7.88  	<translation id="equipPercentageTooLarge">Den numvarande procenten ({0}%) är större än det maximala tillåtna värdet för utrustningen ({1}%). Det maximala värdet kommer att användas istället.</translation>
    7.89  	<translation id="equipPercentageTooLargeTitle">Utrustningsprocenten för stor</translation>
    7.90  	<translation id="equipPercentageTooSmall"> Den numvarande procenten ({0}%) är mindre än det tillåtna minimivärdet för utrustningen ({1}%). Minimivärdet kommer att användas istället.</translation>
    7.91  	<translation id="equipPercentageTooSmallTitle">Utrustningsprocenten för liten</translation>
    7.92 -	<translation id="equipNumberTooLarge">Det nuvarande antalet ({0}) är större än det maximalt tillåtna antalet för utrustningen ({1}). Det maximala antalet kommer att användas istället.</translation>
    7.93 -	<translation id="equipNumberTooLargeTitle">Utrustningens antal för stort</translation>
    7.94 -	<translation id="equipNumberTooSmall"> Det nuvarande antalet ({0}) är mindre än det tillåtna minimiantalet för utrustningen({1}). Minimivärdet kommer att användas istället.</translation>
    7.95 -	<translation id="equipNumberTooSmallTitle">Utrustningens antal för litet</translation>
    7.96 +	<translation id="FrmAbout">Om WarFoundry</translation>
    7.97  	<translation id="FrmEditUnitEquipment">Ändra {0} för {1}</translation>
    7.98 +	<translation id="FrmNewArmy">Skapa ny armé</translation>
    7.99 +	<translation id="FrmNewUnit">Lägg till en ny {0}</translation>
   7.100 +	<translation id="FrmNewUnitEquipment">Ny utrustning för {0}</translation>
   7.101 +	<translation id="FrmPreferences">Inställningar</translation>
   7.102 +	<translation id="FrmReplaceUnitEquipment">Ersätt {0} med ny utrustning</translation>
   7.103 +	<translation id="FrmUnit">{0}</translation>
   7.104 +	<translation id="GameSystemFilesReloaded">System och ras filer har laddats in.</translation>
   7.105 +	<translation id="InvalidArmyFileBoxTitle">Ogiltig arméfil</translation>
   7.106 +	<translation id="InvalidRaceFileBoxTitle">Ogiltig rasfil</translation>
   7.107 +	<translation id="languagePrefSection">Språk</translation>
   7.108 +	<translation id="languagesGroup">Språk</translation>
   7.109 +	<translation id="lblAbilities">Förmågor:</translation>
   7.110 +	<translation id="lblAmount">Antal:</translation>
   7.111 +	<translation id="lblArmyName">Arménamn:</translation>
   7.112 +	<translation id="lblArmySize">Arméstorlek:</translation>
   7.113 +	<translation id="lblDevelopers">Utvecklare:</translation>
   7.114 +	<translation id="lblEquip">Utrustning:</translation>
   7.115 +	<translation id="lblGameSystem">Spelsystem:</translation>
   7.116 +	<translation id="lblItem">Utrustning:</translation>
   7.117 +	<translation id="lblLanguage">Språk:</translation>
   7.118 +	<translation id="lblNotes">Anteckningar:</translation>
   7.119 +	<translation id="FrmUnitlblPoints">({0} {1})</translation>
   7.120 +	<translation id="lblRaceList">Raser:</translation>
   7.121 +	<translation id="lblThanks">Tack till:</translation>
   7.122 +	<translation id="lblUnitList">Enheter:</translation>
   7.123 +	<translation id="lblUnitSize">Storlek:</translation>
   7.124 +	<translation id="lblVersion">Version: {0}</translation>
   7.125 +	<translation id="menuEdit">&amp;Redigera</translation>
   7.126 +	<translation id="menuFile">&amp;Arkiv</translation>
   7.127 +	<translation id="menuHelp">&amp;Hjälp</translation>
   7.128 +	<translation id="miAbout">&amp;Om</translation>
   7.129 +	<translation id="miCloseArmy">&amp;Stäng armé</translation>
   7.130 +	<translation id="miDeleteUnit">&amp;Ta bort enhet</translation>
   7.131 +	<translation id="miEditUnit">&amp;Redigera enhet</translation>
   7.132 +	<translation id="miExit">A&amp;vsluta</translation>
   7.133 +	<translation id="miExportArmyAs">&amp;Exportera armé</translation>
   7.134 +	<translation id="miExportArmyAsBasicHTML">Normal HTML</translation>
   7.135 +	<translation id="miNewArmy">&amp;Skapa ny armé</translation>
   7.136 +	<translation id="miOpenArmy">&amp;Öppna sparad armé</translation>
   7.137 +	<translation id="miPreferences">&amp;Inställningar</translation>
   7.138 +	<translation id="miRedo">&amp;Gör om</translation>
   7.139 +	<translation id="miReloadFiles">&amp;Läs in filer på nytt</translation>
   7.140 +	<translation id="miSaveArmy">&amp;Spara armé</translation>
   7.141 +	<translation id="miSaveArmyAs">Spara armé &amp;som...</translation>
   7.142 +	<translation id="miUndo">&amp;Återställ</translation>
   7.143 +	<translation id="newArmyNoGameSystems">WarFoundry kunde inte hitta data för spel system.
   7.144 +  Vänligen kontrollera felmeddelanden i loggen och se till att du har datafiler för spelsystemet i "data" mappen.</translation>
   7.145 +	<translation id="openArmyDialog">Öppna armé</translation>
   7.146 +	<translation id="PointsLocalisationAbbrevPlural">png</translation>
   7.147 +	<translation id="PointsLocalisationAbbrevSingle">png</translation>
   7.148 +	<translation id="PointsLocalisationNamePlural">poäng</translation>
   7.149 +	<translation id="PointsLocalisationNameSingle">poäng</translation>
   7.150 +	<translation id="rbEquipAll">Utrusta alla</translation>
   7.151 +	<translation id="removeEquipmentText">Utrustningen kommer att tas bort. Fortsätt?</translation>
   7.152 +	<translation id="removeEquipmentTitle">Bekräfta byte av utrustning</translation>
   7.153  	<translation id="removeRequiredEquipmentText">Utrustningen är obligatorisk och kan inte tas bort. Det måste finnas minst en, eller ersättas med ett alternativ.</translation>
   7.154  	<translation id="removeRequiredEquipmentTitle">Kan inte ta bort obligatorisk utrustnign </translation>
   7.155 -	<translation id="removeEquipmentText">Utrustningen kommer att tas bort. Fortsätt?</translation>
   7.156 -	<translation id="removeEquipmentTitle">Bekräfta byte av utrustning</translation>
   7.157 -	<translation id="FrmAbout">Om WarFoundry</translation>
   7.158 -	<translation id="lblVersion">Version: {0}</translation>
   7.159 -	<translation id="lblDevelopers">Utvecklare:</translation>
   7.160 -	<translation id="lblThanks">Tack till:</translation>
   7.161 -	<translation id="FrmUnit">{0}</translation>
   7.162 -	<translation id="lblUnitSize">Storlek:</translation>
   7.163 -	<translation id="StatLineName">Typ</translation>
   7.164 -	<translation id="lblEquip">Utrustning:</translation>
   7.165 -	<translation id="bttnAddWeapon">Lägg till</translation>
   7.166 -	<translation id="lblAbilities">Förmågor:</translation>
   7.167 -	<translation id="lblNotes">Anteckningar:</translation>
   7.168 -	<translation id="bttnRemoveWeapon">Ta bort</translation>
   7.169 -	<translation id="bttnReplaceWeapon">Ersätt</translation>
   7.170 -	<translation id="bttnEditWeapon">Redigera</translation>
   7.171 -	<translation id="equipmentAmountWithCost">{0} ({1} för {2} poäng var)</translation>
   7.172 -	<translation id="equipmentAmountWithZeroCost">{0} ({1} gratis)</translation>
   7.173 -	<translation id="equipmentChoiceAmountAll">För alla ({1})</translation>
   7.174 -	<translation id="equipmentChoiceAmountPercentage">För {0}% ({1})</translation>
   7.175 -	<translation id="equipmentChoiceAmountNumber">{0}</translation>
   7.176 -	<translation id="InvalidRaceFileBoxTitle">Ogiltig rasfil</translation>
   7.177 -	<translation id="InvalidArmyFileBoxTitle">Ogiltig arméfil</translation>
   7.178 -	<translation id="SaveChangesQuestion">Armén "{0}" har ändrats.
   7.179 -Vill du spara ändringarna innan armén stängs?</translation>
   7.180 -
   7.181 -	<translation id="SaveChangesTitle">Osparade förändringar</translation>
   7.182 -	<translation id="SaveFailed">WarFoundry kunde inte spara filen. Var god och kontrollera loggen för mera detaljer.</translation>
   7.183 -	<translation id="SaveFailedTitle">Filen kunde inte sparas</translation>
   7.184 -	<translation id="armyHtmlOutputBodyHeader">{0} - {1}poäng</translation>
   7.185 -	<translation id="armyHtmlOutputTableHeaderUnitName">Namn</translation>
   7.186 -	<translation id="armyHtmlOutputTableHeaderUnitNotes">Anteckningar</translation>
   7.187 -	<translation id="armyHtmlOutputTableHeaderUnitPoints">Poäng</translation>
   7.188 -	<translation id="armyHtmlExportEquipAmountAll">alla ({1})</translation>
   7.189 -	<translation id="armyHtmlExportEquipAmountPercentage">{0}% ({1})</translation>
   7.190 -	<translation id="armyHtmlExportEquipAmountNumber">{0}</translation>
   7.191 -	<translation id="armyHtmlExportEquipAmountRatio">{0} för {1}</translation>
   7.192 -	<translation id="equipmentAmountAll">alla ({1})</translation>
   7.193 -	<translation id="equipmentAmountPercentage">{0}% ({1})</translation>
   7.194 -	<translation id="equipmentAmountNumber">{0}</translation>
   7.195 -	<translation id="setEquipmentAmountCommandDescription">ändra {0} amount för {1} till {2}</translation>
   7.196 -	<translation id="setEquipmentAmountCommandUndoDescription">ändra {0} amount för {1} till {2}</translation>
   7.197 +	<translation id="removeUnitCommandDescription">Ta bort {0}</translation>
   7.198 +	<translation id="removeUnitCommandUndoDescription">Lägg till på nytt {0}</translation>
   7.199  	<translation id="replaceUnitEquipmentCommandDescription">Ersätt {0} med {1} för {2}</translation>
   7.200  	<translation id="replaceUnitEquipmentCommandUndoDescription">Ersätt {0} med {1} för {2}</translation>
   7.201 -	<translation id="createAndAddUnitCommandDescription">Lägg till enhet av {0}</translation>
   7.202 -	<translation id="createAndAddUnitCommandUndoDescription">Ta bort enhet av {0}</translation>
   7.203 -	<translation id="removeUnitCommandDescription">Ta bort {0}</translation>
   7.204 -	<translation id="removeUnitCommandUndoDescription">Lägg till på nytt {0}</translation>
   7.205 -	<translation id="setUnitNameCommandDescription">Byt namn från "{0}" till "{1}"</translation>
   7.206 -	<translation id="setUnitNameCommandUndoDescription">Byt namn från "{0}" till "{1}"</translation>
   7.207 -	<translation id="setUnitSizeCommandDescription">ändra storleken på {0} till {1}</translation>
   7.208 -	<translation id="setUnitSizeCommandUndoDescription"> ändra storleken på {0} till {1}</translation>
   7.209  	<translation id="requirementAND">{0}; och {1}</translation>
   7.210  	<translation id="requirementOR">{0}; eller {1}</translation>
   7.211  	<translation id="requirementUnitExcludes">{0} kan bara väljas om ingen av följande har valts: {1}</translation>
   7.212  	<translation id="requirementUnitMaxNumber">{1} kan bara väljas {0} gånger</translation>
   7.213  	<translation id="requirementUnitMinNumber">{1} måste väljas minst {0} gånger</translation>
   7.214 +	<translation id="requirementUnitTypeAtLeast">{0} kan bara väljas om följande har valts: {1}</translation>
   7.215 +	<translation id="requirementUnitTypeAtLeastJoiner">{0}, {1}</translation>
   7.216  	<translation id="requirementUnitTypeAtLeastSingle">{1} {0}</translation>
   7.217 -	<translation id="requirementUnitTypeAtLeastJoiner">{0}, {1}</translation>
   7.218 -	<translation id="requirementUnitTypeAtLeast">{0} kan bara väljas om följande har valts: {1}</translation>
   7.219 -	<translation id="FrmPreferences">Inställningar</translation>
   7.220 -	<translation id="languagePrefSection">Språk</translation>
   7.221 -	<translation id="lblLanguage">Språk:</translation>
   7.222 -	<translation id="languagesGroup">Språk</translation>
   7.223 -  <translation id="GameSystemFilesReloaded">System och ras filer har laddats in.</translation>
   7.224 +	<translation id="saveArmyDialog">Spara armé</translation>
   7.225 +	<translation id="SaveChangesQuestion">Armén "{0}" har ändrats.
   7.226 +    Vill du spara ändringarna innan armén stängs? </translation>
   7.227 +	<translation id="SaveChangesTitle">Osparade förändringar</translation>
   7.228 +	<translation id="SaveFailed">WarFoundry kunde inte spara filen. Var god och kontrollera loggen för mera detaljer.</translation>
   7.229 +	<translation id="SaveFailedTitle">Filen kunde inte sparas</translation>
   7.230 +	<translation id="setEquipmentAmountCommandDescription">ändra {0} amount för {1} till {2}</translation>
   7.231 +	<translation id="setEquipmentAmountCommandUndoDescription">ändra {0} amount för {1} till {2}</translation>
   7.232 +	<translation id="setUnitNameCommandDescription">Byt namn från "{0}" till "{1}"</translation>
   7.233 +	<translation id="setUnitNameCommandUndoDescription">Byt namn från "{0}" till "{1}"</translation>
   7.234 +	<translation id="setUnitSizeCommandDescription">ändra storleken på {0} till {1}</translation>
   7.235 +	<translation id="setUnitSizeCommandUndoDescription"> ändra storleken på {0} till {1}</translation>
   7.236 +	<translation id="StatLineName">Typ</translation>
   7.237 +	<translation id="statusPanelPoints">{0} {1} / {2} {3}</translation>
   7.238 +	<translation id="statusPanelPointsToolTip">Aktuellt poängvärde för armé</translation>
   7.239 +	<translation id="treeNodeText">{0} ({1} {2})</translation>
   7.240 +  <translation id="setUnitEquipmentItemName">( {0} {1} var)</translation>
   7.241 +  
   7.242  </translations>