aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/Apps/Cheats.cs
diff options
context:
space:
mode:
authorMichael VanOverbeek <[email protected]>2016-07-20 06:43:10 -0700
committerGitHub <[email protected]>2016-07-20 06:43:10 -0700
commit4fe0de40aa9e3dc82de40d447331c39fab5f4c4c (patch)
tree9cde5fe3d96d2118330ecbcbb5eaa0d4de1fa4d8 /source/WindowsFormsApplication1/Apps/Cheats.cs
parent75516ee42dfb89cbe60cb3d1f0121381bc39317f (diff)
parent6cc2ae2259967a09db4143ac8c6b2e2400ffe73a (diff)
downloadshiftos-c-_theultimatehacker-4fe0de40aa9e3dc82de40d447331c39fab5f4c4c.tar.gz
shiftos-c-_theultimatehacker-4fe0de40aa9e3dc82de40d447331c39fab5f4c4c.tar.bz2
shiftos-c-_theultimatehacker-4fe0de40aa9e3dc82de40d447331c39fab5f4c4c.zip
Merge pull request #7 from GabrielTK/master
Added "cheat" Command
Diffstat (limited to 'source/WindowsFormsApplication1/Apps/Cheats.cs')
-rw-r--r--source/WindowsFormsApplication1/Apps/Cheats.cs67
1 files changed, 67 insertions, 0 deletions
diff --git a/source/WindowsFormsApplication1/Apps/Cheats.cs b/source/WindowsFormsApplication1/Apps/Cheats.cs
new file mode 100644
index 0000000..9caaa7f
--- /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 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);
+ }
+
+
+ }
+}