From fe8f2c707eaf3006f9026894d0bf590930eaf26e Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 3 Sep 2015 18:53:30 -0700 Subject: [PATCH] Add Public Works Project cheat button Easy for anyone to implement the other codes from leaftools. --- Subforms/Garden.Designer.cs | 28 ++++++++++++++++++++++++++++ Subforms/Garden.cs | 15 +++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/Subforms/Garden.Designer.cs b/Subforms/Garden.Designer.cs index 54fac24..fd47b52 100644 --- a/Subforms/Garden.Designer.cs +++ b/Subforms/Garden.Designer.cs @@ -230,6 +230,8 @@ private void InitializeComponent() this.TB_Flag1 = new System.Windows.Forms.TextBox(); this.TB_Flag2 = new System.Windows.Forms.TextBox(); this.L_CurrentItem = new System.Windows.Forms.Label(); + this.tabPage6 = new System.Windows.Forms.TabPage(); + this.B_PWP = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.PB_JPEG0)).BeginInit(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); @@ -309,6 +311,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.PB_JPEG1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PB_JPEG2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PB_JPEG3)).BeginInit(); + this.tabPage6.SuspendLayout(); this.SuspendLayout(); // // PB_JPEG0 @@ -388,6 +391,7 @@ private void InitializeComponent() this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Controls.Add(this.tabPage4); this.tabControl1.Controls.Add(this.tabPage5); + this.tabControl1.Controls.Add(this.tabPage6); this.tabControl1.Location = new System.Drawing.Point(12, 12); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; @@ -2667,6 +2671,27 @@ private void InitializeComponent() this.L_CurrentItem.TabIndex = 15; this.L_CurrentItem.Text = "Current Item:"; // + // tabPage6 + // + this.tabPage6.Controls.Add(this.B_PWP); + this.tabPage6.Location = new System.Drawing.Point(4, 22); + this.tabPage6.Name = "tabPage6"; + this.tabPage6.Padding = new System.Windows.Forms.Padding(3); + this.tabPage6.Size = new System.Drawing.Size(652, 560); + this.tabPage6.TabIndex = 5; + this.tabPage6.Text = "Cheats"; + this.tabPage6.UseVisualStyleBackColor = true; + // + // B_PWP + // + this.B_PWP.Location = new System.Drawing.Point(6, 6); + this.B_PWP.Name = "B_PWP"; + this.B_PWP.Size = new System.Drawing.Size(119, 47); + this.B_PWP.TabIndex = 0; + this.B_PWP.Text = "Unlock All Public Works Projects"; + this.B_PWP.UseVisualStyleBackColor = true; + this.B_PWP.Click += new System.EventHandler(this.B_PWP_Click); + // // Garden // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2775,6 +2800,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.PB_JPEG1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.PB_JPEG2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.PB_JPEG3)).EndInit(); + this.tabPage6.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -2983,5 +3009,7 @@ private void InitializeComponent() private System.Windows.Forms.NumericUpDown NUD_Hours; private System.Windows.Forms.NumericUpDown NUD_Minutes; private System.Windows.Forms.NumericUpDown NUD_Seconds; + private System.Windows.Forms.TabPage tabPage6; + private System.Windows.Forms.Button B_PWP; } } \ No newline at end of file diff --git a/Subforms/Garden.cs b/Subforms/Garden.cs index 1d5490f..7fd2ef9 100644 --- a/Subforms/Garden.cs +++ b/Subforms/Garden.cs @@ -1077,5 +1077,20 @@ private void changeTownName(object sender, EventArgs e) Save.TownName = TB_TownName.Text; reloadOverviewLabel(); } + + private void B_PWP_Click(object sender, EventArgs e) + { + byte[] PWPUnlock = + { + 0xFF, 0xFF, 0xFF, 0xFF, // 0 + 0xFF, 0xFF, 0xFF, 0xFF, // 1 + 0xFF, 0xFF, 0xFF, 0xFF, // 2 + 0xFF, 0xFF, 0xFF, 0xFF, // 3 + 0xFF, 0xFF, 0xFF, 0xFF, // 4 + 0x2A, 0xD6, 0xE4, 0x58, // 5 + }; + Array.Copy(PWPUnlock, 0, Save.Data, 0x4D9C8 + 0x80, PWPUnlock.Length); + Util.Alert("All Public Works Projects unlocked!"); + } } }