diff --git a/AtlasServerManager/AtlasServerManager.Designer.cs b/AtlasServerManager/AtlasServerManager.Designer.cs index 22b5e88..40a707c 100644 --- a/AtlasServerManager/AtlasServerManager.Designer.cs +++ b/AtlasServerManager/AtlasServerManager.Designer.cs @@ -114,6 +114,9 @@ private void InitializeComponent() this.customCommandToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); this.loadPluginToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); this.unloadPluginToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); + this.languageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.en = new System.Windows.Forms.ToolStripMenuItem(); + this.zh_cn = new System.Windows.Forms.ToolStripMenuItem(); this.fontDialog1 = new System.Windows.Forms.FontDialog(); this.tabPage2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -143,18 +146,18 @@ private void InitializeComponent() this.tabPage2.Controls.Add(this.ClearConfigButton); this.tabPage2.Controls.Add(this.button1); this.tabPage2.Controls.Add(this.groupBox3); - this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Location = new System.Drawing.Point(4, 25); this.tabPage2.Margin = new System.Windows.Forms.Padding(4); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(4); - this.tabPage2.Size = new System.Drawing.Size(676, 298); + this.tabPage2.Size = new System.Drawing.Size(676, 295); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "Options"; // // ClearConfigButton // this.ClearConfigButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ClearConfigButton.Location = new System.Drawing.Point(482, 247); + this.ClearConfigButton.Location = new System.Drawing.Point(482, 244); this.ClearConfigButton.Name = "ClearConfigButton"; this.ClearConfigButton.Size = new System.Drawing.Size(191, 44); this.ClearConfigButton.TabIndex = 8; @@ -164,7 +167,7 @@ private void InitializeComponent() // button1 // this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button1.Location = new System.Drawing.Point(482, 198); + this.button1.Location = new System.Drawing.Point(482, 195); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(191, 44); this.button1.TabIndex = 7; @@ -186,7 +189,7 @@ private void InitializeComponent() this.groupBox3.Controls.Add(this.label5); this.groupBox3.Location = new System.Drawing.Point(3, 7); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(473, 283); + this.groupBox3.Size = new System.Drawing.Size(473, 280); this.groupBox3.TabIndex = 5; this.groupBox3.TabStop = false; this.groupBox3.Text = "Atlas Server Automatic Update"; @@ -227,8 +230,8 @@ private void InitializeComponent() // splitContainer2.Panel2 // this.splitContainer2.Panel2.Controls.Add(this.ServerUpdatingMessage); - this.splitContainer2.Size = new System.Drawing.Size(461, 146); - this.splitContainer2.SplitterDistance = 69; + this.splitContainer2.Size = new System.Drawing.Size(461, 143); + this.splitContainer2.SplitterDistance = 67; this.splitContainer2.SplitterWidth = 1; this.splitContainer2.TabIndex = 7; // @@ -240,7 +243,7 @@ private void InitializeComponent() this.ServerUpdateMessage.Location = new System.Drawing.Point(0, 0); this.ServerUpdateMessage.Multiline = true; this.ServerUpdateMessage.Name = "ServerUpdateMessage"; - this.ServerUpdateMessage.Size = new System.Drawing.Size(461, 66); + this.ServerUpdateMessage.Size = new System.Drawing.Size(461, 64); this.ServerUpdateMessage.TabIndex = 5; this.ServerUpdateMessage.Text = "Atlas Updating in {time}!"; // @@ -252,7 +255,7 @@ private void InitializeComponent() this.ServerUpdatingMessage.Location = new System.Drawing.Point(0, 2); this.ServerUpdatingMessage.Multiline = true; this.ServerUpdatingMessage.Name = "ServerUpdatingMessage"; - this.ServerUpdatingMessage.Size = new System.Drawing.Size(461, 122); + this.ServerUpdatingMessage.Size = new System.Drawing.Size(461, 133); this.ServerUpdatingMessage.TabIndex = 6; this.ServerUpdatingMessage.Text = "Atlas is now updating please restart your games to get the update!"; // @@ -385,7 +388,7 @@ private void InitializeComponent() this.rCONToolStripMenuItem, this.rCONAllToolStripMenuItem}); this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(155, 92); + this.contextMenuStrip1.Size = new System.Drawing.Size(166, 92); // // serverToolStripMenuItem // @@ -394,25 +397,25 @@ private void InitializeComponent() this.removeToolStripMenuItem, this.editSettingsToolStripMenuItem}); this.serverToolStripMenuItem.Name = "serverToolStripMenuItem"; - this.serverToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.serverToolStripMenuItem.Size = new System.Drawing.Size(165, 22); this.serverToolStripMenuItem.Text = "Server"; // // addToolStripMenuItem // this.addToolStripMenuItem.Name = "addToolStripMenuItem"; - this.addToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.addToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.addToolStripMenuItem.Text = "Add"; // // removeToolStripMenuItem // this.removeToolStripMenuItem.Name = "removeToolStripMenuItem"; - this.removeToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.removeToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.removeToolStripMenuItem.Text = "Remove"; // // editSettingsToolStripMenuItem // this.editSettingsToolStripMenuItem.Name = "editSettingsToolStripMenuItem"; - this.editSettingsToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.editSettingsToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.editSettingsToolStripMenuItem.Text = "Edit Settings"; // // manageToolStripMenuItem @@ -421,19 +424,19 @@ private void InitializeComponent() this.startToolStripMenuItem, this.stopToolStripMenuItem}); this.manageToolStripMenuItem.Name = "manageToolStripMenuItem"; - this.manageToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.manageToolStripMenuItem.Size = new System.Drawing.Size(165, 22); this.manageToolStripMenuItem.Text = "Manage"; // // startToolStripMenuItem // this.startToolStripMenuItem.Name = "startToolStripMenuItem"; - this.startToolStripMenuItem.Size = new System.Drawing.Size(98, 22); + this.startToolStripMenuItem.Size = new System.Drawing.Size(103, 22); this.startToolStripMenuItem.Text = "Start"; // // stopToolStripMenuItem // this.stopToolStripMenuItem.Name = "stopToolStripMenuItem"; - this.stopToolStripMenuItem.Size = new System.Drawing.Size(98, 22); + this.stopToolStripMenuItem.Size = new System.Drawing.Size(103, 22); this.stopToolStripMenuItem.Text = "Stop"; // // rCONToolStripMenuItem @@ -446,43 +449,43 @@ private void InitializeComponent() this.loadPluginToolStripMenuItem, this.unloadPluginToolStripMenuItem}); this.rCONToolStripMenuItem.Name = "rCONToolStripMenuItem"; - this.rCONToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.rCONToolStripMenuItem.Size = new System.Drawing.Size(165, 22); this.rCONToolStripMenuItem.Text = "RCON Selected"; // // broadcastToolStripMenuItem // this.broadcastToolStripMenuItem.Name = "broadcastToolStripMenuItem"; - this.broadcastToolStripMenuItem.Size = new System.Drawing.Size(176, 22); + this.broadcastToolStripMenuItem.Size = new System.Drawing.Size(192, 22); this.broadcastToolStripMenuItem.Text = "Broadcast"; // // saveWorldToolStripMenuItem // this.saveWorldToolStripMenuItem.Name = "saveWorldToolStripMenuItem"; - this.saveWorldToolStripMenuItem.Size = new System.Drawing.Size(176, 22); + this.saveWorldToolStripMenuItem.Size = new System.Drawing.Size(192, 22); this.saveWorldToolStripMenuItem.Text = "Save World"; // // closeSaveWorldToolStripMenuItem // this.closeSaveWorldToolStripMenuItem.Name = "closeSaveWorldToolStripMenuItem"; - this.closeSaveWorldToolStripMenuItem.Size = new System.Drawing.Size(176, 22); + this.closeSaveWorldToolStripMenuItem.Size = new System.Drawing.Size(192, 22); this.closeSaveWorldToolStripMenuItem.Text = "Close + Save World"; // // customCommandToolStripMenuItem // this.customCommandToolStripMenuItem.Name = "customCommandToolStripMenuItem"; - this.customCommandToolStripMenuItem.Size = new System.Drawing.Size(176, 22); + this.customCommandToolStripMenuItem.Size = new System.Drawing.Size(192, 22); this.customCommandToolStripMenuItem.Text = "Custom Command"; // // loadPluginToolStripMenuItem // this.loadPluginToolStripMenuItem.Name = "loadPluginToolStripMenuItem"; - this.loadPluginToolStripMenuItem.Size = new System.Drawing.Size(176, 22); + this.loadPluginToolStripMenuItem.Size = new System.Drawing.Size(192, 22); this.loadPluginToolStripMenuItem.Text = "Load Plugin"; // // unloadPluginToolStripMenuItem // this.unloadPluginToolStripMenuItem.Name = "unloadPluginToolStripMenuItem"; - this.unloadPluginToolStripMenuItem.Size = new System.Drawing.Size(176, 22); + this.unloadPluginToolStripMenuItem.Size = new System.Drawing.Size(192, 22); this.unloadPluginToolStripMenuItem.Text = "Unload Plugin"; // // rCONAllToolStripMenuItem @@ -495,43 +498,43 @@ private void InitializeComponent() this.loadPluginToolStripMenuItem1, this.unloadPluginToolStripMenuItem1}); this.rCONAllToolStripMenuItem.Name = "rCONAllToolStripMenuItem"; - this.rCONAllToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.rCONAllToolStripMenuItem.Size = new System.Drawing.Size(165, 22); this.rCONAllToolStripMenuItem.Text = "RCON All"; // // broadcastToolStripMenuItem1 // this.broadcastToolStripMenuItem1.Name = "broadcastToolStripMenuItem1"; - this.broadcastToolStripMenuItem1.Size = new System.Drawing.Size(176, 22); + this.broadcastToolStripMenuItem1.Size = new System.Drawing.Size(192, 22); this.broadcastToolStripMenuItem1.Text = "Broadcast"; // // saveWorldToolStripMenuItem1 // this.saveWorldToolStripMenuItem1.Name = "saveWorldToolStripMenuItem1"; - this.saveWorldToolStripMenuItem1.Size = new System.Drawing.Size(176, 22); + this.saveWorldToolStripMenuItem1.Size = new System.Drawing.Size(192, 22); this.saveWorldToolStripMenuItem1.Text = "Save World"; // // closeSaveWorldToolStripMenuItem1 // this.closeSaveWorldToolStripMenuItem1.Name = "closeSaveWorldToolStripMenuItem1"; - this.closeSaveWorldToolStripMenuItem1.Size = new System.Drawing.Size(176, 22); + this.closeSaveWorldToolStripMenuItem1.Size = new System.Drawing.Size(192, 22); this.closeSaveWorldToolStripMenuItem1.Text = "Close + Save World"; // // customCommandToolStripMenuItem1 // this.customCommandToolStripMenuItem1.Name = "customCommandToolStripMenuItem1"; - this.customCommandToolStripMenuItem1.Size = new System.Drawing.Size(176, 22); + this.customCommandToolStripMenuItem1.Size = new System.Drawing.Size(192, 22); this.customCommandToolStripMenuItem1.Text = "Custom Command"; // // loadPluginToolStripMenuItem1 // this.loadPluginToolStripMenuItem1.Name = "loadPluginToolStripMenuItem1"; - this.loadPluginToolStripMenuItem1.Size = new System.Drawing.Size(176, 22); + this.loadPluginToolStripMenuItem1.Size = new System.Drawing.Size(192, 22); this.loadPluginToolStripMenuItem1.Text = "Load Plugin"; // // unloadPluginToolStripMenuItem1 // this.unloadPluginToolStripMenuItem1.Name = "unloadPluginToolStripMenuItem1"; - this.unloadPluginToolStripMenuItem1.Size = new System.Drawing.Size(176, 22); + this.unloadPluginToolStripMenuItem1.Size = new System.Drawing.Size(192, 22); this.unloadPluginToolStripMenuItem1.Text = "Unload Plugin"; // // tabControl1 @@ -788,10 +791,11 @@ private void InitializeComponent() this.serverToolStripMenuItem1, this.managerToolStripMenuItem, this.rCONSelecteToolStripMenuItem, - this.rCONAllToolStripMenuItem1}); + this.rCONAllToolStripMenuItem1, + this.languageToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(684, 24); + this.menuStrip1.Size = new System.Drawing.Size(684, 25); this.menuStrip1.TabIndex = 1; this.menuStrip1.Text = "menuStrip1"; // @@ -802,25 +806,25 @@ private void InitializeComponent() this.removeToolStripMenuItem1, this.editSettingsToolStripMenuItem1}); this.serverToolStripMenuItem1.Name = "serverToolStripMenuItem1"; - this.serverToolStripMenuItem1.Size = new System.Drawing.Size(51, 20); + this.serverToolStripMenuItem1.Size = new System.Drawing.Size(57, 21); this.serverToolStripMenuItem1.Text = "Server"; // // addToolStripMenuItem1 // this.addToolStripMenuItem1.Name = "addToolStripMenuItem1"; - this.addToolStripMenuItem1.Size = new System.Drawing.Size(139, 22); + this.addToolStripMenuItem1.Size = new System.Drawing.Size(148, 22); this.addToolStripMenuItem1.Text = "Add"; // // removeToolStripMenuItem1 // this.removeToolStripMenuItem1.Name = "removeToolStripMenuItem1"; - this.removeToolStripMenuItem1.Size = new System.Drawing.Size(139, 22); + this.removeToolStripMenuItem1.Size = new System.Drawing.Size(148, 22); this.removeToolStripMenuItem1.Text = "Remove"; // // editSettingsToolStripMenuItem1 // this.editSettingsToolStripMenuItem1.Name = "editSettingsToolStripMenuItem1"; - this.editSettingsToolStripMenuItem1.Size = new System.Drawing.Size(139, 22); + this.editSettingsToolStripMenuItem1.Size = new System.Drawing.Size(148, 22); this.editSettingsToolStripMenuItem1.Text = "Edit Settings"; // // managerToolStripMenuItem @@ -829,19 +833,19 @@ private void InitializeComponent() this.startToolStripMenuItem1, this.stopToolStripMenuItem1}); this.managerToolStripMenuItem.Name = "managerToolStripMenuItem"; - this.managerToolStripMenuItem.Size = new System.Drawing.Size(62, 20); + this.managerToolStripMenuItem.Size = new System.Drawing.Size(68, 21); this.managerToolStripMenuItem.Text = "Manage"; // // startToolStripMenuItem1 // this.startToolStripMenuItem1.Name = "startToolStripMenuItem1"; - this.startToolStripMenuItem1.Size = new System.Drawing.Size(98, 22); + this.startToolStripMenuItem1.Size = new System.Drawing.Size(103, 22); this.startToolStripMenuItem1.Text = "Start"; // // stopToolStripMenuItem1 // this.stopToolStripMenuItem1.Name = "stopToolStripMenuItem1"; - this.stopToolStripMenuItem1.Size = new System.Drawing.Size(98, 22); + this.stopToolStripMenuItem1.Size = new System.Drawing.Size(103, 22); this.stopToolStripMenuItem1.Text = "Stop"; // // rCONSelecteToolStripMenuItem @@ -854,43 +858,43 @@ private void InitializeComponent() this.loadPluginToolStripMenuItem2, this.unloadPluginToolStripMenuItem2}); this.rCONSelecteToolStripMenuItem.Name = "rCONSelecteToolStripMenuItem"; - this.rCONSelecteToolStripMenuItem.Size = new System.Drawing.Size(99, 20); + this.rCONSelecteToolStripMenuItem.Size = new System.Drawing.Size(109, 21); this.rCONSelecteToolStripMenuItem.Text = "RCON Selected"; // // broadcastToolStripMenuItem2 // this.broadcastToolStripMenuItem2.Name = "broadcastToolStripMenuItem2"; - this.broadcastToolStripMenuItem2.Size = new System.Drawing.Size(176, 22); + this.broadcastToolStripMenuItem2.Size = new System.Drawing.Size(192, 22); this.broadcastToolStripMenuItem2.Text = "Broadcast"; // // saveWorldToolStripMenuItem2 // this.saveWorldToolStripMenuItem2.Name = "saveWorldToolStripMenuItem2"; - this.saveWorldToolStripMenuItem2.Size = new System.Drawing.Size(176, 22); + this.saveWorldToolStripMenuItem2.Size = new System.Drawing.Size(192, 22); this.saveWorldToolStripMenuItem2.Text = "Save World"; // // closeSaveWorldToolStripMenuItem2 // this.closeSaveWorldToolStripMenuItem2.Name = "closeSaveWorldToolStripMenuItem2"; - this.closeSaveWorldToolStripMenuItem2.Size = new System.Drawing.Size(176, 22); + this.closeSaveWorldToolStripMenuItem2.Size = new System.Drawing.Size(192, 22); this.closeSaveWorldToolStripMenuItem2.Text = "Close + Save World"; // // customCommandToolStripMenuItem2 // this.customCommandToolStripMenuItem2.Name = "customCommandToolStripMenuItem2"; - this.customCommandToolStripMenuItem2.Size = new System.Drawing.Size(176, 22); + this.customCommandToolStripMenuItem2.Size = new System.Drawing.Size(192, 22); this.customCommandToolStripMenuItem2.Text = "Custom Command"; // // loadPluginToolStripMenuItem2 // this.loadPluginToolStripMenuItem2.Name = "loadPluginToolStripMenuItem2"; - this.loadPluginToolStripMenuItem2.Size = new System.Drawing.Size(176, 22); + this.loadPluginToolStripMenuItem2.Size = new System.Drawing.Size(192, 22); this.loadPluginToolStripMenuItem2.Text = "Load Plugin"; // // unloadPluginToolStripMenuItem2 // this.unloadPluginToolStripMenuItem2.Name = "unloadPluginToolStripMenuItem2"; - this.unloadPluginToolStripMenuItem2.Size = new System.Drawing.Size(176, 22); + this.unloadPluginToolStripMenuItem2.Size = new System.Drawing.Size(192, 22); this.unloadPluginToolStripMenuItem2.Text = "Unload Plugin"; // // rCONAllToolStripMenuItem1 @@ -903,45 +907,68 @@ private void InitializeComponent() this.loadPluginToolStripMenuItem3, this.unloadPluginToolStripMenuItem3}); this.rCONAllToolStripMenuItem1.Name = "rCONAllToolStripMenuItem1"; - this.rCONAllToolStripMenuItem1.Size = new System.Drawing.Size(69, 20); + this.rCONAllToolStripMenuItem1.Size = new System.Drawing.Size(74, 21); this.rCONAllToolStripMenuItem1.Text = "RCON All"; // // broadcastToolStripMenuItem3 // this.broadcastToolStripMenuItem3.Name = "broadcastToolStripMenuItem3"; - this.broadcastToolStripMenuItem3.Size = new System.Drawing.Size(176, 22); + this.broadcastToolStripMenuItem3.Size = new System.Drawing.Size(192, 22); this.broadcastToolStripMenuItem3.Text = "Broadcast"; // // saveWorldToolStripMenuItem3 // this.saveWorldToolStripMenuItem3.Name = "saveWorldToolStripMenuItem3"; - this.saveWorldToolStripMenuItem3.Size = new System.Drawing.Size(176, 22); + this.saveWorldToolStripMenuItem3.Size = new System.Drawing.Size(192, 22); this.saveWorldToolStripMenuItem3.Text = "Save World"; // // closeSaveWorldToolStripMenuItem3 // this.closeSaveWorldToolStripMenuItem3.Name = "closeSaveWorldToolStripMenuItem3"; - this.closeSaveWorldToolStripMenuItem3.Size = new System.Drawing.Size(176, 22); + this.closeSaveWorldToolStripMenuItem3.Size = new System.Drawing.Size(192, 22); this.closeSaveWorldToolStripMenuItem3.Text = "Close + Save World"; // // customCommandToolStripMenuItem3 // this.customCommandToolStripMenuItem3.Name = "customCommandToolStripMenuItem3"; - this.customCommandToolStripMenuItem3.Size = new System.Drawing.Size(176, 22); + this.customCommandToolStripMenuItem3.Size = new System.Drawing.Size(192, 22); this.customCommandToolStripMenuItem3.Text = "Custom Command"; // // loadPluginToolStripMenuItem3 // this.loadPluginToolStripMenuItem3.Name = "loadPluginToolStripMenuItem3"; - this.loadPluginToolStripMenuItem3.Size = new System.Drawing.Size(176, 22); + this.loadPluginToolStripMenuItem3.Size = new System.Drawing.Size(192, 22); this.loadPluginToolStripMenuItem3.Text = "Load Plugin"; // // unloadPluginToolStripMenuItem3 // this.unloadPluginToolStripMenuItem3.Name = "unloadPluginToolStripMenuItem3"; - this.unloadPluginToolStripMenuItem3.Size = new System.Drawing.Size(176, 22); + this.unloadPluginToolStripMenuItem3.Size = new System.Drawing.Size(192, 22); this.unloadPluginToolStripMenuItem3.Text = "Unload Plugin"; // + // languageToolStripMenuItem + // + this.languageToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.en, + this.zh_cn}); + this.languageToolStripMenuItem.Name = "languageToolStripMenuItem"; + this.languageToolStripMenuItem.Size = new System.Drawing.Size(77, 21); + this.languageToolStripMenuItem.Text = "Language"; + // + // en + // + this.en.Name = "en"; + this.en.Size = new System.Drawing.Size(117, 22); + this.en.Text = "English"; + this.en.Click += new System.EventHandler(this.Language_Click); + // + // zh_cn + // + this.zh_cn.Name = "zh_cn"; + this.zh_cn.Size = new System.Drawing.Size(117, 22); + this.zh_cn.Text = "中文"; + this.zh_cn.Click += new System.EventHandler(this.Language_Click); + // // AtlasServerManager // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -953,7 +980,7 @@ private void InitializeComponent() this.MainMenuStrip = this.menuStrip1; this.Margin = new System.Windows.Forms.Padding(4); this.Name = "AtlasServerManager"; - this.Text = "Atlas Server Manager 4.1"; + this.Text = "Atlas Server Manager 4.1B"; this.Load += new System.EventHandler(this.Form1_Load); this.tabPage2.ResumeLayout(false); this.groupBox3.ResumeLayout(false); @@ -1075,5 +1102,8 @@ private void InitializeComponent() public System.Windows.Forms.NumericUpDown StartupDelayNum; private System.Windows.Forms.Label label3; public System.Windows.Forms.CheckBox DebugCheck; + private System.Windows.Forms.ToolStripMenuItem languageToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem en; + private System.Windows.Forms.ToolStripMenuItem zh_cn; } } \ No newline at end of file diff --git a/AtlasServerManager/AtlasServerManager.cs b/AtlasServerManager/AtlasServerManager.cs index 0f159eb..02faf51 100644 --- a/AtlasServerManager/AtlasServerManager.cs +++ b/AtlasServerManager/AtlasServerManager.cs @@ -14,21 +14,176 @@ public partial class AtlasServerManager : Form private static AtlasServerManager instance; private delegate void RichTextBoxUpdateEventHandler(string txt); private InputDialog inputDialog; + #region Translation + public void SetLanguage(string language) + { + ((ToolStripMenuItem)languageToolStripMenuItem.DropDown.Items.Find(language, false)[0]).Checked = true; + } + + public string GetLanguage() + { + foreach (ToolStripMenuItem dropDownItem in languageToolStripMenuItem.DropDown.Items) + { + if (dropDownItem.Checked) + { + return dropDownItem.Name; + } + } + return "en"; + } + void TranslationHelp(string t, Control.ControlCollection control) + { + if (Program.LanguageJObject == null) + { + return; + } + foreach (Control con in control) + { + TranslationHelp(t + con.Name, con); + } + } + void TranslationHelp(string t, object control) + { + if (Program.LanguageJObject == null) + { + return; + } + if (control.GetType() == typeof(MenuStrip)) + { + t += "-" + ((MenuStrip)control).Name; + //tojson(t, ((MenuStrip)control).Text); + ((MenuStrip)control).Text = TranslationGet(t, ((MenuStrip)control).Text); + if (((MenuStrip)control).Items.Count > 0) + { + foreach (ToolStripMenuItem item in ((MenuStrip)control).Items) + { + TranslationHelp(t, item); + } + } + } + else if (control.GetType() == typeof(ToolStripMenuItem)) + { + t += "-" + ((ToolStripMenuItem)control).Name; + //tojson(t, ((ToolStripMenuItem)control).Text); + ((ToolStripMenuItem)control).Text = TranslationGet(t, ((ToolStripMenuItem)control).Text); + if (((ToolStripMenuItem)control).DropDownItems.Count > 0) + { + foreach (ToolStripDropDownItem dropDownItem in ((ToolStripMenuItem)control).DropDownItems) + { + TranslationHelp(t, dropDownItem); + } + } + } + else if (control.GetType() == typeof(ToolStripDropDownItem)) + { + t += "-" + ((ToolStripDropDownItem)control).Name; + //tojson(t, ((ToolStripDropDownItem)control).Text); + ((ToolStripDropDownItem)control).Text = TranslationGet(t, ((ToolStripDropDownItem)control).Text); + + } + else if (control.GetType() == typeof(TabControl)) + { + t += "-" + ((TabControl)control).Name; + //tojson(t, ((TabControl)control).Text); + ((TabControl)control).Text = TranslationGet(t, ((TabControl)control).Text); + if (((TabControl)control).TabPages.Count > 0) + { + foreach (TabPage tabControl in ((TabControl)control).TabPages) + { + TranslationHelp(t, tabControl); + } + } + } + else if (control.GetType() == typeof(TabPage) || control.GetType() == typeof(GroupBox) || control.GetType() == typeof(SplitContainer) || control.GetType() == typeof(SplitterPanel)) + { + t += "-" + ((Control)control).Name; + //tojson(t, ((TabPage)control).Text); + ((Control)control).Text = TranslationGet(t, ((Control)control).Text); + if (((Control)control).Controls.Count > 0) + { + foreach (Control control1 in ((Control)control).Controls) + { + TranslationHelp(t, control1); + } + } + } + else if (control.GetType() == typeof(Button) || control.GetType() == typeof(Label) || control.GetType() == typeof(CheckBox) || control.GetType() == typeof(NumericUpDown)) + { + t += "-" + ((Control)control).Name; + //tojson(t, ((Control)control).Text); + ((Control)control).Text = TranslationGet(t, ((Control)control).Text); - public AtlasServerManager() + } + else if (control.GetType() == typeof(ArkListView)) + { + if (((ArkListView)control).Columns.Count > 0) + { + foreach (ColumnHeader column in ((ArkListView)control).Columns) + { + t += "-" + column.Name; + //tojson(t, ((Control)control).Text); + column.Text = TranslationGet(t, column.Text); + } + } + } +// else +// { +// Log(control.GetType().ToString()); +// } + } + string TranslationGet(string key, string defaultText) { + if (Program.LanguageJObject != null && Program.LanguageJObject.ContainsKey(key)) + { + return Program.LanguageJObject[key].ToString(); + } +// else +// { +// tojson(key, defaultText); +// +// } + + return defaultText; + } + /// + /// Capture untranslated control use + /// + /// + /// + void tojson(string t, string text) + { + richTextBox1.AppendText("\n\"" + t + "\":\"" + text + "\","); + } + #endregion + + public AtlasServerManager(string arkManagerPath, string language) + { + this.ArkManagerPath = arkManagerPath; InitializeComponent(); + SetLanguage(language); + + instance = this; // // ServerList // ServerList = new ArkListView { - AllowColumnReorder = true, BackColor = System.Drawing.SystemColors.Window, - CheckBoxes = true, ContextMenuStrip = contextMenuStrip1, Dock = DockStyle.Fill, - FullRowSelect = true, GridLines = true, Location = new System.Drawing.Point(4, 4), - Margin = new Padding(4), MultiSelect = false, Name = "ServerList", RightToLeft = System.Windows.Forms.RightToLeft.No, - Size = new System.Drawing.Size(668, 256), TabIndex = 0, UseCompatibleStateImageBehavior = false, + AllowColumnReorder = true, + BackColor = System.Drawing.SystemColors.Window, + CheckBoxes = true, + ContextMenuStrip = contextMenuStrip1, + Dock = DockStyle.Fill, + FullRowSelect = true, + GridLines = true, + Location = new System.Drawing.Point(4, 4), + Margin = new Padding(4), + MultiSelect = false, + Name = "ServerList", + RightToLeft = System.Windows.Forms.RightToLeft.No, + Size = new System.Drawing.Size(668, 256), + TabIndex = 0, + UseCompatibleStateImageBehavior = false, View = View.Details }; ServerList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { @@ -39,12 +194,14 @@ public AtlasServerManager() private void Form1_Load(object sender, EventArgs e) { + TranslationHelp("Main", this.Controls); + //return; //Translate.TranslateMenu(menuStrip1.Items, "zh-TW"); //Translate.TranslateComponents(Controls, "zh-TW"); //Translate.TranslateListView(ServerList.Columns, "zh-TW"); //Translate.FirstTranslate = true; ASMTitle = Text; - ArkManagerPath = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Replace("/", @"\") + Path.DirectorySeparatorChar; + //ArkManagerPath = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Replace("/", @"\") + Path.DirectorySeparatorChar; SteamPath = Path.Combine(ArkManagerPath, @"Steam\"); Registry.LoadRegConfig(this); Worker.Init(this, ServerList.Items.Count > 0); @@ -68,6 +225,7 @@ private void Form1_Load(object sender, EventArgs e) private void AddServer() { AddServer AddSrv = new AddServer(ServerPath); + TranslationHelp(AddSrv.Name, AddSrv.Controls); if (AddSrv.ShowDialog() == DialogResult.OK) { ServerList.Items.Add(new ArkServerListViewItem(AddSrv.ServerData)); @@ -80,10 +238,13 @@ private void AddServer() private void RemoveServer() { - if (ServerList.FocusedItem != null && MessageBox.Show("Are you sure you want to delete ServerX:" + ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerX + ", ServerY: " + ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerY + ", Port: " + ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerPort + "?\n Press 'Yes' To Delete!", "Delete ServerX:" + ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerX + ", ServerY: " + ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerY + ", Port: " + ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerPort + "?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + + if (ServerList.FocusedItem != null && MessageBox.Show(string.Format(TranslationGet("RemoveServer-text", "Are you sure you want to delete ServerX: {0}, ServerY: {1}, Port: {2} ?\n Press 'Yes' To Delete!"), + ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerX, ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerY, ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerPort) + , string.Format(TranslationGet("RemoveServer-caption","Delete ServerX:{0}, ServerY: {1}, Port: {2}?"), ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerX, ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerY, ((ArkServerListViewItem)ServerList.FocusedItem).GetServerData().ServerPort), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ArkServerListViewItem ASLVI = ((ArkServerListViewItem)ServerList.FocusedItem); - Log(ASLVI.GetServerData().AltSaveDirectory + " Removed!"); + Log(ASLVI.GetServerData().AltSaveDirectory + TranslationGet("Removed", " Removed!")); Registry.DeleteServer(ServerList.FocusedItem.Index); ServerList.Items.RemoveAt(ServerList.FocusedItem.Index); if (ServerList.Items.Count == 0) Worker.StopUpdating(); @@ -96,8 +257,9 @@ private void EditServer() { ArkServerListViewItem ASLVI = ((ArkServerListViewItem)ServerList.FocusedItem); AddServer AddSrv = new AddServer(ASLVI.GetServerData(), ServerPath); + TranslationHelp(AddSrv.Name, AddSrv.Controls); if (AddSrv.ShowDialog() == DialogResult.OK) ASLVI.SetServerData(AddSrv.ServerData); - Log(ASLVI.GetServerData().AltSaveDirectory + " Edited!"); + Log(ASLVI.GetServerData().AltSaveDirectory + TranslationGet("Edited", " Edited!")); AddSrv.Dispose(); } } @@ -110,7 +272,7 @@ private void StartServer() ASLVI.GetServerData().StartServer(); ASLVI.UpdateStatus(); Registry.SaveRegConfig(this); - Log(ASLVI.GetServerData().AltSaveDirectory + " Started!"); + Log(ASLVI.GetServerData().AltSaveDirectory + TranslationGet("Started", " Started!")); } } @@ -122,7 +284,7 @@ private void StopServer() ASLVI.GetServerData().StopServer(); ASLVI.UpdateStatus(); Registry.SaveRegConfig(this); - Log(ASLVI.GetServerData().AltSaveDirectory + " Stopped!"); + Log(ASLVI.GetServerData().AltSaveDirectory + TranslationGet("Stopped", " Stopped!")); } } @@ -140,6 +302,10 @@ private void RconBroadcast(bool AllServers) Log("Broadcasted!"); } } + else + { + MessageBox.Show(TranslationGet("Please_select_a_server", "Please select a server!!!")); + } } private void RconSaveWorld(bool AllServers) @@ -152,7 +318,11 @@ private void RconSaveWorld(bool AllServers) ArkServerListViewItem ASLVI = (ArkServerListViewItem)ServerList.FocusedItem; SourceRconTools.SendCommand("saveworld", ASLVI); } - Log("Saved World!"); + Log(TranslationGet("SavedWorld", "Saved World!")); + } + else + { + MessageBox.Show(TranslationGet("Please_select_a_server", "Please select a server!!!")); } } @@ -168,6 +338,10 @@ private void RconCloseSaveWorld(bool AllServers) } Log("Closed Saved World!"); } + else + { + MessageBox.Show("Please select a server!!!"); + } } private void RconCustomCommand(bool AllServers) @@ -184,6 +358,10 @@ private void RconCustomCommand(bool AllServers) Log("Custom Command Executed: " + inputDialog.InputText.Text); } } + else + { + MessageBox.Show("Please select a server!!!"); + } } private void RconPlugin(bool AllServers, bool Load) @@ -200,6 +378,29 @@ private void RconPlugin(bool AllServers, bool Load) Log("Plugin " + (Load ? "Loaded" : "Unloaded") + ": " + inputDialog.InputText.Text); } } + else + { + MessageBox.Show("Please select a server!!!"); + } + } + + private void Language_Click(object sender, EventArgs e) + { + //languageToolStripMenuItem + foreach (ToolStripMenuItem dropDownItem in languageToolStripMenuItem.DropDown.Items) + { + if (dropDownItem.Name == ((ToolStripMenuItem)sender).Name && !((ToolStripMenuItem)sender).Checked) + { + dropDownItem.Checked = true; + Includes.Registry.SaveRegkey("Language", ((ToolStripMenuItem)sender).Name); + Application.Exit(); + Application.Restart(); + } + else + { + dropDownItem.Checked = false; + } + } } private void SetupCallbacks() @@ -285,7 +486,7 @@ private void SetupCallbacks() ClearConfigButton.Click += (e, a) => { - if(MessageBox.Show("Are you sure you want to erase all your configurations?", "Configuration Reset", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + if (MessageBox.Show("Are you sure you want to erase all your configurations?", "Configuration Reset", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Registry.ClearAll(); ServerList.Clear(); @@ -335,7 +536,7 @@ public void Log(string txt) if (txt == null || txt == string.Empty || txt.Length < 8) return; if (txt.Contains("downloading") || txt.Contains("validat") || txt.Contains("committing") || txt.Contains("preallocating")) { - if(!FirstDl) + if (!FirstDl) { FirstDl = true; richTextBox1.AppendText(string.Format("\n[{0}] {1}", DateTime.Now.ToString("hh:mm"), txt)); diff --git a/AtlasServerManager/AtlasServerManager.csproj b/AtlasServerManager/AtlasServerManager.csproj index 7397e65..74a1763 100644 --- a/AtlasServerManager/AtlasServerManager.csproj +++ b/AtlasServerManager/AtlasServerManager.csproj @@ -13,6 +13,7 @@ v4.5 512 + false publish\ true Disk @@ -25,7 +26,6 @@ true 0 1.0.0.%2a - false false true @@ -57,6 +57,9 @@ AtlasServerManager.Program + + ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + @@ -128,6 +131,10 @@ True + + Always + + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/AtlasServerManager/Includes/Registry.cs b/AtlasServerManager/Includes/Registry.cs index bc5e81d..3ff7da5 100644 --- a/AtlasServerManager/Includes/Registry.cs +++ b/AtlasServerManager/Includes/Registry.cs @@ -44,6 +44,7 @@ public static void LoadRegConfig(AtlasServerManager AtlasMgr) AtlasMgr.ServerPath = (string)key.GetValue("ServerDataPath", string.Empty); AtlasMgr.ServerUpdateMessage.Text = (string)key.GetValue("ServerUpdateMessage", AtlasMgr.ServerUpdateMessage.Text); AtlasMgr.ServerUpdatingMessage.Text = (string)key.GetValue("ServerUpdatingMessage", AtlasMgr.ServerUpdatingMessage.Text); + //AtlasMgr.SetLanguage((string)key.GetValue("Language", "en")); LoadRegServers(AtlasMgr); } @@ -51,6 +52,20 @@ public static void LoadRegConfig(AtlasServerManager AtlasMgr) catch (Exception e) { System.Windows.Forms.MessageBox.Show("Failed To Load Setting: " + e.StackTrace); } } + public static void SaveRegkey(string keystring, string value) + { + key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\AtlasServerManager", true); + if (key != null) + { + key.SetValue(keystring, value, Microsoft.Win32.RegistryValueKind.String); + } + } + public static object LoadRegkey(string keystring) + { + key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\AtlasServerManager", true); + if (key == null) return null; + return key.GetValue(keystring); + } public static void SaveRegConfig(AtlasServerManager AtlasMgr) { try @@ -81,7 +96,7 @@ public static void SaveRegConfig(AtlasServerManager AtlasMgr) key.SetValue("ServerDataPath", AtlasMgr.ServerPath, Microsoft.Win32.RegistryValueKind.String); key.SetValue("ServerUpdateMessage", AtlasMgr.ServerUpdateMessage.Text, Microsoft.Win32.RegistryValueKind.String); key.SetValue("ServerUpdatingMessage", AtlasMgr.ServerUpdatingMessage.Text, Microsoft.Win32.RegistryValueKind.String); - + key.SetValue("Language", AtlasMgr.GetLanguage(), Microsoft.Win32.RegistryValueKind.String); SaveRegServers(AtlasMgr); key.Close(); } @@ -126,6 +141,7 @@ public static AtlasServerData LoadRegServer(string Srv) if (key != null) { /* BOOL */ + Asd.Rcon = (int)key.GetValue("Rcon", Asd.Rcon ? 1 : 0) == 1 ? true : false; Asd.WildWipe = (int)key.GetValue("WildWipe", Asd.WildWipe ? 1 : 0) == 1 ? true : false; Asd.PVP = (int)key.GetValue("PVP", Asd.PVP ? 1 : 0) == 1 ? true : false; @@ -213,7 +229,7 @@ public static bool SaveRegServer(AtlasServerData Asd, int ActIndex, bool Default { key.SetValue("ProcessAffinity" + i, Asd.ProcessAffinity[i] ? 1 : 0, Microsoft.Win32.RegistryValueKind.DWord); } - + /* INT */ key.SetValue("ServerPort", Asd.ServerPort, Microsoft.Win32.RegistryValueKind.DWord); key.SetValue("QueryPort", Asd.QueryPort, Microsoft.Win32.RegistryValueKind.DWord); @@ -226,6 +242,7 @@ public static bool SaveRegServer(AtlasServerData Asd, int ActIndex, bool Default key.SetValue("ProcessPriority", Asd.ProcessPriority, Microsoft.Win32.RegistryValueKind.DWord); /* STRING */ + key.SetValue("RCONIP", Asd.RCONIP, Microsoft.Win32.RegistryValueKind.String); key.SetValue("Pass", Asd.Pass, Microsoft.Win32.RegistryValueKind.String); key.SetValue("CustomArgs", Asd.CustomArgs, Microsoft.Win32.RegistryValueKind.String); key.SetValue("CustomAfterArgs", Asd.CustomAfterArgs, Microsoft.Win32.RegistryValueKind.String); diff --git a/AtlasServerManager/Includes/Worker.cs b/AtlasServerManager/Includes/Worker.cs index fd32456..6575c24 100644 --- a/AtlasServerManager/Includes/Worker.cs +++ b/AtlasServerManager/Includes/Worker.cs @@ -47,9 +47,14 @@ public static void AddWorker(WorkerType Index, AtlasServerManager AtlasMgr) public static void Init(AtlasServerManager AtlasMgr, bool StartUpdateCheck) { AddWorker(WorkerType.StatusUpdate, AtlasMgr); - AddWorker(WorkerType.ServerMonitor, AtlasMgr); - if (StartUpdateCheck) + if (StartUpdateCheck) { + ServerUpdater.Updating = true; AddWorker(WorkerType.ServerUpdate, AtlasMgr); + } + + AddWorker(WorkerType.ServerMonitor, AtlasMgr); + + } public static void StopUpdating() diff --git a/AtlasServerManager/Includes/Workers/ServerMonitor.cs b/AtlasServerManager/Includes/Workers/ServerMonitor.cs index a6d3187..28faebb 100644 --- a/AtlasServerManager/Includes/Workers/ServerMonitor.cs +++ b/AtlasServerManager/Includes/Workers/ServerMonitor.cs @@ -10,9 +10,10 @@ public static void CheckServerStatus(AtlasServerManager AtlasMgr, CancellationTo bool SavedAfterLaunch = false; while (true) { + AtlasMgr.Log("123"); if (token.IsCancellationRequested) break; AtlasMgr.Invoke((System.Windows.Forms.MethodInvoker)delegate () - { + { if (!ServerUpdater.Updating && AtlasMgr.BootWhenOffCheck.Checked) { foreach (ArkServerListViewItem ASLVI in AtlasMgr.ServerList.Items) diff --git a/AtlasServerManager/Includes/Workers/ServerUpdater.cs b/AtlasServerManager/Includes/Workers/ServerUpdater.cs index e317f8e..8f3b0bb 100644 --- a/AtlasServerManager/Includes/Workers/ServerUpdater.cs +++ b/AtlasServerManager/Includes/Workers/ServerUpdater.cs @@ -149,7 +149,7 @@ private static int GetCurrentBuildID(AtlasServerManager AtlasMgr) string UpdatePath = ASLVI.GetServerData().ServerPath; if (UpdatePath.StartsWith("./") || UpdatePath.StartsWith(@".\")) UpdatePath = UpdatePath.Replace("./", System.AppDomain.CurrentDomain.BaseDirectory).Replace(@".\", System.AppDomain.CurrentDomain.BaseDirectory).Replace("//", "/").Replace(@"\\", @"\"); - if (!Directory.Exists(Path.GetDirectoryName(UpdatePath))) Directory.CreateDirectory(Path.GetDirectoryName(UpdatePath)); + if (!Directory.Exists(UpdatePath)) Directory.CreateDirectory(UpdatePath); if (UpdatePath.Contains(@"ShooterGame\Binaries\Win64")) UpdatePath = Regex.Split(UpdatePath, "\\ShooterGame")[0]; @@ -178,7 +178,7 @@ private static int GetCurrentBuildID(AtlasServerManager AtlasMgr) } } } - UpdatePaths.Clear(); + //UpdatePaths.Clear(); return Version; } @@ -246,7 +246,7 @@ private static void UpdateAtlas(AtlasServerManager AtlasMgr, string UpdateVersio if (!AtlasMgr.SteamWindowCheck.Checked) UpdateProcess.BeginOutputReadLine(); UpdateProcess.WaitForExit(); } - UpdatePaths.Clear(); + // UpdatePaths.Clear(); } private static void StartServers(AtlasServerManager AtlasMgr) diff --git a/AtlasServerManager/InputDialog.Designer.cs b/AtlasServerManager/InputDialog.Designer.cs index 17bcc6a..9f21e0d 100644 --- a/AtlasServerManager/InputDialog.Designer.cs +++ b/AtlasServerManager/InputDialog.Designer.cs @@ -37,36 +37,36 @@ private void InitializeComponent() // SendButton // this.SendButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.SendButton.Location = new System.Drawing.Point(302, 156); + this.SendButton.Location = new System.Drawing.Point(302, 144); this.SendButton.Name = "SendButton"; - this.SendButton.Size = new System.Drawing.Size(135, 39); + this.SendButton.Size = new System.Drawing.Size(135, 36); this.SendButton.TabIndex = 0; this.SendButton.Text = "Send"; this.SendButton.UseVisualStyleBackColor = true; // // InputText // - this.InputText.Location = new System.Drawing.Point(12, 12); + this.InputText.Location = new System.Drawing.Point(12, 11); this.InputText.Multiline = true; this.InputText.Name = "InputText"; - this.InputText.Size = new System.Drawing.Size(425, 138); + this.InputText.Size = new System.Drawing.Size(425, 128); this.InputText.TabIndex = 1; // // CloseButton // this.CloseButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CloseButton.Location = new System.Drawing.Point(12, 156); + this.CloseButton.Location = new System.Drawing.Point(12, 144); this.CloseButton.Name = "CloseButton"; - this.CloseButton.Size = new System.Drawing.Size(135, 39); + this.CloseButton.Size = new System.Drawing.Size(135, 36); this.CloseButton.TabIndex = 2; this.CloseButton.Text = "Cancel"; this.CloseButton.UseVisualStyleBackColor = true; // // InputDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(449, 207); + this.ClientSize = new System.Drawing.Size(449, 191); this.ControlBox = false; this.Controls.Add(this.CloseButton); this.Controls.Add(this.InputText); diff --git a/AtlasServerManager/Language/zh_cn.json b/AtlasServerManager/Language/zh_cn.json new file mode 100644 index 0000000..51905c7 --- /dev/null +++ b/AtlasServerManager/Language/zh_cn.json @@ -0,0 +1,99 @@ +{ +"MainsplitContainer1-splitContainer1--menuStrip1-serverToolStripMenuItem1":"·þÎñÆ÷", +"MainsplitContainer1-splitContainer1--menuStrip1-serverToolStripMenuItem1-addToolStripMenuItem1":"Ôö¼Ó", +"MainsplitContainer1-splitContainer1--menuStrip1-serverToolStripMenuItem1-removeToolStripMenuItem1":"ÒÆ³ý", +"MainsplitContainer1-splitContainer1--menuStrip1-serverToolStripMenuItem1-editSettingsToolStripMenuItem1":"±à¼­", +"MainsplitContainer1-splitContainer1--menuStrip1-managerToolStripMenuItem":"¹ÜÀí", +"MainsplitContainer1-splitContainer1--menuStrip1-managerToolStripMenuItem-startToolStripMenuItem1":"Æô¶¯", +"MainsplitContainer1-splitContainer1--menuStrip1-managerToolStripMenuItem-stopToolStripMenuItem1":"¹Ø±Õ", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONSelecteToolStripMenuItem":"RCONÑ¡Ïî", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONSelecteToolStripMenuItem-broadcastToolStripMenuItem2":"֪ͨ", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONSelecteToolStripMenuItem-saveWorldToolStripMenuItem2":"±£´æÊÀ½ç", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONSelecteToolStripMenuItem-closeSaveWorldToolStripMenuItem2":"¹Ø±Õ²¢±£´æÊÀ½ç", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONSelecteToolStripMenuItem-customCommandToolStripMenuItem2":"×Ô¶¨ÒåÃüÁî", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONSelecteToolStripMenuItem-loadPluginToolStripMenuItem2":"¼ÓÔØ²å¼þ", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONSelecteToolStripMenuItem-unloadPluginToolStripMenuItem2":"Ð¶ÔØ²å¼þ", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONAllToolStripMenuItem1":"RCONÈ«²¿", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONAllToolStripMenuItem1-broadcastToolStripMenuItem3":"֪ͨ", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONAllToolStripMenuItem1-saveWorldToolStripMenuItem3":"±£´æÊÀ½ç", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONAllToolStripMenuItem1-closeSaveWorldToolStripMenuItem3":"¹Ø±Õ²¢±£´æÊÀ½ç", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONAllToolStripMenuItem1-customCommandToolStripMenuItem3":"×Ô¶¨ÒåÃüÁî", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONAllToolStripMenuItem1-loadPluginToolStripMenuItem3":"¼ÓÔØ²å¼þ", +"MainsplitContainer1-splitContainer1--menuStrip1-rCONAllToolStripMenuItem1-unloadPluginToolStripMenuItem3":"Ð¶ÔØ²å¼þ", +"MainsplitContainer1-splitContainer1--menuStrip1-languageToolStripMenuItem":"ÓïÑÔ", +"MainsplitContainer1-splitContainer1--tabControl1-tabControl1":"", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage1":"·þÎñÆ÷", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage2":"Ñ¡Ïî", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage2-ClearConfigButton":"Çå¿Õ·þÎñÆ÷", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage2-button1":"Ç¿ÖÆ¸üÐÂ", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage2-groupBox3":"·þÎñÆ÷×Ô¶¯¸üÐÂ", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage3":"¼à²â", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage3-groupBox1":"×Ô¶¯°¢ÌØÀ­Ë¹·þÎñÆ÷ÏÔʾÆ÷", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage4":"ÅäÖÃÌæ»»Æ÷", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage4-groupBox2":"ÔÚ·þÎñÆ÷Æô¶¯Ê±×Ô¶¯Ìæ»»ÅäÖÃ", +"MainsplitContainer1-splitContainer1--menuStrip1-menuStrip1":"menuStrip1", +"MainsplitContainer1-splitContainer1--menuStrip1-languageToolStripMenuItem-en":"English", +"MainsplitContainer1-splitContainer1--menuStrip1-languageToolStripMenuItem-zh_cn":"ÖÐÎÄ", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage1-":"·þÎñÆ÷Ŀ¼", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage1--":"ÓÎÏ·äö¿Ú", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage1---":"·þÎñÆ÷ºá×ø±ê", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage1----":"·þÎñÆ÷Êú×ø±ê", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage1-----":"״̬", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage1------":"ÔÚÏßÍæ¼Ò", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage2-groupBox3-label4":"ÿ¸ô(·ÖÖÓ)¼ì²éÒ»´Î", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage2-groupBox3-label5":"¸üо¯¸æ(·ÖÖÓ)", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage3-groupBox1-label3":"ÿ̨·þÎñÆ÷Ö®¼äµÄÆô¶¯ÑÓ³Ù(Ãë)", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage3-groupBox1-label1":"ÿ¸ô(Ãë)¼ì²éÒ»´Î ", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage4-groupBox2-label2":"È·±£ÄúÖÁÉÙ°´ÁËÒ»´ÎBackup INIºÍDB Config¡£", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage4-groupBox2-BackupButton":"±¸·ÝINIºÍDB Config", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage2-groupBox3-DebugCheck":"µ÷ÊÔ", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage2-groupBox3-SteamWindowCheck":"ÏÔʾ SteamCMD(¿ÉÒÔÐÞ¸´Windows 7ÉϵĸüдíÎó)", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage2-groupBox3-checkAutoServerUpdate":"×Ô¶¯¸üзþÎñÆ÷", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage3-groupBox1-GamePortCheck":"¼ì²éÓÎÏ·¶Ë¿Ú", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage3-groupBox1-QueryPortCheck":"¼ì²é½»²æ¶Ë¿Ú", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage3-groupBox1-BootWhenOffCheck":"´¬·þÎñÆ÷ÏÂÏß", +"MainsplitContainer1-splitContainer1--tabControl1-tabPage4-groupBox2-ConfigReplaceCheck":"ÔÚ·þÎñÆ÷Æô¶¯Ê±Ìæ»»ÅäÖÃ", +"AddServergroupBox7-groupBox7":"·þÎñÆ÷·¾¶", +"AddServergroupBox7-groupBox7-BrowseButton":"ËæÒâ¹Û¿´", +"AddServerResetDefaultButton-ResetDefaultButton":"ÖØÖÃĬÈÏ", +"AddServerCloseButton-CloseButton":"¹Ø±Õ", +"AddServerAddServerButton-AddServerButton":"±£´æÅäÖÃ", +"AddServergroupBox2-groupBox2":"RconÉèÖÃ", +"AddServergroupBox2-groupBox2-label13":"½öµ±ÄúÓеڶþ¸öNICʱ²ÅÐèÒªÉèÖÃ", +"AddServergroupBox2-groupBox2-label12":"RconIP:", +"AddServergroupBox2-groupBox2-checkBox3":"ÒÑÆôÓÃ(¸üÐÂ֪ͨÐèÒª)", +"AddServergroupBox2-groupBox2-label7":"Rcon¶Ë¿Ú:", +"AddServergroupBox1-groupBox1":"·þÎñÆ÷ÉèÖÃ", +"AddServergroupBox1-groupBox1-label14":"Æô¶¯²ÎÊýºóµÄÆäËû·þÎñÆ÷(ÒÔ-¿ªÍ·µÄ²ÎÊý)", +"AddServergroupBox1-groupBox1-BattleEyeCheck":"BattleEye", +"AddServergroupBox1-groupBox1-UPNPCheck":"UPnP-×Ô¶¯¶Ë¿Úת·¢(½öÏÞ·ÓÉÆ÷Ñ¡Ï²¢È·±£ÔÚ·ÓÉÆ÷ÉÏÆôÓÃÁËUPnP)", +"AddServergroupBox1-groupBox1-label11":"´¦ÀíÆ÷ÓÅÏȼ¶:", +"AddServergroupBox1-groupBox1-label10":"·þÎñÆ÷IP»òDNS:", +"AddServergroupBox1-groupBox1-label9":"·þÎñÆ÷Êú×ø±ê:", +"AddServergroupBox1-groupBox1-label1":"±£ÁôÇòÔ±:", +"AddServergroupBox1-groupBox1-label2":"·þÎñÆ÷ºá×ø±ê:", +"AddServergroupBox1-groupBox1-ProcessAffinityButton":"¹ý³ÌÇ׺ÍÐÔ", +"AddServergroupBox1-groupBox1-label17":"ÁíÒ»ÖÖÑ¡ÔñSave Directory", +"AddServergroupBox1-groupBox1-checkBox17":"¸¡¶¯Îı¾Ëð»µ", +"AddServergroupBox1-groupBox1-checkBox16":"ÈκÎÈ˵ÄÓ¡¼Ç", +"AddServergroupBox1-groupBox1-checkBox15":"ÃüÖбê¼Ç", +"AddServergroupBox1-groupBox1-checkBox14":"¿ËÂÞ˹¹þ¶û", +"AddServergroupBox1-groupBox1-checkBox13":"3RDÈË", +"AddServergroupBox1-groupBox1-checkBox12":"ÔÊÐíGamma", +"AddServergroupBox1-groupBox1-checkBox11":"MAPµØÖ·", +"AddServergroupBox1-groupBox1-checkBox10":"PVP", +"AddServergroupBox1-groupBox1-label8":"ÆäËû·þÎñÆ÷Æô¶¯²ÎÊý(ÀýÈ磺£¿globalVoiceChat=true£¿compityChat=true)", +"AddServergroupBox1-groupBox1-label6":"¹ÜÀíÔ±ÃÜÂë:", +"AddServergroupBox1-groupBox1-label5":"²éѯ¶Ë¿Ú:", +"AddServergroupBox1-groupBox1-label4":"ÓÎÏ·¶Ë¿Ú:", +"AddServergroupBox1-groupBox1-checkBox1":"³õ´´ÆóÒµµÄÒ°µÏŵ¡¤ÍþÆÕ", +"AddServergroupBox1-groupBox1-label3":"×î´óÍæ¼Ò:", +"RemoveServer-caption":"Delete ServerX:{0}, ServerY: {1}, Port: {2}?", +"RemoveServer-text":"Are you sure you want to delete ServerX: {0}, ServerY: {1}, Port: {2} ?\n Press 'Yes' To Delete!", +"Removed":"Removed!", +"Edited":"Edited!", +"Started":"Started!", +"Stopped":"Stopped!", +"Please_select_a_server":"Please select a server!!!", +"SavedWorld":"Saved World!" +} diff --git a/AtlasServerManager/Program.cs b/AtlasServerManager/Program.cs index a56a0f5..813673d 100644 --- a/AtlasServerManager/Program.cs +++ b/AtlasServerManager/Program.cs @@ -1,11 +1,16 @@ using System; using System.Collections.Generic; +using System.IO; using System.Windows.Forms; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; namespace AtlasServerManager { static class Program { + public static JObject LanguageJObject; + /// /// The main entry point for the application. /// @@ -14,7 +19,22 @@ static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new AtlasServerManager()); + string language = Includes.Registry.LoadRegkey("Language") != null ? Includes.Registry.LoadRegkey("Language").ToString() : "en"; + string arkManagerPath = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Replace("/", @"\") + Path.DirectorySeparatorChar; + if (File.Exists(Path.GetFullPath(arkManagerPath + "/Language/" + language + ".json"))) + { + //System.IO.StreamReader file1=new StreamReader(Path.GetFullPath(arkManagerPath + "/Language/" + language + ".json"),System.Text.Encoding.Default) + //using (System.IO.StreamReader file = System.IO.File.OpenText(Path.GetFullPath(arkManagerPath + "/Language/" + language + ".json"),e)) + using (System.IO.StreamReader file = new StreamReader(Path.GetFullPath(arkManagerPath + "/Language/" + language + ".json"), System.Text.Encoding.Default)) + { + using (JsonTextReader reader = new JsonTextReader(file)) + { + LanguageJObject = (JObject)JToken.ReadFrom(reader); + } + } + } + + Application.Run(new AtlasServerManager(arkManagerPath, language)); } } } \ No newline at end of file diff --git a/AtlasServerManager/Translate.cs b/AtlasServerManager/Translate.cs index ea14a59..d68fad8 100644 --- a/AtlasServerManager/Translate.cs +++ b/AtlasServerManager/Translate.cs @@ -3,6 +3,7 @@ using System.Net; using System.Text; using System.Windows.Forms; +using AtlasServerManager.Includes; namespace AtlasServerManager { @@ -129,5 +130,8 @@ public static void TranslateListView(ListView.ColumnHeaderCollection controlColl TranslateComponent(toolStripItem, Language); } } + + + } } \ No newline at end of file diff --git a/AtlasServerManager/packages.config b/AtlasServerManager/packages.config new file mode 100644 index 0000000..7f83af3 --- /dev/null +++ b/AtlasServerManager/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file