From 061309ccd609dfea48b8b31348abcb4c6b2149e6 Mon Sep 17 00:00:00 2001 From: Kaphotics Date: Wed, 20 Jan 2016 21:25:33 -0800 Subject: [PATCH] AdventureStart -> LastSaved Misattributed --- Misc/SAV6.cs | 8 +++--- SAV/SAV_Trainer.Designer.cs | 50 ++++++++++++++++++------------------- SAV/SAV_Trainer.cs | 8 +++--- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Misc/SAV6.cs b/Misc/SAV6.cs index 3ab1931d3..0afa18cca 100644 --- a/Misc/SAV6.cs +++ b/Misc/SAV6.cs @@ -422,10 +422,6 @@ public int Vivillon } } - public uint AdventureStart { get { return BitConverter.ToUInt32(Data, PlayTime + 0x4); } set { BitConverter.GetBytes(value).CopyTo(Data, PlayTime + 0x4); } } - public int AdventureStartYear { get { return (int)(AdventureStart & 0xFFF); } set { AdventureStart = AdventureStart & 0xFFFFF000 | (uint)value; } } - public int AdventureStartMonth { get { return (int)(AdventureStart >> 12 & 0xF); } set { AdventureStart = AdventureStart & 0xFFFF0FFF | ((uint)value & 0xF) << 12; } } - public int AdventureStartDay { get { return (int)(AdventureStart >> 16 & 0xF); } set { AdventureStart = AdventureStart & 0xFFE0FFFF | ((uint)value & 0x1F) << 16; } } public int PlayedHours{ get { return BitConverter.ToUInt16(Data, PlayTime); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, PlayTime); } @@ -440,6 +436,10 @@ public int PlayedSeconds get { return Data[PlayTime + 3]; } set { Data[PlayTime + 3] = (byte)value; } } + public uint LastSaved { get { return BitConverter.ToUInt32(Data, PlayTime + 0x4); } set { BitConverter.GetBytes(value).CopyTo(Data, PlayTime + 0x4); } } + public int LastSavedYear { get { return (int)(LastSaved & 0xFFF); } set { LastSaved = LastSaved & 0xFFFFF000 | (uint)value; } } + public int LastSavedMonth { get { return (int)(LastSaved >> 12 & 0xF); } set { LastSaved = LastSaved & 0xFFFF0FFF | ((uint)value & 0xF) << 12; } } + public int LastSavedDay { get { return (int)(LastSaved >> 16 & 0xF); } set { LastSaved = LastSaved & 0xFFE0FFFF | ((uint)value & 0x1F) << 16; } } public uint getPSSStat(int index) { return BitConverter.ToUInt32(Data, PSSStats + 4*index); } public void setPSSStat(int index, uint value) { BitConverter.GetBytes(value).CopyTo(Data, PSSStats + 4*index); } diff --git a/SAV/SAV_Trainer.Designer.cs b/SAV/SAV_Trainer.Designer.cs index bb183bffe..ac3b0a3d2 100644 --- a/SAV/SAV_Trainer.Designer.cs +++ b/SAV/SAV_Trainer.Designer.cs @@ -68,6 +68,8 @@ private void InitializeComponent() this.TB_Saying2 = new System.Windows.Forms.TextBox(); this.TB_Saying1 = new System.Windows.Forms.TextBox(); this.GB_Overview = new System.Windows.Forms.GroupBox(); + this.L_LastSaved = new System.Windows.Forms.Label(); + this.CAL_LastSaved = new System.Windows.Forms.DateTimePicker(); this.L_Seconds = new System.Windows.Forms.Label(); this.L_Minutes = new System.Windows.Forms.Label(); this.MT_Seconds = new System.Windows.Forms.MaskedTextBox(); @@ -190,8 +192,6 @@ private void InitializeComponent() this.CB_Stats = new System.Windows.Forms.ComboBox(); this.L_Value = new System.Windows.Forms.Label(); this.MT_Stat = new System.Windows.Forms.MaskedTextBox(); - this.CAL_AdventureStart = new System.Windows.Forms.DateTimePicker(); - this.L_AdventureStart = new System.Windows.Forms.Label(); this.GB_Badges.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pb8)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pb6)).BeginInit(); @@ -651,8 +651,8 @@ private void InitializeComponent() // // GB_Overview // - this.GB_Overview.Controls.Add(this.L_AdventureStart); - this.GB_Overview.Controls.Add(this.CAL_AdventureStart); + this.GB_Overview.Controls.Add(this.L_LastSaved); + this.GB_Overview.Controls.Add(this.CAL_LastSaved); this.GB_Overview.Controls.Add(this.L_Seconds); this.GB_Overview.Controls.Add(this.L_Minutes); this.GB_Overview.Controls.Add(this.MT_Seconds); @@ -689,6 +689,25 @@ private void InitializeComponent() this.GB_Overview.TabStop = false; this.GB_Overview.Text = "Overview"; // + // L_LastSaved + // + this.L_LastSaved.Location = new System.Drawing.Point(12, 227); + this.L_LastSaved.Name = "L_LastSaved"; + this.L_LastSaved.Size = new System.Drawing.Size(80, 13); + this.L_LastSaved.TabIndex = 32; + this.L_LastSaved.Text = "Last Saved:"; + this.L_LastSaved.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // CAL_LastSaved + // + this.CAL_LastSaved.Format = System.Windows.Forms.DateTimePickerFormat.Short; + this.CAL_LastSaved.Location = new System.Drawing.Point(93, 225); + this.CAL_LastSaved.MaxDate = new System.DateTime(4095, 12, 31, 0, 0, 0, 0); + this.CAL_LastSaved.Name = "CAL_LastSaved"; + this.CAL_LastSaved.Size = new System.Drawing.Size(99, 20); + this.CAL_LastSaved.TabIndex = 31; + this.CAL_LastSaved.Value = new System.DateTime(2001, 1, 1, 0, 0, 0, 0); + // // L_Seconds // this.L_Seconds.AutoSize = true; @@ -2010,25 +2029,6 @@ private void InitializeComponent() this.MT_Stat.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.MT_Stat.TextChanged += new System.EventHandler(this.changeStatVal); // - // CAL_AdventureStart - // - this.CAL_AdventureStart.Format = System.Windows.Forms.DateTimePickerFormat.Short; - this.CAL_AdventureStart.Location = new System.Drawing.Point(93, 225); - this.CAL_AdventureStart.MaxDate = new System.DateTime(4095, 12, 31, 0, 0, 0, 0); - this.CAL_AdventureStart.Name = "CAL_AdventureStart"; - this.CAL_AdventureStart.Size = new System.Drawing.Size(99, 20); - this.CAL_AdventureStart.TabIndex = 31; - this.CAL_AdventureStart.Value = new System.DateTime(2001, 1, 1, 0, 0, 0, 0); - // - // L_AdventureStart - // - this.L_AdventureStart.Location = new System.Drawing.Point(12, 227); - this.L_AdventureStart.Name = "L_AdventureStart"; - this.L_AdventureStart.Size = new System.Drawing.Size(80, 13); - this.L_AdventureStart.TabIndex = 32; - this.L_AdventureStart.Text = "Started:"; - this.L_AdventureStart.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // // SAV_Trainer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2253,7 +2253,7 @@ private void InitializeComponent() private System.Windows.Forms.NumericUpDown NUD_X; private System.Windows.Forms.NumericUpDown NUD_Z; private System.Windows.Forms.NumericUpDown NUD_M; - private System.Windows.Forms.Label L_AdventureStart; - private System.Windows.Forms.DateTimePicker CAL_AdventureStart; + private System.Windows.Forms.Label L_LastSaved; + private System.Windows.Forms.DateTimePicker CAL_LastSaved; } } diff --git a/SAV/SAV_Trainer.cs b/SAV/SAV_Trainer.cs index cf1cdfbaf..befe43037 100644 --- a/SAV/SAV_Trainer.cs +++ b/SAV/SAV_Trainer.cs @@ -447,7 +447,7 @@ private void getTextBoxes() } CB_Vivillon.SelectedIndex = SAV.Vivillon; - CAL_AdventureStart.Value = new DateTime(SAV.AdventureStartYear, SAV.AdventureStartMonth, SAV.AdventureStartDay); + CAL_LastSaved.Value = new DateTime(SAV.LastSavedYear, SAV.LastSavedMonth, SAV.LastSavedDay); } private void save() { @@ -528,9 +528,9 @@ private void save() // Vivillon SAV.Vivillon = CB_Vivillon.SelectedIndex; - SAV.AdventureStartYear = CAL_AdventureStart.Value.Year; - SAV.AdventureStartMonth = CAL_AdventureStart.Value.Month; - SAV.AdventureStartDay = CAL_AdventureStart.Value.Day; + SAV.LastSavedYear = CAL_LastSaved.Value.Year; + SAV.LastSavedMonth = CAL_LastSaved.Value.Month; + SAV.LastSavedDay = CAL_LastSaved.Value.Day; } private void clickOT(object sender, MouseEventArgs e)