Add Game Start Time Editor For Scarlet and Violet (#3861)

This commit is contained in:
Jonathan Herbert 2023-04-16 16:16:34 -04:00 committed by GitHub
parent fa9a809751
commit 8fca2075d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 3 deletions

View file

@ -107,6 +107,8 @@ namespace PKHeX.WinForms
this.L_Y = new System.Windows.Forms.Label();
this.L_Z = new System.Windows.Forms.Label();
this.L_X = new System.Windows.Forms.Label();
this.L_Started = new System.Windows.Forms.Label();
this.CAL_AdventureStartDate = new System.Windows.Forms.DateTimePicker();
this.TC_Editor.SuspendLayout();
this.Tab_Overview.SuspendLayout();
this.Tab_MiscValues.SuspendLayout();
@ -626,6 +628,8 @@ namespace PKHeX.WinForms
//
// Tab_Overview
//
this.Tab_Overview.Controls.Add(this.L_Started);
this.Tab_Overview.Controls.Add(this.CAL_AdventureStartDate);
this.Tab_Overview.Controls.Add(this.MT_Seconds);
this.Tab_Overview.Controls.Add(this.MT_LP);
this.Tab_Overview.Controls.Add(this.MT_Hours);
@ -865,6 +869,28 @@ namespace PKHeX.WinForms
this.L_X.Text = "X Coordinate:";
this.L_X.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// L_Started
//
this.L_Started.Location = new System.Drawing.Point(19, 199);
this.L_Started.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.L_Started.Name = "L_Started";
this.L_Started.Size = new System.Drawing.Size(93, 23);
this.L_Started.TabIndex = 73;
this.L_Started.Text = "Game Started:";
this.L_Started.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// CAL_AdventureStartDate
//
this.CAL_AdventureStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.CAL_AdventureStartDate.Location = new System.Drawing.Point(112, 197);
this.CAL_AdventureStartDate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.CAL_AdventureStartDate.MaxDate = new System.DateTime(2050, 12, 31, 0, 0, 0, 0);
this.CAL_AdventureStartDate.MinDate = new System.DateTime(1932, 1, 1, 0, 0, 0, 0);
this.CAL_AdventureStartDate.Name = "CAL_AdventureStartDate";
this.CAL_AdventureStartDate.Size = new System.Drawing.Size(115, 23);
this.CAL_AdventureStartDate.TabIndex = 72;
this.CAL_AdventureStartDate.Value = new System.DateTime(2000, 1, 1, 0, 0, 0, 0);
//
// SAV_Trainer9
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@ -974,5 +1000,7 @@ namespace PKHeX.WinForms
private System.Windows.Forms.Button B_CollectAllStakes;
private System.Windows.Forms.Button B_UnlockTMRecipes;
private System.Windows.Forms.Button B_UnlockBikeUpgrades;
private System.Windows.Forms.Label L_Started;
private System.Windows.Forms.DateTimePicker CAL_AdventureStartDate;
}
}

View file

@ -79,6 +79,8 @@ public partial class SAV_Trainer9 : Form
MT_Hours.Text = SAV.PlayedHours.ToString();
MT_Minutes.Text = SAV.PlayedMinutes.ToString();
MT_Seconds.Text = SAV.PlayedSeconds.ToString();
CAL_AdventureStartDate.Value = SAV.EnrollmentDate.Timestamp;
}
private void Save()
@ -106,9 +108,11 @@ public partial class SAV_Trainer9 : Form
// Save PlayTime
SAV.PlayedHours = ushort.Parse(MT_Hours.Text);
SAV.PlayedMinutes = ushort.Parse(MT_Minutes.Text)%60;
SAV.PlayedSeconds = ushort.Parse(MT_Seconds.Text)%60;
}
SAV.PlayedMinutes = ushort.Parse(MT_Minutes.Text) % 60;
SAV.PlayedSeconds = ushort.Parse(MT_Seconds.Text) % 60;
SAV.EnrollmentDate.Timestamp = CAL_AdventureStartDate.Value;
}
private void ClickOT(object sender, MouseEventArgs e)
{