diff --git a/IniFile.cs b/IniFile.cs index 1555745..ba6050f 100644 --- a/IniFile.cs +++ b/IniFile.cs @@ -2,6 +2,7 @@ using System.IO; using System.Reflection; using System.Runtime.InteropServices; +using System.Windows.Forms; namespace SuperSteamPacker { diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 7da4cd0..d99d5ab 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -61,11 +61,47 @@ this.BranchLabel = new System.Windows.Forms.Label(); this.BranchNameTxtBox = new System.Windows.Forms.TextBox(); this.BranchPasswordCB = new System.Windows.Forms.CheckBox(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.TabManager = new System.Windows.Forms.TabControl(); + this.GamePage = new System.Windows.Forms.TabPage(); + this.SSPLogoPicBox = new System.Windows.Forms.PictureBox(); + this.WorkshopPage = new System.Windows.Forms.TabPage(); + this.MODTmpLstBx = new System.Windows.Forms.ListBox(); + this.MODManageGrp = new System.Windows.Forms.GroupBox(); + this.MODWorkshopItemID = new System.Windows.Forms.Label(); + this.MODWorkshopItemIDBx = new System.Windows.Forms.TextBox(); + this.MODAppIDTxtBx = new System.Windows.Forms.TextBox(); + this.MODAppIDLabel = new System.Windows.Forms.Label(); + this.MODQueueBox = new System.Windows.Forms.ListBox(); + this.MODQueueLabel = new System.Windows.Forms.Label(); + this.MODStartBtn = new System.Windows.Forms.Button(); + this.MODQueueManageGrp = new System.Windows.Forms.GroupBox(); + this.MODMoveUpBtn = new System.Windows.Forms.Button(); + this.MODMoveDownBtn = new System.Windows.Forms.Button(); + this.MODExportQueueButton = new System.Windows.Forms.Button(); + this.MODImportQueueButton = new System.Windows.Forms.Button(); + this.MODClearQueueBtn = new System.Windows.Forms.Button(); + this.MODAddBtn = new System.Windows.Forms.Button(); + this.MODDelBtn = new System.Windows.Forms.Button(); + this.MODGithubBtn = new System.Windows.Forms.Button(); + this.MODcsrinbtn = new System.Windows.Forms.Button(); + this.DepotsPage = new System.Windows.Forms.TabPage(); + this.Placeholder2 = new System.Windows.Forms.Label(); + this.AchievementsPage = new System.Windows.Forms.TabPage(); + this.Placeholder3 = new System.Windows.Forms.Label(); + this.PostTemplatePage = new System.Windows.Forms.TabPage(); + this.Placeholder4 = new System.Windows.Forms.Label(); this.QueueManageGrp.SuspendLayout(); this.GameManageGrp.SuspendLayout(); this.BranchGrp.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.TabManager.SuspendLayout(); + this.GamePage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.SSPLogoPicBox)).BeginInit(); + this.WorkshopPage.SuspendLayout(); + this.MODManageGrp.SuspendLayout(); + this.MODQueueManageGrp.SuspendLayout(); + this.DepotsPage.SuspendLayout(); + this.AchievementsPage.SuspendLayout(); + this.PostTemplatePage.SuspendLayout(); this.SuspendLayout(); // // OSBox @@ -81,15 +117,15 @@ "Windows x64"}); this.OSBox.Location = new System.Drawing.Point(52, 55); this.OSBox.Name = "OSBox"; - this.OSBox.Size = new System.Drawing.Size(151, 21); + this.OSBox.Size = new System.Drawing.Size(177, 21); this.OSBox.TabIndex = 5; // // QueueBox // this.QueueBox.FormattingEnabled = true; - this.QueueBox.Location = new System.Drawing.Point(12, 30); + this.QueueBox.Location = new System.Drawing.Point(6, 26); this.QueueBox.Name = "QueueBox"; - this.QueueBox.Size = new System.Drawing.Size(442, 212); + this.QueueBox.Size = new System.Drawing.Size(468, 212); this.QueueBox.TabIndex = 1; this.QueueBox.SelectedIndexChanged += new System.EventHandler(this.QueueBox_SelectedIndexChanged); // @@ -97,7 +133,7 @@ // this.QueueLabel.AutoSize = true; this.QueueLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.QueueLabel.Location = new System.Drawing.Point(9, 7); + this.QueueLabel.Location = new System.Drawing.Point(3, 3); this.QueueLabel.Name = "QueueLabel"; this.QueueLabel.Size = new System.Drawing.Size(87, 18); this.QueueLabel.TabIndex = 2; @@ -108,7 +144,7 @@ this.AppIDTxtBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.AppIDTxtBox.Location = new System.Drawing.Point(52, 27); this.AppIDTxtBox.Name = "AppIDTxtBox"; - this.AppIDTxtBox.Size = new System.Drawing.Size(151, 20); + this.AppIDTxtBox.Size = new System.Drawing.Size(179, 20); this.AppIDTxtBox.TabIndex = 3; this.AppIDTxtBox.WordWrap = false; this.AppIDTxtBox.TextChanged += new System.EventHandler(this.AppIDTxtBox_TextChanged); @@ -119,7 +155,7 @@ this.AddBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.AddBtn.Location = new System.Drawing.Point(6, 24); this.AddBtn.Name = "AddBtn"; - this.AddBtn.Size = new System.Drawing.Size(140, 35); + this.AddBtn.Size = new System.Drawing.Size(150, 35); this.AddBtn.TabIndex = 7; this.AddBtn.Text = "AddBtn"; this.AddBtn.UseVisualStyleBackColor = true; @@ -139,7 +175,7 @@ // this.AppIDExplain.Cursor = System.Windows.Forms.Cursors.Hand; this.AppIDExplain.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.AppIDExplain.Location = new System.Drawing.Point(209, 26); + this.AppIDExplain.Location = new System.Drawing.Point(236, 26); this.AppIDExplain.Name = "AppIDExplain"; this.AppIDExplain.Size = new System.Drawing.Size(22, 22); this.AppIDExplain.TabIndex = 4; @@ -161,7 +197,7 @@ // this.OSExplain.Cursor = System.Windows.Forms.Cursors.Hand; this.OSExplain.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.OSExplain.Location = new System.Drawing.Point(209, 54); + this.OSExplain.Location = new System.Drawing.Point(235, 55); this.OSExplain.Name = "OSExplain"; this.OSExplain.Size = new System.Drawing.Size(23, 23); this.OSExplain.TabIndex = 6; @@ -173,9 +209,9 @@ // this.DelBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.DelBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.DelBtn.Location = new System.Drawing.Point(152, 23); + this.DelBtn.Location = new System.Drawing.Point(159, 23); this.DelBtn.Name = "DelBtn"; - this.DelBtn.Size = new System.Drawing.Size(140, 36); + this.DelBtn.Size = new System.Drawing.Size(150, 36); this.DelBtn.TabIndex = 8; this.DelBtn.Text = "DelBtn"; this.DelBtn.UseVisualStyleBackColor = true; @@ -185,9 +221,9 @@ // this.StartBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.StartBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.StartBtn.Location = new System.Drawing.Point(464, 339); + this.StartBtn.Location = new System.Drawing.Point(480, 335); this.StartBtn.Name = "StartBtn"; - this.StartBtn.Size = new System.Drawing.Size(204, 58); + this.StartBtn.Size = new System.Drawing.Size(204, 59); this.StartBtn.TabIndex = 14; this.StartBtn.Text = "StartBtn"; this.StartBtn.UseVisualStyleBackColor = true; @@ -196,15 +232,15 @@ // TmpLstBx // this.TmpLstBx.FormattingEnabled = true; - this.TmpLstBx.Location = new System.Drawing.Point(379, 30); + this.TmpLstBx.Location = new System.Drawing.Point(374, 26); this.TmpLstBx.Name = "TmpLstBx"; - this.TmpLstBx.Size = new System.Drawing.Size(75, 69); + this.TmpLstBx.Size = new System.Drawing.Size(100, 95); this.TmpLstBx.TabIndex = 11; this.TmpLstBx.Visible = false; // // UsernameTextBox // - this.UsernameTextBox.Location = new System.Drawing.Point(464, 119); + this.UsernameTextBox.Location = new System.Drawing.Point(480, 115); this.UsernameTextBox.Name = "UsernameTextBox"; this.UsernameTextBox.Size = new System.Drawing.Size(204, 20); this.UsernameTextBox.TabIndex = 1; @@ -214,7 +250,7 @@ // MoreSettingsBtn // this.MoreSettingsBtn.Cursor = System.Windows.Forms.Cursors.Hand; - this.MoreSettingsBtn.Location = new System.Drawing.Point(464, 221); + this.MoreSettingsBtn.Location = new System.Drawing.Point(480, 217); this.MoreSettingsBtn.Name = "MoreSettingsBtn"; this.MoreSettingsBtn.Size = new System.Drawing.Size(204, 25); this.MoreSettingsBtn.TabIndex = 13; @@ -224,7 +260,7 @@ // // PasswordTextBox // - this.PasswordTextBox.Location = new System.Drawing.Point(464, 164); + this.PasswordTextBox.Location = new System.Drawing.Point(480, 160); this.PasswordTextBox.Name = "PasswordTextBox"; this.PasswordTextBox.PasswordChar = '*'; this.PasswordTextBox.Size = new System.Drawing.Size(204, 20); @@ -235,7 +271,7 @@ // PasswordLabel // this.PasswordLabel.AutoSize = true; - this.PasswordLabel.Location = new System.Drawing.Point(465, 146); + this.PasswordLabel.Location = new System.Drawing.Point(481, 142); this.PasswordLabel.Name = "PasswordLabel"; this.PasswordLabel.Size = new System.Drawing.Size(79, 13); this.PasswordLabel.TabIndex = 15; @@ -244,7 +280,7 @@ // UsernameLabel // this.UsernameLabel.AutoSize = true; - this.UsernameLabel.Location = new System.Drawing.Point(465, 102); + this.UsernameLabel.Location = new System.Drawing.Point(481, 98); this.UsernameLabel.Name = "UsernameLabel"; this.UsernameLabel.Size = new System.Drawing.Size(81, 13); this.UsernameLabel.TabIndex = 16; @@ -253,7 +289,7 @@ // SaveLoginBtn // this.SaveLoginBtn.Cursor = System.Windows.Forms.Cursors.Hand; - this.SaveLoginBtn.Location = new System.Drawing.Point(464, 190); + this.SaveLoginBtn.Location = new System.Drawing.Point(480, 186); this.SaveLoginBtn.Name = "SaveLoginBtn"; this.SaveLoginBtn.Size = new System.Drawing.Size(204, 25); this.SaveLoginBtn.TabIndex = 17; @@ -265,9 +301,9 @@ // this.ClearQueueBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.ClearQueueBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ClearQueueBtn.Location = new System.Drawing.Point(298, 23); + this.ClearQueueBtn.Location = new System.Drawing.Point(312, 23); this.ClearQueueBtn.Name = "ClearQueueBtn"; - this.ClearQueueBtn.Size = new System.Drawing.Size(140, 36); + this.ClearQueueBtn.Size = new System.Drawing.Size(150, 36); this.ClearQueueBtn.TabIndex = 9; this.ClearQueueBtn.Text = "ClearQueueBtn"; this.ClearQueueBtn.UseVisualStyleBackColor = true; @@ -279,7 +315,7 @@ this.MoveUpBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.MoveUpBtn.Location = new System.Drawing.Point(6, 64); this.MoveUpBtn.Name = "MoveUpBtn"; - this.MoveUpBtn.Size = new System.Drawing.Size(215, 25); + this.MoveUpBtn.Size = new System.Drawing.Size(225, 25); this.MoveUpBtn.TabIndex = 10; this.MoveUpBtn.Text = "MoveUpBtn"; this.MoveUpBtn.UseVisualStyleBackColor = true; @@ -289,9 +325,9 @@ // this.MoveDownBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.MoveDownBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.MoveDownBtn.Location = new System.Drawing.Point(222, 64); + this.MoveDownBtn.Location = new System.Drawing.Point(237, 64); this.MoveDownBtn.Name = "MoveDownBtn"; - this.MoveDownBtn.Size = new System.Drawing.Size(215, 25); + this.MoveDownBtn.Size = new System.Drawing.Size(225, 25); this.MoveDownBtn.TabIndex = 11; this.MoveDownBtn.Text = "MoveDownBtn"; this.MoveDownBtn.UseVisualStyleBackColor = true; @@ -300,7 +336,7 @@ // csrinbtn // this.csrinbtn.Cursor = System.Windows.Forms.Cursors.Hand; - this.csrinbtn.Location = new System.Drawing.Point(464, 403); + this.csrinbtn.Location = new System.Drawing.Point(480, 400); this.csrinbtn.Name = "csrinbtn"; this.csrinbtn.Size = new System.Drawing.Size(204, 25); this.csrinbtn.TabIndex = 15; @@ -314,7 +350,7 @@ this.ExportQueueButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ExportQueueButton.Location = new System.Drawing.Point(6, 92); this.ExportQueueButton.Name = "ExportQueueButton"; - this.ExportQueueButton.Size = new System.Drawing.Size(215, 25); + this.ExportQueueButton.Size = new System.Drawing.Size(225, 25); this.ExportQueueButton.TabIndex = 12; this.ExportQueueButton.Text = "ExportQueueButton"; this.ExportQueueButton.UseVisualStyleBackColor = true; @@ -324,9 +360,9 @@ // this.ImportQueueButton.Cursor = System.Windows.Forms.Cursors.Hand; this.ImportQueueButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ImportQueueButton.Location = new System.Drawing.Point(222, 92); + this.ImportQueueButton.Location = new System.Drawing.Point(237, 92); this.ImportQueueButton.Name = "ImportQueueButton"; - this.ImportQueueButton.Size = new System.Drawing.Size(215, 25); + this.ImportQueueButton.Size = new System.Drawing.Size(225, 25); this.ImportQueueButton.TabIndex = 13; this.ImportQueueButton.Text = "ImportQueueButton"; this.ImportQueueButton.UseVisualStyleBackColor = true; @@ -335,7 +371,7 @@ // GithubBtn // this.GithubBtn.Cursor = System.Windows.Forms.Cursors.Hand; - this.GithubBtn.Location = new System.Drawing.Point(464, 434); + this.GithubBtn.Location = new System.Drawing.Point(480, 431); this.GithubBtn.Name = "GithubBtn"; this.GithubBtn.Size = new System.Drawing.Size(204, 25); this.GithubBtn.TabIndex = 16; @@ -353,9 +389,9 @@ this.QueueManageGrp.Controls.Add(this.AddBtn); this.QueueManageGrp.Controls.Add(this.DelBtn); this.QueueManageGrp.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.QueueManageGrp.Location = new System.Drawing.Point(12, 339); + this.QueueManageGrp.Location = new System.Drawing.Point(6, 335); this.QueueManageGrp.Name = "QueueManageGrp"; - this.QueueManageGrp.Size = new System.Drawing.Size(446, 122); + this.QueueManageGrp.Size = new System.Drawing.Size(468, 122); this.QueueManageGrp.TabIndex = 20; this.QueueManageGrp.TabStop = false; this.QueueManageGrp.Text = "QueueManageGrp"; @@ -369,9 +405,9 @@ this.GameManageGrp.Controls.Add(this.OSLabel); this.GameManageGrp.Controls.Add(this.OSExplain); this.GameManageGrp.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.GameManageGrp.Location = new System.Drawing.Point(12, 249); + this.GameManageGrp.Location = new System.Drawing.Point(6, 245); this.GameManageGrp.Name = "GameManageGrp"; - this.GameManageGrp.Size = new System.Drawing.Size(242, 84); + this.GameManageGrp.Size = new System.Drawing.Size(264, 84); this.GameManageGrp.TabIndex = 21; this.GameManageGrp.TabStop = false; this.GameManageGrp.Text = "GameManageGrp"; @@ -383,7 +419,7 @@ this.BranchGrp.Controls.Add(this.BranchNameTxtBox); this.BranchGrp.Controls.Add(this.BranchPasswordCB); this.BranchGrp.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.BranchGrp.Location = new System.Drawing.Point(260, 249); + this.BranchGrp.Location = new System.Drawing.Point(276, 245); this.BranchGrp.Name = "BranchGrp"; this.BranchGrp.Size = new System.Drawing.Size(408, 84); this.BranchGrp.TabIndex = 8; @@ -429,38 +465,358 @@ this.BranchPasswordCB.UseVisualStyleBackColor = true; this.BranchPasswordCB.CheckedChanged += new System.EventHandler(this.BranchPasswordCB_CheckedChanged); // - // pictureBox1 + // TabManager // - this.pictureBox1.Image = global::SuperSteamPacker.Properties.Resources.logo; - this.pictureBox1.Location = new System.Drawing.Point(468, 12); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(193, 78); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBox1.TabIndex = 18; - this.pictureBox1.TabStop = false; + this.TabManager.Appearance = System.Windows.Forms.TabAppearance.FlatButtons; + this.TabManager.Controls.Add(this.GamePage); + this.TabManager.Controls.Add(this.WorkshopPage); + this.TabManager.Controls.Add(this.DepotsPage); + this.TabManager.Controls.Add(this.AchievementsPage); + this.TabManager.Controls.Add(this.PostTemplatePage); + this.TabManager.HotTrack = true; + this.TabManager.Location = new System.Drawing.Point(0, 0); + this.TabManager.Name = "TabManager"; + this.TabManager.SelectedIndex = 0; + this.TabManager.Size = new System.Drawing.Size(698, 490); + this.TabManager.TabIndex = 22; + // + // GamePage + // + this.GamePage.BackColor = System.Drawing.Color.White; + this.GamePage.Controls.Add(this.TmpLstBx); + this.GamePage.Controls.Add(this.QueueLabel); + this.GamePage.Controls.Add(this.BranchGrp); + this.GamePage.Controls.Add(this.QueueBox); + this.GamePage.Controls.Add(this.GameManageGrp); + this.GamePage.Controls.Add(this.StartBtn); + this.GamePage.Controls.Add(this.QueueManageGrp); + this.GamePage.Controls.Add(this.GithubBtn); + this.GamePage.Controls.Add(this.UsernameTextBox); + this.GamePage.Controls.Add(this.csrinbtn); + this.GamePage.Controls.Add(this.MoreSettingsBtn); + this.GamePage.Controls.Add(this.SSPLogoPicBox); + this.GamePage.Controls.Add(this.PasswordTextBox); + this.GamePage.Controls.Add(this.SaveLoginBtn); + this.GamePage.Controls.Add(this.PasswordLabel); + this.GamePage.Controls.Add(this.UsernameLabel); + this.GamePage.Location = new System.Drawing.Point(4, 25); + this.GamePage.Name = "GamePage"; + this.GamePage.Padding = new System.Windows.Forms.Padding(3); + this.GamePage.Size = new System.Drawing.Size(690, 461); + this.GamePage.TabIndex = 0; + this.GamePage.Text = "Steam Games"; + // + // SSPLogoPicBox + // + this.SSPLogoPicBox.Image = global::SuperSteamPacker.Properties.Resources.logo; + this.SSPLogoPicBox.Location = new System.Drawing.Point(484, 8); + this.SSPLogoPicBox.Name = "SSPLogoPicBox"; + this.SSPLogoPicBox.Size = new System.Drawing.Size(193, 78); + this.SSPLogoPicBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.SSPLogoPicBox.TabIndex = 18; + this.SSPLogoPicBox.TabStop = false; + // + // WorkshopPage + // + this.WorkshopPage.BackColor = System.Drawing.Color.White; + this.WorkshopPage.Controls.Add(this.MODTmpLstBx); + this.WorkshopPage.Controls.Add(this.MODManageGrp); + this.WorkshopPage.Controls.Add(this.MODQueueBox); + this.WorkshopPage.Controls.Add(this.MODQueueLabel); + this.WorkshopPage.Controls.Add(this.MODStartBtn); + this.WorkshopPage.Controls.Add(this.MODQueueManageGrp); + this.WorkshopPage.Controls.Add(this.MODGithubBtn); + this.WorkshopPage.Controls.Add(this.MODcsrinbtn); + this.WorkshopPage.Location = new System.Drawing.Point(4, 25); + this.WorkshopPage.Name = "WorkshopPage"; + this.WorkshopPage.Padding = new System.Windows.Forms.Padding(3); + this.WorkshopPage.Size = new System.Drawing.Size(690, 461); + this.WorkshopPage.TabIndex = 1; + this.WorkshopPage.Text = "Steam Workshop"; + // + // MODTmpLstBx + // + this.MODTmpLstBx.FormattingEnabled = true; + this.MODTmpLstBx.Location = new System.Drawing.Point(535, 26); + this.MODTmpLstBx.Name = "MODTmpLstBx"; + this.MODTmpLstBx.Size = new System.Drawing.Size(147, 147); + this.MODTmpLstBx.TabIndex = 29; + this.MODTmpLstBx.Visible = false; + // + // MODManageGrp + // + this.MODManageGrp.Controls.Add(this.MODWorkshopItemID); + this.MODManageGrp.Controls.Add(this.MODWorkshopItemIDBx); + this.MODManageGrp.Controls.Add(this.MODAppIDTxtBx); + this.MODManageGrp.Controls.Add(this.MODAppIDLabel); + this.MODManageGrp.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F); + this.MODManageGrp.Location = new System.Drawing.Point(6, 280); + this.MODManageGrp.Name = "MODManageGrp"; + this.MODManageGrp.Size = new System.Drawing.Size(676, 52); + this.MODManageGrp.TabIndex = 28; + this.MODManageGrp.TabStop = false; + this.MODManageGrp.Text = "MODManageGrp"; + // + // MODWorkshopItemID + // + this.MODWorkshopItemID.AutoSize = true; + this.MODWorkshopItemID.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.MODWorkshopItemID.Location = new System.Drawing.Point(219, 23); + this.MODWorkshopItemID.Name = "MODWorkshopItemID"; + this.MODWorkshopItemID.Size = new System.Drawing.Size(96, 13); + this.MODWorkshopItemID.TabIndex = 3; + this.MODWorkshopItemID.Text = "Workshop Item ID:"; + // + // MODWorkshopItemIDBx + // + this.MODWorkshopItemIDBx.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.MODWorkshopItemIDBx.Location = new System.Drawing.Point(321, 19); + this.MODWorkshopItemIDBx.Name = "MODWorkshopItemIDBx"; + this.MODWorkshopItemIDBx.Size = new System.Drawing.Size(349, 20); + this.MODWorkshopItemIDBx.TabIndex = 2; + this.MODWorkshopItemIDBx.TextChanged += new System.EventHandler(this.TextBox_TextChanged); + // + // MODAppIDTxtBx + // + this.MODAppIDTxtBx.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.MODAppIDTxtBx.Location = new System.Drawing.Point(52, 20); + this.MODAppIDTxtBx.Name = "MODAppIDTxtBx"; + this.MODAppIDTxtBx.Size = new System.Drawing.Size(161, 20); + this.MODAppIDTxtBx.TabIndex = 1; + this.MODAppIDTxtBx.TextChanged += new System.EventHandler(this.TextBox_TextChanged); + // + // MODAppIDLabel + // + this.MODAppIDLabel.AutoSize = true; + this.MODAppIDLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.MODAppIDLabel.Location = new System.Drawing.Point(6, 23); + this.MODAppIDLabel.Name = "MODAppIDLabel"; + this.MODAppIDLabel.Size = new System.Drawing.Size(40, 13); + this.MODAppIDLabel.TabIndex = 0; + this.MODAppIDLabel.Text = "AppID:"; + // + // MODQueueBox + // + this.MODQueueBox.FormattingEnabled = true; + this.MODQueueBox.Location = new System.Drawing.Point(6, 26); + this.MODQueueBox.Name = "MODQueueBox"; + this.MODQueueBox.Size = new System.Drawing.Size(676, 251); + this.MODQueueBox.TabIndex = 27; + this.MODQueueBox.SelectedIndexChanged += new System.EventHandler(this.MODQueueBox_SelectedIndexChanged); + // + // MODQueueLabel + // + this.MODQueueLabel.AutoSize = true; + this.MODQueueLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MODQueueLabel.Location = new System.Drawing.Point(3, 3); + this.MODQueueLabel.Name = "MODQueueLabel"; + this.MODQueueLabel.Size = new System.Drawing.Size(123, 18); + this.MODQueueLabel.TabIndex = 25; + this.MODQueueLabel.Text = "MODQueueLabel"; + // + // MODStartBtn + // + this.MODStartBtn.Cursor = System.Windows.Forms.Cursors.Hand; + this.MODStartBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MODStartBtn.Location = new System.Drawing.Point(480, 335); + this.MODStartBtn.Name = "MODStartBtn"; + this.MODStartBtn.Size = new System.Drawing.Size(204, 59); + this.MODStartBtn.TabIndex = 21; + this.MODStartBtn.Text = "MODStartBtn"; + this.MODStartBtn.UseVisualStyleBackColor = true; + this.MODStartBtn.Click += new System.EventHandler(this.MODStartBtn_Click); + // + // MODQueueManageGrp + // + this.MODQueueManageGrp.Controls.Add(this.MODMoveUpBtn); + this.MODQueueManageGrp.Controls.Add(this.MODMoveDownBtn); + this.MODQueueManageGrp.Controls.Add(this.MODExportQueueButton); + this.MODQueueManageGrp.Controls.Add(this.MODImportQueueButton); + this.MODQueueManageGrp.Controls.Add(this.MODClearQueueBtn); + this.MODQueueManageGrp.Controls.Add(this.MODAddBtn); + this.MODQueueManageGrp.Controls.Add(this.MODDelBtn); + this.MODQueueManageGrp.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MODQueueManageGrp.Location = new System.Drawing.Point(6, 335); + this.MODQueueManageGrp.Name = "MODQueueManageGrp"; + this.MODQueueManageGrp.Size = new System.Drawing.Size(468, 122); + this.MODQueueManageGrp.TabIndex = 24; + this.MODQueueManageGrp.TabStop = false; + this.MODQueueManageGrp.Text = "MODQueueManageGrp"; + // + // MODMoveUpBtn + // + this.MODMoveUpBtn.Cursor = System.Windows.Forms.Cursors.Hand; + this.MODMoveUpBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MODMoveUpBtn.Location = new System.Drawing.Point(6, 64); + this.MODMoveUpBtn.Name = "MODMoveUpBtn"; + this.MODMoveUpBtn.Size = new System.Drawing.Size(225, 25); + this.MODMoveUpBtn.TabIndex = 10; + this.MODMoveUpBtn.Text = "MODMoveUpBtn"; + this.MODMoveUpBtn.UseVisualStyleBackColor = true; + // + // MODMoveDownBtn + // + this.MODMoveDownBtn.Cursor = System.Windows.Forms.Cursors.Hand; + this.MODMoveDownBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MODMoveDownBtn.Location = new System.Drawing.Point(237, 64); + this.MODMoveDownBtn.Name = "MODMoveDownBtn"; + this.MODMoveDownBtn.Size = new System.Drawing.Size(225, 25); + this.MODMoveDownBtn.TabIndex = 11; + this.MODMoveDownBtn.Text = "MODMoveDownBtn"; + this.MODMoveDownBtn.UseVisualStyleBackColor = true; + // + // MODExportQueueButton + // + this.MODExportQueueButton.Cursor = System.Windows.Forms.Cursors.Hand; + this.MODExportQueueButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MODExportQueueButton.Location = new System.Drawing.Point(6, 92); + this.MODExportQueueButton.Name = "MODExportQueueButton"; + this.MODExportQueueButton.Size = new System.Drawing.Size(225, 25); + this.MODExportQueueButton.TabIndex = 12; + this.MODExportQueueButton.Text = "MODExportQueueButton"; + this.MODExportQueueButton.UseVisualStyleBackColor = true; + this.MODExportQueueButton.Click += new System.EventHandler(this.MODExportQueueButton_Click); + // + // MODImportQueueButton + // + this.MODImportQueueButton.Cursor = System.Windows.Forms.Cursors.Hand; + this.MODImportQueueButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MODImportQueueButton.Location = new System.Drawing.Point(237, 92); + this.MODImportQueueButton.Name = "MODImportQueueButton"; + this.MODImportQueueButton.Size = new System.Drawing.Size(225, 25); + this.MODImportQueueButton.TabIndex = 13; + this.MODImportQueueButton.Text = "MODImportQueueButton"; + this.MODImportQueueButton.UseVisualStyleBackColor = true; + this.MODImportQueueButton.Click += new System.EventHandler(this.MODImportQueueButton_Click); + // + // MODClearQueueBtn + // + this.MODClearQueueBtn.Cursor = System.Windows.Forms.Cursors.Hand; + this.MODClearQueueBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MODClearQueueBtn.Location = new System.Drawing.Point(312, 23); + this.MODClearQueueBtn.Name = "MODClearQueueBtn"; + this.MODClearQueueBtn.Size = new System.Drawing.Size(150, 36); + this.MODClearQueueBtn.TabIndex = 9; + this.MODClearQueueBtn.Text = "MODClearBtn"; + this.MODClearQueueBtn.UseVisualStyleBackColor = true; + this.MODClearQueueBtn.Click += new System.EventHandler(this.MODClearQueueBtn_Click); + // + // MODAddBtn + // + this.MODAddBtn.Cursor = System.Windows.Forms.Cursors.Hand; + this.MODAddBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MODAddBtn.Location = new System.Drawing.Point(6, 24); + this.MODAddBtn.Name = "MODAddBtn"; + this.MODAddBtn.Size = new System.Drawing.Size(150, 35); + this.MODAddBtn.TabIndex = 7; + this.MODAddBtn.Text = "MODAddBtn"; + this.MODAddBtn.UseVisualStyleBackColor = true; + this.MODAddBtn.Click += new System.EventHandler(this.MODAddBtn_Click); + // + // MODDelBtn + // + this.MODDelBtn.Cursor = System.Windows.Forms.Cursors.Hand; + this.MODDelBtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MODDelBtn.Location = new System.Drawing.Point(159, 23); + this.MODDelBtn.Name = "MODDelBtn"; + this.MODDelBtn.Size = new System.Drawing.Size(150, 36); + this.MODDelBtn.TabIndex = 8; + this.MODDelBtn.Text = "MODDelBtn"; + this.MODDelBtn.UseVisualStyleBackColor = true; + this.MODDelBtn.Click += new System.EventHandler(this.MODDelBtn_Click); + // + // MODGithubBtn + // + this.MODGithubBtn.Cursor = System.Windows.Forms.Cursors.Hand; + this.MODGithubBtn.Location = new System.Drawing.Point(480, 431); + this.MODGithubBtn.Name = "MODGithubBtn"; + this.MODGithubBtn.Size = new System.Drawing.Size(204, 25); + this.MODGithubBtn.TabIndex = 23; + this.MODGithubBtn.Text = "Masquerade\'s Github"; + this.MODGithubBtn.UseVisualStyleBackColor = true; + this.MODGithubBtn.Click += new System.EventHandler(this.GithubBtn_Click); + // + // MODcsrinbtn + // + this.MODcsrinbtn.Cursor = System.Windows.Forms.Cursors.Hand; + this.MODcsrinbtn.Location = new System.Drawing.Point(480, 400); + this.MODcsrinbtn.Name = "MODcsrinbtn"; + this.MODcsrinbtn.Size = new System.Drawing.Size(204, 25); + this.MODcsrinbtn.TabIndex = 22; + this.MODcsrinbtn.Text = "CS.RIN.RU Forum"; + this.MODcsrinbtn.UseVisualStyleBackColor = true; + this.MODcsrinbtn.Click += new System.EventHandler(this.csrinbtn_Click); + // + // DepotsPage + // + this.DepotsPage.BackColor = System.Drawing.Color.White; + this.DepotsPage.Controls.Add(this.Placeholder2); + this.DepotsPage.Location = new System.Drawing.Point(4, 25); + this.DepotsPage.Name = "DepotsPage"; + this.DepotsPage.Padding = new System.Windows.Forms.Padding(3); + this.DepotsPage.Size = new System.Drawing.Size(690, 461); + this.DepotsPage.TabIndex = 2; + this.DepotsPage.Text = "Steam Depots"; + // + // Placeholder2 + // + this.Placeholder2.AutoSize = true; + this.Placeholder2.Font = new System.Drawing.Font("Lucida Sans Unicode", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Placeholder2.Location = new System.Drawing.Point(3, 3); + this.Placeholder2.Name = "Placeholder2"; + this.Placeholder2.Size = new System.Drawing.Size(234, 39); + this.Placeholder2.TabIndex = 1; + this.Placeholder2.Text = "Coming soon."; + // + // AchievementsPage + // + this.AchievementsPage.BackColor = System.Drawing.Color.White; + this.AchievementsPage.Controls.Add(this.Placeholder3); + this.AchievementsPage.Location = new System.Drawing.Point(4, 25); + this.AchievementsPage.Name = "AchievementsPage"; + this.AchievementsPage.Padding = new System.Windows.Forms.Padding(3); + this.AchievementsPage.Size = new System.Drawing.Size(690, 461); + this.AchievementsPage.TabIndex = 3; + this.AchievementsPage.Text = "Achievements"; + // + // Placeholder3 + // + this.Placeholder3.AutoSize = true; + this.Placeholder3.Font = new System.Drawing.Font("Lucida Sans Unicode", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Placeholder3.Location = new System.Drawing.Point(3, 3); + this.Placeholder3.Name = "Placeholder3"; + this.Placeholder3.Size = new System.Drawing.Size(234, 39); + this.Placeholder3.TabIndex = 2; + this.Placeholder3.Text = "Coming soon."; + // + // PostTemplatePage + // + this.PostTemplatePage.BackColor = System.Drawing.Color.White; + this.PostTemplatePage.Controls.Add(this.Placeholder4); + this.PostTemplatePage.Location = new System.Drawing.Point(4, 25); + this.PostTemplatePage.Name = "PostTemplatePage"; + this.PostTemplatePage.Padding = new System.Windows.Forms.Padding(3); + this.PostTemplatePage.Size = new System.Drawing.Size(690, 461); + this.PostTemplatePage.TabIndex = 4; + this.PostTemplatePage.Text = "Post Template"; + // + // Placeholder4 + // + this.Placeholder4.AutoSize = true; + this.Placeholder4.Font = new System.Drawing.Font("Lucida Sans Unicode", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Placeholder4.Location = new System.Drawing.Point(3, 3); + this.Placeholder4.Name = "Placeholder4"; + this.Placeholder4.Size = new System.Drawing.Size(234, 39); + this.Placeholder4.TabIndex = 2; + this.Placeholder4.Text = "Coming soon."; // // MainWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(678, 466); - this.Controls.Add(this.BranchGrp); - this.Controls.Add(this.GameManageGrp); - this.Controls.Add(this.QueueManageGrp); - this.Controls.Add(this.GithubBtn); - this.Controls.Add(this.csrinbtn); - this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.SaveLoginBtn); - this.Controls.Add(this.UsernameLabel); - this.Controls.Add(this.PasswordLabel); - this.Controls.Add(this.PasswordTextBox); - this.Controls.Add(this.MoreSettingsBtn); - this.Controls.Add(this.UsernameTextBox); - this.Controls.Add(this.TmpLstBx); - this.Controls.Add(this.StartBtn); - this.Controls.Add(this.QueueLabel); - this.Controls.Add(this.QueueBox); + this.ClientSize = new System.Drawing.Size(698, 490); + this.Controls.Add(this.TabManager); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "MainWindow"; @@ -472,9 +828,22 @@ this.GameManageGrp.PerformLayout(); this.BranchGrp.ResumeLayout(false); this.BranchGrp.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.TabManager.ResumeLayout(false); + this.GamePage.ResumeLayout(false); + this.GamePage.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.SSPLogoPicBox)).EndInit(); + this.WorkshopPage.ResumeLayout(false); + this.WorkshopPage.PerformLayout(); + this.MODManageGrp.ResumeLayout(false); + this.MODManageGrp.PerformLayout(); + this.MODQueueManageGrp.ResumeLayout(false); + this.DepotsPage.ResumeLayout(false); + this.DepotsPage.PerformLayout(); + this.AchievementsPage.ResumeLayout(false); + this.AchievementsPage.PerformLayout(); + this.PostTemplatePage.ResumeLayout(false); + this.PostTemplatePage.PerformLayout(); this.ResumeLayout(false); - this.PerformLayout(); } @@ -498,7 +867,7 @@ private System.Windows.Forms.Label PasswordLabel; private System.Windows.Forms.Label UsernameLabel; private System.Windows.Forms.Button SaveLoginBtn; - private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.PictureBox SSPLogoPicBox; private System.Windows.Forms.Button ClearQueueBtn; private System.Windows.Forms.Button MoveUpBtn; private System.Windows.Forms.Button MoveDownBtn; @@ -513,6 +882,34 @@ private System.Windows.Forms.TextBox BranchNameTxtBox; private System.Windows.Forms.Label BranchLabel; private System.Windows.Forms.TextBox BranchPasswordTxtBox; + private System.Windows.Forms.TabControl TabManager; + private System.Windows.Forms.TabPage GamePage; + private System.Windows.Forms.TabPage WorkshopPage; + private System.Windows.Forms.TabPage DepotsPage; + private System.Windows.Forms.Label Placeholder2; + private System.Windows.Forms.TabPage AchievementsPage; + private System.Windows.Forms.Button MODStartBtn; + private System.Windows.Forms.GroupBox MODQueueManageGrp; + private System.Windows.Forms.Button MODMoveUpBtn; + private System.Windows.Forms.Button MODMoveDownBtn; + private System.Windows.Forms.Button MODExportQueueButton; + private System.Windows.Forms.Button MODImportQueueButton; + private System.Windows.Forms.Button MODClearQueueBtn; + private System.Windows.Forms.Button MODAddBtn; + private System.Windows.Forms.Button MODDelBtn; + private System.Windows.Forms.Button MODGithubBtn; + private System.Windows.Forms.Button MODcsrinbtn; + private System.Windows.Forms.Label MODQueueLabel; + private System.Windows.Forms.ListBox MODQueueBox; + private System.Windows.Forms.GroupBox MODManageGrp; + private System.Windows.Forms.Label MODAppIDLabel; + private System.Windows.Forms.TextBox MODAppIDTxtBx; + private System.Windows.Forms.Label MODWorkshopItemID; + private System.Windows.Forms.TextBox MODWorkshopItemIDBx; + private System.Windows.Forms.ListBox MODTmpLstBx; + private System.Windows.Forms.TabPage PostTemplatePage; + private System.Windows.Forms.Label Placeholder3; + private System.Windows.Forms.Label Placeholder4; } } diff --git a/MainForm.cs b/MainForm.cs index 29660eb..5b4e55f 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -11,9 +11,15 @@ using System.Linq; using System.Net; using System.Net.Http; using System.Resources; +using System.Security.Cryptography; +using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; +using System.Drawing; +using static SteamKit2.Internal.CContentBuilder_CommitAppBuild_Request; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; +using System.Windows.Forms.VisualStyles; namespace SuperSteamPacker { @@ -72,7 +78,6 @@ namespace SuperSteamPacker } } - var settingsini = new Ini("Settings.ini"); string compressorcheck = settingsini.Read("compressor", "SSP"); @@ -82,6 +87,15 @@ namespace SuperSteamPacker settingsini.Write("compressor", "7z", "SSP"); } + if (settingsini.Read("key", "SSP").Length == 0) + { + if (File.Exists("userdata.ini")) + { + File.Delete("userdata.ini"); + } + settingsini.Write("key", GenerateKey(32), "SSP"); + } + var globalini = new Ini("Language\\Global.ini"); string readlanguage = settingsini.Read("language", "SSP"); @@ -96,6 +110,25 @@ namespace SuperSteamPacker Text = globalini.Read("Title", "SSP") + " " + globalini.Read("Version", "SSP") + " " + languageini.Read("by", "SSP") + " " + globalini.Read("Author", "SSP"); + MODAddBtn.Text = languageini.Read("add", "SSP"); + MODDelBtn.Text = languageini.Read("del", "SSP"); + MODStartBtn.Text = languageini.Read("start", "SSP"); + MODClearQueueBtn.Text = languageini.Read("ClearQueue", "SSP"); + MODExportQueueButton.Text = languageini.Read("Export", "SSP"); + MODImportQueueButton.Text = languageini.Read("Import", "SSP"); + MODQueueLabel.Text = languageini.Read("queue", "SSP") + ":"; + MODMoveUpBtn.Text = languageini.Read("MoveUp", "SSP"); + MODMoveDownBtn.Text = languageini.Read("MoveDown", "SSP"); + MODQueueManageGrp.Text = languageini.Read("QueueManageGroup", "SSP"); + MODManageGrp.Text = languageini.Read("MODManager", "SSP"); + MODDelBtn.Enabled = false; + MODStartBtn.Enabled = false; + MODClearQueueBtn.Enabled = false; + MODMoveUpBtn.Enabled = false; + MODMoveDownBtn.Enabled = false; + MODAddBtn.Enabled = false; + MODExportQueueButton.Enabled = false; + QueueLabel.Text = languageini.Read("queue", "SSP") + ":"; AddBtn.Text = languageini.Read("add", "SSP"); DelBtn.Text = languageini.Read("del", "SSP"); @@ -129,8 +162,8 @@ namespace SuperSteamPacker if (File.Exists("userdata.ini")) { var userdata = new Ini("userdata.ini"); - UsernameTextBox.Text = userdata.Read("username", "userdata"); - PasswordTextBox.Text = userdata.Read("password", "userdata"); + UsernameTextBox.Text = DecryptString(userdata.Read("username", "userdata"), settingsini.Read("key", "SSP")); + PasswordTextBox.Text = DecryptString(userdata.Read("password", "userdata"), settingsini.Read("key", "SSP")); UsernameTextBox.Enabled = false; PasswordTextBox.Enabled = false; } @@ -138,8 +171,128 @@ namespace SuperSteamPacker BranchPasswordTxtBox.Enabled = false; BranchPasswordCB.Enabled = false; BranchNameTxtBox.Enabled = false; + + if (settingsini.Read("darkmode", "SSP") == "1") + { + BackColor = Color.FromArgb(35, 35, 40); + GamePage.BackColor = Color.FromArgb(35, 35, 40); + QueueLabel.ForeColor = Color.White; + UsernameLabel.ForeColor = Color.White; + PasswordLabel.ForeColor = Color.White; + GameManageGrp.ForeColor = Color.White; + BranchGrp.ForeColor = Color.White; + QueueManageGrp.ForeColor = Color.White; + AppIDExplain.BackColor = Color.FromArgb(60, 60, 69); + AppIDExplain.FlatStyle = FlatStyle.Flat; + OSExplain.BackColor = Color.FromArgb(60, 60, 69); + OSExplain.FlatStyle = FlatStyle.Flat; + SaveLoginBtn.BackColor = Color.FromArgb(60, 60, 69); + SaveLoginBtn.FlatStyle = FlatStyle.Flat; + SaveLoginBtn.ForeColor = Color.White; + MoreSettingsBtn.BackColor = Color.FromArgb(60, 60, 69); + MoreSettingsBtn.FlatStyle = FlatStyle.Flat; + MoreSettingsBtn.ForeColor = Color.White; + QueueBox.BackColor = Color.FromArgb(35,32,35); + QueueBox.ForeColor = Color.FromArgb(58, 128, 250); + AddBtn.BackColor = Color.FromArgb(60, 60, 69); + AddBtn.FlatStyle = FlatStyle.Flat; + AddBtn.ForeColor = Color.White; + DelBtn.BackColor = Color.FromArgb(60, 60, 69); + DelBtn.FlatStyle = FlatStyle.Flat; + DelBtn.ForeColor = Color.White; + ClearQueueBtn.BackColor = Color.FromArgb(60, 60, 69); + ClearQueueBtn.FlatStyle = FlatStyle.Flat; + ClearQueueBtn.ForeColor = Color.White; + MoveUpBtn.BackColor = Color.FromArgb(60, 60, 69); + MoveUpBtn.FlatStyle = FlatStyle.Flat; + MoveUpBtn.ForeColor = Color.White; + MoveDownBtn.BackColor = Color.FromArgb(60, 60, 69); + MoveDownBtn.FlatStyle = FlatStyle.Flat; + MoveDownBtn.ForeColor = Color.White; + ExportQueueButton.BackColor = Color.FromArgb(60, 60, 69); + ExportQueueButton.FlatStyle = FlatStyle.Flat; + ExportQueueButton.ForeColor = Color.White; + ImportQueueButton.BackColor = Color.FromArgb(60, 60, 69); + ImportQueueButton.FlatStyle = FlatStyle.Flat; + ImportQueueButton.ForeColor = Color.White; + BranchPasswordCB.ForeColor = Color.White; + StartBtn.BackColor = Color.FromArgb(60, 60, 69); + StartBtn.FlatStyle = FlatStyle.Flat; + StartBtn.ForeColor = Color.White; + csrinbtn.BackColor = Color.FromArgb(60, 60, 69); + csrinbtn.FlatStyle = FlatStyle.Flat; + csrinbtn.ForeColor = Color.White; + GithubBtn.BackColor = Color.FromArgb(60, 60, 69); + GithubBtn.FlatStyle = FlatStyle.Flat; + GithubBtn.ForeColor = Color.White; + SSPLogoPicBox.Image = Properties.Resources.logo_dark; + AppIDTxtBox.ForeColor = Color.White; + AppIDTxtBox.BackColor = Color.FromArgb(60, 60, 69); + AppIDTxtBox.BorderStyle = BorderStyle.FixedSingle; + UsernameTextBox.ForeColor = Color.White; + UsernameTextBox.BackColor = Color.FromArgb(60, 60, 69); + UsernameTextBox.BorderStyle = BorderStyle.FixedSingle; + PasswordTextBox.ForeColor = Color.White; + PasswordTextBox.BackColor = Color.FromArgb(60, 60, 69); + PasswordTextBox.BorderStyle = BorderStyle.FixedSingle; + BranchNameTxtBox.ForeColor = Color.White; + BranchNameTxtBox.BackColor = Color.FromArgb(60, 60, 69); + BranchNameTxtBox.BorderStyle = BorderStyle.FixedSingle; + BranchPasswordTxtBox.ForeColor = Color.White; + BranchPasswordTxtBox.BackColor = Color.FromArgb(60, 60, 69); + BranchPasswordTxtBox.BorderStyle = BorderStyle.FixedSingle; + AchievementsPage.BackColor = Color.FromArgb(35, 35, 40); + WorkshopPage.BackColor = Color.FromArgb(35, 35, 40); + DepotsPage.BackColor = Color.FromArgb(35, 35, 40); + PostTemplatePage.BackColor = Color.FromArgb(35, 35, 40); + Placeholder2.ForeColor = Color.White; + Placeholder3.ForeColor = Color.White; + Placeholder4.ForeColor = Color.White; + MODQueueLabel.ForeColor = Color.White; + MODManageGrp.ForeColor = Color.White; + MODAppIDTxtBx.ForeColor = Color.White; + MODAppIDTxtBx.BackColor = Color.FromArgb(60, 60, 69); + MODAppIDTxtBx.BorderStyle = BorderStyle.FixedSingle; + MODWorkshopItemIDBx.ForeColor = Color.White; + MODWorkshopItemIDBx.BackColor = Color.FromArgb(60, 60, 69); + MODWorkshopItemIDBx.BorderStyle = BorderStyle.FixedSingle; + MODQueueManageGrp.ForeColor = Color.White; + MODAddBtn.BackColor = Color.FromArgb(60, 60, 69); + MODAddBtn.FlatStyle = FlatStyle.Flat; + MODAddBtn.ForeColor = Color.White; + MODDelBtn.BackColor = Color.FromArgb(60, 60, 69); + MODDelBtn.FlatStyle = FlatStyle.Flat; + MODDelBtn.ForeColor = Color.White; + MODClearQueueBtn.BackColor = Color.FromArgb(60, 60, 69); + MODClearQueueBtn.FlatStyle = FlatStyle.Flat; + MODClearQueueBtn.ForeColor = Color.White; + MODMoveUpBtn.BackColor = Color.FromArgb(60, 60, 69); + MODMoveUpBtn.FlatStyle = FlatStyle.Flat; + MODMoveUpBtn.ForeColor = Color.White; + MODMoveDownBtn.BackColor = Color.FromArgb(60, 60, 69); + MODMoveDownBtn.FlatStyle = FlatStyle.Flat; + MODMoveDownBtn.ForeColor = Color.White; + MODImportQueueButton.BackColor = Color.FromArgb(60, 60, 69); + MODImportQueueButton.FlatStyle = FlatStyle.Flat; + MODImportQueueButton.ForeColor = Color.White; + MODExportQueueButton.BackColor = Color.FromArgb(60, 60, 69); + MODExportQueueButton.FlatStyle = FlatStyle.Flat; + MODExportQueueButton.ForeColor = Color.White; + MODcsrinbtn.BackColor = Color.FromArgb(60, 60, 69); + MODcsrinbtn.FlatStyle = FlatStyle.Flat; + MODcsrinbtn.ForeColor = Color.White; + MODGithubBtn.BackColor = Color.FromArgb(60, 60, 69); + MODGithubBtn.FlatStyle = FlatStyle.Flat; + MODGithubBtn.ForeColor = Color.White; + MODStartBtn.BackColor = Color.FromArgb(60, 60, 69); + MODStartBtn.FlatStyle = FlatStyle.Flat; + MODStartBtn.ForeColor = Color.White; + MODQueueBox.BackColor = Color.FromArgb(35, 32, 35); + MODQueueBox.ForeColor = Color.FromArgb(58, 128, 250); + } } + public static void EditVDF(string filePath, string keyToModify, string newValue) { string fileContents = File.ReadAllText(filePath); @@ -170,22 +323,8 @@ namespace SuperSteamPacker } } - private void MainWindow_Load(object sender, EventArgs e) { - if (!File.Exists("settings.ini") || !Directory.Exists("Language")) - { - MessageBox.Show("Important Data is missing! Please redownload this program.", "Super Steam Packer", MessageBoxButtons.OK, MessageBoxIcon.Stop); - Application.Exit(); - } - - if (File.Exists("userdata.ini")) - { - var userdataini = new Ini("userdata.ini"); - UsernameTextBox.Text=userdataini.Read("username", "userdata"); - PasswordTextBox.Text=userdataini.Read("password", "userdata"); - SaveLoginBtn.Enabled = false; - } } private void AppIDExplain_Click(object sender, EventArgs e) @@ -245,14 +384,7 @@ namespace SuperSteamPacker if (!String.IsNullOrEmpty(AppIDTxtBox.Text) && validappidcheck == true) { - if (OSBox.SelectedItem.ToString() == "Mac") - { - QueueBox.Items.Add("AppID: " + AppIDTxtBox.Text + "\t" + "Branch: " + BranchNameTxtBox.Text + "\t\t" + "OS: " + OSBox.SelectedItem.ToString() + "\t\t" + languageini.Read("Status", "SSP") + ":" + " " + languageini.Read("READY", "SSP")); - } - else - { - QueueBox.Items.Add("AppID: " + AppIDTxtBox.Text + "\t" + "Branch: " + BranchNameTxtBox.Text + "\t" + "OS: " + OSBox.SelectedItem.ToString() + "\t" + languageini.Read("Status", "SSP") + ":" + " " + languageini.Read("READY", "SSP")); - } + QueueBox.Items.Add("AppID: " + AppIDTxtBox.Text + "\t" + "Branch: " + BranchNameTxtBox.Text + "\t" + "OS: " + OSBox.SelectedItem.ToString() + "\t" + languageini.Read("Status", "SSP") + ":" + " " + languageini.Read("READY", "SSP")); TmpLstBx.Items.Add(appcheck); AppIDTxtBox.Text=""; StartBtn.Enabled = true; @@ -320,7 +452,6 @@ namespace SuperSteamPacker private void SaveLoginBtn_Click(object sender, EventArgs e) { var settingsini = new Ini("Settings.ini"); - var globalini = new Ini("Language\\Global.ini"); string readlanguage = settingsini.Read("language", "SSP"); var languageini = new Ini("Language\\" + readlanguage + ".ini"); @@ -330,8 +461,8 @@ namespace SuperSteamPacker { File.WriteAllText("userdata.ini", "[userdata]\nusername=\npassword="); var userini = new Ini("userdata.ini"); - userini.Write("username", UsernameTextBox.Text, "userdata"); - userini.Write("password", PasswordTextBox.Text, "userdata"); + userini.Write("username", EncryptString(UsernameTextBox.Text, settingsini.Read("key", "SSP")), "userdata"); + userini.Write("password", EncryptString(PasswordTextBox.Text, settingsini.Read("key", "SSP")), "userdata"); SaveLoginBtn.Enabled = false; UsernameTextBox.Enabled = false; PasswordTextBox.Enabled = false; @@ -344,8 +475,8 @@ namespace SuperSteamPacker { File.WriteAllText("userdata.ini", "[userdata]\nusername=\npassword="); var userini = new Ini("userdata.ini"); - userini.Write("username", UsernameTextBox.Text, "userdata"); - userini.Write("password", PasswordTextBox.Text, "userdata"); + userini.Write("username", EncryptString(UsernameTextBox.Text, settingsini.Read("key", "SSP")), "userdata"); + userini.Write("password", EncryptString(PasswordTextBox.Text, settingsini.Read("key", "SSP")), "userdata"); SaveLoginBtn.Enabled = false; UsernameTextBox.Enabled = false; PasswordTextBox.Enabled = false; @@ -363,6 +494,8 @@ namespace SuperSteamPacker private async void StartBtn_Click(object sender, EventArgs e) { + var depotsini = new Ini("depots.ini"); + StartBtn.Enabled = false; AppIDTxtBox.Enabled = false; OSBox.Enabled = false; if (Directory.Exists("Jobs")) @@ -385,6 +518,10 @@ namespace SuperSteamPacker { Directory.Delete("SteamCMD\\logs", true); } + if (File.Exists("CurrentJob.JOB")) + { + File.Delete("CurrentJob.JOB"); + } var settingsini = new Ini("Settings.ini"); var globalini = new Ini("Language\\Global.ini"); @@ -405,7 +542,17 @@ namespace SuperSteamPacker anonymousloginconfirmation = true; } } - + if (!File.Exists("depots.ini")) + { + try + { + var client = new WebClient(); + client.DownloadFile("https://raw.githubusercontent.com/Masquerade64/SteamDepotNames/main/depots.ini", "depots.ini"); + } + catch + { + } + } if ((!String.IsNullOrEmpty(UsernameTextBox.Text) && !String.IsNullOrEmpty(PasswordTextBox.Text)) || anonymousloginconfirmation == true) { if (!File.Exists("SteamCMD\\steamcmd.exe")) @@ -421,9 +568,12 @@ namespace SuperSteamPacker loadsteam1.Start(); loadsteam1.WaitForExit(); } - Directory.CreateDirectory("Jobs"); for (int i = 0; i < TmpLstBx.Items.Count; i++) { + if (File.Exists("CurrentJob.JOB")) + { + File.Delete("CurrentJob.JOB"); + } TmpLstBx.SelectedIndex = i; string os = ""; string[] workarray = TmpLstBx.SelectedItem.ToString().Split('|'); @@ -449,11 +599,11 @@ namespace SuperSteamPacker { if (i == 0) { - File.WriteAllText("Jobs\\" + i + "_" + workarray[1] + "_" + workarray[0] + ".JOB", "login " + UsernameTextBox.Text + " " + PasswordTextBox.Text + os + "\napp_update " + workarray[1] +" validate\nquit"); + File.WriteAllText("Currentjob.JOB", "login " + UsernameTextBox.Text + " " + PasswordTextBox.Text + os + "\napp_update " + workarray[1] +" validate\nquit"); } else { - File.WriteAllText("Jobs\\" + i + "_" + workarray[1] + "_" + workarray[0] + ".JOB", "login " + UsernameTextBox.Text + os + "\napp_update " + workarray[1] +" validate\nquit"); + File.WriteAllText("Currentjob.JOB", "login " + UsernameTextBox.Text + os + "\napp_update " + workarray[1] +" validate\nquit"); } } else //Non public branch code. @@ -462,84 +612,86 @@ namespace SuperSteamPacker { if (i == 0) { - File.WriteAllText("Jobs\\" + i + "_" + workarray[1] + "_" + workarray[0] + ".JOB", "login " + UsernameTextBox.Text + " " + PasswordTextBox.Text + os + "\napp_update " + workarray[1] + " -beta " + workarray[2] + " validate\nquit"); + File.WriteAllText("Currentjob.JOB", "login " + UsernameTextBox.Text + " " + PasswordTextBox.Text + os + "\napp_update " + workarray[1] + " -beta " + workarray[2] + " validate\nquit"); } else { - File.WriteAllText("Jobs\\" + i + "_" + workarray[1] + "_" + workarray[0] + ".JOB", "login " + UsernameTextBox.Text + os + "\napp_update " + workarray[1] + " -beta " + workarray[2] + " validate\nquit"); + File.WriteAllText("Currentjob.JOB", "login " + UsernameTextBox.Text + os + "\napp_update " + workarray[1] + " -beta " + workarray[2] + " validate\nquit"); } } else //password protected branch { if (i == 0) { - File.WriteAllText("Jobs\\" + i + "_" + workarray[1] + "_" + workarray[0] + ".JOB", "login " + UsernameTextBox.Text + " " + PasswordTextBox.Text + os + "\napp_update " + workarray[1] + " -beta " + workarray[2] + " -betapassword " + workarray[3] + " validate\nquit"); + File.WriteAllText("Currentjob.JOB", "login " + UsernameTextBox.Text + " " + PasswordTextBox.Text + os + "\napp_update " + workarray[1] + " -beta " + workarray[2] + " -betapassword " + workarray[3] + " validate\nquit"); } else { - File.WriteAllText("Jobs\\" + i + "_" + workarray[1] + "_" + workarray[0] + ".JOB", "login " + UsernameTextBox.Text + os + "\napp_update " + workarray[1] + " -beta " + workarray[2] + " -betapassword " + workarray[3] + " validate\nquit"); + File.WriteAllText("Currentjob.JOB", "login " + UsernameTextBox.Text + os + "\napp_update " + workarray[1] + " -beta " + workarray[2] + " -betapassword " + workarray[3] + " validate\nquit"); } } - + } - } - string[] files = Directory.GetFiles("Jobs", "*.JOB"); - - foreach (string file in files) - { - TmpLstBx.SelectedIndex = int.Parse(file.Substring(5, 1)); - string[] workarray = TmpLstBx.SelectedItem.ToString().Split('|'); + TmpLstBx.SelectedIndex = i; string AppID = workarray[1]; string Branch = workarray[2]; if (Branch == "Public") { Branch = Branch.ToLower(); } - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("READY", "SSP"), languageini.Read("GETINFO", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("READY", "SSP"), languageini.Read("GETINFO", "SSP")); var steamGameData = await GetSteamGameDataAsync(AppID); string GameNameEarly = ""; string OS = ""; string BuildNoEarly = ""; string BuildTime = ""; - string[] parts = file.Split('_'); - if (parts.Length > 2) + switch (workarray[0]) { - switch (parts[2].Substring(0, Math.Min(5, parts[2].Length))) - { - case "win64": - OS = "Win64"; - break; - case "win32": - OS = "Win32"; - break; - case "macos": - OS = "Mac"; - break; - case "lin64": - OS = "Linux64"; - break; - case "lin32": - OS = "Linux32"; - break; - } + case "win64": + OS = "Win64"; + break; + case "win32": + OS = "Win32"; + break; + case "macos": + OS = "Mac"; + break; + case "lin64": + OS = "Linux64"; + break; + case "lin32": + OS = "Linux32"; + break; } if (steamGameData != null) { - JToken buildid = steamGameData["data"][AppID]["depots"]["branches"][Branch]["buildid"]; - JToken buildtime = steamGameData["data"][AppID]["depots"]["branches"][Branch]["timeupdated"]; + try + { + JToken buildid = steamGameData["data"][AppID]["depots"]["branches"][Branch]["buildid"]; + BuildNoEarly = buildid.Value(); + } + catch + { + BuildNoEarly = "Unknown"; + } JToken gamename = steamGameData["data"][AppID]["common"]["name"]; - - DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(buildtime.Value()); - BuildTime = dateTime.ToString("MMMM d, yyyy - HH:mm:ss UTC"); - + try + { + JToken buildtime = steamGameData["data"][AppID]["depots"]["branches"][Branch]["timeupdated"]; + DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(buildtime.Value()); + BuildTime = dateTime.ToString("MMMM d, yyyy - HH:mm:ss UTC", System.Globalization.CultureInfo.InvariantCulture); + } + catch + { + BuildTime = ""; + } GameNameEarly = steamGameData["data"][AppID]["common"]["name"].Value(); GameNameEarly = GameNameEarly.Replace(" ", "_"); - BuildNoEarly = buildid.Value(); } else { - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("GETINFO", "SSP"), languageini.Read("UNABLETOREACH", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("GETINFO", "SSP"), languageini.Read("UNABLETOREACH", "SSP")); continue; } try @@ -548,7 +700,7 @@ namespace SuperSteamPacker if (filesearly.Length != 0) { - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("GETINFO", "SSP"), languageini.Read("SKIPPED", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("GETINFO", "SSP"), languageini.Read("SKIPPED", "SSP")); continue; } } @@ -556,7 +708,7 @@ namespace SuperSteamPacker { } - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("GETINFO", "SSP"), languageini.Read("DOWNLOADING", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("GETINFO", "SSP"), languageini.Read("DOWNLOADING", "SSP")); Directory.SetCurrentDirectory("SteamCMD"); if (Directory.Exists("Logs")) { @@ -564,7 +716,7 @@ namespace SuperSteamPacker } Process SteamCMD = new Process(); SteamCMD.StartInfo.FileName = "steamcmd.exe"; - SteamCMD.StartInfo.Arguments = "+runscript" + " ..\\" + file; + SteamCMD.StartInfo.Arguments = "+runscript" + " ..\\" + "CurrentJob.JOB"; SteamCMD.Start(); SteamCMD.WaitForExit(); @@ -583,21 +735,21 @@ namespace SuperSteamPacker } if (File.Exists("Logs\\connection_log.txt")) { - if(File.ReadAllText("Logs\\connection_log.txt").Contains("Rate Limit Exceeded")) + if (File.ReadAllText("Logs\\connection_log.txt").Contains("Rate Limit Exceeded")) { ratelimited = true; - MessageBox.Show("RL"); + //MessageBox.Show("RL"); } if (File.ReadAllText("Logs\\connection_log.txt").Contains("Invalid Password")) { invalidpassword = true; - MessageBox.Show("IP"); + //MessageBox.Show("IP"); } } if (!File.Exists("Logs\\sitelicense_steamcmd.txt") && !File.Exists("Logs\\compat_log.txt")) { steamguardcodefail = true; - MessageBox.Show("SGCF"); + //MessageBox.Show("SGCF"); } if (SteamCMD.ExitCode != 0 || ratelimited || failedsubscription || steamguardcodefail || invalidpassword) @@ -616,16 +768,16 @@ namespace SuperSteamPacker DialogResult ratelimitask = MessageBox.Show(languageini.Read("RateLimitWarn", "SSP"), languageini.Read("WARNING", "SSP"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (ratelimitask == DialogResult.OK) { - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("RATELIMITED", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("RATELIMITED", "SSP")); Directory.SetCurrentDirectory(".."); continue; } else { - for (int ratelimititems = int.Parse(file.Substring(5, 1)); ratelimititems < QueueBox.Items.Count; ratelimititems++) + for (int ratelimititems = i; ratelimititems < QueueBox.Items.Count; ratelimititems++) { - QueueBox.Items[ratelimititems] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("RATELIMITED", "SSP")); - QueueBox.Items[ratelimititems] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("READY", "SSP"), languageini.Read("RATELIMITED", "SSP")); + QueueBox.Items[ratelimititems] = QueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("RATELIMITED", "SSP")); + QueueBox.Items[ratelimititems] = QueueBox.Items[i].ToString().Replace(languageini.Read("READY", "SSP"), languageini.Read("RATELIMITED", "SSP")); } if (Directory.Exists("steamapps")) { @@ -655,11 +807,11 @@ namespace SuperSteamPacker { if (steamguardcodefail || invalidpassword) { - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("BADLOGIN", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("BADLOGIN", "SSP")); } else { - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("FAIL", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("FAIL", "SSP")); } Directory.SetCurrentDirectory(".."); continue; @@ -724,13 +876,20 @@ namespace SuperSteamPacker { string depotid = depot["Name"].Value(); string manifest = depot["Children"].FirstOrDefault(c => c["Name"].Value() == "manifest")?["Value"].Value(); - - DepotManifestList.Add(depotid + " - DepotName [Manifest " + manifest + "]"); + string depotname = depotsini.Read(depotid, "depots"); + if (string.IsNullOrEmpty(depotname)) + { + DepotManifestList.Add(depotid + " - DepotName [Manifest " + manifest + "]"); + } + else + { + DepotManifestList.Add(depotid + " - " + depotname + " [Manifest " + manifest + "]"); + } } } } - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("COMPRESSING", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("COMPRESSING", "SSP")); Process Compress = new Process(); if (settingsini.Read("compressor", "SSP") == "7z") @@ -740,7 +899,7 @@ namespace SuperSteamPacker { if (File.Exists("..\\Completed\\"+GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".7z") || File.Exists("..\\Completed\\" + GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".7z.001")) { - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); Directory.SetCurrentDirectory(".."); Directory.Delete("Temp", true); continue; @@ -755,7 +914,7 @@ namespace SuperSteamPacker { if (File.Exists("..\\Completed\\" + GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".7z") || File.Exists("..\\Completed\\" + GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".7z.001")) { - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); Directory.SetCurrentDirectory(".."); Directory.Delete("Temp", true); continue; @@ -773,7 +932,7 @@ namespace SuperSteamPacker { if (File.Exists("..\\Completed\\" + GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".rar") || File.Exists("..\\Completed\\" + GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".part1.rar")) { - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); Directory.SetCurrentDirectory(".."); Directory.Delete("Temp", true); continue; @@ -787,7 +946,7 @@ namespace SuperSteamPacker { if (File.Exists("..\\Completed\\" + GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".rar") || File.Exists("..\\Completed\\" + GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".part1.rar")) { - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); Directory.SetCurrentDirectory(".."); Directory.Delete("Temp", true); continue; @@ -803,7 +962,7 @@ namespace SuperSteamPacker if (Compress.ExitCode!=0) { - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("FAIL", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("FAIL", "SSP")); Directory.SetCurrentDirectory(".."); DirectoryInfo directoryInfo = new DirectoryInfo("Completed"); foreach (FileInfo fileToDelete in directoryInfo.GetFiles(GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".*")) @@ -823,46 +982,99 @@ namespace SuperSteamPacker } Directory.SetCurrentDirectory(".."); Directory.Delete("Temp", true); - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("WRITINGINFO", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("WRITINGINFO", "SSP")); using (StreamWriter RINfo = new StreamWriter("Completed\\[CS.RIN.RU Info] " + GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".txt")) { GameName = GameName.Replace("_", " "); GameName = GameName.Replace(".", " "); - RINfo.WriteLine("[url=][color=white][b]" + GameName + " [Branch: " + workarray[2] + "] (Clean Steam Files)[/b][/color][/url]"); - RINfo.WriteLine("[size=85][color=white][b]Version:[/b] [i]" + BuildTime + " [Build " + BuildNo + "][/i][/color][/size]"); - RINfo.WriteLine(); - RINfo.WriteLine("[spoiler=\"[color=white]Depots & Manifests[/color]\"][code=text]"); + RINfo.Write("[url=][color=white][b]" + GameName + " [" + OS + "] [Branch: " + workarray[2] + "] (Clean Steam Files)[/b][/color][/url]\n"+"[size=85][color=white][b]Version:[/b] [i]" + BuildTime + " [Build " + BuildNo + "][/i][/color][/size]\n\n"+"[spoiler=\"[color=white]Depots & Manifests[/color]\"][code=text]"); foreach (string item in DepotManifestList) { - RINfo.WriteLine(item); + if (item != DepotManifestList.Last()) + { + RINfo.Write(item + "\n"); + } + else + { + RINfo.Write(item); + } } - RINfo.WriteLine("[/code][/spoiler][color=white][b]Uploaded version:[/b] [i]" + BuildTime + " [Build " + BuildNo + "][/i][/color]"); + RINfo.Write("[/code][/spoiler][color=white][b]Uploaded version:[/b] [i]" + BuildTime + " [Build " + BuildNo + "][/i][/color]"); } if (settingsini.Read("uploadcrewmode", "SSP") == "1") { + var storedata = await GetSteamStoreDataAsync(AppID); + string GameDescription = "A description could not be found for this game. Please add this manually."; + string BonusWebsite = null; + + try + { + JToken ShortDescription = storedata[AppID]["data"]["short_description"]; + GameDescription = ShortDescription.Value(); + } + catch + { + } + try + { + JToken Website = storedata[AppID]["data"]["website"]; + BonusWebsite = Website.Value(); + BonusWebsite = BonusWebsite.Replace("http", "https"); + } + catch + { + } + using (StreamWriter UCInfo = new StreamWriter("Completed\\[Upload Crew Info] " + GameName+".Build."+BuildNo+"."+OS+"."+workarray[2]+".txt")) { GameName = GameName.Replace("_", " "); GameName = GameName.Replace(".", " "); - UCInfo.WriteLine("[color=red][b]" + GameName + "[/b][/color]"); - UCInfo.WriteLine("[list][color=yellow][b]Mirror 1[/b][/color]"); - UCInfo.WriteLine("[url=][color=cyan]" + GameName + "[/color] | [color=#FF8000]#UploadDate#[/color][/url] (#Filehost#) [i]< uploaded by #YourUsernameHere# / pw: cs.rin.ru >[/i][/list]"); - UCInfo.WriteLine(); - UCInfo.WriteLine(); - UCInfo.WriteLine(); - UCInfo.WriteLine("[color=red][b]" + GameName + "[/b][/color]"); - UCInfo.WriteLine("[spoiler=\"[color=white]Depots & Manifests[/color]\"][code=text]"); + + string username = settingsini.Read("rinruusername", "SSP"); + string filehost = settingsini.Read("filehost", "SSP"); + + if (!(BonusWebsite == null)) + { + UCInfo.Write("[img]https://steamcdn-a.akamaihd.net/steam/apps/"+AppID+"/header.jpg[/img]\n\n\n[color=red][b]About This Game:[/b][/color]\r\n[img]https://steamstore-a.akamaihd.net/public/images/v6/maincol_gradient_rule.png[/img]\n" + GameDescription + "\n\n[color=red][b]Official Site:[/b][/color]\r\n[url]https://store.steampowered.com/app/"+AppID+"/[/url]\r\n[url]" + BonusWebsite + "[/url]\n\n[color=red][b]Download Links:[/b][/color]\n[list][color=yellow][b]Mirror 1[/b][/color]\n[url=][color=cyan]" + GameName + "[/color] | [color=#FF8000]#UploadDate#[/color][/url] (" + filehost + ") [i]< uploaded by " + username +" / pw: cs.rin.ru >[/i][/list]\n\n\n[color=red][b]" + GameName + "[/b][/color]\n[spoiler=\"[color=white]Depots & Manifests[/color]\"][code=text]"); + } + else + { + UCInfo.Write("[img]https://steamcdn-a.akamaihd.net/steam/apps/"+AppID+"/header.jpg[/img]\n\n\n[color=red][b]About This Game:[/b][/color]\r\n[img]https://steamstore-a.akamaihd.net/public/images/v6/maincol_gradient_rule.png[/img]\n" + GameDescription + "\n\n[color=red][b]Official Site:[/b][/color]\r\n[url]https://store.steampowered.com/app/"+AppID+"/[/url]\n\n[color=red][b]Download Links:[/b][/color]\n[list][color=yellow][b]Mirror 1[/b][/color]\n[url=][color=cyan]" + GameName + "[/color] | [color=#FF8000]#UploadDate#[/color][/url] (" + filehost + ") [i]< uploaded by " + username +" / pw: cs.rin.ru >[/i][/list]\n\n\n[color=red][b]" + GameName + "[/b][/color]\n[spoiler=\"[color=white]Depots & Manifests[/color]\"][code=text]"); + } + foreach (string item in DepotManifestList) { - UCInfo.WriteLine(item); + if (item != DepotManifestList.Last()) + { + UCInfo.Write(item + "\n"); + } + else + { + UCInfo.Write(item); + } } - UCInfo.WriteLine("[/code][/spoiler][color=white][b]Uploaded version:[/b] [i]" + BuildTime + " [Build " + BuildNo + "][/i][/color]"); + UCInfo.Write("[/code][/spoiler][color=white][b]Uploaded version:[/b] [i]" + BuildTime + " [Build " + BuildNo + "][/i][/color]"); } } - QueueBox.Items[int.Parse(file.Substring(5, 1))] = QueueBox.Items[int.Parse(file.Substring(5, 1))].ToString().Replace(languageini.Read("WRITINGINFO", "SSP"), languageini.Read("COMPLETE", "SSP")); + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("WRITINGINFO", "SSP"), languageini.Read("COMPLETE", "SSP")); + if (File.Exists("Currentjob.JOB")) + { + File.Delete("Currentjob.JOB"); + } + + try + { + int gamesshared = int.Parse(settingsini.Read("gamesshared", "SSP")); + gamesshared++; + settingsini.Write("gamesshared", gamesshared.ToString(), "SSP"); + } + catch + { + settingsini.Write("gamesshared", "0", "SSP"); + } } if (Directory.Exists("Jobs")) { @@ -880,6 +1092,7 @@ namespace SuperSteamPacker PasswordTextBox.Enabled = true; UsernameTextBox.Enabled = true; } + StartBtn.Enabled = true; } private void MoreSettingsBtn_Click(object sender, EventArgs e) @@ -922,7 +1135,6 @@ namespace SuperSteamPacker BranchNameTxtBox.Enabled=false; BranchPasswordCB.Enabled=false; BranchPasswordTxtBox.Enabled=false; - } private void csrinbtn_Click(object sender, EventArgs e) @@ -957,7 +1169,6 @@ namespace SuperSteamPacker MoveDownBtn.Enabled = true; } } - } private void MoveUpBtn_Click(object sender, EventArgs e) @@ -1049,15 +1260,7 @@ namespace SuperSteamPacker os = "Linux x64"; break; } - if (os == "Mac") - { - QueueBox.Items.Add("AppID: " + workarray[1] + "\t" + "Branch: " + workarray[2] + "\t\t" + "OS: " + os + "\t\t" + languageini.Read("Status", "SSP") + ":" + " " + languageini.Read("READY", "SSP")); - } - else - { - QueueBox.Items.Add("AppID: " + workarray[1] + "\t" + "Branch: " + workarray[2] + "\t" + "OS: " + os + "\t" + languageini.Read("Status", "SSP") + ":" + " " + languageini.Read("READY", "SSP")); - } - + QueueBox.Items.Add("AppID: " + workarray[1] + "\t" + "Branch: " + workarray[2] + "\t" + "OS: " + os + "\t" + languageini.Read("Status", "SSP") + ":" + " " + languageini.Read("READY", "SSP")); DelBtn.Enabled = true; ClearQueueBtn.Enabled = true; StartBtn.Enabled = true; @@ -1093,6 +1296,25 @@ namespace SuperSteamPacker } } + static async Task GetSteamStoreDataAsync(string appId) + { + try + { + using (var httpClient = new HttpClient()) + { + var url = $"https://store.steampowered.com/api/appdetails?appids={appId}"; + var response = await httpClient.GetAsync(url); + response.EnsureSuccessStatusCode(); + var jsonString = await response.Content.ReadAsStringAsync(); + return JObject.Parse(jsonString); + } + } + catch + { + return null; + } + } + private void BranchPasswordCB_CheckedChanged(object sender, EventArgs e) { if (BranchPasswordCB.Checked) @@ -1119,5 +1341,661 @@ namespace SuperSteamPacker BranchPasswordCB.Checked = false; } } + + static string EncryptString(string plainText, string key) + { + using (Aes aesAlg = Aes.Create()) + { + aesAlg.Key = Encoding.UTF8.GetBytes(key); + aesAlg.GenerateIV(); + + ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV); + + using (MemoryStream msEncrypt = new MemoryStream()) + { + using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write)) + { + using (StreamWriter swEncrypt = new StreamWriter(csEncrypt)) + { + swEncrypt.Write(plainText); + } + } + string completed = Convert.ToBase64String(aesAlg.IV) + ":" + Convert.ToBase64String(msEncrypt.ToArray()); + byte[] textbytes = Encoding.UTF8.GetBytes(completed); + byte[] keybytes = Encoding.UTF8.GetBytes(key); + byte[] xorbytes = new byte[textbytes.Length]; + for (int i = 0; i < textbytes.Length; i++) + { + xorbytes[i] = (byte)(textbytes[i] ^ keybytes[i % keybytes.Length]); + } + return Convert.ToBase64String(xorbytes); + } + } + } + + static string DecryptString(string cipherText, string key) + { + byte[] xorbytes = Convert.FromBase64String(cipherText); + byte[] keybytes = Encoding.UTF8.GetBytes(key); + + byte[] decryptedBytes = new byte[xorbytes.Length]; + for (int i = 0; i < xorbytes.Length; i++) + { + decryptedBytes[i] = (byte)(xorbytes[i] ^ keybytes[i % keybytes.Length]); + } + + //return Encoding.UTF8.GetString(decryptedBytes); + //string[] parts = cipherText.Split(':'); + + string[] parts = Encoding.UTF8.GetString(decryptedBytes).Split(':'); + byte[] iv = Convert.FromBase64String(parts[0]); + byte[] cipherBytes = Convert.FromBase64String(parts[1]); + + using (Aes aesAlg = Aes.Create()) + { + aesAlg.Key = Encoding.UTF8.GetBytes(key); + aesAlg.IV = iv; + + ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV); + + using (MemoryStream msDecrypt = new MemoryStream(cipherBytes)) + { + using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) + { + using (StreamReader srDecrypt = new StreamReader(csDecrypt)) + { + return srDecrypt.ReadToEnd(); + } + } + } + } + } + + static string GenerateKey(int length) + { + string asciiCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+[]{}|,.<>?"; + StringBuilder sb = new StringBuilder(length); + Random random = new Random(); + for (int i = 0; i < length; i++) + { + int index = random.Next(asciiCharacters.Length); + char randomChar = asciiCharacters[index]; + sb.Append(randomChar); + } + return sb.ToString(); + } + + private void TextBox_TextChanged(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(MODAppIDTxtBx.Text) && !string.IsNullOrEmpty(MODWorkshopItemIDBx.Text)) + { + MODAddBtn.Enabled = true; + } + else + { + MODAddBtn.Enabled = false; + } + } + + + private void MODAddBtn_Click(object sender, EventArgs e) + { + var settingsini = new Ini("Settings.ini"); + var globalini = new Ini("Language\\Global.ini"); + string readlanguage = settingsini.Read("language", "SSP"); + var languageini = new Ini("Language\\" + readlanguage + ".ini"); + + int appidvalue; + long workshopitemvalue; + bool validappid = int.TryParse(MODAppIDTxtBx.Text, out appidvalue); + bool validworkshopid = long.TryParse(MODWorkshopItemIDBx.Text, out workshopitemvalue); + if (validappid == true && validworkshopid == true) + { + bool itemexistsinlist = false; + string newentry = MODAppIDTxtBx.Text + "|" + MODWorkshopItemIDBx.Text; + foreach (string item in MODTmpLstBx.Items) + { + if (newentry == item) + { + itemexistsinlist = true; + break; + } + } + if (!itemexistsinlist) // item is NOT in list. + { + MODTmpLstBx.Items.Add(newentry); + MODQueueBox.Items.Add("AppID: " + MODAppIDTxtBx.Text + "\t\t Workshop Item ID: " + MODWorkshopItemIDBx.Text + "\t\t" + languageini.Read("Status", "SSP") + ":" + " " + languageini.Read("READY", "SSP")); + MODClearQueueBtn.Enabled = true; + MODExportQueueButton.Enabled = true; + MODWorkshopItemIDBx.Text = ""; + MODAppIDTxtBx.Text = ""; + } + else + { + //Item is in the list. + } + MODStartBtn.Enabled = true; + } + else + { + //Item is NOT valid. Something failed the integer check. + MessageBox.Show(languageini.Read("MODWarning1", "SSP"), languageini.Read("Warning", "SSP"), MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + } + + private void MODQueueBox_SelectedIndexChanged(object sender, EventArgs e) + { + MODDelBtn.Enabled=true; + if (MODQueueBox.Items.Count != 1) + { + if (MODQueueBox.SelectedIndex == 0) + { + MODMoveUpBtn.Enabled = false; + } + else + { + MODMoveUpBtn.Enabled = true; + } + if (MODQueueBox.SelectedIndex == MODQueueBox.Items.Count-1) + { + MODMoveDownBtn.Enabled = false; + } + else + { + MODMoveDownBtn.Enabled = true; + } + } + } + + private void MODDelBtn_Click(object sender, EventArgs e) + { + var settingsini = new Ini("Settings.ini"); + var globalini = new Ini("Language\\Global.ini"); + string readlanguage = settingsini.Read("language", "SSP"); + var languageini = new Ini("Language\\" + readlanguage + ".ini"); + + if (MODQueueBox.SelectedItem != null) + { + int selectedindex = MODQueueBox.SelectedIndex; + MODTmpLstBx.SelectedIndex = MODQueueBox.SelectedIndex; + MODQueueBox.Items.Remove(MODQueueBox.SelectedItem); + MODTmpLstBx.Items.Remove(MODTmpLstBx.SelectedItem); + + if (MODQueueBox.Items.Count == 0) + { + MODMoveUpBtn.Enabled = false; + MODMoveDownBtn.Enabled = false; + MODDelBtn.Enabled = false; + MODStartBtn.Enabled = false; + MODClearQueueBtn.Enabled = false; + MODExportQueueButton.Enabled = false; + } + else + { + try + { + MODQueueBox.SelectedIndex = selectedindex; + } + catch + { + MODQueueBox.SelectedIndex = selectedindex-1; + } + } + } + else + { + MessageBox.Show(languageini.Read("pleaseselectwarning", "SSP"), languageini.Read("information", "SSP"), MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + + private void MODClearQueueBtn_Click(object sender, EventArgs e) + { + MODMoveUpBtn.Enabled = false; + MODMoveDownBtn.Enabled = false; + MODClearQueueBtn.Enabled = false; + MODStartBtn.Enabled = false; + MODDelBtn.Enabled = false; + MODExportQueueButton.Enabled = false; + MODTmpLstBx.Items.Clear(); + MODQueueBox.Items.Clear(); + } + + private void MODExportQueueButton_Click(object sender, EventArgs e) + { + var settingsini = new Ini("Settings.ini"); + var globalini = new Ini("Language\\Global.ini"); + string readlanguage = settingsini.Read("language", "SSP"); + var languageini = new Ini("Language\\" + readlanguage + ".ini"); + + SaveFileDialog savequeue = new SaveFileDialog(); + savequeue.Title = languageini.Read("Export", "SSP"); + savequeue.Filter = "SSP Workshop Queue Files (*.SSWQ)|*.SSWQ"; + DialogResult result = savequeue.ShowDialog(); + if (result == DialogResult.OK) + { + string filePath = savequeue.FileName; + using (StreamWriter writer = new StreamWriter(filePath)) + { + foreach (var item in MODTmpLstBx.Items) + { + writer.WriteLine(item.ToString()); + } + } + } + } + + private void MODImportQueueButton_Click(object sender, EventArgs e) + { + var settingsini = new Ini("Settings.ini"); + var globalini = new Ini("Language\\Global.ini"); + string readlanguage = settingsini.Read("language", "SSP"); + var languageini = new Ini("Language\\" + readlanguage + ".ini"); + + OpenFileDialog openqueue = new OpenFileDialog(); + openqueue.Title = languageini.Read("Import", "SSP"); + openqueue.Filter = "SSP Workshop Queue Files (*.SSWQ)|*.SSWQ|Text Files (*.txt)|*.TXT"; + DialogResult result = openqueue.ShowDialog(); + if (result == DialogResult.OK) + { + MODQueueBox.Items.Clear(); + MODTmpLstBx.Items.Clear(); + + string[] lines = File.ReadAllLines(openqueue.FileName); + + foreach (string line in lines) + { + + + if (line.Contains("|")) + { + string[] workarray = line.Split('|'); + MODTmpLstBx.Items.Add(line); + MODQueueBox.Items.Add("AppID: " + workarray[0] + "\t\t Workshop Item ID: " + workarray[1] + "\t\t" + languageini.Read("Status", "SSP") + ":" + " " + languageini.Read("READY", "SSP")); + } + else if (line.Contains("workshop_download_item")) + { + string[] workarray = line.Split(' '); + MODTmpLstBx.Items.Add(workarray[1]+"|"+workarray[2]); + MODQueueBox.Items.Add("AppID: " + workarray[1] + "\t\t Workshop Item ID: " + workarray[2] + "\t\t" + languageini.Read("Status", "SSP") + ":" + " " + languageini.Read("READY", "SSP")); + } + MODDelBtn.Enabled = true; + MODClearQueueBtn.Enabled = true; + MODStartBtn.Enabled = true; + MODExportQueueButton.Enabled = true; + } + } + } + + private void MODStartBtn_Click(object sender, EventArgs e) + { + MODStartBtn.Enabled = false; + if (Directory.Exists("Jobs")) + { + Directory.Delete("Jobs", true); + } + if (Directory.Exists("Temp")) + { + Directory.Delete("Temp", true); + } + if (Directory.Exists("SteamCMD\\steamapps")) + { + Directory.Delete("SteamCMD\\steamapps", true); + } + if (Directory.Exists("SteamCMD\\depotcache")) + { + Directory.Delete("SteamCMD\\depotcache", true); + } + if (Directory.Exists("SteamCMD\\logs")) + { + Directory.Delete("SteamCMD\\logs", true); + } + if (File.Exists("CurrentJob.JOB")) + { + File.Delete("CurrentJob.JOB"); + } + var settingsini = new Ini("Settings.ini"); + var globalini = new Ini("Language\\Global.ini"); + string readlanguage = settingsini.Read("language", "SSP"); + var languageini = new Ini("Language\\" + readlanguage + ".ini"); + + bool anonymousloginconfirmation = false; + + if (String.IsNullOrEmpty(UsernameTextBox.Text)) + { + UsernameTextBox.Text = "anonymous"; + } + if (UsernameTextBox.Text == "anonymous") + { + DialogResult result = MessageBox.Show(languageini.Read("anonymousconfirmation", "SSP"), languageini.Read("Warning", "SSP"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); + if (result == DialogResult.OK) + { + anonymousloginconfirmation = true; + } + } + if ((!String.IsNullOrEmpty(UsernameTextBox.Text) && !String.IsNullOrEmpty(PasswordTextBox.Text)) || anonymousloginconfirmation == true) + { + if (!File.Exists("SteamCMD\\steamcmd.exe")) + { + var client = new WebClient(); + client.DownloadFile("https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip", "download.tmp"); + ZipFile.ExtractToDirectory("download.tmp", "SteamCMD"); + File.Delete("download.tmp"); + + Process loadsteam1 = new Process(); + loadsteam1.StartInfo.FileName = "SteamCMD\\steamcmd.exe"; + loadsteam1.StartInfo.Arguments = "+quit"; + loadsteam1.Start(); + loadsteam1.WaitForExit(); + } + for (int i = 0; i < MODTmpLstBx.Items.Count; i++) + { + if (File.Exists("CurrentJob.JOB")) + { + File.Delete("CurrentJob.JOB"); + } + MODTmpLstBx.SelectedIndex = i; + string[] workarray = MODTmpLstBx.SelectedItem.ToString().Split('|'); + string AppID = workarray[0]; + string WorkshopID = workarray[1]; + + if (File.Exists("Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z") || File.Exists("Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z.001")) + { + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("READY", "SSP"), languageini.Read("SKIPPED", "SSP")); + continue; + } + if (File.Exists("Completed\\Workshop_" + AppID + "_" + WorkshopID + ".rar") || File.Exists("Completed\\Workshop_" + AppID + "_" + WorkshopID + ".part1.rar")) + { + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("READY", "SSP"), languageini.Read("SKIPPED", "SSP")); + continue; + } + + if (i == 0) + { + File.WriteAllText("Currentjob.JOB", "login " + UsernameTextBox.Text + " " + PasswordTextBox.Text + "\nworkshop_download_item " + workarray[0] + " " + workarray[1] + " validate\nquit"); + } + else + { + File.WriteAllText("Currentjob.JOB", "login " + UsernameTextBox.Text + "\nworkshop_download_item " + workarray[0] + " " + workarray[1] + " validate\nquit"); + } + MODTmpLstBx.SelectedIndex = i; + try + { + string[] filesearly = Directory.GetFiles("Completed\\Workshop_", AppID + "_" + WorkshopID + ".*"); + + if (filesearly.Length != 0) + { + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("READY", "SSP"), languageini.Read("SKIPPED", "SSP")); + continue; + } + } + catch + { + } + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("READY", "SSP"), languageini.Read("DOWNLOADING", "SSP")); + if (Directory.Exists("Logs")) + { + Directory.Delete("Logs", true); + } + Directory.SetCurrentDirectory("SteamCMD"); + Process SteamCMD = new Process(); + SteamCMD.StartInfo.FileName = "steamcmd.exe"; + SteamCMD.StartInfo.Arguments = "+runscript" + " ..\\" + "CurrentJob.JOB"; + SteamCMD.Start(); + SteamCMD.WaitForExit(); + + bool failedsubscription = false; + bool ratelimited = false; + bool invalidpassword = false; + bool steamguardcodefail = false; + + if (File.Exists("Logs\\content_log.txt")) + { + if (File.ReadAllText("Logs\\content_log.txt").Contains("No subscription")) + { + failedsubscription = true; + } + } + if (File.Exists("Logs\\connection_log.txt")) + { + if (File.ReadAllText("Logs\\connection_log.txt").Contains("Rate Limit Exceeded")) + { + ratelimited = true; + //MessageBox.Show("RL"); + } + if (File.ReadAllText("Logs\\connection_log.txt").Contains("Invalid Password")) + { + invalidpassword = true; + //MessageBox.Show("IP"); + } + } + if (!File.Exists("Logs\\sitelicense_steamcmd.txt") && !File.Exists("Logs\\compat_log.txt")) + { + steamguardcodefail = true; + //MessageBox.Show("SGCF"); + } + + if (SteamCMD.ExitCode != 0 || ratelimited || failedsubscription || steamguardcodefail || invalidpassword) + { + if (Directory.Exists("steamapps")) + { + Directory.Delete("steamapps", true); + } + if (Directory.Exists("depotcache")) + { + Directory.Delete("depotcache", true); + } + + if (ratelimited && !failedsubscription) + { + DialogResult ratelimitask = MessageBox.Show(languageini.Read("RateLimitWarn", "SSP"), languageini.Read("WARNING", "SSP"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); + if (ratelimitask == DialogResult.OK) + { + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("RATELIMITED", "SSP")); + Directory.SetCurrentDirectory(".."); + continue; + } + else + { + for (int ratelimititems = i; ratelimititems < MODQueueBox.Items.Count; ratelimititems++) + { + MODQueueBox.Items[ratelimititems] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("RATELIMITED", "SSP")); + MODQueueBox.Items[ratelimititems] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("READY", "SSP"), languageini.Read("RATELIMITED", "SSP")); + } + if (Directory.Exists("steamapps")) + { + Directory.Delete("steamapps", true); + } + if (Directory.Exists("depotcache")) + { + Directory.Delete("depotcache", true); + } + if (Directory.Exists("logs")) + { + Directory.Delete("logs", true); + } + Directory.SetCurrentDirectory(".."); + if (Directory.Exists("Temp")) + { + Directory.Delete("Temp", true); + } + if (Directory.Exists("Jobs")) + { + Directory.Delete("Jobs", true); + } + break; + } + } + else + { + if (steamguardcodefail || invalidpassword) + { + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("BADLOGIN", "SSP")); + } + else + { + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("FAIL", "SSP")); + } + Directory.SetCurrentDirectory(".."); + continue; + } + } + Directory.SetCurrentDirectory(".."); + if (!Directory.Exists("Temp")) + { + Directory.CreateDirectory("Temp"); + } + DirectoryInfo depotcachedir = new DirectoryInfo("SteamCMD\\depotcache"); + try + { + depotcachedir.MoveTo("Temp\\depotcache"); + } + catch + + { + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("FAIL", "SSP")); + continue; + } + DirectoryInfo steamappsdir = new DirectoryInfo("SteamCMD\\steamapps"); + steamappsdir.MoveTo("Temp\\steamapps"); + if (File.Exists("Temp\\steamapps\\libraryfolders.vdf")) + { + File.Delete("Temp\\steamapps\\libraryfolders.vdf"); + } + if (Directory.Exists("Temp\\steamapps\\downloading")) + { + Directory.Delete("Temp\\steamapps\\downloading", true); + } + if (Directory.Exists("Temp\\steamapps\\temp")) + { + Directory.Delete("Temp\\steamapps\\temp", true); + } + if (Directory.Exists("Temp\\steamapps\\workshop\\downloads")) + { + Directory.Delete("Temp\\steamapps\\workshop\\downloads", true); + } + if (Directory.Exists("Temp\\steamapps\\workshop\\temp")) + { + Directory.Delete("Temp\\steamapps\\workshop\\temp", true); + } + if (!Directory.Exists("Completed")) + { + Directory.CreateDirectory("Completed"); + } + + Directory.SetCurrentDirectory("Temp"); + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("DOWNLOADING", "SSP"), languageini.Read("COMPRESSING", "SSP")); + + Process Compress = new Process(); + if (settingsini.Read("compressor", "SSP") == "7z") + { + Compress.StartInfo.FileName = "..\\Compressor\\7z.exe"; + if (String.IsNullOrEmpty(settingsini.Read("customcompressoption", "SSP"))) + { + if (File.Exists("..\\Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z") || File.Exists("..\\Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z.001")) + { + MODQueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); + Directory.SetCurrentDirectory(".."); + Directory.Delete("Temp", true); + continue; + } + else + { + Compress.StartInfo.Arguments = "a -mx9 -sdel -pcs.rin.ru -v5g ..\\Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z *"; + } + + } + else + { + if (File.Exists("..\\Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z") || File.Exists("..\\Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z.001")) + { + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); + Directory.SetCurrentDirectory(".."); + Directory.Delete("Temp", true); + continue; + } + else + { + Compress.StartInfo.Arguments = "a " + settingsini.Read("customcompressoption", "SSP") + " ..\\Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z *"; + } + } + } + else + { + Compress.StartInfo.FileName = "..\\Compressor\\rar.exe"; + if (String.IsNullOrEmpty(settingsini.Read("customcompressoption", "SSP"))) + { + if (File.Exists("..\\Completed\\" + AppID + "_" + WorkshopID + ".rar") || File.Exists("..\\Completed\\" + AppID + "_" + WorkshopID + ".part1.rar")) + { + MODQueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); + Directory.SetCurrentDirectory(".."); + Directory.Delete("Temp", true); + continue; + } + else + { + Compress.StartInfo.Arguments = "a -df -hpcs.rin.ru -htc -v5000000k -r ..\\Completed\\" + AppID + "_" + WorkshopID + ".rar *"; + } + } + else + { + if (File.Exists("..\\Completed\\" + AppID + "_" + WorkshopID + ".rar") || File.Exists("..\\Completed\\" + AppID + "_" + WorkshopID + ".part1.rar")) + { + QueueBox.Items[i] = QueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("SKIPPED", "SSP")); + Directory.SetCurrentDirectory(".."); + Directory.Delete("Temp", true); + continue; + } + else + { + Compress.StartInfo.Arguments = "a " + settingsini.Read("customcompressoption", "SSP") + " ..\\Completed\\" + AppID + "_" + WorkshopID + ".rar *"; + } + } + } + Compress.Start(); + Compress.WaitForExit(); + if (Compress.ExitCode != 0) + { + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("FAIL", "SSP")); + Directory.SetCurrentDirectory(".."); + DirectoryInfo directoryInfo = new DirectoryInfo("Completed"); + foreach (FileInfo fileToDelete in directoryInfo.GetFiles("Workshop_" + AppID + "_" + WorkshopID + ".*")) + { + fileToDelete.Delete(); + } + continue; + } + if (!File.Exists("..\\Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z.002") && settingsini.Read("compressor", "SSP") == "7z") + { + if (File.Exists("..\\Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z.001")) + { + File.Move("..\\Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z.001", "..\\Completed\\Workshop_" + AppID + "_" + WorkshopID + ".7z."); + } + } + Directory.SetCurrentDirectory(".."); + Directory.Delete("Temp", true); + MODQueueBox.Items[i] = MODQueueBox.Items[i].ToString().Replace(languageini.Read("COMPRESSING", "SSP"), languageini.Read("COMPLETE", "SSP")); + if (File.Exists("Currentjob.JOB")) + { + File.Delete("Currentjob.JOB"); + } + } + if (Directory.Exists("Jobs")) + { + Directory.Delete("Jobs", true); + } + MessageBox.Show(languageini.Read("jobscomplete", "SSP") + "\n\n" + languageini.Read("jobscomplete2", "SSP"), languageini.Read("information", "SSP"), MessageBoxButtons.OK, MessageBoxIcon.Information); + MODStartBtn.Enabled = false; + MODAddBtn.Enabled = false; + MODDelBtn.Enabled = false; + MODClearQueueBtn.PerformClick(); + } + else + { + MessageBox.Show(languageini.Read("loginwarning", "SSP"), languageini.Read("Warning", "SSP"), MessageBoxButtons.OK, MessageBoxIcon.Warning); + PasswordTextBox.Enabled = true; + UsernameTextBox.Enabled = true; + } + MODStartBtn.Enabled = true; + } } } \ No newline at end of file diff --git a/MoreSettingsForm.Designer.cs b/MoreSettingsForm.Designer.cs index 0dff8d4..72a2a7a 100644 --- a/MoreSettingsForm.Designer.cs +++ b/MoreSettingsForm.Designer.cs @@ -37,11 +37,17 @@ this.CustomCompressorOptionsCheckBox = new System.Windows.Forms.CheckBox(); this.CustomCompressorOptionsTextBox = new System.Windows.Forms.TextBox(); this.UploadCrewModeCB = new System.Windows.Forms.CheckBox(); + this.DarkModeCB = new System.Windows.Forms.CheckBox(); + this.DepotSyncBtn = new System.Windows.Forms.Button(); + this.rinruUsernameTextbox = new System.Windows.Forms.TextBox(); + this.rinruUsernameLabel = new System.Windows.Forms.Label(); + this.filehostLabel = new System.Windows.Forms.Label(); + this.filehostTextbox = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // DelSavedLoginBtn // - this.DelSavedLoginBtn.Location = new System.Drawing.Point(12, 184); + this.DelSavedLoginBtn.Location = new System.Drawing.Point(12, 298); this.DelSavedLoginBtn.Name = "DelSavedLoginBtn"; this.DelSavedLoginBtn.Size = new System.Drawing.Size(280, 23); this.DelSavedLoginBtn.TabIndex = 0; @@ -69,6 +75,7 @@ // // LangChoiceBox // + this.LangChoiceBox.BackColor = System.Drawing.SystemColors.Window; this.LangChoiceBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.LangChoiceBox.FormattingEnabled = true; this.LangChoiceBox.Location = new System.Drawing.Point(13, 30); @@ -121,12 +128,73 @@ this.UploadCrewModeCB.UseVisualStyleBackColor = true; this.UploadCrewModeCB.CheckedChanged += new System.EventHandler(this.UploadCrewModeCB_CheckedChanged); // + // DarkModeCB + // + this.DarkModeCB.AutoSize = true; + this.DarkModeCB.Location = new System.Drawing.Point(12, 276); + this.DarkModeCB.Name = "DarkModeCB"; + this.DarkModeCB.Size = new System.Drawing.Size(125, 17); + this.DarkModeCB.TabIndex = 8; + this.DarkModeCB.Text = "DarkModeCheckBox"; + this.DarkModeCB.UseVisualStyleBackColor = true; + this.DarkModeCB.CheckedChanged += new System.EventHandler(this.DarkModeCB_CheckedChanged); + // + // DepotSyncBtn + // + this.DepotSyncBtn.Location = new System.Drawing.Point(12, 328); + this.DepotSyncBtn.Name = "DepotSyncBtn"; + this.DepotSyncBtn.Size = new System.Drawing.Size(280, 23); + this.DepotSyncBtn.TabIndex = 9; + this.DepotSyncBtn.Text = "DepotSyncBtn"; + this.DepotSyncBtn.UseVisualStyleBackColor = true; + this.DepotSyncBtn.Click += new System.EventHandler(this.DepotSyncBtn_Click); + // + // rinruUsernameTextbox + // + this.rinruUsernameTextbox.Location = new System.Drawing.Point(12, 201); + this.rinruUsernameTextbox.Name = "rinruUsernameTextbox"; + this.rinruUsernameTextbox.Size = new System.Drawing.Size(280, 20); + this.rinruUsernameTextbox.TabIndex = 10; + this.rinruUsernameTextbox.TextChanged += new System.EventHandler(this.rinruUsernameTextbox_TextChanged); + // + // rinruUsernameLabel + // + this.rinruUsernameLabel.AutoSize = true; + this.rinruUsernameLabel.Location = new System.Drawing.Point(12, 183); + this.rinruUsernameLabel.Name = "rinruUsernameLabel"; + this.rinruUsernameLabel.Size = new System.Drawing.Size(101, 13); + this.rinruUsernameLabel.TabIndex = 11; + this.rinruUsernameLabel.Text = "rinruUsernameLabel"; + // + // filehostLabel + // + this.filehostLabel.AutoSize = true; + this.filehostLabel.Location = new System.Drawing.Point(12, 228); + this.filehostLabel.Name = "filehostLabel"; + this.filehostLabel.Size = new System.Drawing.Size(66, 13); + this.filehostLabel.TabIndex = 12; + this.filehostLabel.Text = "filehostLabel"; + // + // filehostTextbox + // + this.filehostTextbox.Location = new System.Drawing.Point(12, 246); + this.filehostTextbox.Name = "filehostTextbox"; + this.filehostTextbox.Size = new System.Drawing.Size(281, 20); + this.filehostTextbox.TabIndex = 13; + this.filehostTextbox.TextChanged += new System.EventHandler(this.filehostTextbox_TextChanged); + // // MoreSettingsForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Window; - this.ClientSize = new System.Drawing.Size(303, 217); + this.ClientSize = new System.Drawing.Size(303, 356); + this.Controls.Add(this.filehostTextbox); + this.Controls.Add(this.filehostLabel); + this.Controls.Add(this.rinruUsernameLabel); + this.Controls.Add(this.rinruUsernameTextbox); + this.Controls.Add(this.DepotSyncBtn); + this.Controls.Add(this.DarkModeCB); this.Controls.Add(this.UploadCrewModeCB); this.Controls.Add(this.CustomCompressorOptionsTextBox); this.Controls.Add(this.CustomCompressorOptionsCheckBox); @@ -155,5 +223,11 @@ private System.Windows.Forms.CheckBox CustomCompressorOptionsCheckBox; private System.Windows.Forms.TextBox CustomCompressorOptionsTextBox; private System.Windows.Forms.CheckBox UploadCrewModeCB; + private System.Windows.Forms.CheckBox DarkModeCB; + private System.Windows.Forms.Button DepotSyncBtn; + private System.Windows.Forms.TextBox rinruUsernameTextbox; + private System.Windows.Forms.Label rinruUsernameLabel; + private System.Windows.Forms.Label filehostLabel; + private System.Windows.Forms.TextBox filehostTextbox; } } \ No newline at end of file diff --git a/MoreSettingsForm.cs b/MoreSettingsForm.cs index 42048dc..a3a7f8a 100644 --- a/MoreSettingsForm.cs +++ b/MoreSettingsForm.cs @@ -1,6 +1,8 @@ using System; using System.IO; using System.Windows.Forms; +using System.Drawing; +using System.Net; namespace SuperSteamPacker { @@ -48,9 +50,21 @@ namespace SuperSteamPacker CustomCompressorOptionsCheckBox.Checked = true; } + rinruUsernameTextbox.Enabled = false; + filehostTextbox.Enabled = false; + if (settingsini.Read("uploadcrewmode", "SSP") == "1") { UploadCrewModeCB.Checked = true; + rinruUsernameTextbox.Enabled = true; + rinruUsernameTextbox.Text = settingsini.Read("rinruusername", "SSP"); + filehostTextbox.Enabled = true; + filehostTextbox.Text = settingsini.Read("filehost", "SSP"); + } + + if (settingsini.Read("darkmode", "SSP") == "1") + { + DarkModeCB.Checked = true; } string readlanguage = settingsini.Read("language", "SSP"); @@ -62,6 +76,38 @@ namespace SuperSteamPacker CustomCompressorOptionsCheckBox.Text = languageini.Read("customcompressoroptions", "SSP"); DelSavedLoginBtn.Text = languageini.Read("DeleteSavedLogin", "SSP"); UploadCrewModeCB.Text = languageini.Read("UploadCrewMode", "SSP"); + DarkModeCB.Text = languageini.Read("DarkMode", "SSP"); + DepotSyncBtn.Text = languageini.Read("SyncDepots", "SSP"); + rinruUsernameLabel.Text = languageini.Read("rinruUsername", "SSP"); + filehostLabel.Text = languageini.Read("filehost", "SSP"); + + if (settingsini.Read("darkmode", "SSP") == "1") + { + LangLabel.ForeColor = Color.White; + CompressorLabel.ForeColor = Color.White; + CompressorLabel.ForeColor = Color.White; + CustomCompressorOptionsCheckBox.ForeColor = Color.White; + UploadCrewModeCB.ForeColor = Color.White; + DarkModeCB.ForeColor = Color.White; + BackColor = Color.FromArgb(35,35,40); + DelSavedLoginBtn.BackColor = Color.FromArgb(60,60,69); + DelSavedLoginBtn.ForeColor = Color.White; + DelSavedLoginBtn.FlatStyle = FlatStyle.Flat; + CustomCompressorOptionsTextBox.ForeColor = Color.White; + CustomCompressorOptionsTextBox.BackColor = Color.FromArgb(60, 60, 69); + CustomCompressorOptionsTextBox.BorderStyle = BorderStyle.FixedSingle; + DepotSyncBtn.BackColor = Color.FromArgb(60, 60, 69); + DepotSyncBtn.ForeColor = Color.White; + DepotSyncBtn.FlatStyle = FlatStyle.Flat; + rinruUsernameLabel.ForeColor = Color.White; + rinruUsernameTextbox.ForeColor = Color.White; + rinruUsernameTextbox.BackColor = Color.FromArgb(60, 60, 69); + rinruUsernameTextbox.BorderStyle = BorderStyle.FixedSingle; + filehostLabel.ForeColor = Color.White; + filehostTextbox.ForeColor = Color.White; + filehostTextbox.BackColor = Color.FromArgb(60, 60, 69); + filehostTextbox.BorderStyle = BorderStyle.FixedSingle; + } } private void DelSavedLoginBtn_Click(object sender, EventArgs e) @@ -135,11 +181,62 @@ namespace SuperSteamPacker { case true: settingsini.Write("uploadcrewmode", "1", "SSP"); + rinruUsernameTextbox.Enabled = true; + filehostTextbox.Enabled = true; break; case false: settingsini.Write("uploadcrewmode", "0", "SSP"); + rinruUsernameTextbox.Enabled = false; + rinruUsernameTextbox.Text = null; + filehostTextbox.Enabled = false; + filehostTextbox.Text = null; break; } } + + private void DarkModeCB_CheckedChanged(object sender, EventArgs e) + { + var settingsini = new Ini("Settings.ini"); + switch (DarkModeCB.Checked) + { + case true: + settingsini.Write("darkmode", "1", "SSP"); + break; + case false: + settingsini.Write("darkmode", "0", "SSP"); + break; + } + } + + private void DepotSyncBtn_Click(object sender, EventArgs e) + { + var settingsini = new Ini("Settings.ini"); + var globalini = new Ini("Language\\Global.ini"); + string readlanguage = settingsini.Read("language", "SSP"); + var languageini = new Ini("Language\\" + readlanguage + ".ini"); + try + { + var client = new WebClient(); + client.DownloadFile("https://raw.githubusercontent.com/Masquerade64/SteamDepotNames/main/depots.ini", "depots.ini"); + MessageBox.Show(languageini.Read("depotsyncsuccess", "SSP"), languageini.Read("Information", "SSP"), MessageBoxButtons.OK, MessageBoxIcon.Information); + DepotSyncBtn.Enabled = false; + } + catch + { + MessageBox.Show(languageini.Read("unabletoaccessgithub", "SSP"), languageini.Read("Warning", "SSP"), MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + } + + private void rinruUsernameTextbox_TextChanged(object sender, EventArgs e) + { + var settingsini = new Ini("Settings.ini"); + settingsini.Write("rinruusername", rinruUsernameTextbox.Text, "SSP"); + } + + private void filehostTextbox_TextChanged(object sender, EventArgs e) + { + var settingsini = new Ini("Settings.ini"); + settingsini.Write("filehost", filehostTextbox.Text, "SSP"); + } } } diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index b7a5739..884fefc 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -100,6 +100,16 @@ namespace SuperSteamPacker.Properties { } } + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] LANGDATA_Spanish { + get { + object obj = ResourceManager.GetObject("LANGDATA_Spanish", resourceCulture); + return ((byte[])(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -110,6 +120,16 @@ namespace SuperSteamPacker.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap logo_dark { + get { + object obj = ResourceManager.GetObject("logo_dark", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 0edd2b9..c87b38a 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -127,9 +127,15 @@ ..\Resources\Global.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\Spanish.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\logo_dark.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\rar.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/Resources/7z.exe b/Resources/7z.exe index a739ca0..2a943e6 100644 Binary files a/Resources/7z.exe and b/Resources/7z.exe differ diff --git a/Resources/English.bin b/Resources/English.bin index 14fe7e2..d0eca92 100644 --- a/Resources/English.bin +++ b/Resources/English.bin @@ -57,4 +57,12 @@ GameManageGroup=Game Manager BranchManagerGroup=Branch Manager BranchLabel=Branch to download: BranchPassword=Branch password? (Enter below) -UploadCrewMode=Upload Crew Mode \ No newline at end of file +UploadCrewMode=Upload Crew Mode +DarkMode=Dark Mode +SyncDepots=Sync Depot Names +unabletoaccessgithub=Unable to access Github. +depotsyncsuccess=Successfully synced Depot names. +MODWarning1=AppID or Workshop Item ID is invalid. +MODManager=Workshop Content Manager +rinruUsername=Enter your cs.rin.ru username: +filehost=Enter where you upload files: \ No newline at end of file diff --git a/Resources/French.bin b/Resources/French.bin index 3273ca2..3626b0a 100644 --- a/Resources/French.bin +++ b/Resources/French.bin @@ -1,7 +1,7 @@ # # Super Steam Packer Language File # French by Titeuf -# +# V1.2 [SSP] by=par @@ -25,7 +25,7 @@ FAIL=ECHOUE RATELIMITED=TAUX LIMITE BADLOGIN=MAUVAISE CONNEXION SKIPPED=Ignore [EXISTE] -GETINFO=OBTENIR DES INFORMATIONS +GETINFO=OBTENTION DES INFORMATIONS UNABLETOREACH=IMPOSSIBLE D'ATTEINDRE L'API WRITINGINFO=WRITING INFO Start=Commencer diff --git a/Resources/Global.bin b/Resources/Global.bin index cebcac4..8e6158f 100644 --- a/Resources/Global.bin +++ b/Resources/Global.bin @@ -1,6 +1,6 @@ [SSP] Title=Super Steam Packer -Version=v1.1.2 +Version=v1.3 Author=Masquerade Forum=CS.RIN.RU Github=Masquerade's Github \ No newline at end of file diff --git a/Resources/Settings.bin b/Resources/Settings.bin index a476dda..1da5811 100644 --- a/Resources/Settings.bin +++ b/Resources/Settings.bin @@ -3,4 +3,5 @@ language=English loginwarningaccepted=false userdatasaved=false compressor=7z -uploadcrewmode=0 \ No newline at end of file +uploadcrewmode=0 +gamesshared=0 \ No newline at end of file diff --git a/Resources/Spanish-no-accents.ini b/Resources/Spanish-no-accents.ini new file mode 100644 index 0000000..94ec479 --- /dev/null +++ b/Resources/Spanish-no-accents.ini @@ -0,0 +1,60 @@ +# +# Super Steam Packer Language File +# + +[SSP] +by=por +queue=Lista +add=Adherir a la lista +del=Eliminar de la lista +ClearQueue=Borrar lista +AppIDInfoMsg1=El AppID del juego que deseas descargar. +AppIDInfoMsg2=Se puede encontrar aqui: +OSMsg1=Version del sistema operativo para descargar. +OSMsg2=Tenga en cuenta que no todos los juegos estan disponibles en mas de un sistema operativo. Consulte SteamDB para obtener informacion especifica del juego +AppIDWarning=Introduzca un ID de aplicacion valido. +Warning=Advertencia! +Status=Estado +Forum=Foro +READY=LISTO +DOWNLOADING=DESCARGANDO +COMPRESSING=COMPRIMIENDO +COMPLETE=COMPLETADO +FAIL=FALLO +RATELIMITED=TARIFA LIMITADA +BADLOGIN=INICIO INCORRECTO DE SESION +SKIPPED=OMITIDO [EXISTE] +GETINFO=OBTENIENDO INFORMACION +UNABLETOREACH=NO SE PUEDE LLEGAR A LA API +WRITINGINFO=ESCRIBIENDO INFORMACION +Start=Comenzar +Username=Nombre de Usuario de Steam: +Password=Contraseña de Steam: +AlreadyAdded=Articulo ya agregado a la lista! +SaveLogin=Guardar detalles de inicio de sesion +LoginSaveWarning1=Al presionar Aceptar, comprende que este programa almacenara sus datos de inicio de sesion. +LoginSaveWarning2=Estos datos se almacenan localmente y no se envian a traves de Internet! +MoreSettings=Mas ajustes +Information=Informacion +pleaseselectwarning=Seleccione un elemento para eliminar. +Language=Idioma +Compressor=Compresor +customcompressoroptions=Usar opciones de compresion personalizadas: +DeleteSavedLogin=Eliminar datos de inicio de sesion guardados +jobscomplete=Todas las tareas completadas! +jobscomplete2=Presionando OK borrara la lista. +compressionwarning1=La configuracion predeterminada sera ideal para la mayoria de los usuarios. +compressionwarning2=Solo cambia esto si sabes lo que estas haciendo! +loginwarning=Ingrese datos de inicio de sesion validos. +anonymousconfirmation=Si continua, utilizara un inicio de sesion anonimo. ¡Esto reduce severamente lo que puedes descargar de Steam! +MoveUp=Mover elemento hacia arriba +MoveDown=Mover elemento hacia abajo +Import=Importar Lista +Export=Exportar Lista +RateLimitWarn=Tienes tarifa limitada, lo que significa que Steam te ha bloqueado el acceso. Elige continuar (no recomendado) o vuelve a intentarlo mas tarde. ¿Continuar? +QueueManageGroup=Administrador de listas +GameManageGroup=Administrador de Juegos +BranchManagerGroup=Administrador de Rama +BranchLabel=Rama para descargar: +BranchPassword=Contraseña de la Rama? (Ingrese abajo) +UploadCrewMode=Cargar modo tripulacion \ No newline at end of file diff --git a/Resources/Spanish.bin b/Resources/Spanish.bin new file mode 100644 index 0000000..f5f2d94 --- /dev/null +++ b/Resources/Spanish.bin @@ -0,0 +1,60 @@ +# +# Super Steam Packer Language File +# + +[SSP] +by=por +queue=Lista +add=Adherir a la lista +del=Eliminar de la lista +ClearQueue=Borrar lista +AppIDInfoMsg1=El AppID del juego que deseas descargar. +AppIDInfoMsg2=Se puede encontrar aqui: +OSMsg1=Version del sistema operativo para descargar. +OSMsg2=Tenga en cuenta que no todos los juegos estan disponibles en mas de un sistema operativo. Consulte SteamDB para obtener informacion especifica del juego +AppIDWarning=Introduzca un ID de aplicacion valido. +Warning=Advertencia! +Status=Estado +Forum=Foro +READY=LISTO +DOWNLOADING=DESCARGANDO +COMPRESSING=COMPRIMIENDO +COMPLETE=COMPLETADO +FAIL=FALLO +RATELIMITED=TARIFA LIMITADA +BADLOGIN=INICIO INCORRECTO DE SESION +SKIPPED=OMITIDO [EXISTE] +GETINFO=OBTENIENDO INFORMACION +UNABLETOREACH=NO SE PUEDE LLEGAR A LA API +WRITINGINFO=ESCRIBIENDO INFORMACION +Start=Comenzar +Username=Nombre de Usuario de Steam: +Password=Contrasena de Steam: +AlreadyAdded=Articulo ya agregado a la lista! +SaveLogin=Guardar detalles de inicio de sesion +LoginSaveWarning1=Al presionar Aceptar, comprende que este programa almacenara sus datos de inicio de sesion. +LoginSaveWarning2=Estos datos se almacenan localmente y no se envian a traves de Internet! +MoreSettings=Mas ajustes +Information=Informacion +pleaseselectwarning=Seleccione un elemento para eliminar. +Language=Idioma +Compressor=Compresor +customcompressoroptions=Usar opciones de compresion personalizadas: +DeleteSavedLogin=Eliminar datos de inicio de sesion guardados +jobscomplete=Todas las tareas completadas! +jobscomplete2=Presionando OK borrara la lista. +compressionwarning1=La configuracion predeterminada sera ideal para la mayoria de los usuarios. +compressionwarning2=Solo cambia esto si sabes lo que estas haciendo! +loginwarning=Ingrese datos de inicio de sesion validos. +anonymousconfirmation=Si continua, utilizara un inicio de sesion anonimo. ¡Esto reduce severamente lo que puedes descargar de Steam! +MoveUp=Mover elemento hacia arriba +MoveDown=Mover elemento hacia abajo +Import=Importar Lista +Export=Exportar Lista +RateLimitWarn=Tienes tarifa limitada, lo que significa que Steam te ha bloqueado el acceso. Elige continuar (no recomendado) o vuelve a intentarlo mas tarde. ¿Continuar? +QueueManageGroup=Administrador de listas +GameManageGroup=Administrador de Juegos +BranchManagerGroup=Administrador de Rama +BranchLabel=Rama para descargar: +BranchPassword=Contrasena de la Rama? +UploadCrewMode=Cargar modo tripulacion \ No newline at end of file diff --git a/Resources/Spanish.ini b/Resources/Spanish.ini new file mode 100644 index 0000000..3aade1f --- /dev/null +++ b/Resources/Spanish.ini @@ -0,0 +1,60 @@ +# +# Super Steam Packer Language File +# + +[SSP] +by=por +queue=Lista +add=Adherir a la lista +del=Eliminar de la lista +ClearQueue=Borrar lista +AppIDInfoMsg1=El AppID del juego que deseas descargar. +AppIDInfoMsg2=Se puede encontrar aquí: +OSMsg1=Versión del sistema operativo para descargar. +OSMsg2=Tenga en cuenta que no todos los juegos están disponibles en más de un sistema operativo. Consulte SteamDB para obtener información específica del juego +AppIDWarning=Introduzca un ID de aplicación válido. +Warning=Advertencia! +Status=Estado +Forum=Foro +READY=LISTO +DOWNLOADING=DESCARGANDO +COMPRESSING=COMPRIMIENDO +COMPLETE=COMPLETADO +FAIL=FALLO +RATELIMITED=TARIFA LIMITADA +BADLOGIN=INICIO INCORRECTO DE SESIóN +SKIPPED=OMITIDO [EXISTE] +GETINFO=OBTENIENDO INFORMACIóN +UNABLETOREACH=NO SE PUEDE LLEGAR A LA API +WRITINGINFO=ESCRIBIENDO INFORMACIóN +Start=Comenzar +Username=Nombre de Usuario de Steam: +Password=Contraseña de Steam: +AlreadyAdded=Artículo ya agregado a la lista! +SaveLogin=Guardar detalles de inicio de sesión +LoginSaveWarning1=Al presionar Aceptar, comprende que este programa almacenará sus datos de inicio de sesión. +LoginSaveWarning2=Estos datos se almacenan localmente y no se envían a través de Internet! +MoreSettings=Más ajustes +Information=Información +pleaseselectwarning=Seleccione un elemento para eliminar. +Language=Idioma +Compressor=Compresor +customcompressoroptions=Usar opciones de compresión personalizadas: +DeleteSavedLogin=Eliminar datos de inicio de sesión guardados +jobscomplete=Todas las tareas completadas! +jobscomplete2=Presionando OK borrará la lista. +compressionwarning1=La configuración predeterminada será la ideal para la mayoría de los usuarios. +compressionwarning2=Solo cambia esto si sabes lo que estás haciendo! +loginwarning=Ingrese datos de inicio de sesión válidos. +anonymousconfirmation=Si continúa, utilizará un inicio de sesión anónimo. Esto reduce severamente lo que puedes descargar de Steam! +MoveUp=Mover elemento hacia arriba +MoveDown=Mover elemento hacia abajo +Import=Importar Lista +Export=Exportar Lista +RateLimitWarn=Tienes tarifa limitada, lo que significa que Steam te ha bloqueado el acceso. Elige continuar (no recomendado) o vuelve a intentarlo más tarde. Continuar? +QueueManageGroup=Administrador de listas +GameManageGroup=Administrador de Juegos +BranchManagerGroup=Administrador de Rama +BranchLabel=Rama para descargar: +BranchPassword=Contraseña de la Rama? (Ingrese abajo) +UploadCrewMode=Cargar modo tripulación \ No newline at end of file diff --git a/Resources/rar.exe b/Resources/rar.exe index ed063c5..6207567 100644 Binary files a/Resources/rar.exe and b/Resources/rar.exe differ diff --git a/SuperSteamPacker.csproj b/SuperSteamPacker.csproj index 23144f2..14337b8 100644 --- a/SuperSteamPacker.csproj +++ b/SuperSteamPacker.csproj @@ -138,6 +138,7 @@ + @@ -147,6 +148,7 @@ + diff --git a/logo_dark.png b/logo_dark.png new file mode 100644 index 0000000..f0deeac Binary files /dev/null and b/logo_dark.png differ