diff --git a/source/WindowsFormsApplication1/Apps/Cheats.Designer.cs b/source/WindowsFormsApplication1/Apps/Cheats.Designer.cs new file mode 100644 index 0000000..90bbc89 --- /dev/null +++ b/source/WindowsFormsApplication1/Apps/Cheats.Designer.cs @@ -0,0 +1,139 @@ +namespace ShiftOS.Apps +{ + partial class Cheats + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.getAllUpgrades = new System.Windows.Forms.Button(); + this.progressDisplay = new System.Windows.Forms.ProgressBar(); + this.LogBox = new System.Windows.Forms.TextBox(); + this.AddMoney = new System.Windows.Forms.Button(); + this.Online = new System.Windows.Forms.Button(); + this.AddMoneyQty = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // getAllUpgrades + // + this.getAllUpgrades.Location = new System.Drawing.Point(30, 37); + this.getAllUpgrades.Name = "getAllUpgrades"; + this.getAllUpgrades.Size = new System.Drawing.Size(147, 23); + this.getAllUpgrades.TabIndex = 0; + this.getAllUpgrades.Text = "Get All Upgrades"; + this.getAllUpgrades.UseVisualStyleBackColor = true; + this.getAllUpgrades.Click += new System.EventHandler(this.getAllUpgrades_Click); + // + // progressDisplay + // + this.progressDisplay.Enabled = false; + this.progressDisplay.Location = new System.Drawing.Point(12, 351); + this.progressDisplay.Name = "progressDisplay"; + this.progressDisplay.Size = new System.Drawing.Size(492, 23); + this.progressDisplay.Step = 1; + this.progressDisplay.TabIndex = 1; + // + // LogBox + // + this.LogBox.AcceptsReturn = true; + this.LogBox.Location = new System.Drawing.Point(12, 242); + this.LogBox.Multiline = true; + this.LogBox.Name = "LogBox"; + this.LogBox.ReadOnly = true; + this.LogBox.Size = new System.Drawing.Size(492, 103); + this.LogBox.TabIndex = 2; + this.LogBox.Text = " --- LOG ---"; + this.LogBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // AddMoney + // + this.AddMoney.Location = new System.Drawing.Point(170, 94); + this.AddMoney.Name = "AddMoney"; + this.AddMoney.Size = new System.Drawing.Size(67, 23); + this.AddMoney.TabIndex = 3; + this.AddMoney.Text = "Add"; + this.AddMoney.UseVisualStyleBackColor = true; + this.AddMoney.Click += new System.EventHandler(this.AddMoney_Click); + // + // Online + // + this.Online.Enabled = false; + this.Online.Location = new System.Drawing.Point(12, 213); + this.Online.Name = "Online"; + this.Online.Size = new System.Drawing.Size(152, 23); + this.Online.TabIndex = 4; + this.Online.Text = "Win Online"; + this.Online.UseVisualStyleBackColor = true; + this.Online.Click += new System.EventHandler(this.button2_Click); + // + // AddMoneyQty + // + this.AddMoneyQty.Location = new System.Drawing.Point(30, 96); + this.AddMoneyQty.Name = "AddMoneyQty"; + this.AddMoneyQty.Size = new System.Drawing.Size(134, 20); + this.AddMoneyQty.TabIndex = 5; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(38, 80); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(86, 13); + this.label1.TabIndex = 6; + this.label1.Text = "Add CodePoints:"; + // + // Cheats + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(524, 386); + this.Controls.Add(this.label1); + this.Controls.Add(this.AddMoneyQty); + this.Controls.Add(this.Online); + this.Controls.Add(this.AddMoney); + this.Controls.Add(this.LogBox); + this.Controls.Add(this.progressDisplay); + this.Controls.Add(this.getAllUpgrades); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Cheats"; + this.Text = "Cheats"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button getAllUpgrades; + private System.Windows.Forms.ProgressBar progressDisplay; + private System.Windows.Forms.TextBox LogBox; + private System.Windows.Forms.Button AddMoney; + private System.Windows.Forms.Button Online; + private System.Windows.Forms.TextBox AddMoneyQty; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/source/WindowsFormsApplication1/Apps/Cheats.cs b/source/WindowsFormsApplication1/Apps/Cheats.cs new file mode 100644 index 0000000..a11cf35 --- /dev/null +++ b/source/WindowsFormsApplication1/Apps/Cheats.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Online.Hacking; + +namespace ShiftOS.Apps +{ + public partial class Cheats : Form + { + public Cheats() + { + InitializeComponent(); + } + + public void SetOptionsEnabled(bool enabled) + { + foreach (Control control in this.Controls) + { + if (control != progressDisplay) + { + control.Enabled = enabled; + } + } + } + + private void getAllUpgrades_Click(object sender, EventArgs e) + { + progressDisplay.Enabled = true; + progressDisplay.Value = 0; + progressDisplay.Maximum = Shiftorium.Utilities.GetAvailable().Count; + foreach (var upg in Shiftorium.Utilities.GetAvailable()) + { + API.Upgrades[upg.id] = true; + progressDisplay.PerformStep(); + WriteLogLine("Installed upgrade \"" + upg.Name + "\"..."); + } + API.UpdateWindows(); + API.CurrentSession.SetupDesktop(); + progressDisplay.Enabled = false; + } + + public void WriteLogLine(string line) + { + LogBox.AppendText("\n"+line); + } + + private void AddMoney_Click(object sender, EventArgs e) + { + int qty; + bool isInt = Int32.TryParse(AddMoneyQty.Text, out qty); + if (!isInt) + { + MessageBox.Show("Not a Number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + ShiftOS.API.AddCodepoints(qty); + } + + private void button2_Click(object sender, EventArgs e) + { + //Package_Grabber.SendMessage(Matchmaker.SelectedServer.IPAddress, ); + } + } +} diff --git a/source/WindowsFormsApplication1/Apps/Cheats.resx b/source/WindowsFormsApplication1/Apps/Cheats.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/source/WindowsFormsApplication1/Apps/Cheats.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/source/WindowsFormsApplication1/Apps/Terminal.cs b/source/WindowsFormsApplication1/Apps/Terminal.cs index 944b333..8293283 100644 --- a/source/WindowsFormsApplication1/Apps/Terminal.cs +++ b/source/WindowsFormsApplication1/Apps/Terminal.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; + using System; using System.Collections.Generic; using System.ComponentModel; @@ -1632,6 +1633,20 @@ public void DoCommand() wrongcommand(); } break; + case "cheat": + if (API.DeveloperMode) + { + WriteLine("Opening..."); + + //Apps.Cheats chts = new Apps.Cheats(); + //chts.Show(); + API.CreateForm(new Apps.Cheats(), "Cheats", API.GetIcon("Terminal")); + } + else + { + wrongcommand(); + } + break; case "netgen": WriteLine("Starting netgen..."); API.CreateForm(new NetGen(), "Network Generator", API.GetIcon("Terminal")); diff --git a/source/WindowsFormsApplication1/ShiftOS.csproj b/source/WindowsFormsApplication1/ShiftOS.csproj index b835f29..066a32e 100644 --- a/source/WindowsFormsApplication1/ShiftOS.csproj +++ b/source/WindowsFormsApplication1/ShiftOS.csproj @@ -103,6 +103,12 @@ Artpad.cs + + Form + + + Cheats.cs + Component @@ -413,6 +419,9 @@ BitnoteWallet.cs + + Cheats.cs + Color_Picker.cs