Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
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, 734 insertions(+), 578 deletions(-) [+] |
line wrap: on
line diff
--- a/FrmArmyTree.cs Sun Dec 12 17:30:53 2010 +0000 +++ b/FrmArmyTree.cs Mon Jan 24 16:50:31 2011 +0000 @@ -1,462 +1,472 @@ -// This file (FrmArmyTree.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2009 IBBoard. -// -// 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. - -using System; -using System.Drawing; -using System.Collections.Generic; -using System.ComponentModel; -using System.Windows.Forms; -using IBBoard.Commands; -using IBBoard.Lang; -using IBBoard.Windows.Forms.I18N; -using IBBoard.Windows.Forms; -using IBBoard.WarFoundry.API; -using IBBoard.WarFoundry.API.Commands; -using IBBoard.WarFoundry.API.Objects; - -namespace IBBoard.WarFoundry.GUI.WinForms -{ - /// <summary> - /// Summary description for FrmArmyTree. - /// </summary> - public class FrmArmyTree : IBBoard.Windows.Forms.IBBForm - { - private System.Windows.Forms.TreeView treeView; - private IContainer components; - private Dictionary<string, TreeNode> nodes; - private System.Windows.Forms.ContextMenu contextMenu; - private IBBMenuItem miDeleteUnit; - private IBBMenuItem miEditUnit; - - private ObjectAddDelegate UnitAddedMethod; - private ObjectRemoveDelegate UnitRemovedMethod; - private StringValChangedDelegate UnitNameChangedMethod, ArmyNameChangedMethod, TreeNameChangedMethod; - private ToolBar toolBar; - private IBBToolBarButton bttnEdit; - private IBBToolBarButton bttnDelete; - private ImageList imageList; - private CommandStack commandStack; - - public FrmArmyTree(CommandStack cmdStack) - { - commandStack = cmdStack; - InitializeComponent(); - UnitAddedMethod = new ObjectAddDelegate(UnitAdded); - UnitRemovedMethod = new ObjectRemoveDelegate(UnitRemoved); - UnitNameChangedMethod = new StringValChangedDelegate(UpdateUnitName); - ArmyNameChangedMethod = new StringValChangedDelegate(UpdateArmyName); - TreeNameChangedMethod = new StringValChangedDelegate(FrmArmyTree_TreeNameChanged); - nodes = new Dictionary<string, TreeNode>(); - this.Name = "ArmyTree"; - WarFoundryCore.ArmyChanged+= new ArmyChangedDelegate(FrmArmyTree_ArmyChanged); - TranslateForm(); - Translation.TranslationChanged += new MethodInvoker(TranslateForm); - } - - private void TranslateForm() - { - ControlTranslator.TranslateControl(this); - - foreach (Component comp in components.Components) - { - ControlTranslator.TranslateComponent(comp); - } - - foreach (IBBMenuItem mi in contextMenu.MenuItems) - { - ControlTranslator.TranslateComponent(mi); - } - } - - /// <summary> - /// Clean up any resources being used. - /// </summary> - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - Translation.TranslationChanged -= new MethodInvoker(TranslateForm); - WarFoundryCore.ArmyChanged -= new ArmyChangedDelegate(FrmArmyTree_ArmyChanged); - } - - #region Windows Form Designer generated code - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmArmyTree)); - this.contextMenu = new System.Windows.Forms.ContextMenu(); - this.miEditUnit = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miDeleteUnit = new IBBoard.Windows.Forms.IBBMenuItem(); - this.imageList = new System.Windows.Forms.ImageList(this.components); - this.toolBar = new System.Windows.Forms.ToolBar(); - this.bttnEdit = new IBBoard.Windows.Forms.IBBToolBarButton(); - this.bttnDelete = new IBBoard.Windows.Forms.IBBToolBarButton(); - this.treeView = new System.Windows.Forms.TreeView(); - this.SuspendLayout(); - // - // contextMenu - // - this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.miEditUnit, - this.miDeleteUnit}); - this.contextMenu.Popup += new System.EventHandler(this.contextMenu_Popup); - // - // miEditUnit - // - this.miEditUnit.Index = 0; - this.miEditUnit.Text = "&edit unit"; - this.miEditUnit.Click += new System.EventHandler(this.miEdit_Click); - this.miEditUnit.Name = "miEditUnit"; - // - // miDeleteUnit - // - this.miDeleteUnit.Index = 1; - this.miDeleteUnit.Text = "&delete unit"; - this.miDeleteUnit.Click += new System.EventHandler(this.miDelete_Click); - this.miDeleteUnit.Name = "miDeleteUnit"; - // - // imageList - // - this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer) (resources.GetObject("imageList.ImageStream"))); - this.imageList.TransparentColor = System.Drawing.Color.Transparent; - this.imageList.Images.SetKeyName(0, "gtk-edit.png"); - this.imageList.Images.SetKeyName(1, "edit-delete.png"); - // - // toolBar - // - this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { - this.bttnEdit, - this.bttnDelete}); - this.toolBar.ButtonSize = new System.Drawing.Size(16, 16); - this.toolBar.DropDownArrows = true; - this.toolBar.ImageList = this.imageList; - this.toolBar.Location = new System.Drawing.Point(0, 0); - this.toolBar.Name = "toolBar"; - this.toolBar.ShowToolTips = true; - this.toolBar.Size = new System.Drawing.Size(240, 28); - this.toolBar.TabIndex = 3; - this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick); - // - // bttnEdit - // - this.bttnEdit.Enabled = false; - this.bttnEdit.ImageIndex = 0; - this.bttnEdit.Name = "bttnEdit"; - // - // bttnDelete - // - this.bttnDelete.Enabled = false; - this.bttnDelete.ImageIndex = 1; - this.bttnDelete.Name = "bttnDelete"; - // - // treeView - // - this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.treeView.ContextMenu = this.contextMenu; - this.treeView.FullRowSelect = true; - this.treeView.Location = new System.Drawing.Point(0, 28); - this.treeView.Name = "treeView"; - this.treeView.Size = new System.Drawing.Size(240, 250); - this.treeView.TabIndex = 0; - this.treeView.DoubleClick += new System.EventHandler(this.treeView_DoubleClick); - this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect); - this.treeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseDown); - // - // FrmArmyTree - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(240, 277); - this.ControlBox = false; - this.Controls.Add(this.toolBar); - this.Controls.Add(this.treeView); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FrmArmyTree"; - this.Text = "FrmArmyTree"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - #endregion - - private void ClearArmy() - { - nodes.Clear(); - treeView.Nodes.Clear(); - } - - private void SetArmy(Army army) - { - ClearArmy(); - - if (army != null) - { - ArmyCategory[] cats = army.Categories; - TreeNode[] catNodes = new TreeNode[cats.Length]; - Unit[] units; - - for (int i = 0; i < cats.Length; i++) - { - ArmyCategory cat = cats[i]; - units = army.GetUnits(cat); - cat.NameChanged += TreeNameChangedMethod; - cat.PointsValueChanged += NodePointsValueChanged; - TreeNode[] unitNodes = new TreeNode[units.Length]; - TreeNode temp; - - for (int j = 0; j < units.Length; j++) - { - unitNodes[j] = CreateTreeNode(units[j]); - } - - temp = new TreeNode(CreateNodeName(cat), unitNodes); - temp.Tag = cat; - catNodes[i] = temp; - nodes[cat.ID] = temp; - } - - TreeNode root = new TreeNode(CreateNodeName(army), catNodes); - root.Tag = army; - army.PointsValueChanged += NodePointsValueChanged; - nodes[army.ID] = root; - treeView.Nodes.Add(root); - root.ExpandAll(); - } - } - - private string CreateNodeName(ICostedWarFoundryObject obj) - { - return Translation.GetTranslation("treeNodeText", "{0} ({1}pts)", obj.Name, obj.Points); - } - - private void NodePointsValueChanged(WarFoundryObject obj, double oldValue, double newValue) - { - if (obj is ICostedWarFoundryObject) - { - SetNodeName(obj); - } - } - - private void SetNodeName(WarFoundryObject obj) - { - TreeNode node = nodes[obj.ID]; - - if (node != null) - { - node.Text = CreateNodeName((ICostedWarFoundryObject)obj); - } - } - - private TreeNode CreateTreeNode(Unit unit) - { - TreeNode temp = new TreeNode(CreateNodeName(unit)); - temp.Tag = unit; - unit.NameChanged+= UnitNameChangedMethod; - unit.PointsValueChanged += NodePointsValueChanged; - nodes[unit.ID] = temp; - return temp; - } - - public void FrmArmyTree_ArmyChanged(Army oldArmy, Army newArmy) - { - if (oldArmy != null) - { - oldArmy.UnitAdded -= UnitAddedMethod; - oldArmy.UnitRemoved -= UnitRemovedMethod; - oldArmy.PointsValueChanged -= NodePointsValueChanged; - } - - if (newArmy != null) - { - newArmy.UnitAdded += UnitAddedMethod; - newArmy.UnitRemoved += UnitRemovedMethod; - newArmy.PointsValueChanged += NodePointsValueChanged; - } - - SetArmy(newArmy); - } - - private void UnitAdded(WarFoundryObject obj) - { - if (obj is Unit) - { - Unit unit = (Unit)obj; - ArmyCategory cat = unit.Category; - TreeNode parent = nodes[cat.ID]; - TreeNode unitNode = CreateTreeNode(unit); - parent.Nodes.Add(unitNode); - parent.Expand(); //make sure it's expanded - } - } - - public new FrmMain MdiParent - { - get { return (FrmMain) base.MdiParent; } - set { base.MdiParent = value; } - } - - private void UnitRemoved(WarFoundryObject obj) - { - if (obj is Unit) - { - Unit unit = (Unit)obj; - RemoveUnitFromTree(unit); - } - } - - private void RemoveUnitFromTree(Unit unit) - { - TreeNode unitNode = nodes[unit.ID]; - unit.NameChanged-= UnitNameChangedMethod; - - if (unitNode!=null) - { - unitNode.Remove(); - nodes.Remove(unit.ID); - } - } - - - private void contextMenu_Popup(object sender, System.EventArgs e) - { - TreeNode node = treeView.SelectedNode; - - if (node!=null && node.Tag is Unit) - { - foreach(MenuItem item in contextMenu.MenuItems) - { - item.Visible = true; - } - } - else - { - foreach(MenuItem item in contextMenu.MenuItems) - { - item.Visible = false; - } - } - } - - private void treeView_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) - { - if (e.Button == MouseButtons.Right) - { - TreeNode tn = treeView.GetNodeAt(e.X, e.Y); - - if (tn!=null) - { - treeView.SelectedNode = tn; - } - else - { - treeView.SelectedNode = null; - } - } - } - - private void miDelete_Click(object sender, System.EventArgs e) - { - DeleteUnit(); - } - - private void DeleteUnit() - { - - TreeNode selected = treeView.SelectedNode; - - if (selected.Tag != null && selected.Tag is Unit) - { - Unit unit = (Unit) selected.Tag; - commandStack.Execute(new RemoveUnitCommand(unit)); - } - } - - private void miEdit_Click(object sender, System.EventArgs e) - { - EditUnit(); - } - - private void treeView_DoubleClick(object sender, System.EventArgs e) - { - EditUnit(); - } - - private void EditUnit() - { - TreeNode selected = treeView.SelectedNode; - object tagData = selected.Tag; - - if (tagData is Unit) - { - Unit unit = (Unit) tagData; - MdiParent.OpenUnitDialog(unit); - } - } - - private void UpdateUnitName(WarFoundryObject obj, string oldValue, string newValue) - { - if (obj is ICostedWarFoundryObject) - { - SetNodeName(obj); - } - } - - private void UpdateArmyName(WarFoundryObject obj, string oldValue, string newValue) - { - if (obj is Army) - { - Army army = (Army)obj; - TreeNode node = treeView.Nodes[0]; - - if (node!=null) - { - node.Text = army.Name; - } - } - } - - private void FrmArmyTree_TreeNameChanged(WarFoundryObject obj, string oldValue, string newValue) - { - TreeNode node = nodes[obj.ID]; - - if (node!=null) - { - node.Text = obj.Name; - } - } - - private void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) - { - if (e.Button == bttnDelete) - { - DeleteUnit(); - } - else if (e.Button == bttnEdit) - { - EditUnit(); - } - } - - private void treeView_AfterSelect(object sender, TreeViewEventArgs e) - { - TreeNode node = treeView.SelectedNode; - - bttnDelete.Enabled = (node != null && node.Tag is Unit); - bttnEdit.Enabled = bttnDelete.Enabled; - } - } -} +// This file (FrmArmyTree.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2009 IBBoard. +// +// 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. + +using System; +using System.Drawing; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using IBBoard.Commands; +using IBBoard.Lang; +using IBBoard.Windows.Forms.I18N; +using IBBoard.Windows.Forms; +using IBBoard.WarFoundry.API; +using IBBoard.WarFoundry.API.Commands; +using IBBoard.WarFoundry.API.Objects; + +namespace IBBoard.WarFoundry.GUI.WinForms +{ + /// <summary> + /// Summary description for FrmArmyTree. + /// </summary> + public class FrmArmyTree : IBBoard.Windows.Forms.IBBForm + { + private System.Windows.Forms.TreeView treeView; + private IContainer components; + private Dictionary<string, TreeNode> nodes; + private System.Windows.Forms.ContextMenu contextMenu; + private IBBMenuItem miDeleteUnit; + private IBBMenuItem miEditUnit; + + private ObjectAddDelegate UnitAddedMethod; + private ObjectRemoveDelegate UnitRemovedMethod; + private StringValChangedDelegate UnitNameChangedMethod, ArmyNameChangedMethod, TreeNameChangedMethod; + private ToolBar toolBar; + private IBBToolBarButton bttnEdit; + private IBBToolBarButton bttnDelete; + private ImageList imageList; + private CommandStack commandStack; + public GameSystem CurrentGameSystem + { + get { return WarFoundryCore.CurrentGameSystem; } + set { WarFoundryCore.CurrentGameSystem = value; } + } + + public FrmArmyTree(CommandStack cmdStack) + { + commandStack = cmdStack; + InitializeComponent(); + UnitAddedMethod = new ObjectAddDelegate(UnitAdded); + UnitRemovedMethod = new ObjectRemoveDelegate(UnitRemoved); + UnitNameChangedMethod = new StringValChangedDelegate(UpdateUnitName); + ArmyNameChangedMethod = new StringValChangedDelegate(UpdateArmyName); + TreeNameChangedMethod = new StringValChangedDelegate(FrmArmyTree_TreeNameChanged); + nodes = new Dictionary<string, TreeNode>(); + this.Name = "ArmyTree"; + WarFoundryCore.ArmyChanged+= new ArmyChangedDelegate(FrmArmyTree_ArmyChanged); + TranslateForm(); + Translation.TranslationChanged += new MethodInvoker(TranslateForm); + } + + private void TranslateForm() + { + ControlTranslator.TranslateControl(this); + + foreach (Component comp in components.Components) + { + ControlTranslator.TranslateComponent(comp); + } + + foreach (IBBMenuItem mi in contextMenu.MenuItems) + { + ControlTranslator.TranslateComponent(mi); + } + foreach (TreeNode node in nodes.Values) + { + node.Text = CreateNodeName((ICostedWarFoundryObject)node.Tag); + } + } + + /// <summary> + /// Clean up any resources being used. + /// </summary> + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + Translation.TranslationChanged -= new MethodInvoker(TranslateForm); + WarFoundryCore.ArmyChanged -= new ArmyChangedDelegate(FrmArmyTree_ArmyChanged); + } + + #region Windows Form Designer generated code + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmArmyTree)); + this.contextMenu = new System.Windows.Forms.ContextMenu(); + this.miEditUnit = new IBBoard.Windows.Forms.IBBMenuItem(); + this.miDeleteUnit = new IBBoard.Windows.Forms.IBBMenuItem(); + this.imageList = new System.Windows.Forms.ImageList(this.components); + this.toolBar = new System.Windows.Forms.ToolBar(); + this.bttnEdit = new IBBoard.Windows.Forms.IBBToolBarButton(); + this.bttnDelete = new IBBoard.Windows.Forms.IBBToolBarButton(); + this.treeView = new System.Windows.Forms.TreeView(); + this.SuspendLayout(); + // + // contextMenu + // + this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.miEditUnit, + this.miDeleteUnit}); + this.contextMenu.Popup += new System.EventHandler(this.contextMenu_Popup); + // + // miEditUnit + // + this.miEditUnit.Index = 0; + this.miEditUnit.Text = "&edit unit"; + this.miEditUnit.Click += new System.EventHandler(this.miEdit_Click); + // + // miDeleteUnit + // + this.miDeleteUnit.Index = 1; + this.miDeleteUnit.Text = "&delete unit"; + this.miDeleteUnit.Click += new System.EventHandler(this.miDelete_Click); + // + // imageList + // + this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream"))); + this.imageList.TransparentColor = System.Drawing.Color.Transparent; + this.imageList.Images.SetKeyName(0, "gtk-edit.png"); + this.imageList.Images.SetKeyName(1, "edit-delete.png"); + // + // toolBar + // + this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { + this.bttnEdit, + this.bttnDelete}); + this.toolBar.ButtonSize = new System.Drawing.Size(16, 16); + this.toolBar.DropDownArrows = true; + this.toolBar.ImageList = this.imageList; + this.toolBar.Location = new System.Drawing.Point(0, 0); + this.toolBar.Name = "toolBar"; + this.toolBar.ShowToolTips = true; + this.toolBar.Size = new System.Drawing.Size(240, 28); + this.toolBar.TabIndex = 3; + this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick); + // + // bttnEdit + // + this.bttnEdit.Enabled = false; + this.bttnEdit.ImageIndex = 0; + this.bttnEdit.Name = "bttnEdit"; + // + // bttnDelete + // + this.bttnDelete.Enabled = false; + this.bttnDelete.ImageIndex = 1; + this.bttnDelete.Name = "bttnDelete"; + // + // treeView + // + this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.treeView.ContextMenu = this.contextMenu; + this.treeView.FullRowSelect = true; + this.treeView.ImageIndex = 0; + this.treeView.ImageList = this.imageList; + this.treeView.Location = new System.Drawing.Point(0, 28); + this.treeView.Name = "treeView"; + this.treeView.SelectedImageIndex = 0; + this.treeView.Size = new System.Drawing.Size(240, 250); + this.treeView.TabIndex = 0; + this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect); + this.treeView.DoubleClick += new System.EventHandler(this.treeView_DoubleClick); + this.treeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseDown); + // + // FrmArmyTree + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(240, 277); + this.ControlBox = false; + this.Controls.Add(this.toolBar); + this.Controls.Add(this.treeView); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FrmArmyTree"; + this.Text = "FrmArmyTree"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + #endregion + + private void ClearArmy() + { + nodes.Clear(); + treeView.Nodes.Clear(); + } + + private void SetArmy(Army army) + { + ClearArmy(); + + if (army != null) + { + ArmyCategory[] cats = army.Categories; + TreeNode[] catNodes = new TreeNode[cats.Length]; + Unit[] units; + + for (int i = 0; i < cats.Length; i++) + { + ArmyCategory cat = cats[i]; + units = army.GetUnits(cat); + cat.NameChanged += TreeNameChangedMethod; + cat.PointsValueChanged += NodePointsValueChanged; + TreeNode[] unitNodes = new TreeNode[units.Length]; + TreeNode temp; + + for (int j = 0; j < units.Length; j++) + { + unitNodes[j] = CreateTreeNode(units[j]); + } + + temp = new TreeNode(CreateNodeName(cat), unitNodes); + temp.Tag = cat; + catNodes[i] = temp; + nodes[cat.ID] = temp; + } + + TreeNode root = new TreeNode(CreateNodeName(army), catNodes); + root.Tag = army; + army.PointsValueChanged += NodePointsValueChanged; + nodes[army.ID] = root; + treeView.Nodes.Add(root); + root.ExpandAll(); + } + } + + private string CreateNodeName(ICostedWarFoundryObject obj) + { + return Translation.GetTranslation("treeNodeText", "{0} ({1} pts)", obj.Name, obj.Points, CurrentGameSystem.UsePointsAbbrev(obj.Points)); + } + + private void NodePointsValueChanged(WarFoundryObject obj, double oldValue, double newValue) + { + if (obj is ICostedWarFoundryObject) + { + SetNodeName(obj); + } + } + + private void SetNodeName(WarFoundryObject obj) + { + TreeNode node = nodes[obj.ID]; + + if (node != null) + { + node.Text = CreateNodeName((ICostedWarFoundryObject)obj); + } + } + + private TreeNode CreateTreeNode(Unit unit) + { + TreeNode temp = new TreeNode(CreateNodeName(unit)); + temp.Tag = unit; + unit.NameChanged+= UnitNameChangedMethod; + unit.PointsValueChanged += NodePointsValueChanged; + nodes[unit.ID] = temp; + return temp; + } + + public void FrmArmyTree_ArmyChanged(Army oldArmy, Army newArmy) + { + if (oldArmy != null) + { + oldArmy.UnitAdded -= UnitAddedMethod; + oldArmy.UnitRemoved -= UnitRemovedMethod; + oldArmy.PointsValueChanged -= NodePointsValueChanged; + } + + if (newArmy != null) + { + newArmy.UnitAdded += UnitAddedMethod; + newArmy.UnitRemoved += UnitRemovedMethod; + newArmy.PointsValueChanged += NodePointsValueChanged; + } + + SetArmy(newArmy); + } + + private void UnitAdded(WarFoundryObject obj) + { + if (obj is Unit) + { + Unit unit = (Unit)obj; + ArmyCategory cat = unit.Category; + TreeNode parent = nodes[cat.ID]; + TreeNode unitNode = CreateTreeNode(unit); + parent.Nodes.Add(unitNode); + parent.Expand(); //make sure it's expanded + } + } + + public new FrmMain MdiParent + { + get { return (FrmMain) base.MdiParent; } + set { base.MdiParent = value; } + } + + private void UnitRemoved(WarFoundryObject obj) + { + if (obj is Unit) + { + Unit unit = (Unit)obj; + RemoveUnitFromTree(unit); + } + } + + private void RemoveUnitFromTree(Unit unit) + { + TreeNode unitNode = nodes[unit.ID]; + unit.NameChanged-= UnitNameChangedMethod; + + if (unitNode!=null) + { + unitNode.Remove(); + nodes.Remove(unit.ID); + } + } + + + private void contextMenu_Popup(object sender, System.EventArgs e) + { + TreeNode node = treeView.SelectedNode; + + if (node!=null && node.Tag is Unit) + { + foreach(MenuItem item in contextMenu.MenuItems) + { + item.Visible = true; + } + } + else + { + foreach(MenuItem item in contextMenu.MenuItems) + { + item.Visible = false; + } + } + } + + private void treeView_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + TreeNode tn = treeView.GetNodeAt(e.X, e.Y); + + if (tn!=null) + { + treeView.SelectedNode = tn; + } + else + { + treeView.SelectedNode = null; + } + } + } + + private void miDelete_Click(object sender, System.EventArgs e) + { + DeleteUnit(); + } + + private void DeleteUnit() + { + + TreeNode selected = treeView.SelectedNode; + + if (selected.Tag != null && selected.Tag is Unit) + { + Unit unit = (Unit) selected.Tag; + commandStack.Execute(new RemoveUnitCommand(unit)); + } + } + + private void miEdit_Click(object sender, System.EventArgs e) + { + EditUnit(); + } + + private void treeView_DoubleClick(object sender, System.EventArgs e) + { + EditUnit(); + } + + private void EditUnit() + { + TreeNode selected = treeView.SelectedNode; + object tagData = selected.Tag; + + if (tagData is Unit) + { + Unit unit = (Unit) tagData; + MdiParent.OpenUnitDialog(unit); + } + } + + private void UpdateUnitName(WarFoundryObject obj, string oldValue, string newValue) + { + if (obj is ICostedWarFoundryObject) + { + SetNodeName(obj); + } + } + + private void UpdateArmyName(WarFoundryObject obj, string oldValue, string newValue) + { + if (obj is Army) + { + Army army = (Army)obj; + TreeNode node = treeView.Nodes[0]; + + if (node!=null) + { + node.Text = army.Name; + } + } + } + + private void FrmArmyTree_TreeNameChanged(WarFoundryObject obj, string oldValue, string newValue) + { + TreeNode node = nodes[obj.ID]; + + if (node!=null) + { + node.Text = obj.Name; + } + } + + private void toolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e) + { + if (e.Button == bttnDelete) + { + DeleteUnit(); + } + else if (e.Button == bttnEdit) + { + EditUnit(); + } + } + + private void treeView_AfterSelect(object sender, TreeViewEventArgs e) + { + TreeNode node = treeView.SelectedNode; + + bttnDelete.Enabled = (node != null && node.Tag is Unit); + bttnEdit.Enabled = bttnDelete.Enabled; + } + } +}
--- a/FrmMain.cs Sun Dec 12 17:30:53 2010 +0000 +++ b/FrmMain.cs Mon Jan 24 16:50:31 2011 +0000 @@ -24,6 +24,7 @@ using IBBoard.WarFoundry.API.Commands; using IBBoard.WarFoundry.API.Exporters; using IBBoard.WarFoundry.API.Objects; +using IBBoard.WarFoundry.API.Util; using IBBoard.WarFoundry.API.Savers; using IBBoard.WarFoundry.API.Factories; using IBBoard.WarFoundry.API.Factories.Xml; @@ -38,6 +39,12 @@ private static readonly string AppTitle = "WarFoundry"; internal static readonly string VERSION = "0.1"; const string DefaultDataDir = "data"; + /* public static string pointsAbbrevSingle; + public static string pointsAbbrevPlural; + public static string pointsAbbreviation; + public static string pointsNameSingle; + public static string pointsNamePlural; + public static string pointsName;*/ private Preferences preferences; private readonly ILog log = LogManager.GetLogger(typeof(FrmMain)); @@ -94,6 +101,7 @@ private IBBToolStripMenuItem miPreferences; private IBBToolStripMenuItem miAbout; + /// <summary> /// The main entry point for the application. /// </summary> @@ -146,8 +154,9 @@ PointsValueChangedMethod = new DoubleValChangedDelegate(FrmMain_PointsValueChangedMethod); //FailedUnitRequirementMethod = new FailedUnitRequirementDelegate(FrmMain_FailedUnitRequirement); + sbErrorPanel.Color = Color.Red; - sbPointsPanel.ToolTipText = Translation.GetTranslation("statusPanelPointsToolTip", "total points value"); + SetPointsPanelToolTipText(); // hack to load default files WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Constants.ExecutablePath + Constants.DirectoryString + DefaultDataDir)); @@ -180,7 +189,15 @@ ControlTranslator.TranslateComponents(components.Components); ControlTranslator.TranslateComponent(openArmyDialog); ControlTranslator.TranslateComponent(saveArmyDialog); - } + //make sure translations exist for gamesystem pointsnames + if (CurrentGameSystem != null) + { + CurrentGameSystem.LoadPointsSystemNames(); + } + //translate pointspanel and tooltip + SetPointsPanelToolTipText(); + SetPointsPanelText(); + } void TranslationChanged() { @@ -868,6 +885,7 @@ { SetAppTitle(); RemoveCategoryButtons(); + newSystem.LoadPointsSystemNames(); } private void FrmMain_ArmyChanged(Army oldArmy, Army newArmy) @@ -1274,8 +1292,104 @@ SetPointsPanelText(); } } +/* + public static string UsePointsAbbrev(double pointTemp) + { + if (pointTemp == 1) + { + pointsAbbreviation = pointsAbbrevSingle; + } + else + { + pointsAbbreviation = pointsAbbrevPlural; + } + return pointsAbbreviation; + } - private void SetPointsPanelText() + public static string UsePointsName(double pointTemp) + { + + if (pointTemp == 1) + { + pointsName = pointsNameSingle; + } + else + { + pointsName = pointsNamePlural; + } + return pointsName; + } + + private void LoadPointsSystemNames() + { + LoadPointsAbbrevPlural(); + LoadPointsAbbrevSingle(); + LoadPointsNamePlural(); + LoadPointsNameSingle(); + } + private void LoadPointsAbbrevPlural() + { + // Use this before calling on pointsAbbreviationPlural to "populate" the variable + if (CurrentGameSystem != null ) + { + if (CurrentGameSystem.SystemPtsAbbrevPlural == "") + { + pointsAbbrevPlural = String.Format(Translation.GetTranslation("PointsLocalisationAbbrevPlural")); + } + else + { + pointsAbbrevPlural = CurrentGameSystem.SystemPtsAbbrevPlural; + } + } + } + private void LoadPointsAbbrevSingle() + { + // Use this before calling on pointsAbbreviationSingle to "populate" the variable + if (CurrentGameSystem != null ) + { + if (CurrentGameSystem.SystemPtsAbbrevSingle == "") + { + pointsAbbrevSingle = String.Format(Translation.GetTranslation("PointsLocalisationAbbrevSingle")); + } + else + { + pointsAbbrevSingle = CurrentGameSystem.SystemPtsAbbrevSingle; + } + } + } + private void LoadPointsNamePlural() + { + if (CurrentGameSystem != null ) + { + // Use this before calling on pointsNamePlural to "populate" the variable + if (CurrentGameSystem.SystemPtsNamePlural == "") + { + pointsNamePlural = String.Format(Translation.GetTranslation("PointsLocalisationNamePlural")); + } + else + { + pointsNamePlural = CurrentGameSystem.SystemPtsNamePlural; + } + } + } + + private void LoadPointsNameSingle() + { + if (CurrentGameSystem != null ) + { + // Use this before calling on pointsNameSingle to "populate" the variable + if (CurrentGameSystem.SystemPtsNameSingle == "") + { + pointsNameSingle = String.Format(Translation.GetTranslation("PointsLocalisationNameSingle")); + } + else + { + pointsNameSingle = CurrentGameSystem.SystemPtsNameSingle; + } + } + } + */ + private void SetPointsPanelText() { if (CurrentArmy==null) { @@ -1284,7 +1398,8 @@ } else { - sbPointsPanel.Text = String.Format(Translation.GetTranslation("statusPanelPoints"), CurrentArmy.Points, CurrentArmy.MaxPoints); + string pointsPanelText = String.Format(Translation.GetTranslation("statusPanelPoints"), CurrentArmy.Points, CurrentGameSystem.UsePointsName(CurrentArmy.Points), CurrentArmy.MaxPoints, CurrentGameSystem.UsePointsName(CurrentArmy.MaxPoints)); + sbPointsPanel.Text = pointsPanelText; if (CurrentArmy.Points>CurrentArmy.MaxPoints) { @@ -1297,6 +1412,11 @@ } } + private void SetPointsPanelToolTipText() + { + sbPointsPanel.ToolTipText = Translation.GetTranslation("statusPanelPointsToolTip", "total points value"); + } + private void redoMenu_Click(object sender, EventArgs e) { if (sender is ToolStripDropDownItem)
--- a/FrmNewArmy.cs Sun Dec 12 17:30:53 2010 +0000 +++ b/FrmNewArmy.cs Mon Jan 24 16:50:31 2011 +0000 @@ -357,7 +357,7 @@ txtArmyName.Text = ""; txtArmyName.Enabled = false; lstRaces.Items.Clear(); - armySize.Value = (decimal)selected.SystemArmyDefaultSize; + armySize.Value = selected.SystemArmyDefaultSize; if (selected != null) {
--- a/FrmUnit.cs Sun Dec 12 17:30:53 2010 +0000 +++ b/FrmUnit.cs Mon Jan 24 16:50:31 2011 +0000 @@ -47,7 +47,13 @@ private TextBox notes; private ListBox abilitiesList; private IBBLabel lblAbilities; - private FlowLayoutPanel statsPanel; + private FlowLayoutPanel statsPanel; + public GameSystem CurrentGameSystem + { + get { return WarFoundryCore.CurrentGameSystem; } + set { WarFoundryCore.CurrentGameSystem = value; } + } + /// <summary> /// Required designer variable. /// </summary> @@ -101,7 +107,7 @@ private void SetPointsValueText() { - lblPoints.Text = "(" + unit.Points + " pts)"; + lblPoints.Text = Translation.GetTranslation("FrmUnitlblPoints", "(" + unit.Points + " pts)", unit.Points, CurrentGameSystem.UsePointsAbbrev(unit.Points)); } private void SetStats()
--- a/Util/UnitEquipmentChoice.cs Sun Dec 12 17:30:53 2010 +0000 +++ b/Util/UnitEquipmentChoice.cs Mon Jan 24 16:50:31 2011 +0000 @@ -6,6 +6,7 @@ using IBBoard.Lang; using IBBoard.WarFoundry.API.Objects; using IBBoard.WarFoundry.API.Util; +using IBBoard.WarFoundry.API; namespace IBBoard.WarFoundry.GUI.WinForms.Util { @@ -17,6 +18,11 @@ { private Unit unit; private UnitEquipmentItem item; + public GameSystem CurrentGameSystem + { + get { return WarFoundryCore.CurrentGameSystem; } + set { WarFoundryCore.CurrentGameSystem = value; } + } public UnitEquipmentChoice(Unit unit, UnitEquipmentItem unitItem) { @@ -34,7 +40,7 @@ } else { - translation = Translation.GetTranslation("equipmentAmountWithCost", "{0} ({1} at {2}pts each)", item.Name, GetAmountString(), item.Cost); + translation = Translation.GetTranslation("equipmentAmountWithCost", "{0} ({1} at {2}pts each)", item.Name, GetAmountString(), item.Cost, CurrentGameSystem.UsePointsAbbrev(item.Cost)); } return translation;
--- a/translations/en.translation Sun Dec 12 17:30:53 2010 +0000 +++ b/translations/en.translation Mon Jan 24 16:50:31 2011 +0000 @@ -29,7 +29,11 @@ <translation id="openArmyDialog">Open Army</translation> <translation id="saveArmyDialog">Save Army</translation> <translation id="armyFileFilter">WarFoundry Army Files (*.army)</translation> - <translation id="statusPanelPoints">{0} pts / {1} pts</translation> + <translation id="PointsLocalisationAbbrevSingle">pt</translation> + <translation id="PointsLocalisationAbbrevPlural">pts</translation> + <translation id="PointsLocalisationNameSingle">point</translation> + <translation id="PointsLocalisationNamePlural">points</translation> + <translation id="statusPanelPoints">{0} {1} / {2} {3}</translation> <translation id="statusPanelPointsToolTip">Current army points value</translation> <translation id="defaultUnitName">Unit of {0} {1}</translation> <translation id="FrmNewArmy">Create new army</translation> @@ -66,6 +70,7 @@ <translation id="lblDevelopers">Developers:</translation> <translation id="lblThanks">Thanks to:</translation> <translation id="FrmUnit">{0} ({1})</translation> + <translation id="FrmUnitlblPoints">({0} {1})</translation> <translation id="lblUnitSize">Unit size:</translation> <translation id="StatLineName">Type Name</translation> <translation id="lblEquip">Equipment:</translation> @@ -75,7 +80,7 @@ <translation id="bttnRemoveWeapon">Remove</translation> <translation id="bttnReplaceWeapon">Replace</translation> <translation id="bttnEditWeapon">Edit</translation> - <translation id="equipmentAmountWithCost">{0} ({1} at {2}pts each)</translation> + <translation id="equipmentAmountWithCost">{0} ({1} at {2}{3} each)</translation> <translation id="equipmentAmountWithZeroCost">{0} ({1} for free)</translation> <translation id="equipmentChoiceAmountAll">For all ({1})</translation> <translation id="equipmentChoiceAmountPercentage">For {0}% ({1})</translation> @@ -123,4 +128,6 @@ <translation id="lblLanguage">Language:</translation> <translation id="languagesGroup">Language</translation> <translation id="GameSystemFilesReloaded">Game system and race files reloaded</translation> + <translation id="treeNodeText">{0} ({1} {2})</translation> + <translation id="setUnitEquipmentItemName">( {0} {1} each)</translation> </translations> \ No newline at end of file
--- a/translations/sv.translation Sun Dec 12 17:30:53 2010 +0000 +++ b/translations/sv.translation Mon Jan 24 16:50:31 2011 +0000 @@ -1,127 +1,134 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8"?> <translations xmlns="http://ibboard.co.uk/translation" lang="sv"> - <translation id="menuFile">&Arkiv</translation> - <translation id="menuEdit">&Redigera</translation> - <translation id="menuHelp">&Hjälp</translation> - <translation id="miNewArmy">&Skapa ny armé</translation> - <translation id="miOpenArmy">&Öppna sparad armé</translation> - <translation id="miSaveArmy">&Spara armé</translation> - <translation id="miSaveArmyAs">Spara armé &som...</translation> - <translation id="miExportArmyAs">&Exportera armé</translation> - <translation id="miExportArmyAsBasicHTML">Normal HTML</translation> - <translation id="miCloseArmy">&Stäng armé</translation> - <translation id="miReloadFiles">&Läs in filer på nytt</translation> - <translation id="miExit">A&vsluta</translation> - <translation id="miUndo">&Återställ</translation> - <translation id="miRedo">&Gör om</translation> - <translation id="miPreferences">&Inställningar</translation> - <translation id="miAbout">&Om</translation> + <translation id="armyFileFilter">WarFoundry arméfiler (*.army)</translation> + <translation id="armyHtmlExportEquipAmountAll">alla ({1})</translation> + <translation id="armyHtmlExportEquipAmountNumber">{0}</translation> + <translation id="armyHtmlExportEquipAmountPercentage">{0}% ({1})</translation> + <translation id="armyHtmlExportEquipAmountRatio">{0} för {1}</translation> + <translation id="armyHtmlOutputBodyHeader">{0} - {1}poäng</translation> + <translation id="armyHtmlOutputTableHeaderUnitName">Namn</translation> + <translation id="armyHtmlOutputTableHeaderUnitNotes">Anteckningar</translation> + <translation id="armyHtmlOutputTableHeaderUnitPoints">Poäng</translation> + <translation id="ArmyTree">Arméöversikt</translation> + <translation id="bttnAddWeapon">Lägg till</translation> + <translation id="bttnCancel">Avbryt</translation> + <translation id="bttnEditWeapon">Redigera</translation> + <translation id="bttnNewArmy">Skapa ny armé</translation> <translation id="bttnOkay">OK</translation> - <translation id="bttnCancel">Avbryt</translation> - <translation id="bttnNewArmy">Skapa ny armé</translation> <translation id="bttnOpenArmy">Öppna sparad armé</translation> - <translation id="bttnSaveArmy">Spara armé</translation> - <translation id="bttnUndo">Återställ</translation> <translation id="bttnRedo">Gör om</translation> - <translation id="ArmyTree">Arméöversikt</translation> - <translation id="miDeleteUnit">&Ta bort enhet</translation> - <translation id="miEditUnit">&Redigera enhet</translation> - <translation id="openArmyDialog">Öppna armé</translation> - <translation id="saveArmyDialog">Spara armé</translation> - <translation id="armyFileFilter">WarFoundry arméfiler (*.army)</translation> - <translation id="statusPanelPoints">{0} poäng / {1} poäng</translation> - <translation id="statusPanelPointsToolTip">Aktuellt poängvärde för armé</translation> + <translation id="bttnRemoveWeapon">Ta bort</translation> + <translation id="bttnReplaceWeapon">Ersätt</translation> + <translation id="bttnSaveArmy">Spara armé</translation> + <translation id="bttnSelectRace">Skapa armé</translation> + <translation id="bttnSelectUnit">Skapa enhet</translation> + <translation id="bttnUndo">Återställ</translation> + <translation id="createAndAddUnitCommandDescription">Lägg till enhet av {0}</translation> + <translation id="createAndAddUnitCommandUndoDescription">Ta bort enhet av {0}</translation> <translation id="defaultUnitName">Enhet av {0} {1}</translation> - <translation id="FrmNewArmy">Skapa ny armé</translation> - <translation id="lblGameSystem">Spelsystem:</translation> - <translation id="lblRaceList">Raser:</translation> - <translation id="lblArmyName">Arménamn:</translation> - <translation id="lblArmySize">Arméstorlek:</translation> - <translation id="bttnSelectRace">Skapa armé</translation> - <translation id="newArmyNoGameSystems">WarFoundry kunde inte hitta data för spel system. -Vänligen kontrollera felmeddelanden i loggen och se till att du har datafielr för spelsystme i "data" mappen.</translation> - <translation id="FrmNewUnit">Lägg till en ny {0}</translation> - <translation id="lblUnitList">Enheter:</translation> - <translation id="bttnSelectUnit">Skapa enhet</translation> - <translation id="FrmNewUnitEquipment">Ny utrustning för {0}</translation> - <translation id="FrmReplaceUnitEquipment">Ersätt {0} med ny utrustning</translation> - <translation id="lblAmount">Antal:</translation> - <translation id="lblItem">Utrustning:</translation> - <translation id="rbEquipAll">Utrusta alla</translation> + <translation id="equipmentAmountAll">alla ({1})</translation> + <translation id="equipmentAmountNumber">{0}</translation> + <translation id="equipmentAmountPercentage">{0}% ({1})</translation> + <translation id="equipmentAmountWithCost">{0} ({1} för {2} {3} var)</translation> + <translation id="equipmentAmountWithZeroCost">{0} ({1} gratis)</translation> + <translation id="equipmentChoiceAmountAll">För alla ({1})</translation> + <translation id="equipmentChoiceAmountNumber">{0}</translation> + <translation id="equipmentChoiceAmountPercentage">För {0}% ({1})</translation> + <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> + <translation id="equipNumberTooLargeTitle">Utrustningens antal för stort</translation> + <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> + <translation id="equipNumberTooSmallTitle">Utrustningens antal för litet</translation> <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> <translation id="equipPercentageTooLargeTitle">Utrustningsprocenten för stor</translation> <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> <translation id="equipPercentageTooSmallTitle">Utrustningsprocenten för liten</translation> - <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> - <translation id="equipNumberTooLargeTitle">Utrustningens antal för stort</translation> - <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> - <translation id="equipNumberTooSmallTitle">Utrustningens antal för litet</translation> + <translation id="FrmAbout">Om WarFoundry</translation> <translation id="FrmEditUnitEquipment">Ändra {0} för {1}</translation> - <translation id="removeRequiredEquipmentText">Utrustningen är obligatorisk och kan inte tas bort. Det måste finnas minst en, eller ersättas med ett alternativ.</translation> - <translation id="removeRequiredEquipmentTitle">Kan inte ta bort obligatorisk utrustnign </translation> + <translation id="FrmNewArmy">Skapa ny armé</translation> + <translation id="FrmNewUnit">Lägg till en ny {0}</translation> + <translation id="FrmNewUnitEquipment">Ny utrustning för {0}</translation> + <translation id="FrmPreferences">Inställningar</translation> + <translation id="FrmReplaceUnitEquipment">Ersätt {0} med ny utrustning</translation> + <translation id="FrmUnit">{0}</translation> + <translation id="GameSystemFilesReloaded">System och ras filer har laddats in.</translation> + <translation id="InvalidArmyFileBoxTitle">Ogiltig arméfil</translation> + <translation id="InvalidRaceFileBoxTitle">Ogiltig rasfil</translation> + <translation id="languagePrefSection">Språk</translation> + <translation id="languagesGroup">Språk</translation> + <translation id="lblAbilities">Förmågor:</translation> + <translation id="lblAmount">Antal:</translation> + <translation id="lblArmyName">Arménamn:</translation> + <translation id="lblArmySize">Arméstorlek:</translation> + <translation id="lblDevelopers">Utvecklare:</translation> + <translation id="lblEquip">Utrustning:</translation> + <translation id="lblGameSystem">Spelsystem:</translation> + <translation id="lblItem">Utrustning:</translation> + <translation id="lblLanguage">Språk:</translation> + <translation id="lblNotes">Anteckningar:</translation> + <translation id="FrmUnitlblPoints">({0} {1})</translation> + <translation id="lblRaceList">Raser:</translation> + <translation id="lblThanks">Tack till:</translation> + <translation id="lblUnitList">Enheter:</translation> + <translation id="lblUnitSize">Storlek:</translation> + <translation id="lblVersion">Version: {0}</translation> + <translation id="menuEdit">&Redigera</translation> + <translation id="menuFile">&Arkiv</translation> + <translation id="menuHelp">&Hjälp</translation> + <translation id="miAbout">&Om</translation> + <translation id="miCloseArmy">&Stäng armé</translation> + <translation id="miDeleteUnit">&Ta bort enhet</translation> + <translation id="miEditUnit">&Redigera enhet</translation> + <translation id="miExit">A&vsluta</translation> + <translation id="miExportArmyAs">&Exportera armé</translation> + <translation id="miExportArmyAsBasicHTML">Normal HTML</translation> + <translation id="miNewArmy">&Skapa ny armé</translation> + <translation id="miOpenArmy">&Öppna sparad armé</translation> + <translation id="miPreferences">&Inställningar</translation> + <translation id="miRedo">&Gör om</translation> + <translation id="miReloadFiles">&Läs in filer på nytt</translation> + <translation id="miSaveArmy">&Spara armé</translation> + <translation id="miSaveArmyAs">Spara armé &som...</translation> + <translation id="miUndo">&Återställ</translation> + <translation id="newArmyNoGameSystems">WarFoundry kunde inte hitta data för spel system. + Vänligen kontrollera felmeddelanden i loggen och se till att du har datafiler för spelsystemet i "data" mappen.</translation> + <translation id="openArmyDialog">Öppna armé</translation> + <translation id="PointsLocalisationAbbrevPlural">png</translation> + <translation id="PointsLocalisationAbbrevSingle">png</translation> + <translation id="PointsLocalisationNamePlural">poäng</translation> + <translation id="PointsLocalisationNameSingle">poäng</translation> + <translation id="rbEquipAll">Utrusta alla</translation> <translation id="removeEquipmentText">Utrustningen kommer att tas bort. Fortsätt?</translation> <translation id="removeEquipmentTitle">Bekräfta byte av utrustning</translation> - <translation id="FrmAbout">Om WarFoundry</translation> - <translation id="lblVersion">Version: {0}</translation> - <translation id="lblDevelopers">Utvecklare:</translation> - <translation id="lblThanks">Tack till:</translation> - <translation id="FrmUnit">{0}</translation> - <translation id="lblUnitSize">Storlek:</translation> - <translation id="StatLineName">Typ</translation> - <translation id="lblEquip">Utrustning:</translation> - <translation id="bttnAddWeapon">Lägg till</translation> - <translation id="lblAbilities">Förmågor:</translation> - <translation id="lblNotes">Anteckningar:</translation> - <translation id="bttnRemoveWeapon">Ta bort</translation> - <translation id="bttnReplaceWeapon">Ersätt</translation> - <translation id="bttnEditWeapon">Redigera</translation> - <translation id="equipmentAmountWithCost">{0} ({1} för {2} poäng var)</translation> - <translation id="equipmentAmountWithZeroCost">{0} ({1} gratis)</translation> - <translation id="equipmentChoiceAmountAll">För alla ({1})</translation> - <translation id="equipmentChoiceAmountPercentage">För {0}% ({1})</translation> - <translation id="equipmentChoiceAmountNumber">{0}</translation> - <translation id="InvalidRaceFileBoxTitle">Ogiltig rasfil</translation> - <translation id="InvalidArmyFileBoxTitle">Ogiltig arméfil</translation> - <translation id="SaveChangesQuestion">Armén "{0}" har ändrats. -Vill du spara ändringarna innan armén stängs?</translation> - - <translation id="SaveChangesTitle">Osparade förändringar</translation> - <translation id="SaveFailed">WarFoundry kunde inte spara filen. Var god och kontrollera loggen för mera detaljer.</translation> - <translation id="SaveFailedTitle">Filen kunde inte sparas</translation> - <translation id="armyHtmlOutputBodyHeader">{0} - {1}poäng</translation> - <translation id="armyHtmlOutputTableHeaderUnitName">Namn</translation> - <translation id="armyHtmlOutputTableHeaderUnitNotes">Anteckningar</translation> - <translation id="armyHtmlOutputTableHeaderUnitPoints">Poäng</translation> - <translation id="armyHtmlExportEquipAmountAll">alla ({1})</translation> - <translation id="armyHtmlExportEquipAmountPercentage">{0}% ({1})</translation> - <translation id="armyHtmlExportEquipAmountNumber">{0}</translation> - <translation id="armyHtmlExportEquipAmountRatio">{0} för {1}</translation> - <translation id="equipmentAmountAll">alla ({1})</translation> - <translation id="equipmentAmountPercentage">{0}% ({1})</translation> - <translation id="equipmentAmountNumber">{0}</translation> - <translation id="setEquipmentAmountCommandDescription">ändra {0} amount för {1} till {2}</translation> - <translation id="setEquipmentAmountCommandUndoDescription">ändra {0} amount för {1} till {2}</translation> + <translation id="removeRequiredEquipmentText">Utrustningen är obligatorisk och kan inte tas bort. Det måste finnas minst en, eller ersättas med ett alternativ.</translation> + <translation id="removeRequiredEquipmentTitle">Kan inte ta bort obligatorisk utrustnign </translation> + <translation id="removeUnitCommandDescription">Ta bort {0}</translation> + <translation id="removeUnitCommandUndoDescription">Lägg till på nytt {0}</translation> <translation id="replaceUnitEquipmentCommandDescription">Ersätt {0} med {1} för {2}</translation> <translation id="replaceUnitEquipmentCommandUndoDescription">Ersätt {0} med {1} för {2}</translation> - <translation id="createAndAddUnitCommandDescription">Lägg till enhet av {0}</translation> - <translation id="createAndAddUnitCommandUndoDescription">Ta bort enhet av {0}</translation> - <translation id="removeUnitCommandDescription">Ta bort {0}</translation> - <translation id="removeUnitCommandUndoDescription">Lägg till på nytt {0}</translation> - <translation id="setUnitNameCommandDescription">Byt namn från "{0}" till "{1}"</translation> - <translation id="setUnitNameCommandUndoDescription">Byt namn från "{0}" till "{1}"</translation> - <translation id="setUnitSizeCommandDescription">ändra storleken på {0} till {1}</translation> - <translation id="setUnitSizeCommandUndoDescription"> ändra storleken på {0} till {1}</translation> <translation id="requirementAND">{0}; och {1}</translation> <translation id="requirementOR">{0}; eller {1}</translation> <translation id="requirementUnitExcludes">{0} kan bara väljas om ingen av följande har valts: {1}</translation> <translation id="requirementUnitMaxNumber">{1} kan bara väljas {0} gånger</translation> <translation id="requirementUnitMinNumber">{1} måste väljas minst {0} gånger</translation> - <translation id="requirementUnitTypeAtLeastSingle">{1} {0}</translation> + <translation id="requirementUnitTypeAtLeast">{0} kan bara väljas om följande har valts: {1}</translation> <translation id="requirementUnitTypeAtLeastJoiner">{0}, {1}</translation> - <translation id="requirementUnitTypeAtLeast">{0} kan bara väljas om följande har valts: {1}</translation> - <translation id="FrmPreferences">Inställningar</translation> - <translation id="languagePrefSection">Språk</translation> - <translation id="lblLanguage">Språk:</translation> - <translation id="languagesGroup">Språk</translation> - <translation id="GameSystemFilesReloaded">System och ras filer har laddats in.</translation> + <translation id="requirementUnitTypeAtLeastSingle">{1} {0}</translation> + <translation id="saveArmyDialog">Spara armé</translation> + <translation id="SaveChangesQuestion">Armén "{0}" har ändrats. + Vill du spara ändringarna innan armén stängs? </translation> + <translation id="SaveChangesTitle">Osparade förändringar</translation> + <translation id="SaveFailed">WarFoundry kunde inte spara filen. Var god och kontrollera loggen för mera detaljer.</translation> + <translation id="SaveFailedTitle">Filen kunde inte sparas</translation> + <translation id="setEquipmentAmountCommandDescription">ändra {0} amount för {1} till {2}</translation> + <translation id="setEquipmentAmountCommandUndoDescription">ändra {0} amount för {1} till {2}</translation> + <translation id="setUnitNameCommandDescription">Byt namn från "{0}" till "{1}"</translation> + <translation id="setUnitNameCommandUndoDescription">Byt namn från "{0}" till "{1}"</translation> + <translation id="setUnitSizeCommandDescription">ändra storleken på {0} till {1}</translation> + <translation id="setUnitSizeCommandUndoDescription"> ändra storleken på {0} till {1}</translation> + <translation id="StatLineName">Typ</translation> + <translation id="statusPanelPoints">{0} {1} / {2} {3}</translation> + <translation id="statusPanelPointsToolTip">Aktuellt poängvärde för armé</translation> + <translation id="treeNodeText">{0} ({1} {2})</translation> + <translation id="setUnitEquipmentItemName">( {0} {1} var)</translation> + </translations>