mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-02 11:36:40 -05:00
Standardize MinDate/MaxDate values
3DS ranges from 1/1/2000 to 12/31/2050. After that, it rolls to 1/1/2050. Switch ranges from 1/1/2000 to 12/31/2060 as the settable range. However, date continues advancing normally after 12/31/2060. Allow the maximum Switch date range to be 12/31/2099 to match maximum Met date. This should be comfortably far in advance for anyone who is alive today.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -83,7 +83,7 @@ private void DisplayEntry(object sender, EventArgs e)
|
||||
uint vnd = ReadUInt32LittleEndian(data.AsSpan(offset + 0x1B0));
|
||||
uint vn = vnd & 0xFF;
|
||||
TB_VN.Text = vn.ToString("000");
|
||||
var s = new List<string> {$"Entry #{vn}"};
|
||||
var s = new List<string> { $"Entry #{vn}" };
|
||||
uint date = (vnd >> 14) & 0x1FFFF;
|
||||
uint month = (date >> 8) & 0xF;
|
||||
uint year = (date & 0xFF) + 2000;
|
||||
@@ -163,7 +163,7 @@ private void NUP_PartyIndex_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
editing = false;
|
||||
int index = LB_DataEntry.SelectedIndex;
|
||||
int offset = (index * StructureSize) + ((Convert.ToInt32(NUP_PartyIndex.Value)-1) * HallFame6Entity.SIZE);
|
||||
int offset = (index * StructureSize) + ((Convert.ToInt32(NUP_PartyIndex.Value) - 1) * HallFame6Entity.SIZE);
|
||||
|
||||
if (offset < 0)
|
||||
return;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -137,7 +137,7 @@ private void GetTextBoxes()
|
||||
var sit = SAV.Situation;
|
||||
NUD_M.Value = sit.M;
|
||||
// Sanity Check Map Coordinates
|
||||
if (!GB_Map.Enabled || sit.X%0.5 != 0 || sit.Z%0.5 != 0 || sit.Y%0.5 != 0)
|
||||
if (!GB_Map.Enabled || sit.X % 0.5 != 0 || sit.Z % 0.5 != 0 || sit.Y % 0.5 != 0)
|
||||
{
|
||||
GB_Map.Enabled = false;
|
||||
}
|
||||
@@ -250,8 +250,8 @@ private void Save()
|
||||
|
||||
// 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;
|
||||
|
||||
// Sprite
|
||||
if (SAV is IMultiplayerSprite ms)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -83,7 +83,7 @@ public SAV_FestivalPlaza(SaveFile sav)
|
||||
DateTime dt = SAV.Festa.FestaDate ?? new DateTime(2000, 1, 1);
|
||||
CAL_FestaStartDate.Value = CAL_FestaStartTime.Value = dt;
|
||||
|
||||
string[] res2 = { "Rank 4: missions","Rank 8: facility","Rank 10: fashion","Rank 20: rename","Rank 30: special menu","Rank 40: BGM","Rank 50: theme Glitz","Rank 60: theme Fairy","Rank 70: theme Tone","Rank 100: phrase","Current Rank" };
|
||||
string[] res2 = { "Rank 4: missions", "Rank 8: facility", "Rank 10: fashion", "Rank 20: rename", "Rank 30: special menu", "Rank 40: BGM", "Rank 50: theme Glitz", "Rank 60: theme Fairy", "Rank 70: theme Tone", "Rank 100: phrase", "Current Rank" };
|
||||
CLB_Reward.Items.Clear();
|
||||
CLB_Reward.Items.Add(res2[^1], (CheckState)RewardState[SAV.Festa.GetFestPrizeReceived(10)]); //add CurrentRank before const-rewards
|
||||
for (int i = 0; i < res2.Length - 1; i++)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -349,8 +349,8 @@ private void SaveTrainerInfo()
|
||||
|
||||
// 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.SecondsToStart = (uint)DateUtil.GetSecondsFrom2000(CAL_AdventureStartDate.Value, CAL_AdventureStartTime.Value);
|
||||
SAV.SecondsToFame = (uint)DateUtil.GetSecondsFrom2000(CAL_HoFDate.Value, CAL_HoFTime.Value);
|
||||
@@ -375,19 +375,19 @@ private void SavePokeFinder()
|
||||
private void SaveBattleTree()
|
||||
{
|
||||
var bt = SAV.BattleTree;
|
||||
bt.SetTreeStreak((int)NUD_RCStreak0.Value, 0, super:false, max:false);
|
||||
bt.SetTreeStreak((int)NUD_RCStreak1.Value, 1, super:false, max:false);
|
||||
bt.SetTreeStreak((int)NUD_RCStreak2.Value, 2, super:false, max:false);
|
||||
bt.SetTreeStreak((int)NUD_RMStreak0.Value, 0, super:false, max:true);
|
||||
bt.SetTreeStreak((int)NUD_RMStreak1.Value, 1, super:false, max:true);
|
||||
bt.SetTreeStreak((int)NUD_RMStreak2.Value, 2, super:false, max:true);
|
||||
bt.SetTreeStreak((int)NUD_RCStreak0.Value, 0, super: false, max: false);
|
||||
bt.SetTreeStreak((int)NUD_RCStreak1.Value, 1, super: false, max: false);
|
||||
bt.SetTreeStreak((int)NUD_RCStreak2.Value, 2, super: false, max: false);
|
||||
bt.SetTreeStreak((int)NUD_RMStreak0.Value, 0, super: false, max: true);
|
||||
bt.SetTreeStreak((int)NUD_RMStreak1.Value, 1, super: false, max: true);
|
||||
bt.SetTreeStreak((int)NUD_RMStreak2.Value, 2, super: false, max: true);
|
||||
|
||||
bt.SetTreeStreak((int)NUD_SCStreak0.Value, 0, super:true, max:false);
|
||||
bt.SetTreeStreak((int)NUD_SCStreak1.Value, 1, super:true, max:false);
|
||||
bt.SetTreeStreak((int)NUD_SCStreak2.Value, 2, super:true, max:false);
|
||||
bt.SetTreeStreak((int)NUD_SMStreak0.Value, 0, super:true, max:true);
|
||||
bt.SetTreeStreak((int)NUD_SMStreak1.Value, 1, super:true, max:true);
|
||||
bt.SetTreeStreak((int)NUD_SMStreak2.Value, 2, super:true, max:true);
|
||||
bt.SetTreeStreak((int)NUD_SCStreak0.Value, 0, super: true, max: false);
|
||||
bt.SetTreeStreak((int)NUD_SCStreak1.Value, 1, super: true, max: false);
|
||||
bt.SetTreeStreak((int)NUD_SCStreak2.Value, 2, super: true, max: false);
|
||||
bt.SetTreeStreak((int)NUD_SMStreak0.Value, 0, super: true, max: true);
|
||||
bt.SetTreeStreak((int)NUD_SMStreak1.Value, 1, super: true, max: true);
|
||||
bt.SetTreeStreak((int)NUD_SMStreak2.Value, 2, super: true, max: true);
|
||||
}
|
||||
|
||||
private void SaveTrainerAppearance()
|
||||
@@ -531,10 +531,10 @@ private void B_Fashion_Click(object sender, EventArgs e)
|
||||
switch (CB_Fashion.SelectedIndex)
|
||||
{
|
||||
case 0: // Base Fashion
|
||||
{
|
||||
SAV.Fashion.Reset();
|
||||
break;
|
||||
}
|
||||
{
|
||||
SAV.Fashion.Reset();
|
||||
break;
|
||||
}
|
||||
case 1: // Full Legal
|
||||
byte[] data1 = SAV is SAV7USUM
|
||||
? SAV.Gender == 0 ? Properties.Resources.fashion_m_uu : Properties.Resources.fashion_f_uu
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -168,8 +168,8 @@ private void SaveTrainerInfo()
|
||||
|
||||
// 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.SecondsToStart = (uint)DateUtil.GetSecondsFrom2000(CAL_AdventureStartDate.Value, CAL_AdventureStartTime.Value);
|
||||
//SAV.SecondsToFame = (uint)DateUtil.GetSecondsFrom2000(CAL_HoFDate.Value, CAL_HoFTime.Value);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -83,8 +83,8 @@ private void SaveTrainerInfo()
|
||||
|
||||
// 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;
|
||||
|
||||
var advDay = CAL_AdventureStartDate.Value.Date;
|
||||
SAV.AdventureStart.Timestamp = advDay.AddSeconds(CAL_AdventureStartTime.Value.TimeOfDay.TotalSeconds);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -110,7 +110,7 @@ private void SaveTrainerInfo()
|
||||
SAV.Language = WinFormsUtil.GetIndex(CB_Language);
|
||||
SAV.OT = TB_OTName.Text;
|
||||
SAV.Rival = TB_Rival.Text;
|
||||
SAV.BattleTower.BP = (uint) NUD_BP.Value;
|
||||
SAV.BattleTower.BP = (uint)NUD_BP.Value;
|
||||
|
||||
// Copy Position
|
||||
if (GB_Map.Enabled && MapUpdated)
|
||||
@@ -125,8 +125,8 @@ private void SaveTrainerInfo()
|
||||
|
||||
// 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.SecondsToStart = (uint)DateUtil.GetSecondsFrom2000(CAL_AdventureStartDate.Value, CAL_AdventureStartTime.Value);
|
||||
//SAV.SecondsToFame = (uint)DateUtil.GetSecondsFrom2000(CAL_HoFDate.Value, CAL_HoFTime.Value);
|
||||
|
||||
@@ -667,8 +667,8 @@ private void InitializeComponent()
|
||||
CAL_AdventureStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
|
||||
CAL_AdventureStartDate.Location = new System.Drawing.Point(132, 194);
|
||||
CAL_AdventureStartDate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
CAL_AdventureStartDate.MaxDate = new System.DateTime(2050, 12, 31, 0, 0, 0, 0);
|
||||
CAL_AdventureStartDate.MinDate = new System.DateTime(1932, 1, 1, 0, 0, 0, 0);
|
||||
CAL_AdventureStartDate.MaxDate = new System.DateTime(2099, 12, 31, 0, 0, 0, 0);
|
||||
CAL_AdventureStartDate.MinDate = new System.DateTime(2000, 1, 1, 0, 0, 0, 0);
|
||||
CAL_AdventureStartDate.Name = "CAL_AdventureStartDate";
|
||||
CAL_AdventureStartDate.Size = new System.Drawing.Size(120, 23);
|
||||
CAL_AdventureStartDate.TabIndex = 72;
|
||||
@@ -799,8 +799,8 @@ private void InitializeComponent()
|
||||
NUD_Z.Minimum = new decimal(new int[] { 99999999, 0, 0, int.MinValue });
|
||||
NUD_Z.Name = "NUD_Z";
|
||||
NUD_Z.Size = new System.Drawing.Size(112, 23);
|
||||
NUD_Z.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
NUD_Z.TabIndex = 53;
|
||||
NUD_Z.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
NUD_Z.ValueChanged += ChangeMapValue;
|
||||
//
|
||||
// NUD_Y
|
||||
@@ -813,8 +813,8 @@ private void InitializeComponent()
|
||||
NUD_Y.Minimum = new decimal(new int[] { 99999999, 0, 0, int.MinValue });
|
||||
NUD_Y.Name = "NUD_Y";
|
||||
NUD_Y.Size = new System.Drawing.Size(112, 23);
|
||||
NUD_Y.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
NUD_Y.TabIndex = 51;
|
||||
NUD_Y.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
NUD_Y.ValueChanged += ChangeMapValue;
|
||||
//
|
||||
// NUD_X
|
||||
@@ -827,8 +827,8 @@ private void InitializeComponent()
|
||||
NUD_X.Minimum = new decimal(new int[] { 99999999, 0, 0, int.MinValue });
|
||||
NUD_X.Name = "NUD_X";
|
||||
NUD_X.Size = new System.Drawing.Size(112, 23);
|
||||
NUD_X.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
NUD_X.TabIndex = 50;
|
||||
NUD_X.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
NUD_X.ValueChanged += ChangeMapValue;
|
||||
//
|
||||
// L_Y
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@ public SAV_SimpleTrainer(SaveFile sav)
|
||||
SAV = (Origin = sav).Clone();
|
||||
Loading = true;
|
||||
|
||||
cba = new[] {CHK_1, CHK_2, CHK_3, CHK_4, CHK_5, CHK_6, CHK_7, CHK_8};
|
||||
cba = new[] { CHK_1, CHK_2, CHK_3, CHK_4, CHK_5, CHK_6, CHK_7, CHK_8 };
|
||||
TB_OTName.MaxLength = SAV.MaxStringLengthOT;
|
||||
B_MaxCash.Click += (sender, e) => MT_Money.Text = SAV.MaxMoney.ToString();
|
||||
B_MaxCoins.Click += (sender, e) => MT_Coins.Text = SAV.MaxCoins.ToString();
|
||||
|
||||
Reference in New Issue
Block a user