mirror of
https://github.com/seriocomedy/ShiftOS-C-.git
synced 2025-01-22 10:50:27 -05:00
Added cheat Command
This commit is contained in:
parent
75516ee42d
commit
8e40410b80
5 changed files with 353 additions and 0 deletions
139
source/WindowsFormsApplication1/Apps/Cheats.Designer.cs
generated
Normal file
139
source/WindowsFormsApplication1/Apps/Cheats.Designer.cs
generated
Normal file
|
@ -0,0 +1,139 @@
|
||||||
|
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 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;
|
||||||
|
}
|
||||||
|
}
|
70
source/WindowsFormsApplication1/Apps/Cheats.cs
Normal file
70
source/WindowsFormsApplication1/Apps/Cheats.cs
Normal file
|
@ -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, );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
source/WindowsFormsApplication1/Apps/Cheats.resx
Normal file
120
source/WindowsFormsApplication1/Apps/Cheats.resx
Normal file
|
@ -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>
|
|
@ -1,4 +1,5 @@
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
@ -1632,6 +1633,20 @@ public void DoCommand()
|
||||||
wrongcommand();
|
wrongcommand();
|
||||||
}
|
}
|
||||||
break;
|
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":
|
case "netgen":
|
||||||
WriteLine("Starting netgen...");
|
WriteLine("Starting netgen...");
|
||||||
API.CreateForm(new NetGen(), "Network Generator", API.GetIcon("Terminal"));
|
API.CreateForm(new NetGen(), "Network Generator", API.GetIcon("Terminal"));
|
||||||
|
|
|
@ -103,6 +103,12 @@
|
||||||
<Compile Include="Apps\Artpad.Designer.cs">
|
<Compile Include="Apps\Artpad.Designer.cs">
|
||||||
<DependentUpon>Artpad.cs</DependentUpon>
|
<DependentUpon>Artpad.cs</DependentUpon>
|
||||||
</Compile>
|
</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">
|
<Compile Include="Controls\SyntaxHighlighter.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
@ -413,6 +419,9 @@
|
||||||
<EmbeddedResource Include="Apps\BitnoteWallet.resx">
|
<EmbeddedResource Include="Apps\BitnoteWallet.resx">
|
||||||
<DependentUpon>BitnoteWallet.cs</DependentUpon>
|
<DependentUpon>BitnoteWallet.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Apps\Cheats.resx">
|
||||||
|
<DependentUpon>Cheats.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Dialogs\Color_Picker.resx">
|
<EmbeddedResource Include="Dialogs\Color_Picker.resx">
|
||||||
<DependentUpon>Color_Picker.cs</DependentUpon>
|
<DependentUpon>Color_Picker.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
Loading…
Reference in a new issue