From 1a95b347a23fbbabab10ee984b2621089dc93135 Mon Sep 17 00:00:00 2001 From: william341 Date: Sat, 23 Jul 2016 16:20:23 -0700 Subject: Re Implemented Cheats --- .../Apps/Cheats.Designer.cs | 125 +++++++++++++++++++++ source/WindowsFormsApplication1/Apps/Cheats.cs | 67 +++++++++++ source/WindowsFormsApplication1/Apps/Cheats.resx | 120 ++++++++++++++++++++ source/WindowsFormsApplication1/Apps/Terminal.cs | 16 +++ 4 files changed, 328 insertions(+) create mode 100644 source/WindowsFormsApplication1/Apps/Cheats.Designer.cs create mode 100644 source/WindowsFormsApplication1/Apps/Cheats.cs create mode 100644 source/WindowsFormsApplication1/Apps/Cheats.resx (limited to 'source/WindowsFormsApplication1/Apps') diff --git a/source/WindowsFormsApplication1/Apps/Cheats.Designer.cs b/source/WindowsFormsApplication1/Apps/Cheats.Designer.cs new file mode 100644 index 0000000..70b5ea4 --- /dev/null +++ b/source/WindowsFormsApplication1/Apps/Cheats.Designer.cs @@ -0,0 +1,125 @@ +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 ShiftUI.Button(); + this.progressDisplay = new ShiftUI.ProgressBar(); + this.LogBox = new ShiftUI.TextBox(); + this.AddMoney = new ShiftUI.Button(); + this.AddMoneyQty = new ShiftUI.TextBox(); + this.label1 = new ShiftUI.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 = ShiftUI.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); + // + // 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 = ShiftUI.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(524, 386); + this.Widgets.Add(this.label1); + this.Widgets.Add(this.AddMoneyQty); + this.Widgets.Add(this.AddMoney); + this.Widgets.Add(this.LogBox); + this.Widgets.Add(this.progressDisplay); + this.Widgets.Add(this.getAllUpgrades); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Cheats"; + this.Text = "Cheats"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private ShiftUI.Button getAllUpgrades; + private ShiftUI.ProgressBar progressDisplay; + private ShiftUI.TextBox LogBox; + private ShiftUI.Button AddMoney; + private ShiftUI.TextBox AddMoneyQty; + private ShiftUI.Label label1; + } +} diff --git a/source/WindowsFormsApplication1/Apps/Cheats.cs b/source/WindowsFormsApplication1/Apps/Cheats.cs new file mode 100644 index 0000000..a37021b --- /dev/null +++ b/source/WindowsFormsApplication1/Apps/Cheats.cs @@ -0,0 +1,67 @@ +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 ShiftUI; +using ShiftOS.Online.Hacking; + +namespace ShiftOS.Apps +{ + public partial class Cheats : Form + { + public Cheats() + { + InitializeComponent(); + } + + public void SetOptionsEnabled(bool enabled) + { + foreach (Widget control in this.Widgets) + { + 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"); + return; + } + ShiftOS.API.AddCodepoints(qty); + } + + + } +} 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 93f6a13..f34bdc6 100644 --- a/source/WindowsFormsApplication1/Apps/Terminal.cs +++ b/source/WindowsFormsApplication1/Apps/Terminal.cs @@ -1508,6 +1508,22 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o } } + public void cmd_cheat(String[] args) + { + if (API.DeveloperMode) + { + WriteLine("Opening..."); + + //Apps.Cheats chts = new Apps.Cheats(); + //chts.Show(); + API.CreateForm(new Apps.Cheats(), "Cheats", API.GetIcon("Terminal")); + } + else + { + wrongcommand(); + } + } + public void cmd_debug(String[] args) { if (API.DeveloperMode == true) -- cgit v1.2.3