aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2016-07-23 16:20:23 -0700
committerwilliam341 <[email protected]>2016-07-23 16:20:23 -0700
commit1a95b347a23fbbabab10ee984b2621089dc93135 (patch)
tree84b767063bc369d6979ffee22a59a3d152494be3
parent4e630d1ab9f7c241bfd659b3a7cbe4c1f65dc021 (diff)
downloadshiftos-c--1a95b347a23fbbabab10ee984b2621089dc93135.tar.gz
shiftos-c--1a95b347a23fbbabab10ee984b2621089dc93135.tar.bz2
shiftos-c--1a95b347a23fbbabab10ee984b2621089dc93135.zip
Re Implemented Cheats
-rw-r--r--source/WindowsFormsApplication1/Apps/Cheats.Designer.cs125
-rw-r--r--source/WindowsFormsApplication1/Apps/Cheats.cs67
-rw-r--r--source/WindowsFormsApplication1/Apps/Cheats.resx120
-rw-r--r--source/WindowsFormsApplication1/Apps/Terminal.cs16
-rw-r--r--source/WindowsFormsApplication1/ShiftOS.csproj9
5 files changed, 337 insertions, 0 deletions
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
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ 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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ 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)
diff --git a/source/WindowsFormsApplication1/ShiftOS.csproj b/source/WindowsFormsApplication1/ShiftOS.csproj
index 9b65eaf..f20a632 100644
--- a/source/WindowsFormsApplication1/ShiftOS.csproj
+++ b/source/WindowsFormsApplication1/ShiftOS.csproj
@@ -103,6 +103,12 @@
<Compile Include="Apps\Artpad.Designer.cs">
<DependentUpon>Artpad.cs</DependentUpon>
</Compile>
+ <Compile Include="Apps\Cheats.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Apps\Cheats.Designer.cs">
+ <DependentUpon>Cheats.cs</DependentUpon>
+ </Compile>
<Compile Include="Controls\SyntaxHighlighter.cs">
<SubType>Component</SubType>
</Compile>
@@ -416,6 +422,9 @@
<EmbeddedResource Include="Apps\BitnoteWallet.resx">
<DependentUpon>BitnoteWallet.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="Apps\Cheats.resx">
+ <DependentUpon>Cheats.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Dialogs\Color_Picker.resx">
<DependentUpon>Color_Picker.cs</DependentUpon>
</EmbeddedResource>